zied.hosni
zied.hosni

Reputation: 490

Where is the blockchain physically

just playing with Hyperledger Composer, and I'm wondering ,Where is the blockchain physically I'mean is it binary file , text file ....? is it portable ?

thank you all

Upvotes: 1

Views: 1748

Answers (4)

Alvin Zachariah
Alvin Zachariah

Reputation: 540

To see the physical location of these data you can go to /var/hyperledger/production in each peer container in your fabric network

Upvotes: 5

Paul O'Mahony
Paul O'Mahony

Reputation: 6740

There are two place which "store" data in Hyperledger Fabric (the underlying blockchain infrastructure used by Composer which is a runtime abstraction layer above it):

  • the ledger
  • the state database ('World state')

The ledger is the actual "blockchain". It is a file-based ledger which stores serialized blocks. Each block has one or more transactions. Each transaction contains a 'read-write set' which modifies one or more key/value pairs. The ledger is the definitive source of data and is immutable.

The state database (or 'World State') holds the last known committed value for any given key - an indexed view into the chain’s transaction log. It is populated when each peer validates and commits a transaction. The state database can always be rebuilt from re-processing the ledger (ie replaying the transactions that led to that state). There are currently two options for the state database: an embedded LevelDB or an external CouchDB.

As an aside, if you are familiar with Hyperledger Fabric 'channels', there is a separate ledger for each channel.

The chain is a transaction log, structured as hash-linked blocks, where each block contains a sequence of N transactions. The block header includes a hash of the block’s transactions, as well as a hash of the prior block’s header. In this way, all transactions on the ledger are sequenced and cryptographically linked together.

The state database is simply an indexed view into the chain’s transaction log, it can therefore be regenerated from the chain at any time.

Source: http://hyperledger-fabric.readthedocs.io/en/release/ledger.html

Suffice to say, Hyperledger Composer uses Fabric (as the blockchain infrastructure) to endorse/order/commit transactions to blocks on the ledger.

Upvotes: 7

user3070069
user3070069

Reputation: 21

Blockchain is shared among all the peer to peer networks hosting it. So basically blockchain is stored in many HDD all around the world.

Upvotes: 1

Hanton
Hanton

Reputation: 686

Actually, the blockchain is a shared database, which is read-only and append-only. And it is distributed in every peers. So every peer has a copy of the shared database. Normally, LevelDB or CouchDB is used in HyperLedger Fabric.

The ledger is comprised of a blockchain (‘chain’) to store the immutable, sequenced record in blocks, as well as a state database to maintain current fabric state.

Here is more information about HyperLedger Fabric Ledger (the blockchain)

Upvotes: 1

Related Questions