From ad81e12df98e27365087dc00f38395717003ce0f Mon Sep 17 00:00:00 2001 From: AurelienFT Date: Mon, 16 Dec 2024 13:22:06 +0100 Subject: [PATCH 1/5] Add document for Ignition from sources and Local network form sources --- README.md | 126 +++++++++++++++++++++++++++++++++++++++++++++++++++--- 1 file changed, 120 insertions(+), 6 deletions(-) diff --git a/README.md b/README.md index 52f64d7d27b..230453bf09a 100644 --- a/README.md +++ b/README.md @@ -115,6 +115,8 @@ $ ./target/debug/fuel-core run --poa-instant=false If you want to participate in the Ignition network with your own node you can launch it following these simple commands. +### From pre-compiled binaries + Install the latest fuelup : ```bash curl -fsSL https://install.fuel.network/ | sh @@ -139,19 +141,131 @@ fuel-core run \ --service-name fuel-ignition-node \ --keypair {KEYGEN_SECRET_KEY} \ --relayer {ETHEREUM_RPC_ENDPOINT} \ ---ip=0.0.0.0 --port 4000 --peering-port 30333 \ +--ip=0.0.0.0 \ +--port 4000 \ +--peering-port 30333 \ +--db-path ~/.fuel-ignition \ +--snapshot {PATH_TO_CHAIN_CONFIGURATION_FOLDER}/ignition \ +--utxo-validation \ +--poa-instant false \ +--enable-p2p \ +--bootstrap-nodes /dnsaddr/mainnet.fuel.network \ +--sync-header-batch-size 100 \ +--relayer-v2-listening-contracts 0xAEB0c00D0125A8a788956ade4f4F12Ead9f65DDf \ +--relayer-da-deploy-height 20620434 \ +--relayer-log-page-size 100 \ +--sync-block-stream-buffer-size 30 \ +--min-gas-price 1000 \ +--starting-gas-price 1000 \ +--gas-price-change-percent 10 \ +--gas-price-threshold-percent 50 +``` +All the values used for the L1 relayer are based on Ethereum Mainnet make sure `{ETHEREUM_RPC_ENDPOINT}` is a RPC communicating to Ethereum Mainnet network. + +Instead of directly placing your personal values on the command we advise you to use, for example, environment variables. + +### From source + +Clone the chain configuration folder : +``` +git clone https://github.com/FuelLabs/chain-configuration +``` + +Clone this repository : +``` +git clone https://github.com/FuelLabs/fuel-core.git +``` + +Go to the latest release tag for ignition on the `fuel-core` repository : +``` +git checkout v0.40.2 +``` + +Generate a keyparr for your node : +``` +cargo run --bin fuel-core-keygen -- new --key-type peering +``` +and copy the secret key displayed. + +Run your node (change all variable with {} to your own personal variables): +```bash +cargo run --release --bin fuel-core -- run \ +--enable-relayer \ +--service-name fuel-ignition-node \ +--keypair {KEYGEN_SECRET_KEY} \ +--relayer {ETHEREUM_RPC_ENDPOINT} \ +--ip=0.0.0.0 \ +--port 4000 \ +--peering-port 30333 \ --db-path ~/.fuel-ignition \ --snapshot {PATH_TO_CHAIN_CONFIGURATION_FOLDER}/ignition \ ---utxo-validation --poa-instant false --enable-p2p \ +--utxo-validation \ +--poa-instant false \ +--enable-p2p \ --bootstrap-nodes /dnsaddr/mainnet.fuel.network \ --sync-header-batch-size 100 \ ---relayer-v2-listening-contracts=0xAEB0c00D0125A8a788956ade4f4F12Ead9f65DDf \ ---relayer-da-deploy-height=20620434 \ ---relayer-log-page-size=100 \ ---sync-block-stream-buffer-size 30 +--relayer-v2-listening-contracts 0xAEB0c00D0125A8a788956ade4f4F12Ead9f65DDf \ +--relayer-da-deploy-height 20620434 \ +--relayer-log-page-size 100 \ +--sync-block-stream-buffer-size 30 \ +--min-gas-price 1000 \ +--starting-gas-price 1000 \ +--gas-price-change-percent 10 \ +--gas-price-threshold-percent 50 +``` +All the values used for the L1 relayer are based on Ethereum Mainnet make sure `{ETHEREUM_RPC_ENDPOINT}` is a RPC communicating to Ethereum Mainnet network. + +Instead of directly placing your personal values on the command we advise you to use, for example, environment variables. + +## Running a Local network from source + +Clone this repository : +``` +git clone https://github.com/FuelLabs/fuel-core.git +``` + +Generate a keypair for the p2p of your node : +``` +cargo run --bin fuel-core-keygen -- new --key-type peering +``` +and copy the secret key displayed. + +Generate a keypair for the block production of your node : +``` +cargo run --bin fuel-core-keygen -- new --key-type block-production +``` +and copy the secret key displayed. + +Run your node (change all variable with {} to your own personal variables): +```bash +cargo run --release --bin fuel-core -- run \ +--enable-relayer \ +--consensus-key {KEYGEN_BLOCK_PRODUCTION_SECRET_KEY} +--service-name fuel-local-node \ +--relayer {ETHEREUM_RPC_ENDPOINT} \ +--enable-p2p \ +--ip=0.0.0.0 \ +--port 4000 \ +--peering-port 30333 \ +--keypair {KEYGEN_P2P_SECRET_KEY} \ +--db-path ~/.fuel-local \ +--utxo-validation \ +--poa-interval-period 1s \ +--sync-header-batch-size 100 \ +--relayer-v2-listening-contracts 0xAEB0c00D0125A8a788956ade4f4F12Ead9f65DDf \ +--relayer-da-deploy-height 20620434 \ +--relayer-log-page-size 100 \ +--sync-block-stream-buffer-size 30 \ +--min-gas-price 1000 \ +--starting-gas-price 1000 \ +--gas-price-change-percent 10 \ +--gas-price-threshold-percent 50 ``` +All the values used for the L1 relayer are based on Ethereum Sepolia make sure `{ETHEREUM_RPC_ENDPOINT}` is a RPC communicating to Ethereum Sepolia network. + Instead of directly placing your personal values on the command we advise you to use, for example, environment variables. + ### Troubleshooting #### Publishing From ab3037b7bec64a8a2b2d9bb934585c02e93e71f0 Mon Sep 17 00:00:00 2001 From: AurelienFT Date: Mon, 16 Dec 2024 13:23:52 +0100 Subject: [PATCH 2/5] Increase download logs size --- README.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index 230453bf09a..abd1f99f51d 100644 --- a/README.md +++ b/README.md @@ -153,7 +153,7 @@ fuel-core run \ --sync-header-batch-size 100 \ --relayer-v2-listening-contracts 0xAEB0c00D0125A8a788956ade4f4F12Ead9f65DDf \ --relayer-da-deploy-height 20620434 \ ---relayer-log-page-size 100 \ +--relayer-log-page-size 2000 \ --sync-block-stream-buffer-size 30 \ --min-gas-price 1000 \ --starting-gas-price 1000 \ @@ -206,7 +206,7 @@ cargo run --release --bin fuel-core -- run \ --sync-header-batch-size 100 \ --relayer-v2-listening-contracts 0xAEB0c00D0125A8a788956ade4f4F12Ead9f65DDf \ --relayer-da-deploy-height 20620434 \ ---relayer-log-page-size 100 \ +--relayer-log-page-size 2000 \ --sync-block-stream-buffer-size 30 \ --min-gas-price 1000 \ --starting-gas-price 1000 \ @@ -254,7 +254,7 @@ cargo run --release --bin fuel-core -- run \ --sync-header-batch-size 100 \ --relayer-v2-listening-contracts 0xAEB0c00D0125A8a788956ade4f4F12Ead9f65DDf \ --relayer-da-deploy-height 20620434 \ ---relayer-log-page-size 100 \ +--relayer-log-page-size 2000 \ --sync-block-stream-buffer-size 30 \ --min-gas-price 1000 \ --starting-gas-price 1000 \ From 227d33bb0cfe01419617fea5cbc8d4d5a428fe6c Mon Sep 17 00:00:00 2001 From: AurelienFT <32803821+AurelienFT@users.noreply.github.com> Date: Mon, 16 Dec 2024 13:52:12 +0100 Subject: [PATCH 3/5] Apply suggestions from code review Co-authored-by: Andrea Cerone <22031682+acerone85@users.noreply.github.com> --- README.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index abd1f99f51d..947f163bc39 100644 --- a/README.md +++ b/README.md @@ -171,7 +171,7 @@ Clone the chain configuration folder : git clone https://github.com/FuelLabs/chain-configuration ``` -Clone this repository : +Clone the `fuel-core` repository : ``` git clone https://github.com/FuelLabs/fuel-core.git ``` @@ -181,7 +181,7 @@ Go to the latest release tag for ignition on the `fuel-core` repository : git checkout v0.40.2 ``` -Generate a keyparr for your node : +Generate a keypair for your node : ``` cargo run --bin fuel-core-keygen -- new --key-type peering ``` @@ -219,7 +219,7 @@ Instead of directly placing your personal values on the command we advise you to ## Running a Local network from source -Clone this repository : +Clone the `fuel-core` repository : ``` git clone https://github.com/FuelLabs/fuel-core.git ``` From 10dd94be35e55146e00e0a8d706190dddccc0479 Mon Sep 17 00:00:00 2001 From: AurelienFT Date: Tue, 17 Dec 2024 12:19:02 +0100 Subject: [PATCH 4/5] Reorder readme and update command --- README.md | 132 +++++++++++++++++++++++++++--------------------------- 1 file changed, 67 insertions(+), 65 deletions(-) diff --git a/README.md b/README.md index abd1f99f51d..95a5f55ed2f 100644 --- a/README.md +++ b/README.md @@ -47,69 +47,6 @@ You'll need `wasm32-unknown-unknown` target installed. rustup target add wasm32-unknown-unknown ``` -### Compiling - -We recommend using `xtask` to build fuel-core: - -```sh -cargo xtask build -``` - -This will run `cargo build` as well as any other custom build processes we have such as re-generating a GraphQL schema for the client. - -### Testing - -The [ci_checks.sh](ci_checks.sh) script file can be used to run all CI checks, -including the running of tests. - -```shell -source ci_checks.sh -``` - -The script requires pre-installed tools. For more information run: - -```shell -cat ci_checks.sh -``` - -## Running - -The service can be launched by executing `fuel-core run`. The list of options for running can be accessed via the `help` option: - -```console -$ ./target/debug/fuel-core run --help - -USAGE: - fuel-core run [OPTIONS] - -OPTIONS: - --snapshot - Snapshot from which to do (re)genesis. Defaults to local testnet configuration - - [env: SNAPSHOT=] - ... -``` - -For many development purposes it is useful to have a state that won't persist and the `db-type` option can be set to `in-memory` as in the following example. - -### Example - -```console -$ ./target/debug/fuel-core run --db-type in-memory -2023-06-13T12:45:22.860536Z INFO fuel_core::cli::run: 230: Block production mode: Instant -2023-06-13T12:38:47.059783Z INFO fuel_core::cli::run: 310: Fuel Core version v0.18.1 -2023-06-13T12:38:47.078969Z INFO new{name=fuel-core}:_commit_result{block_id=b1807ca9f2eec7e459b866ecf69b68679fc6b205a9a85c16bd4943d1bfc6fb2a height=0 tx_status=[]}: fuel_core_importer::importer: 231: Committed block -2023-06-13T12:38:47.097777Z INFO new{name=fuel-core}: fuel_core::graphql_api::service: 208: Binding GraphQL provider to 127.0.0.1:4000 -``` - -To disable block production on your local node, set `--poa-instant=false` - -### Example - -```console -$ ./target/debug/fuel-core run --poa-instant=false -2023-06-13T12:44:12.857763Z INFO fuel_core::cli::run: 232: Block production disabled -``` ## Running a Ignition node @@ -189,7 +126,7 @@ and copy the secret key displayed. Run your node (change all variable with {} to your own personal variables): ```bash -cargo run --release --bin fuel-core -- run \ +cargo run --release --bin fuel-core --no-default-features --features production -- run \ --enable-relayer \ --service-name fuel-ignition-node \ --keypair {KEYGEN_SECRET_KEY} \ @@ -238,7 +175,7 @@ and copy the secret key displayed. Run your node (change all variable with {} to your own personal variables): ```bash -cargo run --release --bin fuel-core -- run \ +cargo run --release --bin fuel-core --no-default-features --features production -- run \ --enable-relayer \ --consensus-key {KEYGEN_BLOCK_PRODUCTION_SECRET_KEY} --service-name fuel-local-node \ @@ -265,6 +202,71 @@ All the values used for the L1 relayer are based on Ethereum Sepolia make sure ` Instead of directly placing your personal values on the command we advise you to use, for example, environment variables. +## Setup to make conntributions + +### Compiling + +We recommend using `xtask` to build fuel-core: + +```sh +cargo xtask build +``` + +This will run `cargo build` as well as any other custom build processes we have such as re-generating a GraphQL schema for the client. + +### Testing + +The [ci_checks.sh](ci_checks.sh) script file can be used to run all CI checks, +including the running of tests. + +```shell +source ci_checks.sh +``` + +The script requires pre-installed tools. For more information run: + +```shell +cat ci_checks.sh +``` + +## Running + +The service can be launched by executing `fuel-core run`. The list of options for running can be accessed via the `help` option: + +```console +$ ./target/debug/fuel-core run --help + +USAGE: + fuel-core run [OPTIONS] + +OPTIONS: + --snapshot + Snapshot from which to do (re)genesis. Defaults to local testnet configuration + + [env: SNAPSHOT=] + ... +``` + +For many development purposes it is useful to have a state that won't persist and the `db-type` option can be set to `in-memory` as in the following example. + +### Example + +```console +$ ./target/debug/fuel-core run --db-type in-memory +2023-06-13T12:45:22.860536Z INFO fuel_core::cli::run: 230: Block production mode: Instant +2023-06-13T12:38:47.059783Z INFO fuel_core::cli::run: 310: Fuel Core version v0.18.1 +2023-06-13T12:38:47.078969Z INFO new{name=fuel-core}:_commit_result{block_id=b1807ca9f2eec7e459b866ecf69b68679fc6b205a9a85c16bd4943d1bfc6fb2a height=0 tx_status=[]}: fuel_core_importer::importer: 231: Committed block +2023-06-13T12:38:47.097777Z INFO new{name=fuel-core}: fuel_core::graphql_api::service: 208: Binding GraphQL provider to 127.0.0.1:4000 +``` + +To disable block production on your local node, set `--poa-instant=false` + +### Example + +```console +$ ./target/debug/fuel-core run --poa-instant=false +2023-06-13T12:44:12.857763Z INFO fuel_core::cli::run: 232: Block production disabled +``` ### Troubleshooting From 5722689b75c85c3a62a7a4a0cae1dc6ba21ef7c9 Mon Sep 17 00:00:00 2001 From: AurelienFT Date: Tue, 17 Dec 2024 12:21:43 +0100 Subject: [PATCH 5/5] Add direct link to skip rust setup if needed --- README.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/README.md b/README.md index f4be436097f..1cf79c57040 100644 --- a/README.md +++ b/README.md @@ -15,6 +15,8 @@ Before pushing any changes or creating pull request please run `source ci_checks ## Building +If you plan to use already pre-compiled binairies you can directly go to [Running a Ignition node](#running-a-ignition-node). + ### System Requirements There are several system requirements including clang.