For the complete documentation index, see llms.txt. This page is also available as Markdown.

Run a Gravity Testnet Public Full Node With Docker

Run a Gravity Longevity Testnet (L1) Public Full Node with Docker. Covers image preparation, testnet artifacts, PFN identity generation, pruning, startup, sync checks, and operational cleanup.

This guide walks you through running a Gravity Longevity Testnet Public Full Node (PFN) with the gravity_node Docker image. A PFN syncs from an upstream public-network seed and can serve EVM JSON-RPC for applications, indexers, or internal services.

Gravity Longevity Testnet is an L1 network with Chain ID 7771625. A PFN does not participate in consensus, does not hold validator stake, and does not require validator invite access. If you only need occasional testnet reads or writes, you can use the public endpoint at https://testnet-rpc.gravity.xyz instead.

Placeholders. Commands below use <YOUR_...> placeholders. Replace each value before running. Never commit generated identities, private keys, .env files, rendered node config, logs, or node databases to version control.

Prerequisites

  1. Docker and Docker Compose v2. Production-like nodes should run on Linux. Docker Desktop on macOS is useful for local validation, but it handles host networking differently from Linux.

  2. Local command-line tools. Install just, envsubst from GNU gettext, jq, curl, nc, and lsof.

  3. The Gravity SDK repository. The Docker image and config templates live in gravity-sdk.

    git clone https://github.com/Galxe/gravity-sdk.git
    cd gravity-sdk
    git checkout v1.10.0-pre
  4. Testnet genesis.json and waypoint.txt. These artifacts pin the exact chain you are joining. Download the canonical files from gravity-sdk/genesis/testnet.

  5. An upstream public-network seed. The current public testnet PFN seed is shown below.

  6. SSD/NVMe storage. Chain data grows with uptime. Budget well above the current chain size.

1. Pull the Docker Image

docker pull ghcr.io/galxe/gravity_node:v1.10.0-pre

To build from source instead, check out v1.10.0-pre and tag the image ghcr.io/galxe/gravity_node:v1.10.0-pre so the .env values below still match:

2. Prepare the Docker Workspace

Edit .env:

The container reads node config from ./config and stores chain data in Docker volumes.

3. Prepare Testnet Artifacts

From docker/gravity_node:

Copy these artifacts into the Docker config directory:

4. Gather Seed Information

Use the public testnet PFN host as the upstream seed.

Node
Host
JSON-RPC endpoint
Public-network seed port
Peer ID
Network public key

testnet-rpc-p2p-1

testnet-rpc-p2p-1.gravity.xyz

https://testnet-rpc.gravity.xyz

6195

e7ddaced105af1c4381ca670cea01b0a8e3006c7e360a4f4e40e79fe06c29433

86d3bd6c81fb6994bdbe8df40da28acf44433138cb09ad491c4d98637abd817a

Before using the seed, verify from your node host that the public-network port is reachable:

Use the current public testnet PFN seed when rendering PFN_SEEDS_BLOCK in the Docker config section below:

For normal JSON-RPC traffic, use the aggregate public RPC endpoint:

5. Generate a PFN Identity

Create a minimal cluster config file for identity generation, for example cluster/local-testnet-pfn-docker.toml:

The Docker flow uses this TOML only to generate node identity material. It does not read ports, seeds, base_dir, or data_dir from the TOML during container startup. Docker runtime storage is controlled by the volume or bind mount in the start command, and by the container paths rendered in the next section.

Generate the PFN identity:

The generated identity.yaml contains private node identity material. Keep it on the runtime host only.

6. Render Container Config

The container sees config at /gravity/config and data at /gravity/data, so the rendered files must use container paths, not host paths.

DATA_DIR, STORAGE_DIR, and LOG_DIR are intentionally separate:

To place data on a specific host disk, mount that host path to /gravity/data. To place logs on a specific host disk, mount that host path to /gravity/logs. Do not change the TOML data_dir for Docker runtime storage.

From docker/gravity_node:

If you do not want transaction-lookup pruning, do not set PRUNE_TRANSACTIONLOOKUP_DISTANCE, and render reth_config.json from the non-prune template instead:

Verify the rendered config:

Expected reth_config.json behavior:

  • chain points to /gravity/config/genesis.json;

  • gravity_node_config points to /gravity/config/public_full_node.yaml;

  • datadir points to /gravity/data/data/reth;

  • log.file.directory points to /gravity/logs/execution_logs/;

  • when pruning is enabled, prune.transactionlookup.distance is 10064.

7. Pruning Mode

prune_transactionlookup_distance = 10064 starts reth with transaction-lookup pruning enabled. This keeps recent transaction-hash lookup data while allowing older lookup indexes to be pruned.

Use a value greater than or equal to 10064 for production-like PFN/RPC nodes. Treat smaller values as test-only and reject them during config review.

Use this pruning mode when you want lower execution database growth and do not need arbitrary old eth_getTransactionByHash lookups from this node.

If you omit prune_transactionlookup_distance, the generated PFN reth config uses archive-style transaction lookup behavior and keeps historical lookup indexes instead of pruning them. That is simpler for indexers or debugging flows that need old transaction hashes, but it uses more disk over time.

Do not set prune_transactionlookup_distance = 0 to disable pruning. A distance of 0 is still a pruning mode and can prune transaction lookup data aggressively. To run without transaction-lookup pruning, leave the field out.

8. Optional: Warm Start From a Snapshot or Existing Node

A new Docker PFN can sync from genesis, but that may take a long time on an established testnet. To warm start, load the snapshot into the Docker data volume before the first node start.

If the Docker PFN has already started once, stop the container and remove the old data volume before importing a snapshot. Do not merge snapshot files into an already-initialized database.

The Docker container mounts its data volume at /gravity/data. The chain databases must live under /gravity/data/data, so extract snapshot contents into that data subdirectory.

Option A: Download the Public Testnet Data Snapshot

Gravity publishes daily Longevity Testnet PFN data snapshots. List dates, then download. For example, use 2026-09-01 for gravity-testnet-data/2026-09-01.tar:

The snapshot tar contains database directories such as consensus_db/, quorumstoreDB/, and reth/ at the archive root. It does not contain an outer data/ directory.

For the Linux compose flow, load the snapshot into the compose data volume:

For the macOS docker run flow, load the snapshot into the explicit named volume used by the start command below:

After extraction, the Docker data volume should contain:

Option B: Copy From an Existing Node You Control

If you already run a trusted RPC/PFN, you can copy only the chain databases from that node:

Then load /tmp/testnet-pfn-data.tar into the Docker data volume with the same compose or docker run extraction pattern above. Mount /tmp as /snapshot and replace the extraction command with:

Do not copy rand_db or secure_storage.json from another node. Those files carry node-specific randomness or safety state and should not be reused.

9. Start the PFN

Make sure the selected host ports are free:

On Linux, use Docker Compose:

The compose file uses network_mode: host because p2p ports need predictable advertised addresses.

On Docker Desktop for macOS, host networking behaves differently. For local validation from the macOS host, use explicit port publishing:

10. Verify Sync

Confirm that your local Docker PFN is on the testnet chain:

The expected result is 0x7695e9, which is decimal 7771625.

Query the local Docker PFN:

Compare with the public RPC:

When the two heights are close and your local height keeps advancing, the node is caught up. Gravity has BFT-final blocks: once a block is returned by your node, there is no EVM-style reorg to wait for.

Follow logs:

Confirm the prune config was accepted:

11. Stop, Restart, or Reset

For the Linux compose flow, stop the container but keep chain data:

Restart:

Delete the local PFN database and start from zero again:

For the macOS docker run flow, stop the container but keep chain data:

Delete the local PFN database and start from zero again:

Only remove Docker volumes when you intentionally want to delete the node database.

Files to Keep Out of Version Control

Do not commit generated runtime files:

  • docker/gravity_node/.env;

  • docker/gravity_node/config/*;

  • cluster/output/<YOUR_NODE_ID>/config/identity.yaml;

  • Docker volumes such as gravity-data, gravity-logs, gravity_node_testnet_pfn_data, and gravity_node_testnet_pfn_logs;

  • node databases and logs.

The reusable materials are the public guide and SDK templates. Each operator should generate their own identity and runtime config.

See Also

Last updated

Was this helpful?