Skip to content

Commit

Permalink
Commit network config when saving to Postgres
Browse files Browse the repository at this point in the history
  • Loading branch information
jbearer committed Jan 9, 2024
1 parent 7e0d222 commit a301d2c
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 1 deletion.
1 change: 1 addition & 0 deletions .env
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ ESPRESSO_SEQUENCER_L1_USE_LATEST_BLOCK_TAG=true
ESPRESSO_SEQUENCER_ETH_MNEMONIC="test test test test test test test test test test test junk"
ESPRESSO_SEQUENCER_HOTSHOT_ACCOUNT_INDEX=5
ESPRESSO_COMMITMENT_TASK_PORT=60000
ESPRESSO_SEQUENCER_DB_PORT=5432

# Example rollup demo variables
ESPRESSO_DEMO_ROLLUP_PORT=8084
Expand Down
2 changes: 2 additions & 0 deletions docker-compose.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -186,6 +186,8 @@ services:

sequencer-db:
image: postgres
ports:
- "$ESPRESSO_SEQUENCER_DB_PORT:5432"
environment:
- POSTGRES_PASSWORD=password
healthcheck:
Expand Down
3 changes: 2 additions & 1 deletion sequencer/src/persistence/sql.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ use super::{NetworkConfig, PersistenceOptions, SequencerPersistence};
use crate::api::{data_source::SequencerDataSource, sql::DataSource};
use async_trait::async_trait;
use clap::Parser;
use hotshot_query_service::data_source::sql::Query;
use hotshot_query_service::data_source::{sql::Query, VersionedDataSource};

/// Options for Postgres-backed persistence.
#[derive(Parser, Clone, Debug, Default)]
Expand Down Expand Up @@ -84,6 +84,7 @@ impl SequencerPersistence for Persistence {
.await?
.execute("INSERT INTO network_config (config) VALUES ($1)", [&json])
.await?;
self.commit().await?;
Ok(())
}
}

0 comments on commit a301d2c

Please sign in to comment.