QuestionQ30

Smart Contracts

After the transaction containing the delState("A") function is committed, what occurs to the ledger and state database?

  • A getstate("A") function returns the current state of the key "A".
  • B The deleting transaction sets an empty value to the key "A" in the write set.
  • C The state of the key "A" is removed from the state database, but its history remains in the ledger.
  • D All transaction histories which updated the state "A" are deleted from the ledger.
Explanation

delState deletes the specified key from the committed current state (world-state database). Fabric’s blockchain is an immutable record of state transitions, so deleting the current state does not delete the key’s transaction history from the ledger.

Learn more

Community Discussion

No comments yet. Be the first to start the discussion!