-
Notifications
You must be signed in to change notification settings - Fork 299
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* add lc server * add client * add builder * add config * add server cli * fix rpc socket defaults * change rpc defaults * better block safety
- Loading branch information
Showing
22 changed files
with
3,629 additions
and
138 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -45,7 +45,7 @@ impl<N: NetworkSpec> State<N> { | |
inner_ref.write().await.push_finalized_block(block); | ||
} | ||
|
||
} | ||
}, | ||
} | ||
} | ||
}); | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
[package] | ||
name = "helios-opstack" | ||
version = "0.7.0" | ||
edition = "2021" | ||
|
||
[[bin]] | ||
name = "server" | ||
path = "./bin/server.rs" | ||
|
||
[dependencies] | ||
tokio.workspace = true | ||
eyre.workspace = true | ||
tracing.workspace = true | ||
hex.workspace = true | ||
serde.workspace = true | ||
typenum.workspace = true | ||
tracing-subscriber = { version = "0.3.17", features = ["env-filter"] } | ||
reqwest.workspace = true | ||
url.workspace = true | ||
|
||
# consensus | ||
alloy.workspace = true | ||
revm.workspace = true | ||
sha2.workspace = true | ||
ethereum_ssz_derive.workspace = true | ||
ethereum_ssz.workspace = true | ||
ssz_types.workspace = true | ||
op-alloy-network = { git = "https://github.com/alloy-rs/op-alloy", tag = "v0.1.5" } | ||
op-alloy-consensus = { git = "https://github.com/alloy-rs/op-alloy", tag = "v0.1.5" } | ||
op-alloy-rpc-types = { git = "https://github.com/alloy-rs/op-alloy", tag = "v0.1.5" } | ||
|
||
# server | ||
axum = "0.7.6" | ||
clap = { version = "4.5.4", features = ["derive", "env"] } | ||
|
||
# config | ||
figment = { version = "0.10.7", features = ["toml", "env"] } | ||
|
||
# networking | ||
libp2p = { version = "0.51.3", features = ["macros", "tokio", "tcp", "mplex", "noise", "gossipsub", "ping"] } | ||
discv5 = "0.7.0" | ||
libp2p-identity = { version = "0.1.2", features = ["secp256k1"] } | ||
unsigned-varint = "0.7.1" | ||
snap = "1" | ||
|
||
helios-core = { path = "../core" } |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
use std::net::SocketAddr; | ||
|
||
use clap::Parser; | ||
use eyre::Result; | ||
use tracing_subscriber::{EnvFilter, FmtSubscriber}; | ||
|
||
use helios_opstack::{ | ||
config::{Network, NetworkConfig}, | ||
server::start_server, | ||
}; | ||
|
||
#[tokio::main] | ||
async fn main() -> Result<()> { | ||
enable_tracing(); | ||
let cli = Cli::parse(); | ||
let config = NetworkConfig::from(cli.network); | ||
|
||
let chain_id = config.chain.chain_id; | ||
let unsafe_signer = config.chain.unsafe_signer; | ||
let server_addr = cli.server_address; | ||
let gossip_addr = cli.gossip_address; | ||
|
||
start_server(server_addr, gossip_addr, chain_id, unsafe_signer).await?; | ||
|
||
Ok(()) | ||
} | ||
|
||
fn enable_tracing() { | ||
let env_filter = EnvFilter::builder() | ||
.with_default_directive("helios_opstack=info".parse().unwrap()) | ||
.from_env() | ||
.expect("invalid env filter"); | ||
|
||
let subscriber = FmtSubscriber::builder() | ||
.with_env_filter(env_filter) | ||
.finish(); | ||
|
||
tracing::subscriber::set_global_default(subscriber).expect("subscriber set failed"); | ||
} | ||
|
||
#[derive(Parser)] | ||
struct Cli { | ||
#[clap(short, long)] | ||
network: Network, | ||
#[clap(short, long, default_value = "127.0.0.1:3000")] | ||
server_address: SocketAddr, | ||
#[clap(short, long, default_value = "0.0.0.0:9876")] | ||
gossip_address: SocketAddr, | ||
} |
Oops, something went wrong.