Deploy a PFN using Source Code
To deploy a PFN using the aptos-core
source code, first, see Building Aptos From Source for instructions
on how to download the aptos-core
repository and build the binary. Then, follow the steps below:
-
Make sure your current working directory is
aptos-core
. -
Check out the
mainnet
branch usinggit checkout --track origin/mainnet
; remember, you may instead usedevnet
ortestnet
if you wish to run your PFN in a different network. -
Next, download the
genesis.blob
andwaypoint.txt
files for the network your PFN will connect to:-
Run this command to download the genesis blob (for mainnet):
curl -O https://raw.githubusercontent.com/aptos-labs/aptos-networks/main/mainnet/genesis.blob
-
Run this command to download the waypoint file (for mainnet):
curl -O https://raw.githubusercontent.com/aptos-labs/aptos-networks/main/mainnet/waypoint.txt
Don't want to connect to mainnet?To connect to other networks (e.g.,
devnet
andtestnet
), you can find the genesis and waypoint here ➜ https://github.com/aptos-labs/aptos-networks. Be sure to download thegenesis.blob
andwaypoint.txt
for those networks, instead of using the genesis and waypoint pointed to by thecurl
commands above. -
-
Next, run the command below to create a copy of the PFN configuration YAML template:
cp config/src/config/test_data/public_full_node.yaml fullnode.yaml
-
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 editingexecution.genesis_file_location
in thefullnode.yaml
configuration. By default, it points togenesis.blob
in the current working directory.execution:
genesis_file_location: "./genesis.blob" - Specify the correct path to the
waypoint.txt
file you just downloaded by editingbase.waypoint.from_file
in thefullnode.yaml
configuration. By default, it points towaypoint.txt
in the current working directory. For example:base:
waypoint:
from_file: "./waypoint.txt" - Specify the directory on your local machine that you want to store the blockchain database by editing the
base.data_dir
in thefullnode.yaml
configuration. For example, you can create a directorymy-full-node/data
in your home directory and specify it as:base:
data_dir: "</path/to/my/homedir/my-full-node/data>"
- Specify the correct path to the
-
Start your local public fullnode by running the below command:
cargo run -p aptos-node --release -- -f ./fullnode.yaml
The command above will build a release binary for aptos-node
at: aptos-core/target/release/aptos-node
. The release
binaries tend to be substantially faster than debug binaries but lack debugging information useful for development.
To build a debug binary, omit the --release
flag from the command above.
You have now successfully configured and started running a PFN in the Aptos mainnet.
If you want to verify that your PFN is running correctly, you can follow the instructions in the Verify a PFN guide.