-
Notifications
You must be signed in to change notification settings - Fork 39
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
51 changed files
with
5,548 additions
and
572 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
# Prerequirements for building | ||
|
||
1. Install rust | ||
2. make fetch-thirdparty | ||
3. make setup-thirdparty | ||
|
||
# How to run silius with p2p enabled | ||
|
||
## Run silius with bootnodes | ||
|
||
``` | ||
cargo run -- bundler --eth-client-address http://localhost:8545 --mnemonic-file ./bundler-spec-tests/keys/0xf39Fd6e51aad88F6F4ce6aB8827279cffFb92266 --beneficiary 0xf39Fd6e51aad88F6F4ce6aB8827279cffFb92266 --entry-points 0x5FF137D4b0FDCD49DcA30c7CF57E578a026d2789 --http --http.port 4000 --eth-client-proxy-address http://localhost:8545 --p2p-broadcast-address 127.0.0.1 --bootnodes "enr:-Iu4QBh2tesC8BokO61v1w43MnbfHF5H95ZJNHVEQaRq_MjFFuxmeVQnoEXxUDk5qKJCHM944gC72Xg4dYwRkGt9zA4BgmlkgnY0gmlwhH8AAAGJc2VjcDI1NmsxoQKRdyIA8OvArCcZbt3hoJHu4nVe6CblqjO0CnrbGACi-IN0Y3CCEPGDdWRwghDx" --enable-p2p --tcp4-port 4338 --udp4-port 4338 --datadir ./.local/data | ||
``` | ||
|
||
|
||
## Run silius as bootnodes | ||
|
||
``` | ||
cargo run -- bundler --eth-client-address http://localhost:8545 --mnemonic-file ./bundler-spec-tests/keys/0xf39Fd6e51aad88F6F4ce6aB8827279cffFb92266 --beneficiary 0xf39Fd6e51aad88F6F4ce6aB8827279cffFb92266 --entry-points 0x5FF137D4b0FDCD49DcA30c7CF57E578a026d2789 --http --http.port 4000 --eth-client-proxy-address http://localhost:8545 --p2p-broadcast-address 127.0.0.1 --enable-p2p | ||
``` |
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
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 |
---|---|---|
@@ -0,0 +1,31 @@ | ||
use ethers::providers::Middleware; | ||
use silius_p2p::network::Network; | ||
use silius_primitives::reputation::ReputationEntry; | ||
use silius_uopool::{Mempool, Reputation, VecCh, VecUo}; | ||
|
||
use crate::builder::UoPoolBuilder; | ||
|
||
/// The Integrator is for the integrations between p2p network and the uopool | ||
pub struct NetworkIntegrator<M, P, R, E> | ||
where | ||
M: Middleware + Clone + 'static, | ||
P: Mempool<UserOperations = VecUo, CodeHashes = VecCh, Error = E> + Send + Sync, | ||
R: Reputation<ReputationEntries = Vec<ReputationEntry>, Error = E> + Send + Sync, | ||
{ | ||
network: Network, | ||
uopool_builder: UoPoolBuilder<M, P, R, E>, | ||
} | ||
|
||
impl<M, P, R, E> NetworkIntegrator<M, P, R, E> | ||
where | ||
M: Middleware + Clone + 'static, | ||
P: Mempool<UserOperations = VecUo, CodeHashes = VecCh, Error = E> + Send + Sync, | ||
R: Reputation<ReputationEntries = Vec<ReputationEntry>, Error = E> + Send + Sync, | ||
{ | ||
pub fn new(network: Network, uopool_builder: UoPoolBuilder<M, P, R, E>) -> Self { | ||
Self { | ||
network, | ||
uopool_builder, | ||
} | ||
} | ||
} |
Oops, something went wrong.