{"id":19460097,"url":"https://github.com/offchainlabs/nitro-devnode","last_synced_at":"2025-04-15T01:10:46.720Z","repository":{"id":259904748,"uuid":"878532308","full_name":"OffchainLabs/nitro-devnode","owner":"OffchainLabs","description":"A script for running an Arbitrum Nitro dev node and deploying contracts for testing.","archived":false,"fork":false,"pushed_at":"2025-03-27T13:05:24.000Z","size":32,"stargazers_count":3,"open_issues_count":1,"forks_count":8,"subscribers_count":10,"default_branch":"main","last_synced_at":"2025-03-27T14:23:09.680Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Shell","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/OffchainLabs.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2024-10-25T15:07:04.000Z","updated_at":"2025-03-27T13:05:24.000Z","dependencies_parsed_at":"2024-10-28T17:26:54.057Z","dependency_job_id":"8a7e6f55-1dd7-4b28-b56d-2983341a6835","html_url":"https://github.com/OffchainLabs/nitro-devnode","commit_stats":null,"previous_names":["offchainlabs/nitro-devnode"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/OffchainLabs%2Fnitro-devnode","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/OffchainLabs%2Fnitro-devnode/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/OffchainLabs%2Fnitro-devnode/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/OffchainLabs%2Fnitro-devnode/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/OffchainLabs","download_url":"https://codeload.github.com/OffchainLabs/nitro-devnode/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248986312,"owners_count":21194025,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-11-10T17:35:35.563Z","updated_at":"2025-04-15T01:10:46.707Z","avatar_url":"https://github.com/OffchainLabs.png","language":"Shell","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Nitro dev node\n\nThis repository contains a simple script to start a Nitro dev node and deploy the Stylus `Cache Manager` contract for testing purposes.\n\n## Prerequisites\n\nBefore beginning, ensure the following is installed and running on your machine:\n\n- Docker: Required to run the Nitro dev node in a container. Install Docker by following [the official installation guide](https://docs.docker.com/get-started/get-docker/) for your operating system.\n- cast: A command-line tool from Foundry for interacting with Ethereum smart contracts. You can install it via Foundry by following [the installation instructions](https://book.getfoundry.sh/getting-started/installation).\n- jq: A lightweight JSON parsing tool used to extract contract addresses from the script output. Install jq by following [the official installation guide](https://jqlang.github.io/jq/download/) for your operating system.\n\n## Development account (used by default)\n\nIn `--dev` mode, the script uses a pre-funded development account by default. This account is pre-funded with ETH in all networks and is used to deploy contracts, interact with the chain, and assume chain ownership.\n\n- Address: 0x3f1Eae7D46d88F08fc2F8ed27FCb2AB183EB2d0E\n- Private key: 0xb6b15c8cb491557369f3c7d2c287b053eb229daa9c22138887752191c9520659\n\nYou don’t need to set up a private key manually unless you prefer using your own key.\n \n\n## Chain ownership in `--dev` mode\n\nIn Nitro `--dev` mode, the default chain owner is set to `0x0000000000000000000000000000000000000000`. However, you can use the `ArbDebug` precompile to set the chain owner. This precompile includes the `becomeChainOwner()` function, which can be called to assume ownership of the chain.\n\nChain ownership is important because it allows the owner to perform certain critical functions within the Arbitrum environment, such as:\n\n- Adding or removing other chain owners\n- Setting the L1 and L2 base fees directly\n- Adjusting the gas pricing inertia and backlog tolerance\n- Modifying the computational speed limit and transaction gas limits\n- Managing network and infrastructure fee accounts\n\nThe script automatically sets the chain owner to the pre-funded dev account before registering the `Cache Manager` contract. Here’s how the `becomeChainOwner()` function is called within the script:\n\n```bash\ncast send 0x00000000000000000000000000000000000000FF \"becomeChainOwner()\" --private-key 0xb6b15c8cb491557369f3c7d2c287b053eb229daa9c22138887752191c9520659 --rpc-url http://127.0.0.1:8547\n```\n\nThis step ensures that the dev account has ownership of the chain, which is necessary to register the `Cache Manager` as a WASM cache manager.\n\n\n## Usage\n\nTo use the script, follow these steps:\n\n1. Clone the repository:\n\n```bash\ngit clone https://github.com/OffchainLabs/nitro-devnode.git\ncd nitro-devnode\n```\n\n2. Run the dev node script:\nRun the script to start the Nitro dev node, deploy the Stylus `Cache Manager` contract, and register it as a WASM cache manager using the default development account:\n\n```bash\n./run-dev-node.sh\n```\n\nThe script will:\n\n- Start the Nitro dev node in the background using Docker.\n- Deploy the Stylus `Cache Manager` contract on the local Nitro network.\n- Register the `Cache Manager` contract as a WASM cache manager.\n\n## Note on `--dev` mode\n\nThe script starts the Nitro node in `--dev` mode, which does not persist chain data. Each time you restart the node, the chain state resets. This is suitable for testing and development purposes, but for persistent chain data, consider using a full node setup instead of `--dev`.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Foffchainlabs%2Fnitro-devnode","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Foffchainlabs%2Fnitro-devnode","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Foffchainlabs%2Fnitro-devnode/lists"}