https://github.com/fuellabs/fuel-utils
The repository contains utils useful to interact with the Fuel network.
https://github.com/fuellabs/fuel-utils
Last synced: 8 months ago
JSON representation
The repository contains utils useful to interact with the Fuel network.
- Host: GitHub
- URL: https://github.com/fuellabs/fuel-utils
- Owner: FuelLabs
- License: apache-2.0
- Created: 2024-05-16T13:04:02.000Z (about 2 years ago)
- Default Branch: master
- Last Pushed: 2025-09-24T11:06:06.000Z (9 months ago)
- Last Synced: 2025-09-24T12:33:32.179Z (9 months ago)
- Language: Rust
- Size: 235 KB
- Stars: 3
- Watchers: 5
- Forks: 3
- Open Issues: 3
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Util to interact with the network
```shell
Usage: fuel-core-network-upgrader
Commands:
upgrade Upgrades the state transition function of the network
upload Uploads the state transition bytecode
transfer Transfers assets to recipient
parameters Downloads consensus parameters from the node
help Print this message or the help of the given subcommand(s)
Options:
-h, --help Print help
-V, --version Print version
```
### Transfer
```shell
Usage: fuel-core-network-upgrader transfer [OPTIONS] --amount --recipient --url
Options:
-a, --amount The amount to transfer [env: AMOUNT=]
-r, --recipient The recipient of the transfer [env: RECIPIENT=]
-u, --url The URL to upload the bytecode to [env: URL=https://devnet.fuel.network/v1/graphql]
-i, --asset-id The asset to transfer [env: ASSET_ID=]
-h, --help Print help
```
### Upload
```shell
Usage: fuel-core-network-upgrader upload [OPTIONS] --path --url
Options:
-p, --path
The path to the bytecode file to upload
-u, --url
The URL to upload the bytecode to [env: URL=https://devnet.fuel.network/v1/graphql]
--subsection-size
The size of the subsections to split the bytecode into. Default size is 64KB [env: SUBSECTION_SIZE=] [default: 65536]
-s, --starting-subsection
The size of the subsections to split the bytecode into. Default size is 64KB [env: STARTING_SUBSECTION=] [default: 0]
-h, --help
Print help
```
### Upgrade
```shell
Usage: fuel-core-network-upgrader upgrade --url
Commands:
state-transition Upgrades the state transition function of the network
consensus-parameters Upgrades the consensus parameters of the network
help Print this message or the help of the given subcommand(s)
Options:
-u, --url The URL to upload the bytecode to [env: URL=https://devnet.fuel.network/v1/graphql]
-h, --help Print help
```
### Parameters
```shell
Usage: fuel-core-network-upgrader parameters [OPTIONS] --url
Options:
-p, --path The path to dump the consensus parameters [default: consensus_parameters.json]
-u, --url The URL to upload the bytecode to [env: URL=https://devnet.fuel.network/v1/graphql]
-h, --help Print help
```
## Update consensus parameters
1. Download the current consensus parameters from the node:
```shell
URL=https://devnet.fuel.network/v1/graphql fuel-core-network-upgrader parameters
```
2. Update the `consensus_parameters.json` file with the new parameters.
3. Upload the new consensus parameters to the node by using Privileged Address account with funds:
```shell
URL=https://devnet.fuel.network/v1/graphql fuel-core-network-upgrader upgrade consensus-parameters -p consensus_parameters.json
```
## Update state transition function
1. Upload the new state transition bytecode to the node by using ANY account with funds:
```shell
URL=https://devnet.fuel.network/v1/graphql fuel-core-network-upgrader upload -p fuel-core-wasm-executor.wasm
```
2. Copy the root of the bytecode from the logs.
3. Upgrade to uploaded state transition function by using Privileged Address account with funds:
```shell
URL=https://devnet.fuel.network/v1/graphql fuel-core-network-upgrader upgrade state-transition -r 0000000000000000000000000000000000000000000000000000000000000000
```
## Transfer assets
You can transfer assets to any account by using ANY account with funds:
```shell
URL=https://devnet.fuel.network/v1/graphql fuel-core-network-upgrader transfer --amount 10000000000 --recipient 1d5adf1197c4f48dfa642261e98fcefedd2ccd805dbbd2c574ddf3ed6dc66b5a
```