waves_logo Docs
  • Node Owner Guide
    Node Owner Guide
  • Install Waves Node
    • Deploy Node in Docker
      Deploy Node in Docker
    • Install Node on Ubuntu
      Install Node on Ubuntu
    • Install Node on macOS
      Install Node on macOS
    • Install Node on Windows
      Install Node on Windows
    • Install from Source (Building SBT)
      Install from Source (Building SBT)
    Install Waves Node
  • Synchronize Waves Blockchain
    • Import/Export Blockchain
      Import/Export Blockchain
    • Download the Latest Blockchain
      Download the Latest Blockchain
    • Rollback Waves Node
      Rollback Waves Node
    Synchronize Waves Blockchain
  • Generate Blocks
    Generate Blocks
  • Upgrade Waves Node
    Upgrade Waves Node
  • Node Configuration
    Node Configuration
  • Logging Configuration
    Logging Configuration
  • Node Wallet
    Node Wallet
  • Features
    • Activation protocol
      Activation protocol
    Features
  • Custom Blockchain
    Custom Blockchain
  • Node REST API
    • API Key
      API Key
    • Working with Transactions
      Working with Transactions
    • Numeric Fields Format
      Numeric Fields Format
    • Pagination
      Pagination
    • CORS
      CORS
    • API Limitations of Pool of Public Nodes
      API Limitations of Pool of Public Nodes
    • Slow Requests
      Slow Requests
    • Response Codes and Errors
      Response Codes and Errors
    Node REST API
  • Extensions
    • gRPC Server
      gRPC Server
    • Blockchain Updates
      Blockchain Updates
    Extensions
  • Troubleshooting
    • Block Generation FAQ
      Block Generation FAQ
    Troubleshooting
  • Node Go
    Node Go
      • English
      • Русский
      On this page
        • Import Blockchain from Binary File
        • Export Blockchain to Binary File
      waves_logo Docs

          # Import/Export Blockchain

          A running node requires up-to-date blockchain database for operation. You can speed up (by ~10%) your blockchain synchronization by importing blockchain from binary file rather than synchronizing your blockchain state during regular node operation. Binary files contain chain of transaction blocks in verifiable format (include the original sequence of all the transactions with signatures and blocks with signatures of the block generators).

          If you have a running Waves node that is synchronized to current state, you can export your blockchain to a binary file.

          # Import Blockchain from Binary File

          Importing blockchain from binary file causes CPU load and can take 1-3 days to complete. The process implies the same execution of every transaction that happens during normal node operation. That includes validation of signatures, balances etc.

          To import blockchain, do the following:

          1. Download the binary file (for example, mainnet_last for Mainnet) from one of the links below:

            Mainnet: http://blockchain.wavesnodes.com/

            Testnet: http://blockchain-testnet.wavesnodes.com/

            Stagenet: http://blockchain-stagenet.wavesnodes.com/

          2. Stop the node with service waves stop command.

          3. Empty the existing directory where the node's database is stored. By default, the database is stored in data subdirectory of the base application directory (in particular, in /var/lib/waves/data for a node installed from a DEB package).

            Linux console command

            sudo rm -rdf /var/lib/waves/data.

          4. Execute the following command:

            Windows

            java -cp waves-all-<version>.jar com.wavesplatform.Importer -c <configuration-file-name> -i <binary-file-name>

            Linux

            Mainnet: sudo -u waves waves import -c /etc/waves/waves.conf -i <binary-file-name>

            Testnet: sudo -u waves-testnet waves-testnet import -c /etc/waves-testnet/waves.conf -i <binary-file-name>

            macOS

            java -cp waves-all-<version>.jar com.wavesplatform.Importer -c <configuration-file-name> -i <binary-file-name>

            Use the name of the desired binary file instead of binary-file-name.

          Note: You can speed up the import by 5-20% at your own risk. To do so, use -no-verify option of the Importer parameter to turn off block and transaction validation. Use with caution and only if you trust the blockchain binary file.

          # Import Blockchain Up to a Certain Height

          It is possible to set target height. If the height parameter is not set, all the blocks will be imported.

          To import blockchain up to a certain height, do the following:

          1. Stop the node with service waves stop command.

          2. Empty the existing directory where the node's database is stored.

          3. Execute the following command:

            Windows

            java com.wavesplatform.Importer -c <configuration-file-name> -i <blockchain_file> -h <height>

            Linux

            Mainnet: sudo -u waves waves import -c /etc/waves/waves.conf -i <blockchain_file> -h <height>

            Testnet: sudo -u waves-testnet waves-testnet import -c /etc/waves-testnet/waves.conf -i <blockchain_file> -h <height>

            macOS

            java com.wavesplatform.Importer -c <configuration-file-name> -i <blockchain_file> -h <height>

          # Export Blockchain to Binary File

          If you have a running Waves node that is synchronized to current state, you can export the node's blockchain to a binary file. Exporting is quite a fast operation, but the resulting binary file can take up to 1/3 of the database directory size.

          To export the existing blockchain to a binary file, do the following:

          1. Stop the node with service waves stop command.

          2. Execute the following command:

            Windows

            java -cp waves-all-<version>.jar com.wavesplatform.Exporter -c <configuration-file-name> -o <output-file-name> -h <height>

            Linux

            Mainnet: sudo -u waves waves export -c /etc/waves/waves.conf -o <output-file-name> -h <height>

            Testnet: sudo -u waves-testnet waves-testnet export -c /etc/waves-testnet/waves.conf -o <output-file-name> -h <height>

            macOS

            java -cp waves-all-<version>.jar com.wavesplatform.Exporter -c <configuration-file-name> -o <output-file-name> -h <height>

          The height parameter allows to specify maximum height of the blocks during exporting. If the parameter is not set, all the blocks will be exported.

          The output-file-name parameter is optional ('blockchain' is used by default). The resulting export file with the <output-file-name>-<height> name will be created in the database directory.

          Synchronize Waves Blockchain
          Download the Latest Blockchain
          Synchronize Waves Blockchain
          Download the Latest Blockchain