Skip to content

Using Docker

This section describes how to configure and run your PFN using Docker.

  1. First, install Docker.
  2. Next, run the following script to prepare your local configuration and data directory for mainnet. This will download the fullnode.yaml configuration file, the genesis.blob and waypoint.txt files for your PFN, and create a data directory to store the blockchain database:
Terminal window
mkdir mainnet && cd mainnet
mkdir data && \
curl -O https://raw.githubusercontent.com/aptos-labs/aptos-core/mainnet/docker/compose/aptos-node/fullnode.yaml && \
curl -O https://raw.githubusercontent.com/aptos-labs/aptos-networks/main/mainnet/waypoint.txt && \
curl -O https://raw.githubusercontent.com/aptos-labs/aptos-networks/main/mainnet/genesis.blob
  1. Next, make sure that the fullnode.yaml configuration file that you downloaded above contains only the following content. This will ensure that this configuration is for a PFN and not for another node type (e.g., validator or VFN):
base:
role: "full_node"
data_dir: "/opt/aptos/data"
waypoint:
from_file: "/opt/aptos/etc/waypoint.txt"
execution:
genesis_file_location: "/opt/aptos/etc/genesis.blob"
full_node_networks:
- network_id: "public"
discovery_method: "onchain"
listen_address: "/ip4/0.0.0.0/tcp/6182"
api:
enabled: true
address: "0.0.0.0:8080"
  1. Next, run the following docker command:
Terminal window
docker run --pull=always \
--rm -p 8080:8080 \
-p 9101:9101 -p 6180:6180 \
-v $(pwd):/opt/aptos/etc -v $(pwd)/data:/opt/aptos/data \
--workdir /opt/aptos/etc \
--name=aptos-fullnode aptoslabs/validator:mainnet aptos-node \
-f /opt/aptos/etc/fullnode.yaml

You have now successfully configured and started running a PFN in the Aptos mainnet.