1
  • What are the main set of files that are required for orchestration of new network from old data from old sawtooth network ( I don't want to extend old sawtooth network).

I want to backup the essential files that are crucial for the operation of the network from the last block in the ledger.

  • I have list of files that were generated in sawtooth validator and with poet concenses:
    • block-00.lmdb
    • poet-key-state-0371cbed.lmdb
    • block-00.lmdb-lock
    • poet_consensus_state-020a4912.lmdb
    • block-chain-id
    • poet_consensus_state-020a4912.lmdb-lock
    • merkle-00.lmdb
    • poet_consensus_state-0371cbed.lmdb
    • merkle-00.lmdb-lock
    • txn_receipts-00.lmdb
    • poet-key-state-020a4912.lmdb
    • txn_receipts-00.lmdb-lock
    • poet-key-state-020a4912.lmdb-lock
  • What is the significance of each file and what are the consequences if not included when restarting the network or creation of new network with old data in ledger.

2 Answers2

5

Answer for this question could bloat, I will cover most part of it here for the benefit of folks who have this question, especially this will help when they want to deploy the network through Kubernetes. Also similar questions are being asked frequently in the official RocketChat channel.

The essential set of files for the Validator and the PoET are stored in /etc/sawtooth (keys and config directory) and /var/lib/sawtooth (data directory) directories by default, unless changed. Create a mounted volume for these so that they can be reused when a new instance is orchestrated.

Here's the file through which the default validator paths can be changed https://github.com/hyperledger/sawtooth-core/blob/master/validator/packaging/path.toml.example

Note that you've missed keys in the list of essential files in your question and that plays important role in the network. In case of PoET each enclave registration information is stored in the Validator Registry against the Validator's public key. In case of Raft/PBFT consensus engine makes use of keys (members list info) to send peer-peer messages.

In case of Raft the data directory it is /var/lib/sawtooth-raft-engine.

Significance of each of the file you listed may not be important for the most people. However, here goes explanation on important ones

  • *-lock files you see are system generated. If you see these, then one of the process must have opened the file for write.
  • block-00.lmdb it's the block store/block chain, has KV pair of block-id to block information. It's also possible to index blocks by other keys. Hyperledger Sawtooth documentation is right place to understand complete details.
  • merkle-00.lmdb is to store the state root hash/global state. It's merkle tree representation in KV pair.
  • txn-receipts-00.lmdb file is where transaction execution status is stored upon success. This also has information about events if any associated with those transactions.
Arun
  • 592
  • 3
  • 13
2

Here is a list of files from the Sawtooth FAQ: https://sawtooth.hyperledger.org/faq/validator/#what-files-does-sawtooth-use

Dan Anderson
  • 2,265
  • 1
  • 9
  • 20
  • Do I have to stop the node to backup the validator data or do I have to make the tar of mounted data as the validator is executing. – Jasti Sri Radhe Shyam Aug 05 '19 at 14:23
  • 1
    Sawtooth uses the LMDB database for the blockchain and the global state. I read that LMDB does not need to be stopped to be backed up. That said, I prefer to dump the database. That is, with something like `mdb_dump -n /var/lib/sawtooth/block-00.lmdb >block-00.lmdb.dump` Also LMDB is a sparse file, so make sure you use sparse options when copying or backing up the file. Such as `tar -S` or `cp --sparse` – Dan Anderson Aug 05 '19 at 17:09