Skip to content

Commit b56dfbb

Browse files
authored
feat: provide default consensus rpc (#91)
1 parent cbb96ab commit b56dfbb

File tree

3 files changed

+7
-1
lines changed

3 files changed

+7
-1
lines changed

README.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,11 +17,13 @@ To install Helios, run `heliosup`.
1717
## Usage
1818
To run Helios, run the below command, replacing `$ETH_RPC_URL` with an RPC provider URL such as Alchemy or Infura:
1919
```
20-
helios --consensus-rpc https://www.lightclientdata.org --execution-rpc $ETH_RPC_URL
20+
helios --execution-rpc $ETH_RPC_URL
2121
```
2222
Helios will now run a local RPC server at `http://127.0.0.1:8545`.
2323

2424
### Additional Options
25+
`--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.
26+
2527
`--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.
2628

2729
`--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.

config/src/lib.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -89,6 +89,7 @@ impl Config {
8989
pub fn to_base_config(&self) -> BaseConfig {
9090
BaseConfig {
9191
rpc_port: self.rpc_port.unwrap_or(8545),
92+
consensus_rpc: Some(self.consensus_rpc.clone()),
9293
checkpoint: self.checkpoint.clone(),
9394
chain: self.chain.clone(),
9495
forks: self.forks.clone(),

config/src/networks.rs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ impl Network {
2020
#[derive(Serialize, Default)]
2121
pub struct BaseConfig {
2222
pub rpc_port: u16,
23+
pub consensus_rpc: Option<String>,
2324
#[serde(
2425
deserialize_with = "bytes_deserialize",
2526
serialize_with = "bytes_serialize"
@@ -36,6 +37,7 @@ pub fn mainnet() -> BaseConfig {
3637
)
3738
.unwrap(),
3839
rpc_port: 8545,
40+
consensus_rpc: Some("https://www.lightclientdata.org".to_string()),
3941
chain: ChainConfig {
4042
chain_id: 1,
4143
genesis_time: 1606824023,
@@ -68,6 +70,7 @@ pub fn goerli() -> BaseConfig {
6870
)
6971
.unwrap(),
7072
rpc_port: 8545,
73+
consensus_rpc: None,
7174
chain: ChainConfig {
7275
chain_id: 5,
7376
genesis_time: 1616508000,

0 commit comments

Comments
 (0)