feat: require execution rpc (#49)

This commit is contained in:
Noah Citron 2022-09-22 20:34:34 -07:00 committed by GitHub
parent b137df4b85
commit 5b55c1b35e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 7 additions and 12 deletions

View File

@ -46,14 +46,12 @@ fn get_config() -> Config {
None => get_cached_checkpoint(&data_dir).unwrap_or(config.general.checkpoint), None => get_cached_checkpoint(&data_dir).unwrap_or(config.general.checkpoint),
}; };
config.general.execution_rpc = Some(cli.execution_rpc);
if let Some(port) = cli.port { if let Some(port) = cli.port {
config.general.rpc_port = Some(port); config.general.rpc_port = Some(port);
} }
if let Some(execution_rpc) = cli.execution_rpc {
config.general.execution_rpc = execution_rpc;
}
if let Some(consensus_rpc) = cli.consensus_rpc { if let Some(consensus_rpc) = cli.consensus_rpc {
config.general.consensus_rpc = consensus_rpc; config.general.consensus_rpc = consensus_rpc;
} }
@ -94,7 +92,7 @@ struct Cli {
#[clap(short = 'w', long)] #[clap(short = 'w', long)]
checkpoint: Option<String>, checkpoint: Option<String>,
#[clap(short, long)] #[clap(short, long)]
execution_rpc: Option<String>, execution_rpc: String,
#[clap(short, long)] #[clap(short, long)]
consensus_rpc: Option<String>, consensus_rpc: Option<String>,
#[clap(long)] #[clap(long)]

View File

@ -31,7 +31,7 @@ impl Node {
let consensus = let consensus =
ConsensusClient::new(consensus_rpc, checkpoint_hash, config.clone()).await?; ConsensusClient::new(consensus_rpc, checkpoint_hash, config.clone()).await?;
let execution = ExecutionClient::new(execution_rpc)?; let execution = ExecutionClient::new(execution_rpc.as_ref().unwrap())?;
let payloads = BTreeMap::new(); let payloads = BTreeMap::new();
let finalized_payloads = BTreeMap::new(); let finalized_payloads = BTreeMap::new();

View File

@ -26,7 +26,7 @@ pub struct General {
#[serde(deserialize_with = "bytes_deserialize")] #[serde(deserialize_with = "bytes_deserialize")]
pub checkpoint: Vec<u8>, pub checkpoint: Vec<u8>,
pub consensus_rpc: String, pub consensus_rpc: String,
pub execution_rpc: String, pub execution_rpc: Option<String>,
pub rpc_port: Option<u16>, pub rpc_port: Option<u16>,
} }

View File

@ -16,8 +16,7 @@ pub fn mainnet() -> Config {
) )
.unwrap(), .unwrap(),
consensus_rpc: "http://testing.mainnet.beacon-api.nimbus.team".to_string(), consensus_rpc: "http://testing.mainnet.beacon-api.nimbus.team".to_string(),
execution_rpc: "https://eth-mainnet.g.alchemy.com/v2/Q0BqQPbTQfSMzrCNl4x80XS_PLLB1RNf" execution_rpc: None,
.to_string(),
rpc_port: Some(8545), rpc_port: Some(8545),
}, },
forks: Forks { forks: Forks {
@ -52,9 +51,7 @@ pub fn goerli() -> Config {
) )
.unwrap(), .unwrap(),
consensus_rpc: "http://34.207.158.131:5052".to_string(), consensus_rpc: "http://34.207.158.131:5052".to_string(),
execution_rpc: execution_rpc: None,
"https://eth-goerli.g.alchemy.com:443/v2/o_8Qa9kgwDPf9G8sroyQ-uQtyhyWa3ao"
.to_string(),
rpc_port: Some(8545), rpc_port: Some(8545),
}, },
forks: Forks { forks: Forks {