Keeping your node up-to-date ensures you benefit from the latest performance improvements, bug-fixes, and security patches.
This page describes the most common upgrade path – an in-place upgrade: you replace the binary or the image and keep your data. A release that changes how blocks run from some block on is required by that block; see Required In-Place Upgrade. A network migration to a new genesis is covered under Breaking Changes & Migrations.
Each release page opens with one line that says whether your node must install the release:
Upgrade: optional.
Upgrade: required on mainnet from block 3300000 (about 2026-12-10 12:00 UTC), required on testnet from block 16300000 (about 2026-12-03 12:00 UTC).
Upgrade: required on mainnet from block 3300000 (about 2026-12-10 12:00 UTC), optional on testnet.
Upgrade: optional on mainnet, required on testnet from block 16300000 (about 2026-12-03 12:00 UTC).
The blocks and times above are examples. optional means a node on the release before keeps following the chain. required ... from block N means your node must run this release, or a later one, before that network reaches block N. The time is an estimate from the block rate; the block is what counts.
A release that is required on mainnet is published at least 7 days before its mainnet block. Releases up to v2.6.8 were published before this line, so their pages do not carry it.
Release notices go out on the release page. To get them, choose Watch → Custom → Releases on the repository, or follow the feed at https://github.com/trufnetwork/node/releases.atom.
While an in-place binary upgrade is safe, taking a quick backup guarantees you can roll back if something goes wrong.
- Node root directory – copy the folder that contains
config.toml,genesis.json,nodekey.json, and thestore/&db/sub-folders.
Example:cp -r ~/.kwild ~/.kwild.bak.$(date +%Y%m%d_%H%M%S)
- PostgreSQL database – make a snapshot or export of your
kwilddatabase using whatever backup tooling you normally rely on (e.g. cloud volume snapshot,pg_dump,pgBackRest, etc.).
Upgrades normally leave data intact; the backup is an insurance policy.
# systemd example
sudo systemctl stop kwild
# If you run Postgres in a container, it can keep runningIf you manage kwild with another init system or inside Docker Compose, use the matching stop command (docker compose stop, task single:stop, etc.).
-
Download – grab the release you are installing from GitHub.
<VERSION>is its version without thev, such as2.6.9:curl -L "https://github.com/trufnetwork/node/releases/download/v<VERSION>/tn_<VERSION>_linux_amd64.tar.gz" \ -o kwild.tgz tar -xzf kwild.tgz kwildNote: This extracts the
kwildbinary to your current directory.Or, build from source in your clone, at the release tag:
git fetch --tags && git checkout v<VERSION> && task build
Note: This builds the binary to
.build/kwildin your repository directory. -
Replace the old binary (adjust paths based on where you downloaded/built and where kwild is installed):
If you built from source:
sudo mv .build/kwild /usr/local/bin/kwild sudo chmod +x /usr/local/bin/kwild
If you downloaded the binary:
sudo mv kwild /usr/local/bin/kwild sudo chmod +x /usr/local/bin/kwild
Note: Adjust the source path if you downloaded/built in a different location, and the destination path if your kwild binary is installed elsewhere (e.g.,
/usr/bin/kwild,~/bin/kwild, etc.). -
Check the version:
kwild version
Versionis the TN release the binary was built from, andGit commitis the first 9 characters of its commit. Av2.6.9release binary prints, for example:Version: 2.6.9 Git commit: <first 9 characters of the release commit> Built: <commit time> (commit time) Go version: go1.25.3 OS/Arch: linux/amd64kwild --versionprints the same release (kwild version 2.6.9), andkwild version --output json | jq -r .result.versionprints only2.6.9. A binary built withtask buildprints thegit describeversion of your clone instead, such as2.6.8-4-g9e008683for a clone 4 commits pastv2.6.8.A binary that prints
0.10.1(kwil-db's version) was built before TN releases carried their own version, as the v2.6.8 release was. Read its release from the release page or tarball you downloaded it from.If your node runs in Docker, read the release from the image label of the running container:
docker inspect --format '{{ index .Config.Labels "org.opencontainers.image.version" }}' <container>
For an image that carries the TN version,
docker exec <container> /app/kwild versionprints the same release; an older image prints0.10.1there.
sudo systemctl start kwildValidate that the node is running and catching up:
kwild admin statussyncing: false indicates you are fully synced.
-
Tail the logs for a minute to ensure there are no showstopper errors:
sudo journalctl -u kwild -f | cat -
Confirm your best block height advances and peers connect.
-
Use the built-in health endpoint to confirm the node is healthy and not syncing:
# Overall health should be true curl -s http://127.0.0.1:8484/api/v1/health | jq '.healthy' # Node-level sync status should be false once caught up curl -s http://127.0.0.1:8484/api/v1/health | jq '.services.user.syncing'
A value of
truefor.healthyandfalsefor.services.user.syncingmeans the upgrade was successful. If syncing remainstruefor an extended period, inspect the logs and peer connectivity.
Starting with recent versions, kwil-db includes peer blacklisting functionality to improve network stability and give operators better control over problematic peers.
- Manual peer control - Block specific peers via CLI commands
- Persistent storage - Blacklist survives node restarts
- Automatic protection - Auto-blacklist peers that exhaust connection retries (when enabled)
- Better network health - Prevent resource waste from problematic peers
Option 1: Automated (append to config)
Use this bash command to automatically append the blacklist configuration to the end of your config.toml file if the blacklist section doesn't already exist:
# Stop your node first
sudo systemctl stop kwild
# Add blacklist configuration to end of config.toml
# Note: Adjust the path if you used a different directory during setup
cat >> ~/truf-node-operator/my-node-config/config.toml << 'EOF'
# peer blacklisting configuration
[p2p.blacklist]
# enable peer blacklisting functionality
enable = true
# automatically blacklist peers that exhaust connection retries
auto_blacklist_on_max_retries = true
# duration to blacklist peers that exhaust connection retries (0 = permanent)
auto_blacklist_duration = "1h"
EOF
# Restart node
sudo systemctl start kwildThis bash heredoc command (cat >> file << 'EOF') safely appends the configuration block to the bottom of your config file without modifying existing sections.
Note: The path above assumes you followed the standard Node Operator Guide which uses ~/truf-node-operator/my-node-config/. If you created your configuration in a different location, adjust the path accordingly.
Option 2: Manual Configuration
Edit your ~/truf-node-operator/my-node-config/config.toml and add this section if it doesn't exist (adjust path if you used a different directory):
# peer blacklisting configuration
[p2p.blacklist]
# enable peer blacklisting functionality
enable = true
# automatically blacklist peers that exhaust connection retries
auto_blacklist_on_max_retries = true
# duration to blacklist peers that exhaust connection retries (0 = permanent)
auto_blacklist_duration = "1h"Supported duration formats:
"30s"- 30 seconds"5m"- 5 minutes"1h"- 1 hour (default)"2h30m"- 2 hours and 30 minutes"1h30m45s"- 1 hour, 30 minutes, and 45 seconds"0s"or"0"- Permanent blacklist
Once enabled, you can manage peer blacklists:
# Block a problematic peer permanently
kwild blacklist add 12D3KooWExample... --reason "connection_issues"
# Block a peer temporarily (1 hour)
kwild blacklist add 12D3KooWExample... --reason "temporary_ban" --duration "1h"
# List blacklisted peers
kwild blacklist list
# Remove a peer from blacklist
kwild blacklist remove 12D3KooWExample...Check that blacklist is working:
# Should show blacklist section in config
kwild print-config | grep -A 5 "blacklist"
# Test CLI access
kwild blacklist listA required release changes how blocks run from the block its release page names. It runs every block before that one the same way as the release before it, so you can install it at any time before the block. A node that still runs an older release when the network reaches the block stops there; see If Your Node Stopped at a Block.
- Read the first line of the release page, for example:
A mainnet node must run this release, or a later one, before mainnet reaches block 3300000. On testnet the release is optional.
Upgrade: required on mainnet from block 3300000 (about 2026-12-10 12:00 UTC), optional on testnet. - Check how far your node is from that block:
curl -s http://127.0.0.1:8484/api/v1/health | jq '.services.user.block_height'
- Install the release before the block:
- Binary (for example with systemd): follow steps 1 to 5 above with the release's version.
- Docker Compose, as in the Container Image Guide: set
TN_NODE_TAGin.envto the release tag, such asv2.6.9, then run:docker compose pull tn-node postgres-roles docker compose up -d
- AMI: run
sudo tn-node-update v2.6.9with the release tag. See Updates in the AMI guide. A node built from an older AMI, one with no/opt/tn/ami-node-tagfile, has an update command that takes no tag; follow Nodes From an Older AMI instead.
- Check that your node reports the release, as in Check the version, and that its height keeps advancing.
A node that runs an older release stops at the first block it computes differently from the network. kwild logs:
processAndCommit: AppHash mismatch, halting the node. expected: <app hash your node computed>, received: <app hash the network committed>
When the node halts while following the chain, this text is the reason of the log line Received halt signal, stopping the consensus engine. When it halts while catching up, for example after a restart, the text is part of the error kwild stops with, such as failed to apply block at height: <height>: error: processAndCommit: AppHash mismatch, halting the node. .... A validator that ran the block as a proposal logs Incorrect AppHash, halting the node. received: <app hash the network committed>, computed: <app hash your node computed> instead.
The node does not commit that block. Its writes stay in Postgres transactions that kwild rolls back when it stops or starts, the block is not stored, and the node stays at the block before it. Started again on the same release, it applies the block again and stops at the same place, so Restart=always or restart: unless-stopped only repeats the stop.
To recover:
- On the release page, find the release that is required from that block on.
- Install it as in step 3 of Required In-Place Upgrade.
- Start the node, if the install step did not. It applies the block again with the new release and continues from there. You do not need to reset the node or restore a snapshot.
- Check that the height passes the block:
curl -s http://127.0.0.1:8484/api/v1/health | jq '.services.user.block_height'
If the node stops at the same block while kwild version prints the required release, reach out on Discord or open a GitHub issue with the log lines.
Minor Kwil releases do not require a database upgrade.
If the release notes specify a new official Postgres image (e.g. ghcr.io/trufnetwork/kwil-postgres:x.y-z) you can recreate the container at your convenience – data volumes are preserved.
kwild connects to Postgres as a role without superuser rights, set up by deployments/postgres-roles.sql. The Compose files run that script before the node starts. If you run kwild as a service, stop it, run the script once when you upgrade from a release that connected as a superuser, and start it again. See Moving an Existing Node Off the Superuser Role. Run the script again after an upgrade that changes it, such as the one that adds the event trigger for pg_repack's copies. That change needs no restart of kwild, but run it between tn_vacuum runs, and read Replica Identity Errors first: once the trigger is in place, a run copies every table.
When a new version introduces consensus-breaking changes, a simple binary replacement is not sufficient.
These scenarios require a network migration (offline or zero-downtime) and coordination with the core team.
If you want to create your own fork (as opposed to recovering from another node's network fork), you can follow the Offline migrations guide until step 2 to create a new genesis file and a snapshot of the database.
After you create the new genesis file, beware that the content still points to the old network configuration, please open the generated genesis file and confirm about:
db_owner: admin address
- Testnet example:
0x7E5F4552091A69125d5DfCb7b8C2659029395Bdf - Corresponding test key:
0000…001
-
validators: every entry’spubkeyandtypemust match the validator nodes you will run, either the validator will tell you the details or for a single-validator test network you can reuse your own key. -
leader: choose which validator starts as leader. In a single-validator setup this is the same key as in step 2.
Then you'll be able to follow the Resetting Your Node Instance procedure to reset your node and sync with the new genesis file and database snapshot. It's important to also update the config.toml file to point to the new snapshot by updating the genesis_state parameter. The procedure recreates the Postgres container on an empty volume, where the image's init script makes kwild a superuser again, so do not skip its step that runs postgres-roles.sql again before kwild starts.
note:
- You can use this command to see your node address and keys,
kwild key info -o ./new-node-config/nodekey.json - Please be careful about the directory you use for new network / fork, don't use the old directory / content or you will generate the wrong data / encounter errors.
When the network requires a fork due to consensus changes or critical issues, you'll need to reset your node with a new genesis file.
Prerequisites:
- Read the release page of the release that moves the network: it gives the migration instructions
- Ensure you have the latest
truf-node-operatorrepository (git pull)
Recovery Steps:
Follow the Resetting Your Node Instance procedure in the Node Operator Guide. The process preserves your node identity and configuration while syncing with the new network state. It recreates the Postgres container on an empty volume, where the image's init script makes kwild a superuser again, so do not skip its step that runs postgres-roles.sql again before kwild starts.
What's Preserved During Network Forks:
- Node identity (nodekey) and validator status
- All custom configuration settings
- Chain ID continuity
- Historical data up to the fork point
See:
If the release page of your target version says it needs a network migration, contact the TRUF.NETWORK team before proceeding.
Reach out on Discord or open a GitHub issue – we are happy to help.