Skip to content

Commit

Permalink
Merge pull request #210 from Vid201/chore/cli
Browse files Browse the repository at this point in the history
Update CLI
  • Loading branch information
Vid201 authored Sep 6, 2023
2 parents 49530a1 + acb168c commit bd79ea0
Show file tree
Hide file tree
Showing 40 changed files with 1,360 additions and 1,040 deletions.
9 changes: 5 additions & 4 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
.github
docs
Dockerfile
bundler-spec-tests
target
thirdparty/account-abstraction/*
thirdparty/bundler/*
.github
Dockerfile
crates/contrarcts/thirdparty/account-abstraction/*
tests/thirdparty/bundler/*
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,5 @@
.local
.vscode
**/.env
.env
.env
db
18 changes: 9 additions & 9 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ default-members = ["bin/silius"]

[workspace.package]
authors = ["Vid Kersic <[email protected]>"]
version = "0.2.0-alpha"
edition = "2021"
license = "MIT OR Apache-2.0"
repository = "https://github.com/Vid201/silius"
Expand Down
17 changes: 10 additions & 7 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -2,22 +2,25 @@ build:
cargo build --release

run-silius:
cargo run --release -- --eth-client-address http://127.0.0.1:8545 --mnemonic-file ${HOME}/.silius/0xf39Fd6e51aad88F6F4ce6aB8827279cffFb92266 --beneficiary 0xf39Fd6e51aad88F6F4ce6aB8827279cffFb92266 --entry-points 0x5FF137D4b0FDCD49DcA30c7CF57E578a026d2789 --http --ws
cargo run --release -- bundler --eth-client-address http://127.0.0.1:8545 --mnemonic-file ${HOME}/.silius/0xf39Fd6e51aad88F6F4ce6aB8827279cffFb92266 --beneficiary 0xf39Fd6e51aad88F6F4ce6aB8827279cffFb92266 --entry-points 0x5FF137D4b0FDCD49DcA30c7CF57E578a026d2789 --http --ws

run-silius-bundling:
cargo run --release -- bundling --eth-client-address http://127.0.0.1:8545 --mnemonic-file ${HOME}/.silius/0xf39Fd6e51aad88F6F4ce6aB8827279cffFb92266 --beneficiary 0xf39Fd6e51aad88F6F4ce6aB8827279cffFb92266 --entry-points 0x5FF137D4b0FDCD49DcA30c7CF57E578a026d2789

run-silius-uopool:
cargo run --release --bin silius-uopool -- --eth-client-address http://127.0.0.1:8545 --entry-points 0x5FF137D4b0FDCD49DcA30c7CF57E578a026d2789
cargo run --release -- uopool --eth-client-address http://127.0.0.1:8545 --entry-points 0x5FF137D4b0FDCD49DcA30c7CF57E578a026d2789

run-silius-rpc:
cargo run --release --bin silius-rpc --http --ws
cargo run --release -- rpc --http --ws

run-create-wallet:
cargo run --release --bin create-wallet -- --output-path ${HOME}/.silius
run-silius-create-wallet:
cargo run --release -- 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 --entry-points 0x5FF137D4b0FDCD49DcA30c7CF57E578a026d2789 --http --ws --rpc-api eth,debug,web3
cargo run --release -- bundler --eth-client-address http://127.0.0.1:8545 --mnemonic-file ${HOME}/.silius/0xf39Fd6e51aad88F6F4ce6aB8827279cffFb92266 --beneficiary 0xf39Fd6e51aad88F6F4ce6aB8827279cffFb92266 --entry-points 0x5FF137D4b0FDCD49DcA30c7CF57E578a026d2789 --http --ws --http.api eth,debug,web3 --ws.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 --entry-points 0x5FF137D4b0FDCD49DcA30c7CF57E578a026d2789 --http --ws --rpc-api eth,debug,web3
cargo run --profile debug-fast -- bundler --verbosity 4 --eth-client-address http://127.0.0.1:8545 --mnemonic-file /home/vid/.silius/0xf39Fd6e51aad88F6F4ce6aB8827279cffFb92266 --beneficiary 0xf39Fd6e51aad88F6F4ce6aB8827279cffFb92266 --entry-points 0x5FF137D4b0FDCD49DcA30c7CF57E578a026d2789 --http --ws --http.api eth,debug,web3 --ws.api eth,debug,web3

fetch-thirdparty:
git submodule update --init
Expand Down
17 changes: 12 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -39,31 +39,37 @@ make setup-thirdparty
Create wallet for bundler:

```bash
cargo run --release --bin create-wallet -- --output-path ${HOME}/.silius --chain-id 5
cargo run --release -- create-wallet --output-path ${HOME}/.silius --chain-id 5
```

Run bundler (with user operation pool and JSON-RPC API):

```bash
cargo run --release -- --eth-client-address http://127.0.0.1:8545 --mnemonic-file ${HOME}/.silius/0xf39Fd6e51aad88F6F4ce6aB8827279cffFb92266 --beneficiary 0xf39Fd6e51aad88F6F4ce6aB8827279cffFb92266 --entry-points 0x5FF137D4b0FDCD49DcA30c7CF57E578a026d2789 --http --ws
cargo run --release -- bundler --eth-client-address http://127.0.0.1:8545 --mnemonic-file ${HOME}/.silius/0xf39Fd6e51aad88F6F4ce6aB8827279cffFb92266 --beneficiary 0xf39Fd6e51aad88F6F4ce6aB8827279cffFb92266 --entry-points 0x5FF137D4b0FDCD49DcA30c7CF57E578a026d2789 --http --ws
```

Run only bundling component:

```bash
cargo run --release -- bundling --eth-client-address http://127.0.0.1:8545 --mnemonic-file ${HOME}/.silius/0xf39Fd6e51aad88F6F4ce6aB8827279cffFb92266 --beneficiary 0xf39Fd6e51aad88F6F4ce6aB8827279cffFb92266 --entry-points 0x5FF137D4b0FDCD49DcA30c7CF57E578a026d2789
```

Run only user operation pool:

```bash
cargo run --release --bin silius-uopool -- --eth-client-address http://127.0.0.1:8545 --entry-points 0x5FF137D4b0FDCD49DcA30c7CF57E578a026d2789
cargo run --release -- uopool --eth-client-address http://127.0.0.1:8545 --entry-points 0x5FF137D4b0FDCD49DcA30c7CF57E578a026d2789
```

Run only JSON-RPC API:

```bash
cargo run --release --bin silius-rpc --http --ws
cargo run --release -- rpc --http --ws
```

### Docker

```bash
docker run --net=host -v ./bundler-spec-tests/keys:/data/silius -v ./db:/data/silius/db ghcr.io/vid201/silius:latest --rpc-listen-address 0.0.0.0:3000 --eth-client-address http://127.0.0.1:8545 --datadir data/silius --mnemonic-file data/silius/0xf39Fd6e51aad88F6F4ce6aB8827279cffFb92266 --beneficiary 0xf39Fd6e51aad88F6F4ce6aB8827279cffFb92266 --entry-points 0x5ff137d4b0fdcd49dca30c7cf57e578a026d2789 --http --ws --rpc-api eth,debug,web3
docker run --net=host -v ./bundler-spec-tests/keys/0xf39Fd6e51aad88F6F4ce6aB8827279cffFb92266:/data/silius/0xf39Fd6e51aad88F6F4ce6aB8827279cffFb92266 -v ./db:/data/silius/db ghcr.io/vid201/silius:latest bundler --eth-client-address http://127.0.0.1:8545 --datadir data/silius --mnemonic-file data/silius/0xf39Fd6e51aad88F6F4ce6aB8827279cffFb92266 --beneficiary 0xf39Fd6e51aad88F6F4ce6aB8827279cffFb92266 --entry-points 0x5ff137d4b0fdcd49dca30c7cf57e578a026d2789 --http --http.addr 0.0.0.0 --http.port 3000 --http.api eth,debug,web3 --ws --ws.addr 0.0.0.0 --ws.port 3001 --ws.api eth,debug,web3
```

## Supported networks
Expand Down Expand Up @@ -117,6 +123,7 @@ The best place for the discussion is the dedicated [Telegram group](https://t.me
## Projects using Silius

- [Luban the Paymaster](https://github.com/da-bao-jian/luban-the-paymaster): A Cross-chain Tx Sponsorship Protocol.
- [Ethers UserOp](https://github.com/qi-protocol/ethers-userop/): An ether-rs middleware to craft UserOperations.

## Licenses

Expand Down
23 changes: 1 addition & 22 deletions bin/silius/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "silius"
version = "0.1.0"
version = { workspace = true }
authors = { workspace = true }
edition = { workspace = true }
license = { workspace = true }
Expand All @@ -9,10 +9,8 @@ rust-version = { workspace = true }
description = """
AA (ERC-4337) bundler - Silius
"""
default-run = "silius"

[dependencies]

anyhow = { workspace = true }
clap = { version = "4", features = ["derive"] }
dirs = "4.0"
Expand All @@ -27,22 +25,3 @@ silius-rpc = { path = "../../crates/rpc" }
tokio = { workspace = true }
tracing = { workspace = true }
tracing-subscriber = { version = "0.3", features = ["env-filter"] }

[lib]
path = "src/lib.rs"

[[bin]]
path = "src/silius.rs"
name = "silius"

[[bin]]
path = "src/silius-uopool.rs"
name = "silius-uopool"

[[bin]]
path = "src/silius-rpc.rs"
name = "silius-rpc"

[[bin]]
path = "src/create-wallet.rs"
name = "create-wallet"
Loading

0 comments on commit bd79ea0

Please sign in to comment.