Skip to content

Commit 8aeef6e

Browse files
ali-behjatiReisen
authored andcommitted
Add vaa verification
1 parent d77070f commit 8aeef6e

File tree

11 files changed

+523
-57
lines changed

11 files changed

+523
-57
lines changed

hermes/Cargo.lock

Lines changed: 204 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

hermes/Cargo.toml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,13 @@ wormhole-sdk = { git = "https://github.com/wormhole-foundation/wormhole", tag =
6868
pyth-oracle = { git = "https://github.com/pyth-network/pyth-client", rev = "7d593d87e07a1e2486e7ca21597d664ee72be1ec", features = ["library"] }
6969

7070
strum = { version = "0.24", features = ["derive"] }
71+
ethabi = { version = "18.0.0", features = ["serde"] }
7172

7273
[patch.crates-io]
7374
serde_wormhole = { git = "https://github.com/wormhole-foundation/wormhole", tag = "v2.17.1" }
75+
76+
[profile.release]
77+
panic = 'abort'
78+
79+
[profile.dev]
80+
panic = 'abort'

hermes/src/api.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ impl State {
3232
///
3333
/// Currently this is based on Axum due to the simplicity and strong ecosystem support for the
3434
/// packages they are based on (tokio & hyper).
35-
pub async fn spawn(rpc_addr: String, store: Store) -> Result<()> {
35+
pub async fn spawn(store: Store, rpc_addr: String) -> Result<()> {
3636
let state = State::new(store);
3737

3838
// Initialize Axum Router. Note the type here is a `Router<State>` due to the use of the

hermes/src/main.rs

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -36,23 +36,31 @@ async fn init() -> Result<()> {
3636
// Spawn the P2P layer.
3737
log::info!("Starting P2P server on {:?}", wh_listen_addrs);
3838
network::p2p::spawn(
39+
store.clone(),
3940
wh_network_id.to_string(),
4041
wh_bootstrap_addrs,
4142
wh_listen_addrs,
42-
store.clone(),
4343
)
4444
.await?;
4545

46+
// Spawn the Ethereum guardian set watcher
47+
network::ethereum::spawn(
48+
store.clone(),
49+
"https://rpc.ankr.com/eth".to_owned(),
50+
"0x98f3c9e6E3fAce36bAAd05FE09d375Ef1464288B".to_owned(),
51+
)
52+
.await;
53+
4654
// Spawn the RPC server.
4755
log::info!("Starting RPC server on {}", api_addr);
4856

4957
// TODO: Add max size to the config
50-
api::spawn(api_addr.to_string(), store.clone()).await?;
58+
api::spawn(store.clone(), api_addr.to_string()).await?;
5159

5260
// Spawn the Pythnet listener
5361
// TODO: Exit the thread when it gets spawned
5462
log::info!("Starting Pythnet listener using {}", pythnet_ws_endpoint);
55-
network::pythnet::spawn(pythnet_ws_endpoint, store.clone()).await?;
63+
network::pythnet::spawn(store.clone(), pythnet_ws_endpoint).await?;
5664

5765
// Wait on Ctrl+C similar to main.
5866
tokio::signal::ctrl_c().await?;

hermes/src/network.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,3 @@
1+
pub mod ethereum;
12
pub mod p2p;
23
pub mod pythnet;

0 commit comments

Comments
 (0)