diff --git a/apps/src/lib/config/ethereum.rs b/apps/src/lib/config/ethereum.rs index 52d757c67b5..d02df901840 100644 --- a/apps/src/lib/config/ethereum.rs +++ b/apps/src/lib/config/ethereum.rs @@ -14,12 +14,15 @@ pub enum Mode { /// oracle is configured to listen for events from the Ethereum bridge /// smart contracts using this endpoint. Managed, + /// Do not run `geth`. The oracle will listen to the Ethereum JSON-RPC + /// endpoint as specified in the `oracle_rpc_endpoint` setting. + Remote, /// Do not start a managed `geth` subprocess. Instead of the oracle /// listening for events using a Ethereum JSON-RPC endpoint, an endpoint /// will be exposed by the ledger itself for submission of Borsh- /// serialized [`EthereumEvent`]s. Mostly useful for testing purposes. EventsEndpoint, - /// Do not run any components of the Ethereum bridge + /// Do not run any components of the Ethereum bridge. Off, } diff --git a/apps/src/lib/node/ledger/mod.rs b/apps/src/lib/node/ledger/mod.rs index 25af7b52cc4..e7c65eb525c 100644 --- a/apps/src/lib/node/ledger/mod.rs +++ b/apps/src/lib/node/ledger/mod.rs @@ -310,7 +310,7 @@ async fn run_aux(config: config::Ledger, wasm_dir: PathBuf) { TendermintMode::Validator ) { // boot up the ethereum node process and wait for it to finish syncing - let (eth_sender, eth_receiver) = unbounded_channel(); + let (eth_event_sender, eth_event_receiver) = unbounded_channel(); let url = ethereum_url.clone(); let start_managed_eth_node = matches!(config.ethereum.mode, ethereum::Mode::Managed); @@ -343,20 +343,22 @@ async fn run_aux(config: config::Ledger, wasm_dir: PathBuf) { }); let oracle = match config.ethereum.mode { - ethereum::Mode::Managed => ethereum_node::oracle::run_oracle( - ethereum_url, - eth_sender, - abort_sender, - ), + ethereum::Mode::Managed | ethereum::Mode::Remote => { + ethereum_node::oracle::run_oracle( + ethereum_url, + eth_event_sender, + abort_sender, + ) + } ethereum::Mode::EventsEndpoint => { ethereum_node::test_tools::event_endpoint::start_oracle( - eth_sender, + eth_event_sender, ) } ethereum::Mode::Off => { ethereum_node::test_tools::mock_oracle::run_oracle( ethereum_url, - eth_sender, + eth_event_sender, abort_sender, ) } @@ -379,7 +381,7 @@ async fn run_aux(config: config::Ledger, wasm_dir: PathBuf) { eth_abort_resp_send, eth_abort_resp_recv, )), - Some((oracle, eth_receiver)), + Some((oracle, eth_event_receiver)), Some(( tokio::spawn(async move { // Construct a service for broadcasting protocol txs from