From fcee8086d5608308bc8d216a9ad3a29f3d7d4b95 Mon Sep 17 00:00:00 2001 From: Dzejkop Date: Wed, 17 Apr 2024 10:51:36 +0200 Subject: [PATCH 1/3] Fix docker compose setup --- compose.yml | 3 ++- src/app.rs | 4 +++- src/tasks/index.rs | 2 ++ 3 files changed, 7 insertions(+), 2 deletions(-) diff --git a/compose.yml b/compose.yml index 7db4896..542f069 100644 --- a/compose.yml +++ b/compose.yml @@ -41,4 +41,5 @@ services: image: ghcr.io/foundry-rs/foundry:latest ports: - "8545:8545" - command: ["anvil --block-time 2"] + command: ["anvil --block-time 2 --host 0.0.0.0"] + diff --git a/src/app.rs b/src/app.rs index f3a1c49..3ef353f 100644 --- a/src/app.rs +++ b/src/app.rs @@ -50,7 +50,9 @@ impl App { ) -> eyre::Result> { let url = self.db.get_network_rpc(chain_id, RpcKind::Ws).await?; - let ws = Ws::connect(url.as_str()).await?; + let ws = Ws::connect(url.as_str()) + .await + .context("Connecting to WS provider")?; let provider = Provider::new(ws); Ok(provider) diff --git a/src/tasks/index.rs b/src/tasks/index.rs index 49eaa8b..440542b 100644 --- a/src/tasks/index.rs +++ b/src/tasks/index.rs @@ -25,10 +25,12 @@ pub async fn index_chain(app: Arc, chain_id: u64) -> eyre::Result<()> { let ws_rpc = app.ws_provider(chain_id).await?; let rpc = app.http_provider(chain_id).await?; + tracing::info!("Subscribing to new blocks"); // Subscribe to new block with the WS client which uses an unbounded receiver, buffering the stream let mut blocks_stream = ws_rpc.subscribe_blocks().await?; // Get the first block from the stream, backfilling any missing blocks from the latest block in the db to the chain head + tracing::info!("Backfilling blocks"); if let Some(latest_block) = blocks_stream.next().await { backfill_to_block(app.clone(), chain_id, &rpc, latest_block) .await?; From a44778d90cf93d229801eb396b1590791601b572 Mon Sep 17 00:00:00 2001 From: Dzejkop Date: Wed, 17 Apr 2024 11:10:15 +0200 Subject: [PATCH 2/3] Add commented out geth option --- compose.yml | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) diff --git a/compose.yml b/compose.yml index 542f069..16f640e 100644 --- a/compose.yml +++ b/compose.yml @@ -43,3 +43,28 @@ services: - "8545:8545" command: ["anvil --block-time 2 --host 0.0.0.0"] + # blockchain: + # image: ethereum/client-go:alltools-stable + # hostname: blockchain + # command: > + # geth --datadir /root/datadir --dev --http --ws + # --http.api eth,web3,net,debug + # --http.addr "0.0.0.0" + # --ws.addr "0.0.0.0" + # --ws.port 8545 + # --http.vhosts "*" + # --http.corsdomain "https://remix.ethereum.org" + # --rpc.gascap 0 + # --rpc.txfeecap 0 + # --vmdebug + # volumes: + # - geth_datadir:/root/datadir + # ports: + # - "30303:30303" + # - "8545:8545" + # stdin_open: true + # tty: true + # restart: unless-stopped + +# volumes: +# geth_datadir: \ No newline at end of file From 6eb37b00c69a08df63b7d07d477f4f4b301d9d92 Mon Sep 17 00:00:00 2001 From: Dzejkop Date: Wed, 17 Apr 2024 11:10:26 +0200 Subject: [PATCH 3/3] Fix 1/admin/relayers --- src/db.rs | 1 + 1 file changed, 1 insertion(+) diff --git a/src/db.rs b/src/db.rs index ec2b221..bdc010d 100644 --- a/src/db.rs +++ b/src/db.rs @@ -170,6 +170,7 @@ impl Database { nonce, current_nonce, max_inflight_txs, + max_queued_txs, gas_price_limits, enabled FROM relayers