Fuel node beta-4

Fuel node beta-4

with own toolchain

ยท

4 min read

1. upgrade and install git

sudo apt update && sudo apt upgrade -y
sudo apt-get install git-all

1.1. install NodeJS

move to tonymoon.hashnode.dev/deploy-fuel-smartcont.. section 2.1. install NodeJS

2. install curl

sudo apt-get install curl

proceed with installation (default) press 1

source "$HOME/.cargo/env"

3. delete the old files and go to $home directory

cd $home && rm -rf .fuel && rm -rf .forc && rm -rf .fuelup && rm -rf fuel-project

4. install Rust

curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh

5. install the Fuel toolchain

curl --proto '=https' --tlsv1.2 -sSf https://install.fuel.network/fuelup-init.sh | sh
export PATH="${HOME}/.fuelup/bin:${PATH}"

6. create custom toolchains and set up it as a default

fuelup self update
fuelup toolchain new test_beta4_toolchain
fuelup default test_beta4_toolchain

7. add components to your custom toolchain

fuelup component add forc@0.46.1
fuelup component add forc-explore@0.28.1
fuelup component add forc-index@0.24.3
fuelup component add forc-wallet@0.3.0
fuelup component add fuel-core@0.20.8
fuelup component add fuel-indexer@0.24.3
fuelup show

7. getting a Sepolia (Ethereum Testnet) API Key

Infura

https://sepolia.infura.io/v3/{YOUR_API_KEY}

Alchemy

https://eth-sepolia.g.alchemy.com/v2/{YOUR_API_KEY}

8. generating a P2P Key

fuel-core-keygen new --key-type peering
{
  "peer_id":"16Uiu2HAm8kCaJaaKTujrSwdBxyCELTY979KYaP9YBkWVLTGTo7Bf",
  "secret":"361b3275a3dd4150ea4c786b8dff7822205331e56ac2e73c32b17cb295978c8c",
  "type":"p2p"
}

9. configure a chainConfig.json

{
  "chain_name": "Testnet Beta 4",
  "block_gas_limit": 30000000,
  "initial_state": {
    "coins": [
      {
        "owner": "0xa1184d77d0d08a064e03b2bd9f50863e88faddea4693a05ca1ee9b1732ea99b7",
        "amount": "0x1000000000000000",
        "asset_id": "0x0000000000000000000000000000000000000000000000000000000000000000"
      },
      {
        "owner": "0xb5566df884bee4e458151c2fe4082c8af38095cc442c61e0dc83a371d70d88fd",
        "amount": "0x1000000000000000",
        "asset_id": "0x0000000000000000000000000000000000000000000000000000000000000000"
      },
      {
        "owner": "0x9da7247e1d63d30d69f136f0f8654ee8340362c785b50f0a60513c7edbf5bb7c",
        "amount": "0x1000000000000000",
        "asset_id": "0x0000000000000000000000000000000000000000000000000000000000000000"
      },
      {
        "owner": "0x4b2ca966aad1a9d66994731db5138933cf61679107c3cde2a10d9594e47c084e",
        "amount": "0x1000000000000000",
        "asset_id": "0x0000000000000000000000000000000000000000000000000000000000000000"
      },
      {
        "owner": "0x26183fbe7375045250865947695dfc12500dcc43efb9102b4e8c4d3c20009dcb",
        "amount": "0x1000000000000000",
        "asset_id": "0x0000000000000000000000000000000000000000000000000000000000000000"
      },
      {
        "owner": "0x81f3a10b61828580d06cc4c7b0ed8f59b9fb618be856c55d33decd95489a1e23",
        "amount": "0x1000000000000000",
        "asset_id": "0x0000000000000000000000000000000000000000000000000000000000000000"
      },
      {
        "owner": "0x587aa0482482efea0234752d1ad9a9c438d1f34d2859b8bef2d56a432cb68e33",
        "amount": "0x1000000000000000",
        "asset_id": "0x0000000000000000000000000000000000000000000000000000000000000000"
      }
    ]
  },
  "transaction_parameters": {
    "contract_max_size": 16777216,
    "max_inputs": 255,
    "max_outputs": 255,
    "max_witnesses": 255,
    "max_gas_per_tx": 10000000,
    "max_script_length": 1048576,
    "max_script_data_length": 1048576,
    "max_storage_slots": 255,
    "max_predicate_length": 1048576,
    "max_predicate_data_length": 1048576,
    "max_gas_per_predicate": 10000000,
    "gas_price_factor": 92,
    "gas_per_byte": 4,
    "max_message_data_length": 1048576,
    "chain_id": 0
  },
  "gas_costs": {
    "add": 1,
    "addi": 1,
    "aloc": 1,
    "and": 1,
    "andi": 1,
    "bal": 13,
    "bhei": 1,
    "bhsh": 1,
    "burn": 132,
    "cb": 1,
    "cfei": 1,
    "cfsi": 1,
    "croo": 16,
    "div": 1,
    "divi": 1,
    "eck1": 951,
    "ecr1": 3000,
    "ed19": 3000,
    "eq": 1,
    "exp": 1,
    "expi": 1,
    "flag": 1,
    "gm": 1,
    "gt": 1,
    "gtf": 1,
    "ji": 1,
    "jmp": 1,
    "jne": 1,
    "jnei": 1,
    "jnzi": 1,
    "jmpf": 1,
    "jmpb": 1,
    "jnzf": 1,
    "jnzb": 1,
    "jnef": 1,
    "jneb": 1,
    "k256": 11,
    "lb": 1,
    "log": 9,
    "lt": 1,
    "lw": 1,
    "mcpi": 33,
    "mint": 135,
    "mlog": 1,
    "mod": 1,
    "modi": 1,
    "move": 1,
    "movi": 1,
    "mroo": 2,
    "mul": 1,
    "muli": 1,
    "mldv": 1,
    "noop": 1,
    "not": 1,
    "or": 1,
    "ori": 1,
    "ret_contract": 13,
    "rvrt_contract": 13,
    "s256": 2,
    "sb": 1,
    "scwq": 13,
    "sll": 1,
    "slli": 1,
    "srl": 1,
    "srli": 1,
    "srw": 12,
    "sub": 1,
    "subi": 1,
    "sw": 1,
    "sww": 43,
    "swwq": 44,
    "time": 1,
    "tr": 105,
    "tro": 60,
    "wdcm": 1,
    "wqcm": 1,
    "wdop": 1,
    "wqop": 1,
    "wdml": 1,
    "wqml": 1,
    "wddv": 1,
    "wqdv": 2,
    "wdmd": 3,
    "wqmd": 4,
    "wdam": 2,
    "wqam": 3,
    "wdmm": 3,
    "wqmm": 3,
    "xor": 1,
    "xori": 1,
    "call": {
      "base": 144,
      "dep_per_unit": 214
    },
    "ccp": {
      "base": 15,
      "dep_per_unit": 103
    },
    "csiz": {
      "base": 17,
      "dep_per_unit": 790
    },
    "ldc": {
      "base": 15,
      "dep_per_unit": 272
    },
    "logd": {
      "base": 26,
      "dep_per_unit": 64
    },
    "mcl": {
      "base": 1,
      "dep_per_unit": 3333
    },
    "mcli": {
      "base": 1,
      "dep_per_unit": 3333
    },
    "mcp": {
      "base": 1,
      "dep_per_unit": 2000
    },
    "meq": {
      "base": 1,
      "dep_per_unit": 2500
    },
    "retd_contract": {
      "base": 29,
      "dep_per_unit": 62
    },
    "smo": {
      "base": 209,
      "dep_per_unit": 55
    },
    "srwq": {
      "base": 47,
      "dep_per_unit": 5
    }
  },
  "consensus": {
    "PoA": {
      "signing_key": "f65d6448a273b531ee942c133bb91a6f904c7d7f3104cdaf6b9f7f50d3518871"
    }
  }
}

10. open port 22 for ssh connection and 4000 for graphql with firewall

sudo ufw allow ssh
sudo ufw allow 4000/tcp

enable firewall

sudo ufw enable

check status firewall by opened ports

sudo ufw status verbose

11. Run your node

fuel-core run \
--service-name {ANY_SERVICE_NAME} \
--keypair {P2P_SECRET} \
--relayer {RPC_ENDPOINT} \
--ip 0.0.0.0 --port 4000 --peering_port 30333 \
--db-path  ~/.fuel_beta4 \
--chain ./chainConfig.json \
--utxo-validation --poa-instant false --network beta-4 --enable-p2p \
--min-gas-price 1 --max_block_size 18874368  --max_transmit_size 18874368 \
--reserved_nodes /dns4/p2p-beta-4.fuel.network/tcp/30333/p2p/16Uiu2HAm3xjsqASZ68KpaJPkPCMUiMgquhjyDHtxcVxVdFkMgRFf,/dns4/p2p-beta-4.fuel.network/tcp/30334/p2p/16Uiu2HAmJyoJ2HrtPRdBALMT8fs5Q25xVj57gZj5s6G6dzbHypoS \
--sync_max_get_header 100 --sync_max_get_txns 100 \
--relayer-v2-listening-contracts 0x03f2901Db5723639978deBed3aBA66d4EA03aF73 \
--relayer-da-finalization 4 \
--relayer-da-deploy-height 4111672 \
--relayer-log-page-size 2000

for check fuel-core run commands

fuel-core run --help

12. check your node at 4000 port

http://your_ip:4000/graphql

13. check query Beta4

query Beta4 {
  blocks(last: 1) {
    nodes {
      header {
        time
        height
      }
      transactions {
        id
        script
        isMint
        receipts {
          receiptType
          data
        }
      }
    }
  }
}

Did you find this article valuable?

Support tonym00n by becoming a sponsor. Any amount is appreciated!

ย