Skip to content

Commit

Permalink
Arbitrum local testnet setup (#205)
Browse files Browse the repository at this point in the history
Co-authored-by: Lohann Paterno Coutinho Ferreira <lohann@enjin.io>
  • Loading branch information
ManojJiSharma and Lohann authored Jan 19, 2024
1 parent 8d0abba commit d6301e0
Show file tree
Hide file tree
Showing 15 changed files with 638 additions and 54 deletions.
26 changes: 21 additions & 5 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,12 @@ jobs:
- name: Dprint check
run: dprint check

- name: Install nightly toolchain
run: rustup toolchain install nightly

- name: Install cargo-fmt for nightly toolchain
run: rustup component add rustfmt --toolchain nightly

- name: cargo fmt
run: cargo +nightly fmt --all -- --check

Expand Down Expand Up @@ -68,9 +74,10 @@ jobs:
- name: Install rust toolchain
uses: actions-rs/toolchain@v1
with:
toolchain: stable
toolchain: 1.74.1
components: clippy
target: x86_64-unknown-linux-musl
override: true

- name: cargo clippy (${{ matrix.crate }})
run: |
Expand Down Expand Up @@ -108,10 +115,19 @@ jobs:
- name: Install rust toolchain
uses: actions-rs/toolchain@v1
with:
toolchain: stable
toolchain: 1.74.1
components: clippy
target: x86_64-unknown-linux-musl
override: true

- name: Checkout code
run: git clone -b release --recurse-submodules https://github.com/ManojJiSharma/nitro-testnode.git

- name: Run the arbitrum nitro-testnode
run: |
cd nitro-testnode
./test-node.bash --detach
- name: clippy
run: |
cargo clippy --locked --workspace --examples --tests --all-features \
Expand All @@ -128,9 +144,6 @@ jobs:
-Dclippy::pedantic \
-Aclippy::module_name_repetitions
- name: Cleanup Docker
run: ./scripts/reset_docker.sh

- name: Pull nodes
run: ./scripts/pull_nodes.sh

Expand All @@ -142,3 +155,6 @@ jobs:
--exclude rosetta-server-ethereum \
--exclude rosetta-server-polkadot \
--exclude rosetta-client
- name: Cleanup Docker
run: ./scripts/reset_docker.sh
4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -5,3 +5,7 @@

# These are backup files generated by rustfmt
**/*.rs.bk


# Ignore nitro-testnode folder
chains/arbitrum/testing/nitro-testnode/
36 changes: 36 additions & 0 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 @@ -17,6 +17,7 @@ members = [
"rosetta-docker",
"rosetta-server",
"rosetta-types",
"chains/arbitrum/testing/rosetta-testing-arbitrum",
]
resolver = "2"

Expand Down
26 changes: 26 additions & 0 deletions chains/arbitrum/testing/rosetta-testing-arbitrum/Cargo.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
[package]
name = "rosetta-testing-arbitrum"
version = "0.1.0"
edition = "2021"
license = "MIT"
repository = "https://github.com/analog-labs/chain-connectors"
description = "Arbitrum unit test."

[dependencies]
anyhow = "1.0"
ethers = { version = "2.0", default-features = true, features = ["abigen", "rustls"] }
rosetta-config-ethereum.workspace = true
rosetta-core.workspace = true
rosetta-docker = { workspace = true, features = ["tests"] }
rosetta-server-ethereum.workspace = true
sequential-test = "0.2.4"
serde_json.workspace = true
tokio = { workspace = true, features = ["rt-multi-thread", "macros"] }
tracing = "0.1.40"

[dev-dependencies]
alloy-sol-types = { version = "0.5" }
ethers-solc = "2.0"
rosetta-client.workspace = true
sha3 = "0.10"
url = "2.4"
11 changes: 11 additions & 0 deletions chains/arbitrum/testing/rosetta-testing-arbitrum/Readme.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
# Arbitrum test instructions

Before running the test-cases need to setup the [Arbitrum nitro-testnode](https://github.com/OffchainLabs/nitro-testnode).

Place the nitro-testnode in side the testing folder.

Clone repo using :

```bash
git clone -b release --recurse-submodules https://github.com/OffchainLabs/nitro-testnode.git
```
Loading

0 comments on commit d6301e0

Please sign in to comment.