From 7a24b561ba40f765e8dab3fff8916c35b541dbc9 Mon Sep 17 00:00:00 2001 From: Yarik Bratashchuk Date: Thu, 27 Jun 2024 18:12:09 +0000 Subject: [PATCH 1/2] Update init_full_node script and full_and_sequencer_node guide --- guides/full-and-sequencer-node.md | 75 +++++++++---------------------- public/gm/init-full-node.sh | 24 +++++----- 2 files changed, 34 insertions(+), 65 deletions(-) diff --git a/guides/full-and-sequencer-node.md b/guides/full-and-sequencer-node.md index 5831a3d58..40a79d8a8 100644 --- a/guides/full-and-sequencer-node.md +++ b/guides/full-and-sequencer-node.md @@ -1,48 +1,35 @@ # Full and sequencer node rollup setup -This guide will cover how to set up the GM world rollup example as -a multi-node network using a full and sequencer node. - -## About - -This guide is using a feature released in v0.10.2 that -uses [go-header](https://github.com/celestiaorg/go-header), -which uses libp2p that syncs blocks over a peer-to-peer (p2p) -network. + + -This is the same way that celestia-node syncs blocks over p2p. +This guide will cover how to set up the GM World rollup example as +a multi-node network using a full and sequencer node. -## Prerequisites +## Running a local DA network {#running-local-da} -First, you'll need to complete the [GM world](../tutorials/gm-world) tutorial. +In this demo, we'll be using the local-da setup used in [GM World](../tutorials/gm-world) -In this demo, we'll be using the local-celestia-devnet setup used -in [part 1](./gm-world). +To set up a local DA network node: -## Getting started +```bash-vue +curl -sSL https://rollkit.dev/install-local-da.sh | bash -s {{constants.localDALatestTag}} +``` -For running a full node, you will need to update -`DA_HEIGHT` and `P2P_ID` manually. You can retrieve -namespace and height from your terminal output -from when you ran the `init-local.sh` script. +This script builds and runs the node, now listening on port `7980`. -They will be printed before your chain starts: +## Running a sequencer node -```txt -______ _ _ _ _ _ -| ___ \ | || || | (_)| | -| |_/ / ___ | || || | __ _ | |_ -| / / _ \ | || || |/ /| || __| -| |\ \ | (_) || || || < | || |_ -\_| \_| \___/ |_||_||_|\_\|_| \__| +By following the [GM World](../tutorials/gm-world) tutorial, you will have a sequencer node running. +We wil now set up a full node to run alongside the sequencer node. - Your DA_BLOCK_HEIGHT is 5 // [!code focus] -``` -### Clone the script +## Getting started -Now, clone the script for the full node: +Clone the script for the full node: ```bash # From inside the `gm` directory @@ -50,21 +37,9 @@ cd $HOME/gm wget https://rollkit.dev/gm/init-full-node.sh ``` -### Set DA height - -Next, you can open the script and set your namespace and DA height from above: - -```sh -DA_BLOCK_HEIGHT=your-block-height // [!code --] -DA_BLOCK_HEIGHT=5 // [!code ++] -P2P_ID="your-p2p-id" -``` - ### Update the p2p address -Next, we'll update the p2p address. - -Once your sequencer starts producing blocks, it will show the p2p address, +Once your sequencer node starts producing blocks, it will show the p2p address, beginning with 12D: ```bash @@ -80,24 +55,14 @@ beginning with 12D: 3:55PM INF starting Celestia Data Availability Layer Client baseURL=http://localhost:26658 module=da_client ``` -In your `init-full-node.sh` script, you will now set the `P2P_ADDRESS` variable +In your `init-full-node.sh` script, you will now set the `P2P_ID` variable for your script to use: ```bash -DA_BLOCK_HEIGHT=5 P2P_ID="your-p2p-id" // [!code --] P2P_ID="12D3KooWCmfJLkQjZUArWpNUDJSezeFiLYzCULXe1dEKY6ZpXZpk" // [!code ++] ``` -Also, in your `init-full-node.sh` script, the `AUTH_TOKEN` is fetched from the celestia-node running in the docker, which is also used by the sequencer node. If you are running a separate celestia-node for sequencer and full node, please update the `AUTH_TOKEN` accordingly. Note that, the `AUTH_TOKEN` is needed to perform DA queries via celestia-node. - -```bash -# uses the same celestia-node as sequencer node -# if you are running a separate celestia-node for full node -# use the auth token from that node -AUTH_TOKEN=$(docker exec $(docker ps -q) celestia bridge auth admin --node.store /home/celestia/bridge) -``` - ## Start the full node Now run your full node with the script: diff --git a/public/gm/init-full-node.sh b/public/gm/init-full-node.sh index ec8932967..df43d2159 100644 --- a/public/gm/init-full-node.sh +++ b/public/gm/init-full-node.sh @@ -1,19 +1,23 @@ CHAIN_ID=gm BASE_DIR="$HOME/.gm_fn" +P2P_ID="your-p2p-id" + +# notice that this will remove the existing rollkit.toml that was used to run sequencing node +# if you need to run sequencing node again, you should update config_dir to the $HOME/gm/.gm +rm -rf $BASE_DIR rollkit.toml -rm -rf $BASE_DIR +cat << EOF > rollkit.toml +entrypoint = "$HOME/gm/cmd/gmd/main.go" -gmd --home "$BASE_DIR" init FullNode --chain-id $CHAIN_ID +[chain] + config_dir = "$BASE_DIR" +EOF -cp -R "$HOME/.gm/config/genesis.json" "$BASE_DIR/config/genesis.json" +rollkit rebuild -DA_BLOCK_HEIGHT=your-block-height -P2P_ID="your-p2p-id" +rollkit init FullNode --chain-id $CHAIN_ID -# uses the same celestia-node as sequencer node -# if you are running a separate celestia-node for full node -# use the auth token from that node -AUTH_TOKEN=$(docker exec $(docker ps -q) celestia bridge auth admin --node.store /home/celestia/bridge) +cp -R "$HOME/gm/.gm/config/genesis.json" "$BASE_DIR/config/genesis.json" # rollkit logo cat <<'EOF' @@ -49,4 +53,4 @@ cat <<'EOF' EOF -gmd start --rollkit.da_auth_token=$AUTH_TOKEN --rollkit.da_namespace 00000000000000000000000000000000000000000008e5f679bf7116cb --rollkit.da_start_height $DA_BLOCK_HEIGHT --rpc.laddr tcp://127.0.0.1:46657 --grpc.address 127.0.0.1:9390 --p2p.seeds $P2P_ID@127.0.0.1:36656 --p2p.laddr "0.0.0.0:46656" --log_level debug --minimum-gas-prices="0.025stake" --home $BASE_DIR +rollkit start --rollkit.da_address http://127.0.0.1:7980 --rpc.laddr tcp://127.0.0.1:46657 --grpc.address 127.0.0.1:9390 --p2p.seeds $P2P_ID@127.0.0.1:36656 --p2p.laddr "0.0.0.0:46656" --log_level debug --minimum-gas-prices="0.025stake" From 7cda96a285ab3332382bdcf1fb824557bbea1b1d Mon Sep 17 00:00:00 2001 From: Yarik Bratashchuk Date: Thu, 5 Sep 2024 14:42:35 +0000 Subject: [PATCH 2/2] Minor djustments --- .vitepress/constants/constants.js | 4 +-- guides/full-and-sequencer-node.md | 44 +++++++++++++++++++++++-------- 2 files changed, 35 insertions(+), 13 deletions(-) diff --git a/.vitepress/constants/constants.js b/.vitepress/constants/constants.js index ff00316ed..d1043995c 100644 --- a/.vitepress/constants/constants.js +++ b/.vitepress/constants/constants.js @@ -4,12 +4,12 @@ const constants = Object.freeze({ nodeVersion: "21.7.2", yarnVersion: "1.22.19", - rollkitLatestTag: "v0.13.6", + rollkitLatestTag: "v0.13.8", rollkitLatestSha: "6a33192", rollkitCosmosSDKVersion: "v0.50.6-rollkit-v0.13.3-no-fraud-proofs", rollkitIgniteAppVersion: "v0.2.1", - localDALatestTag: "v0.2.0", + localDALatestTag: "v0.3.1", igniteVersionTag: "v28.4.0", }); diff --git a/guides/full-and-sequencer-node.md b/guides/full-and-sequencer-node.md index 40a79d8a8..21ac0d0f6 100644 --- a/guides/full-and-sequencer-node.md +++ b/guides/full-and-sequencer-node.md @@ -43,16 +43,22 @@ Once your sequencer node starts producing blocks, it will show the p2p address, beginning with 12D: ```bash -3:55PM INF port binded module=x/ibc/port port=icahost -3:55PM INF claimed capability capability=2 module=icahost name=ports/icahost -3:55PM INF service start impl=RPC module=server msg={} -3:55PM INF service start impl=Node module=server msg={} -3:55PM INF starting P2P client module=server -3:55PM INF serving HTTP listen address={"IP":"127.0.0.1","Port":36657,"Zone":""} module=server -3:55PM INF listening on address=/ip4/10.0.0.171/tcp/36656/p2p/12D3KooWCmfJLkQjZUArWpNUDJSezeFiLYzCULXe1dEKY6ZpXZpk module=p2p // [!code focus] -3:55PM INF listening on address=/ip4/127.0.0.1/tcp/36656/p2p/12D3KooWCmfJLkQjZUArWpNUDJSezeFiLYzCULXe1dEKY6ZpXZpk module=p2p // [!code focus] -3:55PM INF no seed nodes - only listening for connections module=p2p -3:55PM INF starting Celestia Data Availability Layer Client baseURL=http://localhost:26658 module=da_client +... +1:55PM INF service start impl=RPC module=server msg="Starting RPC service" +1:55PM INF service start impl=Node module=server msg="Starting Node service" +1:55PM INF serving HTTP listen address=[::]:26657 module=server +1:55PM INF starting P2P client module=server +1:55PM INF listening on address=/ip4/127.0.0.1/tcp/36656/p2p/12D3KooWJbD9TQoMSSSUyfhHMmgVY3LqCjxYFz8wQ92Qa6DAqtmh module=p2p // [!code focus] +1:55PM INF listening on address=/ip4/163.172.162.109/tcp/36656/p2p/12D3KooWJbD9TQoMSSSUyfhHMmgVY3LqCjxYFz8wQ92Qa6DAqtmh module=p2p // [!code focus] +1:55PM INF no seed nodes - only listening for connections module=p2p +1:55PM INF working in aggregator mode block time=1000 module=server +1:55PM INF starting API server... address=tcp://0.0.0.0:1317 module=api-server +1:55PM INF serve module=api-server msg="Starting RPC HTTP server on [::]:1317" +1:55PM INF Creating and publishing block height=3458 module=BlockManager +1:55PM INF finalized block block_app_hash=A1A55270140B772643DCB444E0503B9865BB3702DF2D0A8E143CAF4717D2DB20 height=3458 module=BlockManager num_txs_res=0 num_val_updates=0 +1:55PM INF executed block app_hash=A1A55270140B772643DCB444E0503B9865BB3702DF2D0A8E143CAF4717D2DB20 height=3458 module=BlockManager +1:55PM INF starting gRPC server... address=localhost:9090 module=grpc-server +... ``` In your `init-full-node.sh` script, you will now set the `P2P_ID` variable @@ -60,7 +66,7 @@ for your script to use: ```bash P2P_ID="your-p2p-id" // [!code --] -P2P_ID="12D3KooWCmfJLkQjZUArWpNUDJSezeFiLYzCULXe1dEKY6ZpXZpk" // [!code ++] +P2P_ID="12D3KooWJbD9TQoMSSSUyfhHMmgVY3LqCjxYFz8wQ92Qa6DAqtmh" // [!code ++] ``` ## Start the full node @@ -72,5 +78,21 @@ Now run your full node with the script: bash init-full-node.sh ``` +Your full node will now start and connect to the sequencer node. You should see the following output: +```bash +... +2:33PM DBG indexed transactions height=1 module=txindex num_txs=0 +2:33PM INF block marked as DA included blockHash=7897885B959F52BF0D772E35F8DA638CF8BBC361C819C3FD3E61DCEF5034D1CC blockHeight=5532 module=BlockManager +2:33PM DBG block body retrieved daHeight=1 hash=7897885B959F52BF0D772E35F8DA638CF8BBC361C819C3FD3E61DCEF5034D1CC height=5532 module=BlockManager +2:33PM DBG block not found in cache height=2 module=BlockManager +2:33PM INF block marked as DA included blockHash=E2E01078F151633768876E822D65EF52DD39E5073BB27AC5F903E52D48339F5C blockHeight=5533 module=BlockManager +2:33PM INF block marked as DA included blockHash=B88DA651CD1AC7116CD95B3CFB6369BD8964BF77B3E909944F816B2E35DF8EF4 blockHeight=5534 module=BlockManager +2:33PM DBG block body retrieved daHeight=1 hash=E2E01078F151633768876E822D65EF52DD39E5073BB27AC5F903E52D48339F5C height=5533 module=BlockManager +2:33PM INF block marked as DA included blockHash=376E44AB9F7023E76480CCD39F2D908FFE05911BF5C0387F5FF788C32D4C312E blockHeight=5535 module=BlockManager +2:33PM DBG block not found in cache height=2 module=BlockManager +2:33PM INF block marked as DA included blockHash=ABF1789EFB08F3DF7422579C9E52A0E6A54B4CDC8EB5FA32CA2E751ACCAEE23B blockHeight=5536 module=BlockManager +... +``` + Congratulations! You will now have a full node running alongside your Rollkit sequencer.