1. 03 Feb, 2017 1 commit
    • manish's avatar
      Move Blockstorage code under /fabric/common package · 2a16532c
      manish authored
      This changes introduced by this CR
      - Moves the block storage code from package
      core/ledger/blkstorage to common/ledger/blkstorage
      - Splits the ledger_interface.go so as to move common interfaces
      and data type to common/ledger package
      - Moves some of the util functions to common/ledger package
      - Moves core/ledger/ordererledger package to orderer/ledger/fsledger
      orderer folks can futher rename/refactor this as seems suitable to them
      Change-Id: I759e16f00dc2ec9bb62196121083cf48eae76948
      Signed-off-by: default avatarmanish <manish.sethi@gmail.com>
  2. 26 Jan, 2017 1 commit
    • denyeart's avatar
      [FAB-1762] Refactor couchdb history db to leveldb. · 2c982629
      denyeart authored
      - Utilize leveldb for history of keys instead of couchdb
      - Single leveldb database serves all chains to optimize
        footprint (same structure as leveldb block index database
        and leveldb state database)
      - Block commit writes a history key for each key/value
        that is updated in a tran, in the form:
      - History database is an index for history of key writes
        over time.  The key values are not included to reduce
        size of database.
      - GetHistoryForKey() finds all records starting with ~ns~key
        and returns the transactions that updated the key.
      - Subsequent changeset will lookup and return the txid
        and historic value from the block storage.  Client can
        then GetTransactionById to see the historic transactions.
      - Since history db size is much reduced, it is now enabled
        by default in core.yaml.
      - Upon crash recovery, ledger initialization will ensure
        that both state db and history db in sync with block storage
      Reused existing test logic, therefore the changeset
      is relatively large to ensure tests still pass.
      Change-Id: I79103aa39957f58d246de5b5295fb40a4b9c033b
      Signed-off-by: default avatardenyeart <enyeart@us.ibm.com>
  3. 20 Jan, 2017 1 commit
    • denyeart's avatar
      FAB-1585 Refactor History to enable LevelDB · 74eeb666
      denyeart authored
      The purpose of this refactor is to create a common interface and to
      isolate the db implementation, so that we can enable history on
      LevelDB. This change only refactors the existing code and tests.
      It does not add new functionality or any new tests. There will be
      future changes that add history support on LevelDB and clean up
      tests to work against LevelDB.
      Note: History is not enabled by default. History must be enabled in
      core.yaml historyDatabase for it's unit tests to run.
      Change-Id: Ia5293cd345be4499e5e3df0c2949af16f71a608d
      Signed-off-by: default avatardenyeart <enyeart@us.ibm.com>
  4. 17 Jan, 2017 1 commit
    • manish's avatar
      SingleLevelDB for block index · 8cdd0f4d
      manish authored
      This changeset:
      - Renames package ledger/util/db to ledger/util/leveldbhelper
      - Implements a leveldb provider
        (that enables using same leveldb instance as a multiple logical dbs)
        in util package for being able to reuse across statedb, index,
        and later for historydb
      - Implements a provider as a single point of invocation
        for managing multiple block storage
      - Uses a single leveldb instance for block storage index
      - Makes the structures other than providers as private
        to their respective packages
      Change-Id: I5f0b3b9aa8ef3ac1ccdce4f3c6fa6d842b5318c1
      Signed-off-by: default avatarmanish <manish.sethi@gmail.com>
  5. 16 Jan, 2017 1 commit
  6. 08 Jan, 2017 1 commit
  7. 15 Dec, 2016 2 commits
  8. 13 Dec, 2016 2 commits
    • Mari Wade's avatar
      FAB-1336 Add new ledger blockstorage index. · 458c5212
      Mari Wade authored
      Add a new ledger blockstorage index for History
      that will map (blocknum,trannum) to the file storage
      location for this block transaction
      This index will be used for the API  GetTransactionsForKey()
      for (chaincode1,key1).  It will do a key range query on chaincode1~key1
      to pick up all chaincode1~key1 records.  Results will indicate
      the set of (blocknum,trannum) transactions that updated this key.
      Change-Id: I81da09e5526d7e2966634c78a03d34011d514442
      Signed-off-by: default avatarMari Wade <mariwade@us.ibm.com>
    • Mari Wade's avatar
      FAB-1140 Ledger History Database framework · d18aa985
      Mari Wade authored
      This is an initial check-in that will
      1) create the history database in couchDB if it does not exist.
      2) add the history commit to the LEDGER Commit if history is enabled
      3) stores the history in the history database
      The History functionality is not enabled unless both
      couchDB and History are enabled in the config.
      Note that tests will be added to validate the writes
      and the actual data written to the database in future
      changes.  The tests to validate history is not possible
      until the query APIs are put in place in future changes.
      Change-Id: Id207007ab5faae957c1e05234e441566a116ea33
      Signed-off-by: default avatarMari Wade <mariwade@us.ibm.com>
  9. 08 Dec, 2016 1 commit
    • senthil's avatar
      FAB-1233 State DB recovery · c0dc54bd
      senthil authored
      We need to recover the state DB when
      (i) the peer fails during commit (partial written state).
      (ii) the database gets corrupted.
      We introduce a new state in DB called savepoint, and update
      it with the block height once all valid tx in the last/recent block is
      Whenever peer starts (first boot up or after a failure), we compare the
      savepoint in DB and block height to see whether the state DB is in
      consistent state. If not, we execute the following steps:
      (i) retrieve all required blocks (#blocks = block height - savepoint)
      from block storage,
      (ii) compute write set for valid tx, commits these values, & update the
      Change-Id: I769d1391de511d3cdb55c40692beb829e2cc5c2f
      Signed-off-by: default avatarsenthil <cendhu@gmail.com>
  10. 01 Dec, 2016 1 commit
  11. 28 Nov, 2016 1 commit
  12. 23 Nov, 2016 1 commit
    • Alessandro Sorniotti's avatar
      TX proposal/endorsement/validation flow (+MSP) · 16fa08e2
      Alessandro Sorniotti authored
      This change set contains a set of functions to generate a transaction (from
      proposal, endorsements and a signing identity) and validate it (given a set
      of root CAs). The validation code will be used by the committer. The tx
      assembling code should be helpful for the SDK team to understand how
      transactions should be assembled. Additionally, it has changed the type of
      messages exchanged everywhere to be of the proper type and with signatures
      (obtained from a fixed identity for now). Finally, it contains an initial
      implementation of VSCC with unit tests (which is however not yet called by
      the committer).
      Change-Id: I375ecc7e61516f3c4ab8fd874aa564e99cc720fb
      Signed-off-by: default avatarAlessandro Sorniotti <ale.linux@sopit.net>
  13. 11 Nov, 2016 1 commit
  14. 26 Oct, 2016 1 commit
  15. 15 Sep, 2016 1 commit