Run a PFN from Source Code
Last updated
Was this helpful?
Last updated
Was this helpful?
You can run your own public fullnode (PFN) to synchronize the state of the Aptos blockchain and stay up-to-date. PFNs replicate the entire state of the blockchain by syncing from other Aptos VFNs and PFNs. PFNs can be run by anyone. This tutorial explains how to deploy a PFN and connect to an Aptos network.
For running a production-grade PFN, we recommend that your hardware meet the same requirements as a validator or VFN. You can see the hardware requirements for these nodes, here: .
If you wish to run a PFN for development or testing only, lower hardware specs can be used. But, it should not be used in production. For example:
CPU: 8 cores, 16 threads (Intel Xeon Skylake or newer).
Memory: 32GB RAM.
When you are running a PFN, you are required to open network ports on your nodes to allow other nodes (i.e., peers) to connect to you. There are different Aptos network types, and each network type uses a different port. However, the only network type that a PFN uses is the public network, where PFNs to connect to other PFNs and VFNs.
Your PFN can be configured so that the public network operates using a specific port on your node. You can configure the port settings using the node configuration YAML file. Here is an for a PFN that configures the public network to use port 6180
.
The recommendations described below assume the default port settings used by PFNs. If you have changed the default port settings in your configuration file, then you should adjust the recommendations accordingly.
Running a PFN:
Assuming default ports are used, the following should be configured for PFNs:
Open the following TCP ports:
6182
– Public network: Open this port publicly to enable PFNs to connect to your VFN.
Close the following TCP ports:
9101
– Inspection service: Close this port to prevent unauthorized metric inspection.
9102
– Admin service: Close this port to prevent unauthorized admin service interaction.
80/8080
REST API: Close this port to prevent unauthorized REST API access.
The amount of data stored by Aptos depends on the ledger history (length) of the blockchain and the number of on-chain states (e.g., accounts and resources). Both the ledger history and the number of on-chain states depend on several additional factors, including the age of the blockchain, the average transaction rate over time, and the configuration of the ledger database pruner.
Note that because archival nodes store the entire history of the blockchain, the database size on archival nodes will continue to grow unbounded. As a result, we cannot provide a recommendation for archival node storage sizes.
Make sure your current working directory is aptos-core
.
Check out the mainnet
branch using git checkout --track origin/mainnet
; remember, you may instead use devnet
or testnet
if you wish to run your PFN in a different network.
Next, download the genesis.blob
and waypoint.txt
files for the network your PFN will connect to:
Run this command to download the genesis blob (for mainnet):
Run this command to download the waypoint file (for mainnet):
Next, run the command below to create a copy of the PFN configuration YAML template:
Finally, edit the fullnode.yaml
configuration file to ensure that your PFN: (i) contains the genesis blob and waypoint file you just downloaded; and (ii) saves the synchronized blockchain data to the location of your choice (on your local machine). To do this:
Specify the correct path to the genesis.blob
file you just downloaded by editing execution.genesis_file_location
in the fullnode.yaml
configuration. By default, it points to genesis.blob
in the current working directory.
fullnode.yaml
Specify the correct path to the waypoint.txt
file you just downloaded by editing base.waypoint.from_file
in the fullnode.yaml
configuration. By default, it points to waypoint.txt
in the current working directory. For example:
fullnode.yaml
Specify the directory on your local machine that you want to store the blockchain database by editing the base.data_dir
in the fullnode.yaml
configuration. For example, you can create a directory my-full-node/data
in your home directory and specify it as:
fullnode.yaml
Start your local public fullnode by running the below command:
You have now successfully configured and started running a PFN in the Aptos mainnet.
You can deploy a PFN in one of two ways: (i) building and running from source code; or (ii) using Docker. This document describes how to deploy your PFN using both methods.
First, see for instructions on how to download the aptos-core
repository and build the binary. Then, follow the steps below:
Don’t want to connect to mainnet?
To connect to other networks (e.g., devnet
and testnet
), you can find the genesis and waypoint here ➜ . Be sure to download the genesis.blob
and waypoint.txt
for those networks, instead of using the genesis and waypoint pointed to by the curl
commands above.