Developer Resources
Block ExplorerGitHubRun a NodeMigration GuideETN Testnet Faucet
  • Overview
  • Foundational topics
    • Intro to the Electroneum Smart Chain
    • Intro to ETN
    • Intro to dapps
    • Web2 vs Web3
    • Accounts
    • Transactions
    • Blocks
    • Electroneum Virtual Machine (EVM)
      • Opcodes
    • Gas and Fees
    • Nodes and clients
    • Networks
    • Consensus mechanisms
      • IBFT
  • Electroneum Stack
    • Intro to the stack
    • Smart contracts
    • Development networks
    • Development frameworks
    • Electroneum client APIs
      • JavaScript APIs
      • JSON-RPC
    • Storage
    • Integrated Development Environments (IDEs)
    • Metamask
  • Advanced
    • Bridges
    • Standards
      • Token standards
        • ERC-20 Fungible Tokens
        • ERC-721 NFTs
    • Oracles
    • Networking layer
      • Network addresses
    • Data structures and encoding
      • Patricia Merkle Trie
      • Recursive-length prefix (RLP)
      • Web3 secret storage definition
  • Design fundamentals
    • Intro to design and UX
  • ETN-SC Client
    • Getting started
      • Introduction
      • Hardware requirements
      • Instaling ETN-SC
    • Fundamentals
      • Command-line options
      • Security
      • Sync-modes
      • Account management
      • Databases
      • Backup & restore
      • Logs
      • Connecting to peers
      • Pruning
      • Private networks
      • Config files
      • Light client
    • Interacting with ETN-SC
      • JSON-RPC Server
        • Batch requests
        • Real-time events
      • JSON-RPC Namespaces
        • admin
        • clique
        • debug
        • eth
        • istanbul
        • les
        • miner
        • net
        • personal
        • txpool
      • JS Console
      • JS Console 2: Contracts
      • GraphQL Server
    • Developers
      • Introduction
      • Dapp developers
        • Dev mode
        • Go API
        • Go Account Management
        • Go Contract Bindings
      • EVM tracing
        • Introduction
        • Basic traces
        • Built-in tracers
        • Custom EVM tracer
        • Tutorial for JavaScript tracing
      • ETN-SC developer
        • Developer guide
        • Disclosures
        • DNS discovery setup guide
        • Code review guidelines
      • Contributing
    • Monitoring
      • Creating Dashboards
      • Understanding Dashboards
      • Ethstats
      • Metrics
    • Tools
      • Clef
        • Introduction
        • APIs
        • Rules
        • Setup
        • Datatypes
        • Tutorial
        • Clique-signing
      • abigen
      • devp2p
    • FAQs
  • Migration to Smart Chain
    • Overview
    • How to Migrate
      • ETN Online Wallets
      • Paper Wallets
      • CLI Wallet Users
      • Exchange Holders
      • Exchanges
    • Bridge Smart Contract
  • Misc. Guides
    • Set up Ledger + Metamask
  • MY.ELECTRONEUM.COM
    • Vendor API
Powered by GitBook
On this page
  • Data Directory
  • Cleanup
  • Blockchain Import/Export

Was this helpful?

  1. ETN-SC Client
  2. Fundamentals

Backup & restore

PreviousDatabasesNextLogs

Last updated 1 year ago

Was this helpful?

Keep secure backups of your keystore and password!

Data Directory

All data relating to a specific Etn-sc instance gets written inside a data directory. The default data directory locations are platform specific:

  • Mac: ~/Library/Electroneum-sc

  • Linux: ~/.electroneum-sc

  • Windows: %LOCALAPPDATA%\Electroneum-sc

Accounts are stored in the keystore subdirectory. The contents of this directories should be transportable between nodes, platforms, and client implementations.

To configure the location of the data directory, the --datadir parameter can be specified. See for more details. There may exist multiple data directories for multiple networks (e.g. a separate directory for Electroneum Mainnet and testnet). Each would have subdirectories for their blockchain data and keystore.

It is important to backup the files in the keystore securely. These files are encrypted using an account password. This needs to be securely backed up too. There is no way to decrypt the keys without the password!

Cleanup

Etn-sc's blockchain and state databases can be removed with:

etn-sc removedb

This is useful for deleting an old chain and sync'ing to a new one. It only affects data directories that can be re-created on synchronisation and does not touch the keystore. Specifically, passing the removedb command with no arguments removes the full node state database, ancient database and light node database.

Blockchain Import/Export

Export the blockchain in binary format with:

etn-sc export <filename>

Or if you want to back up portions of the chain over time, a first and last block can be specified. For example, to back up the first epoch:

etn-sc export <filename> 0 29999

Note that when backing up a partial chain, the file will be appended rather than truncated.

Import binary-format blockchain exports with:

etn-sc import <filename>

And finally: REMEMBER YOUR PASSWORD and BACKUP YOUR KEYSTORE!

CLI Options