LogoLogo
  • Welcome
  • Explorers
    • Aptos Explorer
    • Cosmos Explorer
  • Blockchains
    • Aptos
      • Run a Validator and VFN
        • Operator
        • Node Requirements
        • Deploy Nodes
          • Using Source Code
        • Connect Nodes
          • Connect to a Network
          • Staking Pool Operations
          • Delegation Pool Operations
          • Staking Pool Voter
        • Verify Nodes
          • Node Health
          • Validator Leaderboard
        • Modify Nodes
          • Upgrade Nodes
          • Shutdown Nodes
      • Run a Public Fullnode
        • PFN Requirements
        • Deploy a PFN
          • Deploy a PFN using Source Code
        • Verify a PFN
        • Modify a PFN
          • Customize PFN Networks
          • Generate a PFN Identity
          • Upgrade your PFN
          • Run a PFN from Source Code
      • Bootstrap a Node with historical data
        • Bootstrap from a Backup
        • Bootstrap from a Snapshot
      • Configure a Node
        • State Synchronization
        • Data Pruning
        • Telemetry
        • Locating Node Files
          • Files For Mainnet
          • Files For Testnet
          • Files For Devnet
      • Monitor your Nodes
        • Important Node Metrics
        • Node Health Checker
        • Node Health Checker FAQ
        • Node Inspection Service
      • Building Aptos From Source
      • Aptos Networks
    • Berachain V2
      • Node Snapshot
      • Explorer
      • AddrBook File
      • Genesis File
      • API Endpoint
      • RPC Endpoint
      • gRPC Endpoint
      • Live Peers
      • Forest Staking Peer
      • Performance Optimizer Script
      • Discord & TG Alert System
      • RPC Load Balancer Setup
    • Casper
      • Explorer
    • Haqq
      • Node Snapshot
      • Explorer
      • AddrBook File
      • Genesis File
      • API Endpoint
      • RPC Endpoint
      • Live Peers
      • Forest Staking Peer
    • Mantra
      • Node Snapshot
      • Explorer
      • AddrBook File
      • Genesis File
      • API Endpoint
      • RPC Endpoint
      • Live Peers
      • Forest Staking Peer
    • Ika
    • Story Protocol
      • Node Snapshot
      • Explorer
      • AddrBook File
      • Genesis File
      • API Endpoint
      • RPC Endpoint
      • EVM Endpoint
      • Websocket
      • WSS
      • Discord & TG Alert System
      • RPC Load Balancer
      • Performance Optimizer Script
      • Live Peers
      • Forest Staking Peer
    • Supra
      • Explorer
      • Oracle data
    • Showdown
      • Node Snapshot
      • Explorer
      • AddrBook File
      • Genesis File
      • API Endpoint
      • RPC Endpoint
      • Live Peers
      • Forest Staking Peer
    • Soarchain
      • Node Snapshot
      • Explorer
      • AddrBook File
      • Genesis File
      • API Endpoint
      • RPC Endpoint
      • Live Peers
      • Forest Staking Peer
    • Zenrock
      • Node Snapshot
      • Explorer
      • AddrBook File
      • Genesis File
      • API Endpoint
      • RPC Endpoint
      • Live Peers
      • Forest Staking Peer
    • Zetachain
      • Node Snapshot
      • Explorer
      • AddrBook File
      • Genesis File
      • API Endpoint
      • RPC Endpoint
      • Live Peers
      • Forest Staking Peer
    • Airchains
      • Node Snapshot
      • Explorer
  • Gunzilla - Off The Grid
    • Vision and Foundation
    • Gunzilla Hacker Dashboard
      • Key Features of the Hackers Dashboard
        • Wallet Integration and Testnet Access
        • License System with Rarity Tiers
        • Decoding Stats and Hash Power Tracking
        • Marketplace for Trading Licenses and Assets
        • Scanner Tool for Blockchain Transparency
        • Social Media Integration and Community Engagement
      • Mastering the Hackers Dashboard
      • Benefits of the Hackers Dashboard
    • Gunzilla Token Page
  • Forest Esports Team
    • Forest Hexers
  • Crypto Tools & Analytics
    • Top 10 Crypto Exchanges
      • Binance
      • Coinbase
      • Kraken
      • Bybit
      • OKX
      • KuCoin
      • Bitfinex
      • Gemini
      • Crypto.com
      • Bitstamp
    • Top 10 Wallets
      • Ledger Nano X
      • Trezor Model T
      • Exodus
      • Coinbase Wallet
      • Trust Wallet
      • MetaMask
      • Crypto.com DeFi Wallet
      • ZenGo
      • Atomic Wallet
      • SafePal
  • Top 10 Crypto Data Platforms
    • CoinMarketCap
    • CoinGecko
    • CryptoCompare
    • CoinCodex
    • Live Coin Watch
    • CoinCheckup
    • Messari
    • CoinPaprika
    • Arkham Intelligence
  • DeFi Analytics and Tracking
    • DefiLlama
    • Dune Analytics
    • DeBank
    • Zapper
    • Token Terminal
    • DeepDAO
    • Revert Finance
    • L2BEAT
  • API's
    • What are APIs?
    • How APIs Work
    • Types of APIs
    • Real-World API Use Cases
    • Benefits of Using API's
    • Challenges and Considerations of using API's
  • Node Security
    • Physical Security
    • Network Security
    • System and Software Security
    • Access Control
    • Data Security
    • Monitoring and Logging
    • Backup and Disaster Recovery
    • Best Practices for Validator Nodes
    • Cloud Security
    • Incident Response and Recovery
  • Linux Bash
    • Bash 101
      • Getting Started with Bash
      • Navigating the File System
      • File Management Basics
      • Viewing and Editing Files
      • Managing Permissions
      • Working with Processes
      • Using Pipes and Redirection
      • Bash Scripting Basics
      • Essential Networking Commands
      • Installing Software with Package Managers
    • Advanced Linux for Validator Nodes
      • Advanced Bash Scripting for Node Automation and Maintenance
      • Monitoring and Logging Essentials
      • Networking and Security Best Practices
      • Backup and Disaster Recovery
  • Staking 101
    • Understand What Staking Is and How It Works
    • Choose a Blockchain Network to Stake On
    • Set Up a Compatible Wallet for Staking
    • Purchase or Transfer Funds for Staking
    • Choose a Staking Pool
    • Connect Your Wallet to a Staking Platform
    • Confirm and Stake Your Funds
    • Monitor Staking Rewards and Performance
    • Withdraw or Re-Stake Rewards
  • Optimizing Your Infrastructure Choices
    • Infrastructure Comparison: VPS vs. Bare Metal
Powered by GitBook
On this page
  • Public backup files
  • Restore an Aptos DB

Was this helpful?

  1. Blockchains
  2. Aptos
  3. Bootstrap a Node with historical data

Bootstrap from a Backup

PreviousBootstrap a Node with historical dataNextBootstrap from a Snapshot

Last updated 7 months ago

Was this helpful?

This document describes how to bootstrap an Aptos node using a backup. This can be done on all node types, including validators, VFNs and PFNs. Bootstrapping using a backup helps node operators achieve two goals:

  1. Quickly bootstrap a database to start a new or failed node.

  2. Efficiently recover data from any specific period in the blockchain’s history (e.g., from genesis to a target version).

To achieve these goals, the Aptos database restore tool lets you use existing to restore the database of a node. This includes the transaction history containing events, write sets, and key-value pairs. Using the tool, you can restore transactions from any historical range, or restore the database to the latest version in the backup. The public backup files are backed by cryptographic proofs and stored on both AWS and Google Cloud for easy access.

Public backup files

Aptos Labs maintains a few publicly accessible database backups by continuously querying a PFN and storing the backup data in remote storage, such as Amazon S3 or Google Cloud Storage. The links to this backup data can be seen below:

AWS Backup Data
Google Cloud Backup Data

Testnet

Discontinued

Mainnet

Backups are only created for testnet and mainnet. Given that devnet is wiped frequently, it is not useful to maintain backups for it.

The backup files consist of three types of data that can be used to reconstruct the blockchain DB:

  • epoch_ending – This contains the ledger_info at the ending block of each epoch since the genesis. This data can be used to prove the epoch’s provenance from the genesis and validator set of each epoch.

  • state_snapshot – This contains a snapshot of the blockchain’s state Merkle tree (SMT) and key values at a certain version.

  • transaction – This contains the raw transaction metadata, payload, the executed outputs of the transaction after VM, and the cryptographic proofs of the transaction in the ledger history.

Each type of data in the backup storage is organized as follows:

  • The metadata file in the metadata folder contains the range of each backup and the relative path to the backup folder.

  • The backup contains a manifest file and all the actual chunked data files.

See the diagram below for a visual representation of the backup data structure:

Restore an Aptos DB

  1. Recreating a database with a minimal transaction history at a user-specified transaction version (or the latest version offered by the backup).

  2. Restoring the database over a specific period. In addition to the above, this option ensures that the recreated database carries the ledger history of the user-designated version range.

The sections below provide examples of how to use the Aptos CLI to restore a database from a backup.

Bootstrap to the latest version

The aptos node bootstrap-db command can quickly restore a database from the latest snapshot back to a target version, but it does not restore the transaction history prior to the target version.

Use the following options to run the command:

  • target-version – The sync will begin from this period onwards in the transaction history (towards the latest version).

  • target-db-dir – The target DB path to write the restored database.

Example command:

aptos node bootstrap-db \    --target-version 500000000 \    --command-adapter-config /path/to/s3-public.yaml \    --target-db-dir /path/to/local/db

Restore over a specific time period

The aptos node bootstrap-db command can restore the transaction history within a specified period, along with the state Merkle tree at the target version.

Use the following options to run the command:

  • ledger-history-start-version – The sync will begin from this period onwards in the transaction history (towards the target version).

  • target-version – The sync will end at this period in the transaction history.

  • target-db-dir – The target DB path to write the restored database.

Example command:

aptos node bootstrap-db \    --ledger-history-start-version 150000000 \    --target-version 155000000    --command-adapter-config /path/to/s3-public.yaml \    --target-db-dir /path/to/local/db

Restore a full history from genesis

  • Open File Limit: Set the open file limit to 10K, e.g., using ulimit -n 10000.

If you are restoring a node, you will need the following resources:

Network
Disk
RAM

Testnet

1.5 TB

32 GB

Mainnet

1 TB

32 GB

Example command:

aptos node bootstrap-db \  
--ledger-history-start-version 0 \  
--target-version use_the_largest_version_in_backup \  
--command-adapter-config /path/to/s3-public.yaml \  
--target-db-dir /path/to/local/db

If you don’t specify the target_version (via --target-version), the tool will use the latest version in the backup as the target version.

The supports two kinds of restore operations for Aptos nodes:

Aptos CLI 1.0.14 or newer is needed to perform these operations. Additionally, depending on whether you use AWS or Google Cloud, install or .

command-adapter-config – The path to one of the that specifies the location of the public backup files and commands used by our backup and restore tool to interact with the remote storage.

command-adapter-config – The path to one of the that specifies the location of the public backup files and commands used by our backup and restore tool to interact with the remote storage.

To restore an Aptos node with the full history from genesis, set ledger-history-start-version to 0 and disable the pruner by following the instructions in the section before starting the node. Note: performing a full history restore requires a significant amount of resources and time. See the resource requirements below.

public backup files
Aptos CLI
AWS CLI
gsutil
YAML configuration files
YAML configuration files
disabling the ledger pruner
https://github.com/aptos-labs/aptos-networks/blob/main/testnet/backups/gcs.yaml
https://github.com/aptos-labs/aptos-networks/blob/main/mainnet/backups/s3-public.yaml
https://github.com/aptos-labs/aptos-networks/blob/main/mainnet/backups/gcs.yaml