refactor: move sequencer_ directories into sequencer

This commit is contained in:
Daniil Polyakov 2026-03-10 14:58:06 +03:00
parent 666353d7df
commit bffc711470
34 changed files with 58 additions and 58 deletions

View File

@ -12,12 +12,12 @@ jobs:
strategy:
matrix:
include:
- name: sequencer_runner
dockerfile: ./sequencer_runner/Dockerfile
- name: sequencer_service
dockerfile: ./sequencer/service/Dockerfile
build_args: |
STANDALONE=false
- name: sequencer_runner-standalone
dockerfile: ./sequencer_runner/Dockerfile
- name: sequencer_service-standalone
dockerfile: ./sequencer/service/Dockerfile
build_args: |
STANDALONE=true
- name: indexer_service

2
.gitignore vendored
View File

@ -6,7 +6,7 @@ data/
.idea/
.vscode/
rocksdb
sequencer_runner/data/
sequencer/service/data/
storage.json
result
wallet-ffi/wallet_ffi.h

4
Cargo.lock generated
View File

@ -3839,7 +3839,7 @@ dependencies = [
"nssa",
"nssa_core",
"sequencer_core",
"sequencer_runner",
"sequencer_service",
"serde_json",
"tempfile",
"testcontainers",
@ -7479,7 +7479,7 @@ dependencies = [
]
[[package]]
name = "sequencer_runner"
name = "sequencer_service"
version = "0.1.0"
dependencies = [
"actix",

View File

@ -19,7 +19,7 @@ members = [
"programs/token",
"sequencer_core",
"sequencer_rpc",
"sequencer_runner",
"sequencer_service",
"indexer/core",
"indexer/service",
"indexer/service/protocol",
@ -44,7 +44,7 @@ storage = { path = "storage" }
key_protocol = { path = "key_protocol" }
sequencer_core = { path = "sequencer_core" }
sequencer_rpc = { path = "sequencer_rpc" }
sequencer_runner = { path = "sequencer_runner" }
sequencer_service = { path = "sequencer/service" }
indexer_core = { path = "indexer/core" }
indexer_service = { path = "indexer/service" }
indexer_service_protocol = { path = "indexer/service/protocol" }

View File

@ -30,10 +30,10 @@ run-bedrock:
docker compose up
# Run Sequencer
[working-directory: 'sequencer_runner']
[working-directory: 'sequencer/service']
run-sequencer:
@echo "🧠 Running sequencer"
RUST_LOG=info RISC0_DEV_MODE=1 cargo run --release -p sequencer_runner configs/debug
RUST_LOG=info RISC0_DEV_MODE=1 cargo run --release -p sequencer_service configs/debug
# Run Indexer
[working-directory: 'indexer/service']
@ -62,8 +62,8 @@ run-wallet +args:
# Clean runtime data
clean:
@echo "🧹 Cleaning run artifacts"
rm -rf sequencer_runner/bedrock_signing_key
rm -rf sequencer_runner/rocksdb
rm -rf sequencer/service/bedrock_signing_key
rm -rf sequencer/service/rocksdb
rm -rf indexer/service/rocksdb
rm -rf wallet/configs/debug/storage.json
rm -rf rocksdb

View File

@ -161,7 +161,7 @@ The sequencer and logos blockchain node can be run locally:
- `RUST_LOG=info cargo run -p indexer_service indexer/service/configs/indexer_config.json`
3. On another terminal go to the `logos-blockchain/lssa` repo and run the sequencer:
- `RUST_LOG=info cargo run -p sequencer_runner sequencer_runner/configs/debug`
- `RUST_LOG=info cargo run -p sequencer_service sequencer/service/configs/debug/sequencer_config.json`
4. (To run the explorer): on another terminal go to `logos-blockchain/lssa/explorer_service` and run the following:
- `cargo install cargo-leptos`
- `cargo leptos build --release`
@ -171,8 +171,8 @@ The sequencer and logos blockchain node can be run locally:
After stopping services above you need to remove 3 folders to start cleanly:
1. In the `logos-blockchain/logos-blockchain` folder `state` (not needed in case of docker setup)
2. In the `lssa` folder `sequencer_runner/rocksdb`
3. In the `lssa` file `sequencer_runner/bedrock_signing_key`
2. In the `lssa` folder `sequencer/service/rocksdb`
3. In the `lssa` file `sequencer/service/bedrock_signing_key`
4. In the `lssa` folder `indexer/service/rocksdb`
### Normal mode (`just` commands)
@ -220,7 +220,7 @@ This will use a wallet binary built from this repo and not the one installed in
### Standalone mode
The sequencer can be run in standalone mode with:
```bash
RUST_LOG=info cargo run --features standalone -p sequencer_runner sequencer_runner/configs/debug
RUST_LOG=info cargo run --features standalone -p sequencer_service sequencer/service/configs/debug
```
## Running with Docker

View File

@ -1,5 +1,5 @@
{
"home": "/var/lib/sequencer_runner",
"home": "/var/lib/sequencer_service",
"override_rust_log": null,
"genesis_id": 1,
"is_genesis_random": true,

View File

@ -7,12 +7,12 @@ services:
environment:
- RUST_LOG=error
sequencer_runner:
sequencer_service:
depends_on:
- logos-blockchain-node-0
- indexer_service
volumes: !override
- ./configs/docker-all-in-one/sequencer:/etc/sequencer_runner
- ./configs/docker-all-in-one/sequencer:/etc/sequencer_service
indexer_service:
depends_on:

View File

@ -6,7 +6,7 @@ include:
- path:
bedrock/docker-compose.yml
- path:
sequencer_runner/docker-compose.yml
sequencer/service/docker-compose.yml
- path:
indexer/service/docker-compose.yml
- path:

View File

@ -11,7 +11,7 @@ workspace = true
nssa_core = { workspace = true, features = ["host"] }
nssa.workspace = true
sequencer_core = { workspace = true, features = ["default", "testnet"] }
sequencer_runner.workspace = true
sequencer_service.workspace = true
wallet.workspace = true
common.workspace = true
key_protocol.workspace = true

View File

@ -11,7 +11,7 @@ use log::{debug, error, warn};
use nssa::{AccountId, PrivacyPreservingTransaction};
use nssa_core::Commitment;
use sequencer_core::indexer_client::{IndexerClient, IndexerClientTrait as _};
use sequencer_runner::SequencerHandle;
use sequencer_service::SequencerHandle;
use tempfile::TempDir;
use testcontainers::compose::DockerCompose;
use wallet::{WalletCore, config::WalletConfigOverrides};
@ -229,7 +229,7 @@ impl TestContext {
)
.context("Failed to create Sequencer config")?;
let sequencer_handle = sequencer_runner::startup_sequencer(config).await?;
let sequencer_handle = sequencer_service::startup_sequencer(config).await?;
Ok((sequencer_handle, temp_sequencer_dir))
}

View File

@ -1,5 +1,5 @@
[package]
name = "sequencer_runner"
name = "sequencer_service"
version = "0.1.0"
edition = "2024"
license = { workspace = true }

View File

@ -40,7 +40,7 @@ RUN r0vm --version
# Install logos blockchain circuits
RUN curl -sSL https://raw.githubusercontent.com/logos-blockchain/logos-blockchain/main/scripts/setup-logos-blockchain-circuits.sh | bash
WORKDIR /sequencer_runner
WORKDIR /sequencer_service
# Build argument to enable standalone feature (defaults to false)
ARG STANDALONE=false
@ -48,17 +48,17 @@ ARG STANDALONE=false
# Planner stage - generates dependency recipe
FROM chef AS planner
COPY . .
RUN cargo chef prepare --bin sequencer_runner --recipe-path recipe.json
RUN cargo chef prepare --bin sequencer_service --recipe-path recipe.json
# Builder stage - builds dependencies and application
FROM chef AS builder
ARG STANDALONE
COPY --from=planner /sequencer_runner/recipe.json recipe.json
COPY --from=planner /sequencer_service/recipe.json recipe.json
# Build dependencies only (this layer will be cached)
RUN if [ "$STANDALONE" = "true" ]; then \
cargo chef cook --bin sequencer_runner --features standalone --release --recipe-path recipe.json; \
cargo chef cook --bin sequencer_service --features standalone --release --recipe-path recipe.json; \
else \
cargo chef cook --bin sequencer_runner --release --recipe-path recipe.json; \
cargo chef cook --bin sequencer_service --release --recipe-path recipe.json; \
fi
# Copy source code
@ -66,13 +66,13 @@ COPY . .
# Build the actual application
RUN if [ "$STANDALONE" = "true" ]; then \
cargo build --release --features standalone --bin sequencer_runner; \
cargo build --release --features standalone --bin sequencer_service; \
else \
cargo build --release --bin sequencer_runner; \
cargo build --release --bin sequencer_service; \
fi
# Strip debug symbols to reduce binary size
RUN strip /sequencer_runner/target/release/sequencer_runner
RUN strip /sequencer_service/target/release/sequencer_service
# Runtime stage - minimal image
FROM debian:trixie-slim
@ -84,11 +84,11 @@ RUN apt-get update \
# Create non-root user for security
RUN useradd -m -u 1000 -s /bin/bash sequencer_user && \
mkdir -p /sequencer_runner /etc/sequencer_runner && \
chown -R sequencer_user:sequencer_user /sequencer_runner /etc/sequencer_runner
mkdir -p /sequencer_service /etc/sequencer_service && \
chown -R sequencer_user:sequencer_user /sequencer_service /etc/sequencer_service
# Copy binary from builder
COPY --from=builder --chown=sequencer_user:sequencer_user /sequencer_runner/target/release/sequencer_runner /usr/local/bin/sequencer_runner
COPY --from=builder --chown=sequencer_user:sequencer_user /sequencer_service/target/release/sequencer_service /usr/local/bin/sequencer_service
# Copy r0vm binary from builder
COPY --from=builder --chown=sequencer_user:sequencer_user /usr/local/bin/r0vm /usr/local/bin/r0vm
@ -97,7 +97,7 @@ COPY --from=builder --chown=sequencer_user:sequencer_user /usr/local/bin/r0vm /u
COPY --from=builder --chown=sequencer_user:sequencer_user /root/.logos-blockchain-circuits /home/sequencer_user/.logos-blockchain-circuits
# Copy entrypoint script
COPY sequencer_runner/docker-entrypoint.sh /docker-entrypoint.sh
COPY sequencer_service/docker-entrypoint.sh /docker-entrypoint.sh
RUN chmod +x /docker-entrypoint.sh
# Expose default port
@ -124,5 +124,5 @@ USER root
ENTRYPOINT ["/docker-entrypoint.sh"]
WORKDIR /sequencer_runner
CMD ["sequencer_runner", "/etc/sequencer_runner"]
WORKDIR /sequencer_service
CMD ["sequencer_service", "/etc/sequencer_service"]

View File

@ -1,5 +1,5 @@
{
"home": "/var/lib/sequencer_runner",
"home": "/var/lib/sequencer_service",
"override_rust_log": null,
"genesis_id": 1,
"is_genesis_random": true,

View File

@ -0,0 +1,14 @@
services:
sequencer_service:
image: lssa/sequencer_service
build:
context: ..
dockerfile: sequencer/service/Dockerfile
container_name: sequencer_service
ports:
- "3040:3040"
volumes:
# Mount configuration folder
- ./configs/docker:/etc/sequencer_service
# Mount data folder
- ./data:/var/lib/sequencer_service

View File

@ -1,11 +1,11 @@
#!/bin/sh
# This is an entrypoint script for the sequencer_runner Docker container,
# This is an entrypoint script for the sequencer_service Docker container,
# it's not meant to be executed outside of the container.
set -e
CONFIG="/etc/sequencer_runner/sequencer_config.json"
CONFIG="/etc/sequencer/service/sequencer_config.json"
# Check config file exists
if [ ! -f "$CONFIG" ]; then

View File

@ -1,5 +1,5 @@
use anyhow::Result;
use sequencer_runner::main_runner;
use sequencer_service::main_runner;
pub const NUM_THREADS: usize = 4;

View File

@ -1,14 +0,0 @@
services:
sequencer_runner:
image: lssa/sequencer_runner
build:
context: ..
dockerfile: sequencer_runner/Dockerfile
container_name: sequencer_runner
ports:
- "3040:3040"
volumes:
# Mount configuration folder
- ./configs/docker:/etc/sequencer_runner
# Mount data folder
- ./data:/var/lib/sequencer_runner

View File

@ -15,7 +15,7 @@ use wallet::{
// TODO #169: We have sample configs for sequencer, but not for wallet
// TODO #168: Why it requires config as a directory? Maybe better to deduce directory from config
// file path?
// TODO #172: Why it requires config as env var while sequencer_runner accepts as
// TODO #172: Why it requires config as env var while sequencer_service accepts as
// argument?
#[tokio::main]
async fn main() -> Result<()> {