feat: provide default consensus rpc (#91)

This commit is contained in:
Noah Citron 2022-11-07 10:24:37 -05:00 committed by GitHub
parent cbb96abd65
commit b56dfbb5a7
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 7 additions and 1 deletions

View File

@ -17,11 +17,13 @@ To install Helios, run `heliosup`.
## Usage
To run Helios, run the below command, replacing `$ETH_RPC_URL` with an RPC provider URL such as Alchemy or Infura:
```
helios --consensus-rpc https://www.lightclientdata.org --execution-rpc $ETH_RPC_URL
helios --execution-rpc $ETH_RPC_URL
```
Helios will now run a local RPC server at `http://127.0.0.1:8545`.
### Additional Options
`--consensus-rpc` or `-c` can be used to set a custom consensus layer rpc endpoint. This must be a consenus node that supports the light client beaconchain api. We recomment using Nimbus for this. If no consensus rpc is supplied, it defaults to `https://www.lightclientdata.org` which is run by us.
`--checkpoint` or `-w` can be used to set a custom weak subjectivity checkpoint. This must be equal the first beacon blockhash of an epoch. Weak subjectivity checkpoints are the root of trust in the system. If this is set to a malicious value, an attacker can cause the client to sync to the wrong chain. Helios sets a default value initially, then caches the most recent finalized block it has seen for later use.
`--network` or `-n` sets the network to sync to. Current valid option are `mainnet` and `goerli`, however users can add custom networks in their configurationf files.

View File

@ -89,6 +89,7 @@ impl Config {
pub fn to_base_config(&self) -> BaseConfig {
BaseConfig {
rpc_port: self.rpc_port.unwrap_or(8545),
consensus_rpc: Some(self.consensus_rpc.clone()),
checkpoint: self.checkpoint.clone(),
chain: self.chain.clone(),
forks: self.forks.clone(),

View File

@ -20,6 +20,7 @@ impl Network {
#[derive(Serialize, Default)]
pub struct BaseConfig {
pub rpc_port: u16,
pub consensus_rpc: Option<String>,
#[serde(
deserialize_with = "bytes_deserialize",
serialize_with = "bytes_serialize"
@ -36,6 +37,7 @@ pub fn mainnet() -> BaseConfig {
)
.unwrap(),
rpc_port: 8545,
consensus_rpc: Some("https://www.lightclientdata.org".to_string()),
chain: ChainConfig {
chain_id: 1,
genesis_time: 1606824023,
@ -68,6 +70,7 @@ pub fn goerli() -> BaseConfig {
)
.unwrap(),
rpc_port: 8545,
consensus_rpc: None,
chain: ChainConfig {
chain_id: 5,
genesis_time: 1616508000,