Skip to content

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:

  1. Make sure your current working directory is aptos-core.

  2. 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.

  3. 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):

      Terminal window
      curl -O https://raw.githubusercontent.com/aptos-labs/aptos-networks/main/mainnet/genesis.blob
    • Run this command to download the waypoint file (for mainnet):

      Terminal window
      curl -O https://raw.githubusercontent.com/aptos-labs/aptos-networks/main/mainnet/waypoint.txt
  4. Next, run the command below to create a copy of the PFN configuration YAML template:

    Terminal window
    cp config/src/config/test_data/public_full_node.yaml fullnode.yaml
  5. 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:

    1. 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.
      execution:
      genesis_file_location: "./genesis.blob"
    2. 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:
      base:
      waypoint:
      from_file: "./waypoint.txt"
    3. 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:
      base:
      data_dir: "</path/to/my/homedir/my-full-node/data>"
  6. Start your local public fullnode by running the below command:

Terminal window
cargo run -p aptos-node --release -- -f ./fullnode.yaml

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