-
Notifications
You must be signed in to change notification settings - Fork 3
docs: view documentation for new docker image #1168
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
14 commits
Select commit
Hold shift + click to select a range
cc49cbc
chore: update Docker configuration and environment variables
outerlook 07d91c6
docs: add container image guide for TRUF.NETWORK node setup
outerlook 38de38b
chore: update Docker image references from tn-db to ghcr.io/trufnetwo…
outerlook cce2e57
Merge branch 'main' into chore/docs-docker
MicBun 019e2ba
chore: update environment variable handling in Docker and Taskfile
outerlook b58709c
chore: update kwil-db and core dependencies to latest versions
outerlook 3b6ac41
fix: correct parameter order in ERC20 transfer action tests
outerlook 59c4fa0
refactor: improve seed file retrieval in migration logic
outerlook 931ebf2
chore: replace deprecated SQL migration file with new version for mai…
outerlook f41acde
feat: add new SQL migration files and update seed file retrieval
outerlook 7ff0fc6
feat: integrate ERC20 shim for testing resets
outerlook e9db5b0
refactor: streamline ERC20 test cleanup process
outerlook 81b7504
fix: update metadata height handling in tests
outerlook 381a6b9
fix: enhance metadata height handling in tests
outerlook File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,118 @@ | ||
| # TN Node Container Quickstart | ||
|
|
||
| Run the TRUF.NETWORK node container with Docker Compose while keeping the standard operator layout for data and configuration. | ||
|
|
||
| > **Heads up** | ||
| > The default quickstart relies on the container’s auto-initialization, which generates a brand-new genesis and starts an isolated network. Follow the optional pre-population section (or mount existing config) before the first run if you need to join an established network instead of bootstrapping a fresh one. | ||
|
|
||
| ## Prerequisites | ||
| - Docker Engine 24+ with the `docker compose` plugin. | ||
| - Pull access to `ghcr.io/trufnetwork/node` and `kwildb/postgres`. | ||
| - Optional: the [`kwild` CLI](https://github.com/trufnetwork/node/releases) if you want to pre-populate configuration files instead of using the container’s auto-initialization path. | ||
|
|
||
| ## 1. Prepare the workspace | ||
| ```bash | ||
| mkdir -p ~/truf-node/tn_data | ||
| cd ~/truf-node | ||
| ``` | ||
| The `tn_data` directory becomes the bind mount that stores keys, logs, and the blockstore on the host so they persist across container rebuilds. | ||
|
|
||
| ## 2. Save the Compose stack | ||
| Create `docker-compose.yml` in `~/truf-node` using the minimal stack below. | ||
|
|
||
| <details> | ||
| <summary>Minimal docker-compose.yml</summary> | ||
|
|
||
| ```yaml | ||
| services: | ||
| postgres: | ||
| image: kwildb/postgres:16.8-1 | ||
| restart: unless-stopped | ||
| environment: | ||
| POSTGRES_HOST_AUTH_METHOD: trust | ||
| volumes: | ||
| # this creates a host directory named pg-data in the current workspace | ||
| - ./pg-data:/var/lib/postgresql/data | ||
| healthcheck: | ||
| test: ["CMD-SHELL", "pg_isready -U postgres"] | ||
| interval: 5s | ||
| timeout: 5s | ||
| retries: 5 | ||
|
|
||
| tn-node: | ||
| image: ghcr.io/trufnetwork/node:${TN_NODE_TAG:-latest} | ||
| restart: unless-stopped | ||
| depends_on: | ||
| postgres: | ||
| condition: service_healthy | ||
| environment: | ||
| KWILD_DB_HOST: postgres | ||
| KWILD_DB_PORT: 5432 | ||
| SETUP_CHAIN_ID: ${SETUP_CHAIN_ID:-truflation-dev} | ||
| SETUP_DB_OWNER: ${SETUP_DB_OWNER:-} | ||
| volumes: | ||
| # this creates a host directory named tn_data in the current workspace, or reuses your pre-generated config if it exists | ||
| - ./tn_data:/root/.kwild | ||
| ports: | ||
| - "8484:8484" # JSON-RPC | ||
| - "6600:6600" # P2P | ||
| ``` | ||
|
|
||
| </details> | ||
|
|
||
| Compose automatically loads variables from a `.env` file in the same directory. At a minimum set the node image tag you want to run (for example the latest release) and optionally pre-fill auto-setup values: | ||
|
|
||
| ```dotenv | ||
| TN_NODE_TAG=v0.15.0 | ||
| SETUP_CHAIN_ID=truflation-dev | ||
| # Leave empty to let the container derive the owner from the generated node key | ||
| SETUP_DB_OWNER= | ||
| ``` | ||
|
|
||
| ## 3. Launch the services | ||
| ```bash | ||
| docker compose up -d | ||
| docker compose ps | ||
| ``` | ||
| The node waits for Postgres to pass its health check before it starts. Use the bind mount (`~/truf-node/tn_data`) to inspect the generated config, keys, and logs. | ||
|
|
||
| ### Verify the node | ||
| ```bash | ||
| curl http://localhost:8484/api/v1/health | ||
| docker compose logs -f tn-node | ||
| ``` | ||
|
|
||
| ## Optional: Pre-populate the configuration | ||
| If you need this container to join an existing network (mainnet/testnet/devnet), generate `config.toml`, `genesis.json`, and keys ahead of time so the container skips auto-initialization. | ||
|
|
||
| 1. Clone the operator repository (once): | ||
| ```bash | ||
| git clone https://github.com/trufnetwork/truf-node-operator.git ~/truf-node-operator | ||
| ``` | ||
| 2. Install or download the matching `kwild` release binary and add it to your `PATH`. | ||
| 3. Generate the config with the official genesis (adjust flags as needed for your environment, just like the [Node Operator Guide](node-operator-guide.md)): | ||
| ```bash | ||
| kwild setup init \ | ||
| --genesis ~/truf-node-operator/configs/network/v2/genesis.json \ | ||
| --root ~/truf-node/tn_data \ | ||
| --p2p.bootnodes "4e0b5c952be7f26698dc1898ff3696ac30e990f25891aeaf88b0285eab4663e1#ed25519@node-1.mainnet.truf.network:26656,0c830b69790eaa09315826403c2008edc65b5c7132be9d4b7b4da825c2a166ae#ed25519@node-2.mainnet.truf.network:26656" \ | ||
| --state-sync.enable \ | ||
| --state-sync.trusted-providers "0c830b69790eaa09315826403c2008edc65b5c7132be9d4b7b4da825c2a166ae#ed25519@node-2.mainnet.truf.network:26656" \ | ||
| --rpc.private | ||
| ``` | ||
| 4. Update the generated database host so it matches the Compose service name. Open `~/truf-node/tn_data/config.toml` and set: | ||
| ```toml | ||
| [db] | ||
| host = 'postgres' | ||
| ``` | ||
| (This ensures the node reaches the Postgres container without relying on environment overrides.) | ||
|
|
||
| The next `docker compose up -d` start reuses this configuration instead of triggering auto-setup. | ||
|
|
||
| ### Relying on auto-generation | ||
| For throwaway networks you can skip the steps above. Leave `SETUP_DB_OWNER` blank to let the container derive an identifier from the generated node key. Override `SETUP_CHAIN_ID` and `SETUP_DB_OWNER` in `.env` only when you want deterministic values for the generated genesis. | ||
|
|
||
| ## Maintenance tips | ||
| - Back up the `~/truf-node/tn_data` directory; it contains the node identity, admin certificates, and blockstore. | ||
| - To rotate configuration, stop the stack, edit files under `~/truf-node/tn_data`, then start the stack again. The entrypoint leaves existing files untouched. | ||
| - Testing a new image? Set `TN_NODE_TAG` to the candidate tag and point the compose stack at a fresh host directory so you can diff auto-generated config before promoting it to production. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.