Skip to content

Commit

Permalink
Merge branch 'master' into add-how-to-use-timeboost
Browse files Browse the repository at this point in the history
  • Loading branch information
TucksonDev authored Oct 29, 2024
2 parents 85ec457 + 15818a5 commit eda6cda
Show file tree
Hide file tree
Showing 15 changed files with 367 additions and 41 deletions.
Binary file added arbitrum-docs/bold/assets/9Pr_Image_1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added arbitrum-docs/bold/assets/BnF_Image_3.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added arbitrum-docs/bold/assets/CRA_Image_4.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added arbitrum-docs/bold/assets/KSf_Image_1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added arbitrum-docs/bold/assets/csI_Image_2.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
229 changes: 229 additions & 0 deletions arbitrum-docs/bold/concepts/bold-technical-deep-dive.md

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,4 @@ The BoLD dispute protocol is currently deployed on a public testnet (that posts

To provide feedback, click the _Request an update_ button at the top of this document, [join the Arbitrum Discord](https://discord.gg/arbitrum), or reach out to our team directly by completing [this form](http://bit.ly/3yy6EUK).

:::
:::
2 changes: 1 addition & 1 deletion arbitrum-docs/partials/_contribute-docs-partial.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@ Every document should be a specific _type_ of document. Each type of document ha
| ------------------- | ---------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
| Gentle introduction | Onboard a specific reader audience with tailored questions and answers | [A gentle introduction to Orbit](/launch-orbit-chain/orbit-gentle-introduction.md) |
| Quickstart | Onboard a specific reader audience with step-by-step "learn by doing" instructions | [Quickstart: Build dApps](/build-decentralized-apps/01-quickstart-solidity-hardhat.md) |
| How-to | Provide task-oriented procedural guidance | [How to run a local dev node](/run-arbitrum-node/04-run-local-dev-node.md) |
| How-to | Provide task-oriented procedural guidance | [How to run a full chain simulation](/run-arbitrum-node/04-run-local-full-chain-simulation.md) |
| Concept | Explain what things are and how they work | [Token bridging](/build-decentralized-apps/token-bridging/03-token-bridge-erc20.md) <br/>[Nodes and networks](https://docs.prylabs.network/docs/concepts/nodes-networks) |
| FAQ | Address frequently asked questions | [FAQ: Run a node](../node-running/faq.md) |
| Troubleshooting | List common troubleshooting scenarios and solutions | [Troubleshooting: Run a node](/run-arbitrum-node/06-troubleshooting.md) |
Expand Down
33 changes: 15 additions & 18 deletions arbitrum-docs/partials/_local-devnet-flags.md
Original file line number Diff line number Diff line change
@@ -1,20 +1,17 @@
<section class="small-table">
| Flag | Description |
|-------------------------------|------------------------------------------------------------------------------------------------------|
| `--init` | Removes all the data, rebuilds, and deploys a new rollup |
| `--pos` | L1 is a proof-of-stake chain (using Prysm for consensus) |
| `--validate` | Validates all blocks in WASM, heavy computation |
| `--l3node` | Deploys an L3 node on top of the L2 |
| `--l3-fee-token` | Sets up the L3 chain to use a custom fee token. Only valid if `--l3node` flag is provided |
| `--l3-fee-token-decimals` | Number of decimals to use for a custom fee token. Only valid if `--l3-fee-token` flag is provided |
| `--l3-token-bridge` | Deploys an L2-L3 token bridge. Only valid if `--l3node` flag is provided |
| `--batchposters` | Batch posters [0-3] |
| `--redundantsequencers` | Redundant sequencers [0-3] |
| `--detach` | Detaches from nodes after running them |
| `--blockscout` | Builds or launches the Blockscout |
| `--simple` | Runs a simple configuration: one node as a sequencer/batch-poster/staker (default unless using `--dev`) |
| `--tokenbridge` | Deploy an L1-L2 token bridge |
| `--no-tokenbridge` | Opt out of building or launching the token bridge |
| `--no-run` | Does not launch nodes (useful with build or init) |
| `--no-simple` | Runs a full configuration with separate sequencer/batch-poster/validator/relayer |
| Flag | Description |
|-------------------------------|------------------------------------------------------------------------------------------------------|
| `--init` | Removes all the data, rebuilds, and deploys a new rollup | | `--pos` | L1 is a
proof-of-stake chain (using Prysm for consensus) | | `--validate` | Validates all blocks in WASM,
heavy computation | | `--l3node` | Deploys an L3 node on top of the L2 | | `--l3-fee-token` | Sets
up the L3 chain to use a custom fee token. Only valid if `--l3node` flag is provided | |
`--l3-fee-token-decimals` | Number of decimals to use for a custom fee token. Only valid if
`--l3-fee-token` flag is provided | | `--l3-token-bridge` | Deploys an L2-L3 token bridge. Only
valid if `--l3node` flag is provided | | `--batchposters` | Batch posters [0-3] | |
`--redundantsequencers` | Redundant sequencers [0-3] | | `--detach` | Detaches from nodes after
running them | | `--blockscout` | Builds or launches the Blockscout | | `--simple` | Runs a simple
configuration: one node as a sequencer/batch-poster/staker (default unless using `--dev`) | |
`--tokenbridge` | Deploy an L1-L2 token bridge | | `--no-tokenbridge` | Opt out of building or
launching the token bridge | | `--no-run` | Does not launch nodes (useful with build or init) | |
`--no-simple` | Runs a full configuration with separate sequencer/batch-poster/validator/relayer |
</section>
2 changes: 1 addition & 1 deletion arbitrum-docs/run-arbitrum-node/01-overview.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ In order to be able to _interact with_ or _build applications on_ any of the Arb

Here, you can find resources that help you run different types of Arbitrum nodes:

- Step-by-step instructions for running different Arbitrum nodes, including [full Nitro node](/run-arbitrum-node/03-run-full-node.md), [full Classic node](/run-arbitrum-node/more-types/03-run-classic-node.md), [local dev node](/run-arbitrum-node/04-run-local-dev-node.md), [feed relay](/run-arbitrum-node/sequencer/01-run-feed-relay.md), and [validator](/run-arbitrum-node/more-types/02-run-validator-node.md)
- Step-by-step instructions for running different Arbitrum nodes, including [full Nitro node](/run-arbitrum-node/03-run-full-node.md), [full Classic node](/run-arbitrum-node/more-types/03-run-classic-node.md), [local full chain simulation](/run-arbitrum-node/04-run-local-full-chain-simulation.md), [Nitro dev node](/run-arbitrum-node/run-nitro-dev-node.mdx), [feed relay](/run-arbitrum-node/sequencer/01-run-feed-relay.md), and [validator](/run-arbitrum-node/more-types/02-run-validator-node.md)
- Step-by-step instructions for how to [read the sequencer feed](/run-arbitrum-node/sequencer/02-read-sequencer-feed.md), [build the Nitro locally](/run-arbitrum-node/nitro/01-build-nitro-locally.md) and [run the sequencer coordinator manager UI tool](/run-arbitrum-node/sequencer/03-run-sequencer-coordination-manager.md)
- Step-by-step instructions for [how to configure a Data Availability Committee](/run-arbitrum-node/data-availability-committees/01-get-started.md)
- [Troubleshooting page](/run-arbitrum-node/06-troubleshooting.md)
Expand Down
Original file line number Diff line number Diff line change
@@ -1,13 +1,15 @@
---
title: 'How to run a local dev node'
description: Learn how to run an Arbitrum local dev node on your local machine.
title: 'How to run a local full chain simulation'
description: This page provides instructions for setting up a complete local development environment for testing Arbitrum contracts in a fully simulated environment.
author: jose-franco
sme: jose-franco
sidebar_position: 6
content_type: how-to
---

A local Arbitrum Nitro dev node can help you deploy and test smart contracts in a fully controlled environment. This how-to walks you through the process of deploying and running a full development environment on your local machine that includes a Nitro dev node, a dev-mode geth L1, and multiple instances with different roles.
## Overview

A local full-chain simulation allows you to deploy and test smart contracts in a fully controlled environment. This how-to walks you through the process of setting up and running a complete development environment on your local machine, including a Nitro node, a dev-mode Geth L1, and multiple instances with different roles.

Note that the node is now Stylus-enabled by default, and the setup instructions remain the same as for running a Stylus dev node.

Expand Down
85 changes: 85 additions & 0 deletions arbitrum-docs/run-arbitrum-node/run-nitro-dev-node.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,85 @@
---
title: 'How to run a local Nitro dev node'
description: 'This page provides instructions for setting up and running a local Nitro dev node for contract testing and development.'
author: mahsamoosavi
sme: mahsamoosavi
target_audience: 'Developers deploying smart contracts using Stylus'
content_type: how-to
sidebar_position: 5
---

import PublicPreviewBannerPartial from '../partials/_public-preview-banner-partial.mdx';

<PublicPreviewBannerPartial />

## Overview

This page provides step-by-step instructions for setting up and running a local Nitro node in `--dev` mode. This mode is ideal for developers who want to quickly test contracts using a single node, as it offers a simpler and faster setup compared to more complex environments.

While some teams use `nitro-testnode` for testing cross-layer messaging, which involves launching both Geth as L1 and Nitro as L2, this setup can be more complex and time-consuming. If your primary goal is to test contracts on a local node without needing cross-layer interactions, Nitro's `--dev` mode offers a lightweight and efficient alternative.

However, if you need more advanced functionality—such as cross-layer messaging, working with both L1 and L2 chains, or testing interactions between different layers—`nitro-testnode` is the preferred option. The testnode setup allows you to simulate a full L1-L2 environment, which is critical for those scenarios. See here for instructions.

Note that Nitro `--dev` mode is ideal for Stylus contract testing, as it is much lighter and faster to set up than the full nitro-testnode environment.

## Prerequisites

Before beginning, ensure the following is installed and running on your machine:

- 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.
- 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).
- 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.

## Clone the [nitro-devnode](https://github.com/OffchainLabs/nitro-devnode) repository

Use the following command to clone the repository:

```shell
git clone https://github.com/OffchainLabs/nitro-devnode.git
cd nitro-devnode
```

## Run the dev node script:

Run 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:

```shell
./run-dev-node.sh
```

The script will:

- Start the Nitro dev node in the background using Docker.
- Deploy the Stylus `Cache Manager` contract on the local Nitro network.
- Register the `Cache Manager` contract as a WASM cache manager.

## Development account (used by default)

In `--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.

- Address: 0x3f1Eae7D46d88F08fc2F8ed27FCb2AB183EB2d0E
- Private key: 0xb6b15c8cb491557369f3c7d2c287b053eb229daa9c22138887752191c9520659

You don’t need to set up a private key manually unless you prefer using your own key.

## Chain ownership in `--dev` mode

In 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.

Chain ownership is important because it allows the owner to perform certain critical functions within the Arbitrum environment, such as:

- Adding or removing other chain owners
- Setting the L1 and L2 base fees directly
- Adjusting the gas pricing inertia and backlog tolerance
- Modifying the computational speed limit and transaction gas limits
- Managing network and infrastructure fee accounts

The 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:

```shell
cast send 0x00000000000000000000000000000000000000FF "becomeChainOwner()" --private-key 0xb6b15c8cb491557369f3c7d2c287b053eb229daa9c22138887752191c9520659 --rpc-url http://127.0.0.1:8547
```

This step ensures that the dev account has ownership of the chain, which is necessary to register the `Cache Manager` as a WASM cache manager.

At the end of the process, you'll have the Nitro `dev` mode running with the necessary components deployed. This environment is ready for testing and interacting with your contracts, including those written in Stylus, using the deployed `Cache Manager` to support enhanced functionality for Stylus-based smart contracts.
21 changes: 8 additions & 13 deletions arbitrum-docs/stylus/stylus-quickstart.md
Original file line number Diff line number Diff line change
Expand Up @@ -50,22 +50,17 @@ You can download Docker from [Docker’s website](https://www.docker.com/product

[Foundry's Cast](https://book.getfoundry.sh/cast/) is a command-line tool that allows you to interact with your EVM contracts.

#### Nitro testnode
#### Nitro devnode

Stylus is available on Arbitrum Sepolia, but we'll use nitro testnode which has a pre-funded wallet saving us the effort of wallet provisioning or running out of tokens to send transactions.
Stylus is available on Arbitrum Sepolia, but we'll use nitro devnode which has a pre-funded wallet saving us the effort of wallet provisioning or running out of tokens to send transactions.

```shell title="Install your testnode"
git clone -b release --recurse-submodules https://github.com/OffchainLabs/nitro-testnode.git && cd nitro-testnode
```shell title="Install your devnode"
git clone https://github.com/OffchainLabs/nitro-devnode.git
cd nitro-devnode
```

```shell title="Launch your testnode"
./test-node.bash --init
```

The initialization part might take up to a few minutes, but you can move on to the next section while it launches.

```shell title="Re-use your testnode"
./test-node.bash
```shell title="Launch your devnode"
./run-dev-node.sh
```

## Creating a Stylus project with cargo stylus
Expand All @@ -82,7 +77,7 @@ In your terminal, run:
cargo install --force cargo-stylus
```

Add WASM ([WebAssembly](https://webassembly.org/)) as a build target for the specific Rust toolchain you are using. The below example sets your default Rust toolchain to 1.80 as well as adding the WASM build target:
Add WASM ([WebAssembly](https://webassembly.org/)) as a build target for the specific Rust toolchain you are using. The below example sets your default Rust toolchain to 1.80 as well as adding the WASM build target:

```shell
rustup default 1.80
Expand Down
13 changes: 9 additions & 4 deletions website/sidebars.js
Original file line number Diff line number Diff line change
Expand Up @@ -597,7 +597,7 @@ const sidebars = {
{
type: 'html',
value:
'<a class="menu__link menu__list-item" href="/run-arbitrum-node/run-local-dev-node">Run a Stylus dev node<span class="other-section-icon">↑</span></a>',
'<a class="menu__link menu__list-item" href="/run-arbitrum-node/run-nitro-dev-node">Run a Stylus dev node<span class="other-section-icon">↑</span></a>',
// q: why use an anchor html tag here?/node-running/how-tos/running-an-stylus-node
// a: see note at end of file
},
Expand Down Expand Up @@ -656,7 +656,12 @@ const sidebars = {
},
{
type: 'doc',
id: 'run-arbitrum-node/run-local-dev-node',
id: 'run-arbitrum-node/run-local-full-chain-simulation',
label: 'Run a local full chain simulation',
},
{
type: 'doc',
id: 'run-arbitrum-node/run-nitro-dev-node',
label: 'Run a local dev node',
},
{
Expand Down Expand Up @@ -961,8 +966,8 @@ const sidebars = {
label: 'BoLD Whitepaper',
},
{
type: 'link',
href: 'https://github.com/OffchainLabs/bold/blob/main/docs/research-specs/TechnicalDeepDive.pdf',
type: 'doc',
id: 'bold/concepts/bold-technical-deep-dive',
label: 'Technical deep dive',
},
{
Expand Down
13 changes: 13 additions & 0 deletions website/src/css/partials/_content-body.scss
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,19 @@ article {
font-weight: 600;
}

img[alt='200px-img'] {
width: 200px;
}
img[alt='400px-img'] {
width: 400px;
}
img[alt='600px-img'] {
width: 600px;
}
img[alt='900px-img'] {
width: 900px;
}

.theme-admonition {
margin-bottom: 2em;

Expand Down

0 comments on commit eda6cda

Please sign in to comment.