Skip to content

Commit

Permalink
Merge branch 'master' into orbit-chain-ownership-docs
Browse files Browse the repository at this point in the history
  • Loading branch information
mahsamoosavi authored Oct 11, 2023
2 parents 36fe828 + c2ff67a commit 53508c2
Show file tree
Hide file tree
Showing 22 changed files with 166 additions and 122 deletions.
4 changes: 3 additions & 1 deletion .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,9 @@ jobs:
echo "format-check-result=$?" >> $GITHUB_OUTPUT
- name: Output formatting error
if: steps.prettier-check.outputs.format-check-result == 1
if: |
steps.prettier-check.outputs.format-check-result == 1 &&
github.event.pull_request.head.repo.full_name == github.repository
uses: actions/github-script@v6
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
Expand Down
2 changes: 1 addition & 1 deletion arbitrum-docs/for-devs/concepts/public-chains.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ Finally, Arbitrum Sepolia is a testnet chain. It's designed for testing purposes

### Nitro

Nitro is the technology that powers Arbitrum One, Arbitrum Nova (with Anytrust configuration) and Arbitrum Goerli. It's designed to offer high throughput and low cost, making it ideal for scaling Ethereum applications. Nitro is a major upgrade to the “Classic” stack, offering several improvements including advanced calldata compression, separate contexts for common execution and fault proving, Ethereum L1 gas compatibility, and more. You can find more information about Nitro in [Inside Arbitrum Nitro](/inside-arbitrum-nitro/inside-arbitrum-nitro.mdx).
Nitro is the technology that powers Arbitrum One, Arbitrum Nova (with Anytrust configuration), Arbitrum Sepolia, and Arbitrum Goerli. It's designed to offer high throughput and low cost, making it ideal for scaling Ethereum applications. Nitro is a major upgrade to the “Classic” stack, offering several improvements including advanced calldata compression, separate contexts for common execution and fault proving, Ethereum L1 gas compatibility, and more. You can find more information about Nitro in [Inside Arbitrum Nitro](/inside-arbitrum-nitro/inside-arbitrum-nitro.mdx).

### AnyTrust (variant of Nitro)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,10 @@ import KnowMoreToolsBox from '../partials/_know-more-tools-box-partial.md';

Here, we offer a compilation of tools and blockchain explorers that enable you to examine and oversee transactions, smart contracts, and overall blockchain activity related to decentralized applications (dApps) on different Arbitrum chains.

| Tool | Use-cases | Relevant links |
| --------- | ------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| Arbiscan | Track/trace transactions and examine addresses on Arbitrum networks | <ul><li>Arbitrum One: [https://arbiscan.io/](https://arbiscan.io/)</li><li>Arbitrum Nova: [https://nova.arbiscan.io/](https://nova.arbiscan.io/)</li><li>Arbitrum Goerli: [https://goerli.arbiscan.io/](https://goerli.arbiscan.io/)</li></ul> |
| DexGuru | Track/trace transactions and examine addresses on Arbitrum networks | <ul><li>Arbitrum One: [https://arbitrum.dex.guru/](https://arbitrum.dex.guru/)</li><li>Arbitrum Nova: [https://nova.dex.guru/](https://nova.dex.guru/)</li></ul> |
| Dune | Visualize and analyze Arbitrum network data | <ul><li>[Dune](https://dune.com/)</li><li>[Arbitrum community-created Duune dashboard](https://dune.com/browse/dashboards?q=arbitrum)</li></ul> |
| Chainbase | Index, transform, and use on-chain data at scale | [Chainbase](https://chainbase.com/) |
| Tool | Use-cases | Relevant links |
| ---------- | ------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| Arbiscan | Track/trace transactions and examine addresses on Arbitrum networks | <ul><li>Arbitrum One: [https://arbiscan.io/](https://arbiscan.io/)</li><li>Arbitrum Nova: [https://nova.arbiscan.io/](https://nova.arbiscan.io/)</li><li>Arbitrum Goerli: [https://goerli.arbiscan.io/](https://goerli.arbiscan.io/)</li></ul> |
| DexGuru | Track/trace transactions and examine addresses on Arbitrum networks | <ul><li>Arbitrum One: [https://arbitrum.dex.guru/](https://arbitrum.dex.guru/)</li><li>Arbitrum Nova: [https://nova.dex.guru/](https://nova.dex.guru/)</li></ul> |
| Blockscout | Track/trace transactions and examine addresses on Arbitrum networks | <ul><li>Arbitrum Sepolia: [https://sepolia-explorer.arbitrum.io/](https://sepolia-explorer.arbitrum.io/)</li></ul> |
| Dune | Visualize and analyze Arbitrum network data | <ul><li>[Dune](https://dune.com/)</li><li>[Arbitrum community-created Duune dashboard](https://dune.com/browse/dashboards?q=arbitrum)</li></ul> |
| Chainbase | Index, transform, and use on-chain data at scale | [Chainbase](https://chainbase.com/) |
3 changes: 2 additions & 1 deletion arbitrum-docs/for-devs/quickstart-solidity-hardhat.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,8 @@ We're going to build a digital cupcake vending machine using Solidity smart cont
1. The vending machine will distribute a cupcake to anyone who hasn't recently received one.
2. The vending machine's rules can't be changed by anyone.

Here's our vending machine implemented with Javascript:
Here's our vending machine implemented with Javascript.
To use it, enter a name in the form below and press the 'Cupcake please!' button, you should see your cupcake balance go up.

import { VendingMachine } from '@site/src/components/VendingMachine/VendingMachine';

Expand Down
50 changes: 0 additions & 50 deletions arbitrum-docs/migration/state-migration.mdx

This file was deleted.

2 changes: 1 addition & 1 deletion arbitrum-docs/node-running/gentle-introduction-run-node.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,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](./how-tos/running-a-full-node.mdx), [full Classic node](./how-tos/running-a-classic-node.mdx), [local dev node](./how-tos/local-dev-node.mdx), [feed relay](./how-tos/running-a-feed-relay.mdx), and [validator](./how-tos/running-a-validator.mdx)
- Step-by-step instructions for how to [read the sequencer feed](./how-tos/read-sequencer-feed.md), [build the Nitro locally](./how-tos/build-nitro-locally.md), and [run a DAS](../das/daserver-instructions.mdx)
- Step-by-step instructions for how to [read the sequencer feed](./how-tos/read-sequencer-feed.md), [build the Nitro locally](./how-tos/build-nitro-locally.md), and [run a DAS](./how-tos/running-a-daserver.mdx)
- [Command-line options](./command-line-options.md)
- [Troubleshooting page](./troubleshooting-running-nodes.md)
- [Frequently asked questions](./faq.md)
3 changes: 2 additions & 1 deletion arbitrum-docs/node-running/how-tos/build-nitro-locally.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
---
title: 'How to build Nitro locally (Debian, Ubuntu, MacOS)'
sidebar_label: Build Nitro locally (Debian, Ubuntu, MacOS)
description: This how-to provides step-by-step instructions for building Nitro locally using Docker on Debian, Ubuntu, or MacOS.
author: amsanghi
sidebar_label: Build Nitro locally (Debian, Ubuntu, MacOS)
sidebar_position: 7
content-type: how-to
---

Expand Down
4 changes: 4 additions & 0 deletions arbitrum-docs/node-running/how-tos/local-dev-node.mdx
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
---
title: 'How to run a local dev node'
description: Learn how to run an Arbitrum local dev node on your local machine.
author: jose-franco
sme: jose-franco
sidebar_label: Run a local dev node
sidebar_position: 6
content-type: how-to
---

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,92 @@
---
title: 'How to migrate state and history from a classic (pre-Nitro) node to a Nitro node'
sidebar_label: Migrate state from Classic to Nitro
description: This how-to provides step-by-step instructions for migrating the state and history from a classic (pre-Nitro) node to a Nitro node
author: jose-franco
sme: jose-franco
target_audience: 'Node runners interested in creating the full state of the Arbitrum One chain on their own (i.e., without an initial database)'
content-type: how-to
sidebar_position: 10
---

When running a Nitro node for the first time on a chain that produced [classic blocks](/for-devs/concepts/public-chains#classic-deprecated) in the past (like Arbitrum One), you need to initialize its database to, at least, the state of the chain after executing the last classic block. The common, and recommended, way of doing that is to provide a database snapshot using the `--init.url` option (as mentioned in [How to run a full node (Nitro)](/node-running/how-tos/running-a-full-node.mdx)). In this how-to we show you an alternative way for doing that, migrating the state and history of the chain from a fully synced classic node.

:::info Is this How-to for you?

As mentioned, the recommended way of initializing a Nitro node is by using a pre-initialized database snapshot with the `--init.url` option. This guide is for those that are interested in re-creating the full state of the chain from the genesis block using their own classic node.

Keep in mind that this process only applies to Arbitrum One. Other Arbitrum chains didn't produce classic blocks in the past, they started as Nitro chains.

:::

## Prerequisites

To successfully migrate the state and history of the chain from a classic (pre-Nitro) node to a Nitro node, you'll need:

- A fully synced classic node: you can find instructions on how to run a classic node in [this page](/node-running/how-tos/running-a-classic-node.mdx).
- A clean, uninitialized Nitro node: you can find instructions on how to set up a Nitro node in [this page](/node-running/how-tos/running-a-full-node.mdx).

## Step 1: Enable export options in your classic node

Launch your classic node with the option `--node.rpc.nitroexport.enable=true`. All exported data will be written to directory "nitroexport" under the classic instance directory (e.g. `${HOME}/.arbitrum/mainnet/nitroexport`). Make sure the classic node has read the entire rollup state.

:::caution Caution

Enabling the export options is only recommended for nodes with no public/external interfaces.

:::

:::info Exported file contents are not deterministic

Exporting the state of your own classic node should produce the same state as using files supplied by the Arbitrum Foundation (i.e. the same genesis blockhash). However, multiple exports of the same state will not necessarily create identical intermediate files. For example, state export is done in parallel, so the order of entries in the file is not deterministic.

:::

## Step 2: Export information from your classic node

### Block & transaction history

These are block headers, transactions and receipts executed in the classic node. Nitro node uses the history to be able to answer simple requests, like `eth_getTransactionReceipt`, from the classic history. The last block in the chain is the only one that affects the genesis block: timestamp is copied from the last block, and parentHash is taken from the last block's blockHash.

- Call the RPC method `arb_exportHistory` with parameter `"latest"` to initiate history export. It will return immediately.
- Calling `arb_exportHistoryStatus` will return the latest block exported, or an error if the export failed.
- Data will be stored in the directory `nitroexport/nitro/l2chaindata/ancient`.

### Rollup state

The rollup state is exported as a series of JSON files. State read from these JSON files will be added to Nitro's genesis block.

- Call the RPC method `arb_exportState` with parameter `"latest"` to initiate state export. Unless disconnected, this will only return after the state export is done.
- Data will be stored in the directory `nitroexport/state/<block_number>/`.

### Outbox messages (optional)

This data does not impact consensus and is optional. It allows a Nitro node to provide the information required when executing a withdrawal made on the classic rollup.

- Call the RPC method `arb_exportOutbox` with parameter `"0xffffffffffffffff"` to initiate outbox export. It will return immediately.
- Calling `arb_exportOutboxStatus` will return the latest outbox batch exported, or an error if the export failed.
- Data will be stored in the directory `nitroexport/nitro/classic-msg`.

## Step 3: Initialize your Nitro node importing the exported data

- Place the `l2chaindata` and `classic-msg` (if exported) directories in Nitro's instance directory (e.g. `${HOME}/.arbitrum/arb1-nitro/`).
- Launch the Nitro node with the argument `--init.import-file=/path/to/state/index.json`

:::caution Caution

This state import operation requires more resources than a regular run of a Nitro node.

:::

### Other useful Nitro options

| Flag | Description |
| -------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `--init.accounts-per-sync` | Allows the node to make partial database writes to hard-disk during initialization, allowing memory to be freed. This should be used if memory load is very high. A reasonable initial value to try would be 100000. Systems with constrained memory might require a lower value. |
| `--init.then-quit` | Causes the node to quit after initialization is done. |
| `--init.force` | For an already-initialized node, forces the node to recalculate Nitro's genesis block. If the genesis blockhash doesn't match what's in the database, the node will panic. |

## See also

- [How to run a full node (Nitro)](/node-running/how-tos/running-a-full-node.mdx)
- [How to run a full node (Classic, pre-Nitro)](/node-running/how-tos/running-a-classic-node.mdx)
4 changes: 4 additions & 0 deletions arbitrum-docs/node-running/how-tos/read-sequencer-feed.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
---
title: 'How to read the Sequencer feed'
description: Learn how to read the sequencer feed
sidebar_label: Read the sequencer feed
sidebar_position: 9
content-type: how-to
todos:
- Follow convention and style guide
- Communicate "who this is for" and "under which scenarios this is useful".
Expand Down
Loading

0 comments on commit 53508c2

Please sign in to comment.