Skip to content

Commit

Permalink
Merge pull request #180 from Vid201/chore/rpc
Browse files Browse the repository at this point in the history
chore: make rpc web3 interface optional
  • Loading branch information
Vid201 authored Aug 2, 2023
2 parents e420ad3 + bf6abee commit d0399c3
Show file tree
Hide file tree
Showing 5 changed files with 10 additions and 6 deletions.
4 changes: 2 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,10 @@ run-create-wallet:
cargo run --release --bin create-wallet -- --output-path ${HOME}/.silius

run-silius-debug:
cargo run --release -- --eth-client-address http://127.0.0.1:8545 --mnemonic-file ${HOME}/.silius/0xf39Fd6e51aad88F6F4ce6aB8827279cffFb92266 --beneficiary 0xf39Fd6e51aad88F6F4ce6aB8827279cffFb92266 --gas-factor 600 --min-balance 1 --entry-points 0x5FF137D4b0FDCD49DcA30c7CF57E578a026d2789 --min-stake 1 --min-unstake-delay 0 --min-priority-fee-per-gas 0 --max-verification-gas 1500000 --rpc-api eth,debug
cargo run --release -- --eth-client-address http://127.0.0.1:8545 --mnemonic-file ${HOME}/.silius/0xf39Fd6e51aad88F6F4ce6aB8827279cffFb92266 --beneficiary 0xf39Fd6e51aad88F6F4ce6aB8827279cffFb92266 --gas-factor 600 --min-balance 1 --entry-points 0x5FF137D4b0FDCD49DcA30c7CF57E578a026d2789 --min-stake 1 --min-unstake-delay 0 --min-priority-fee-per-gas 0 --max-verification-gas 1500000 --rpc-api eth,debug,web3

run-silius-debug-mode:
RUST_LOG=silius=TRACE cargo run --profile debug-fast -- --eth-client-address http://127.0.0.1:8545 --mnemonic-file /home/vid/.silius/0xf39Fd6e51aad88F6F4ce6aB8827279cffFb92266 --beneficiary 0xf39Fd6e51aad88F6F4ce6aB8827279cffFb92266 --gas-factor 600 --min-balance 1 --entry-points 0x5FF137D4b0FDCD49DcA30c7CF57E578a026d2789 --min-stake 1 --min-unstake-delay 0 --min-priority-fee-per-gas 0 --max-verification-gas 1500000 --rpc-api eth,debug
RUST_LOG=silius=TRACE cargo run --profile debug-fast -- --eth-client-address http://127.0.0.1:8545 --mnemonic-file /home/vid/.silius/0xf39Fd6e51aad88F6F4ce6aB8827279cffFb92266 --beneficiary 0xf39Fd6e51aad88F6F4ce6aB8827279cffFb92266 --gas-factor 600 --min-balance 1 --entry-points 0x5FF137D4b0FDCD49DcA30c7CF57E578a026d2789 --min-stake 1 --min-unstake-delay 0 --min-priority-fee-per-gas 0 --max-verification-gas 1500000 --rpc-api eth,debug,web3

fetch-thirdparty:
git submodule update --init
Expand Down
2 changes: 1 addition & 1 deletion bin/silius/src/cli.rs
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ pub struct RpcServiceOpts {
#[clap(long, default_value = "127.0.0.1:3000")]
pub rpc_listen_address: String,

#[clap(long, value_delimiter=',', default_value = "eth", value_parser = ["eth", "debug"])]
#[clap(long, value_delimiter=',', default_value = "eth", value_parser = ["eth", "debug", "web3"])]
pub rpc_api: Vec<String>,

#[clap(long, value_delimiter = ',', default_value = "*")]
Expand Down
4 changes: 3 additions & 1 deletion bin/silius/src/silius-rpc.rs
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,9 @@ async fn main() -> Result<()> {
.with_proxy(opt.eth_client_address)
.with_cors(opt.rpc_opts.cors_domain);

server.add_method(Web3ApiServerImpl {}.into_rpc())?;
if api.contains("web3") {
server.add_method(Web3ApiServerImpl {}.into_rpc())?;
}

let uopool_grpc_client =
UoPoolClient::connect(format!("http://{}", opt.uopool_grpc_listen_address)).await?;
Expand Down
4 changes: 3 additions & 1 deletion bin/silius/src/silius.rs
Original file line number Diff line number Diff line change
Expand Up @@ -156,7 +156,9 @@ fn main() -> Result<()> {
let mut server = JsonRpcServer::new(opt.rpc_opts.rpc_listen_address.clone()).with_proxy(opt.eth_client_address)
.with_cors(opt.rpc_opts.cors_domain);

server.add_method(Web3ApiServerImpl{}.into_rpc())?;
if api.contains("web3") {
server.add_method(Web3ApiServerImpl{}.into_rpc())?;
}

if api.contains("eth") {
server.add_method(
Expand Down
2 changes: 1 addition & 1 deletion bundler-spec-test/launcher.sh
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ case $1 in
--min-stake 1 \
--min-unstake-delay 0 \
--min-priority-fee-per-gas 0 \
--rpc-api eth,debug \
--rpc-api eth,debug,web3 \
--max-verification-gas 1500000 & echo $! > bundler.pid
popd
cd @account-abstraction && yarn deploy --network localhost
Expand Down

0 comments on commit d0399c3

Please sign in to comment.