Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: OffchainLabs/nitro
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: ci
Choose a base ref
...
head repository: edgeandnode/nitro
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: ci
Choose a head ref
Can’t automatically merge. Don’t worry, you can still create the pull request.
  • 7 commits
  • 6 files changed
  • 3 contributors

Commits on Nov 2, 2022

  1. feat: use pre-built nitro images to speed up CI

    Signed-off-by: Tomás Migone <[email protected]>
    tmigone committed Nov 2, 2022
    Copy the full SHA
    0a6c677 View commit details
  2. feat: use pre-built testnode images to speed up CI

    Signed-off-by: Tomás Migone <[email protected]>
    tmigone committed Nov 2, 2022
    Copy the full SHA
    c63c2d0 View commit details
  3. chore: update README.md

    Signed-off-by: Tomás Migone <[email protected]>
    tmigone committed Nov 2, 2022
    Copy the full SHA
    8640f48 View commit details

Commits on Nov 3, 2022

  1. fix: run token bridge deployment after nodes start up

    Signed-off-by: Tomás Migone <[email protected]>
    tmigone committed Nov 3, 2022
    Copy the full SHA
    43894dc View commit details
  2. fix: add sdk volume to sequencer for deployment data retrieval

    Signed-off-by: Tomás Migone <[email protected]>
    tmigone committed Nov 3, 2022
    Copy the full SHA
    145a4f6 View commit details

Commits on Nov 11, 2024

  1. Fixing Github action deprication

    actions/upload-artifact@v3 is being depricated Dec 2, 2024
    
    This PR updates this component to v4
    Brandon Graham committed Nov 11, 2024
    Copy the full SHA
    efa03ae View commit details

Commits on Nov 12, 2024

  1. Merge pull request #2 from edgeandnode/bgraham/fix_gh_workflow

    Fixing Github action deprication
    bgrahamen authored Nov 12, 2024

    Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature.
    Copy the full SHA
    040ddc5 View commit details
Showing with 85 additions and 57 deletions.
  1. +1 −1 .github/workflows/docker.yml
  2. +5 −0 Dockerfile.nitro-node
  3. +12 −45 README.md
  4. +48 −0 build-images.sh
  5. +6 −5 docker-compose.yaml
  6. +13 −6 test-node.bash
2 changes: 1 addition & 1 deletion .github/workflows/docker.yml
Original file line number Diff line number Diff line change
@@ -68,7 +68,7 @@ jobs:
echo -e "\x1b[1;34mWAVM module root:\x1b[0m $module_root"
- name: Upload WAVM machine as artifact
uses: actions/upload-artifact@v3
uses: actions/upload-artifact@v4
with:
name: wavm-machine-${{ steps.module-root.outputs.module-root }}
path: target/machines/latest/*
5 changes: 5 additions & 0 deletions Dockerfile.nitro-node
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# Reference > https://hub.docker.com/r/offchainlabs/nitro-node
ARG VERSION_TAG=v2.0.8
ARG VERSION_HASH=5b9fe9c

FROM offchainlabs/nitro-node:$VERSION_TAG-$VERSION_HASH-dev
57 changes: 12 additions & 45 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,52 +1,19 @@
<br />
<p align="center">
<a href="https://arbitrum.io/">
<img src="https://arbitrum.io/wp-content/uploads/2021/08/Arbitrum_Symbol-Full-color-White-background-768x840.png" alt="Logo" width="80" height="80">
</a>
# Arbitrum Nitro

<h3 align="center">Arbitrum Nitro</h3>
This is a fork of https://github.com/OffchainLabs/nitro with modifications made to better support testing and development of [The Graph's](https://thegraph.com/) multi-layer protocol. See https://github.com/graphprotocol/contracts for details on the protocol contracts.

<p align="center">
<a href="https://developer.arbitrum.io/"><strong>Next Generation Ethereum L2 Technology »</strong></a>
<br />
</p>
</p>

## About Arbitrum Nitro
## Quick setup

<img src="https://arbitrum.io/wp-content/uploads/2021/08/Arbitrum_Symbol-Full-color-White-background-768x840.png" alt="Logo" width="80" height="80">
For a quick setup of your local Nitro environment, run:

Nitro is the latest iteration of the Arbitrum technology. It is a fully integrated, complete
layer 2 optimistic rollup system, including fraud proofs, the sequencer, the token bridges,
advanced calldata compression, and more.

See the live docs-site [here](https://developer.arbitrum.io/) (or [here](./docs) for markdown docs source.)

The Nitro stack is built on several innovations. At its core is a new prover, which can do Arbitrum’s classic
interactive fraud proofs over WASM code. That means the L2 Arbitrum engine can be written and compiled using
standard languages and tools, replacing the custom-designed language and compiler used in previous Arbitrum
versions. In normal execution,
validators and nodes run the Nitro engine compiled to native code, switching to WASM if a fraud proof is needed.
We compile the core of Geth, the EVM engine that practically defines the Ethereum standard, right into Arbitrum.
So the previous custom-built EVM emulator is replaced by Geth, the most popular and well-supported Ethereum client.

The last piece of the stack is a slimmed-down version of our ArbOS component, rewritten in Go, which provides the
rest of what’s needed to run an L2 chain: things like cross-chain communication, and a new and improved batching
and compression system to minimize L1 costs.

Essentially, Nitro runs Geth at layer 2 on top of Ethereum, and can prove fraud over the core engine of Geth
compiled to WASM.

Arbitrum One successfully migrated from the Classic Arbitrum stack onto Nitro on 8/31/22. (See [state migration](https://developer.arbitrum.io/migration/state-migration) and [dapp migration](https://developer.arbitrum.io/migration/dapp_migration) for more info).

## License

We currently have Nitro [licensed](./LICENSE) under a Business Source License, similar to our friends at Uniswap and Aave, with an "Additional Use Grant" to ensure that everyone can have full comfort using and running nodes on all public Arbitrum chains.

## Contact

Discord - [Arbitrum](https://discord.com/invite/5KE54JwyTs)

Twitter: [Arbitrum](https://twitter.com/arbitrum)
```bash
git clone https://github.com/edgeandnode/nitro
pushd nitro
git submodule update --init --recursive
./test-node.bash --init --no-blockscout --detach
```

This will start a local Arbitrum testnet with a single sequencer node and all Arbitrum contracts deployed and ready to go. The L1 node will be available at http://localhost:8545 while the L2 sequencer at http://localhost:8547. A prefunded account can be accessed using the following private key: `e887f7d17d07cc7b8004053fb8826f6657084e88904bb61590e498ca04704cf2`

__Note__: if you run the test nodes in "attached mode" (by removing the `--detach` flag) you'll need to manually deploy the Arbitrum contracts by running `docker-compose run network-gen` on a separate terminal.
48 changes: 48 additions & 0 deletions build-images.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
#!/bin/bash
set -e

function build_and_push_image () {
local PLATFORM=$1
local ARCH=$2
local DOCKER_ORG=$3
local IMAGE_NAME=$4
local DOCKERFILE_NAME=${5:-Dockerfile}

TAG=$DOCKER_ORG/$IMAGE_NAME:$ARCH

echo "Building for platform $PLATFORM, pushing to $TAG"

docker buildx build . --pull \
--platform $PLATFORM \
--file $DOCKERFILE_NAME \
--tag $TAG \
--load

echo "Publishing..."
docker push $TAG
}

function create_and_push_manifest() {
local DOCKER_ORG=$1
local IMAGE_NAME=$2

echo "Publishing manifest..."
docker manifest create $DOCKER_ORG/$IMAGE_NAME:latest \
--amend $DOCKER_ORG/$IMAGE_NAME:amd64 \
--amend $DOCKER_ORG/$IMAGE_NAME:arm64v8
docker manifest push --purge $DOCKER_ORG/$IMAGE_NAME:latest
}

# Build testnode-scripts image
pushd testnode-scripts
build_and_push_image "linux/amd64" "amd64" "tmigone" "nitro-testnode-scripts"
build_and_push_image "linux/arm64/v8" "arm64v8" "tmigone" "nitro-testnode-scripts"
create_and_push_manifest "tmigone" "nitro-testnode-scripts"
popd

# Build network-gen image
pushd testnode-tokenbridge
build_and_push_image "linux/amd64" "amd64" "tmigone" "nitro-testnode-tokenbridge"
build_and_push_image "linux/arm64/v8" "arm64v8" "tmigone" "nitro-testnode-tokenbridge"
create_and_push_manifest "tmigone" "nitro-testnode-tokenbridge"
popd
11 changes: 6 additions & 5 deletions docker-compose.yaml
Original file line number Diff line number Diff line change
@@ -59,14 +59,15 @@ services:
pid: host # allow debugging
build:
context: .
target: nitro-node-dev
dockerfile: Dockerfile.nitro-node
ports:
- "127.0.0.1:8547:8547"
- "127.0.0.1:8548:8548"
- "127.0.0.1:9642:9642"
volumes:
- "seqdata:/home/user/.arbitrum/local/nitro"
- "config:/config"
- "sdk-data:/workspace"
command: --conf.file /config/sequencer_config.json --node.feed.output.enable --node.feed.output.port 9642 --http.api net,web3,eth,txpool,debug --node.seq-coordinator.my-url ws://sequencer:8548 --graphql.enable --graphql.vhosts * --graphql.corsdomain *
depends_on:
- geth
@@ -124,7 +125,7 @@ services:
pid: host # allow debugging
build:
context: .
target: nitro-node-dev
dockerfile: Dockerfile.nitro-node
ports:
- "127.0.0.1:8047:8547"
- "127.0.0.1:8048:8548"
@@ -141,7 +142,7 @@ services:
pid: host # allow debugging
build:
context: .
target: nitro-node-dev
dockerfile: Dockerfile.nitro-node
ports:
- "127.0.0.1:8147:8547"
- "127.0.0.1:8148:8548"
@@ -205,7 +206,7 @@ services:
- sequencer

testnode-scripts:
build: testnode-scripts/
image: tmigone/nitro-testnode-scripts
volumes:
- "l1keystore:/home/user/l1keystore"
- "config:/config"
@@ -228,7 +229,7 @@ services:
- geth
- sequencer
pid: host
build: testnode-tokenbridge/
image: tmigone/nitro-testnode-tokenbridge
environment:
- ARB_URL=http://sequencer:8547
- ETH_URL=http://geth:8545
19 changes: 13 additions & 6 deletions test-node.bash
Original file line number Diff line number Diff line change
@@ -186,23 +186,30 @@ if $force_init; then

docker-compose run testnode-scripts bridge-funds --ethamount 100000

if $tokenbridge; then
echo == Deploying token bridge
docker-compose run -e ARB_KEY=$devprivkey -e ETH_KEY=$devprivkey testnode-tokenbridge gen:network
docker-compose run --entrypoint sh testnode-tokenbridge -c "cat localNetwork.json"
echo
fi
fi

if $run; then
UP_FLAG=""
if $detach; then
UP_FLAG="-d"
else
echo == Deploying Token bridge
echo Not running in detached mode. To deploy token bridge run the following commands on another terminal or re-run with --detach flag:
echo docker-compose run -e ARB_KEY=$devprivkey -e ETH_KEY=$devprivkey testnode-tokenbridge gen:network
echo docker-compose run --entrypoint sh testnode-tokenbridge -c "cat localNetwork.json"
echo
fi

echo == Launching Sequencer
echo if things go wrong - use --init to create a new chain
echo

docker-compose up $UP_FLAG $NODES

if $tokenbridge && $detach; then
echo == Deploying token bridge
docker-compose run -e ARB_KEY=$devprivkey -e ETH_KEY=$devprivkey testnode-tokenbridge gen:network
docker-compose run --entrypoint sh testnode-tokenbridge -c "cat localNetwork.json"
echo
fi
fi