2fast
2fast

Reputation: 1

I would like to know if you can import files into Hyperldeger Fabric

I am new in this field and therefore I am still doing studies and researches, I would like to know if JSON files can be imported in Hyperldeger Fabric--if it is better Hyperledeger Fabric or Fabric Composer. more precisely I would like to understand if there is a way to populate the DLT of Hyperledger Fabric automatically.

for now, I have only tried Hyperledger Composer online playground

Upvotes: 0

Views: 207

Answers (2)

Rodolfo Leal
Rodolfo Leal

Reputation: 537

Fabric don't have any feature to automatically populate the ledger.

You have to develop a solution in order to upoload each Json file and put that on the ledger state.

Any type of data can be inserted on the ledged because it stores byte arrays so its up to you how to serialize.

Upvotes: 2

Mohamed Assem
Mohamed Assem

Reputation: 164

  • in case you're asking to making your chaincode or smart contract like talking to the file system and read file or even call some API to collect JSON files, it could be done but this will break your transaction flow specially during the endorsement process due to during the endorsement process it's expected from each peer to return the same value after executing the transaction against the chaincode to consider the transaction is a valid transaction, so in case one of the endorsers failed to call the API or failed to read file from file system the transaction will considered to be invalid. so it's not recommended to do any third party activity in your chaincode or smart contract even if it's possible to do so.
  • about populating the ledger it can be done it's eventually a database so you can dump it's data, However, if you're trying to backup to recover the ledger in case the whole network down it's impossible due to when you'll reinstall the network the whole config and certificates which were bounded to the transaction will be changed so it has no sense to do it.

Upvotes: 0

Related Questions