Fabric Flashcards

1
Q

World state component

A
  • Describes the state of the ledger at a given point in time.
  • The ledger has a replaceable data store for the world state.
  • By default, this is a LevelDB key-value store database (or CouchDB).
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

Transaction log component

A

Records all transactions which have resulted in the current value of the world state.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

How assets are represented in Hyperledger Fabric

A
  • As a collection of key-value pairs.
  • Can be represented in binary and/or JSON form.
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

Ordering service

A
  • The ordering service is the component which gathers endorsed transactions from applications and orders them into transaction blocks, which are subsequently distributed to every peer node in the channel. It does this according to the policies defined in channel configuration.
  • When acting at the network level, ordering service role is to provide a management point for network resources according to the policies defined in network configuration.
  • When acting at the channel level, orderer role is to gather transactions and distribute blocks inside channel.
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

Membership Service Provider (MSP)

A
  • The mapping of certificates to member organizations.
  • The MSP identifies which Root CAs and Intermediate CAs are accepted to define the members of a trust domain by listing the identities of their members, or by identifying which CAs are authorized to issue valid identities for their members.
  • MSP goes beyond simply listing who is a network participant or member of a channel. It is the MSP that turns an identity into a role by identifying specific privileges an actor has on a node or channel.
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

Smart Contracts, how to create them

A
  • Client application has to go through smart contract to get to ledger.
  • Smart contract must be installed on the peer to access the ledger, and then defined on a channel (instantiated).
  • Each organization needs to approve a chaincode definition
  • Program Logic remains private to those nodes who have installed it
  • Supplied within the chaincode definition (during instantiation) is the endorsement policy. It describes which organizations must approve transactions before they will be accepted by other organizations onto their copy of the ledger.
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

Chaincode vs Smart Contract

A
  • Multiple smart contracts can be defined within the same chaincode.
  • When a chaincode is deployed, all smart contracts within it are made available to applications. Endorsement policy applies to all of the smart contracts defined within it.
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

System Chaincodes

A

Domain independent system interactions, unrelated to these smart contracts for business processes.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

Order-Execute Transaction process

A
  • Validates and orders transactions then propagates them to all peer nodes.
  • Each peer then executes the transactions sequentially.
  • Must be deterministic - for this reason written in DSL like Solidity.
  • Transactions are executed sequentially by all nodes, performance and scale is limited.
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

Execute-Order-Validate Transaction process

A
  • Execute (endorse) a transaction and check its correctness, thereby endorsing it. Each transaction need only be executed (endorsed) by the subset of the peer nodes necessary to satisfy the transaction’s endorsement policy (like - each org must endorse given transaction). This allows for parallel execution increasing overall performance and scale of the system.
  • Order transactions via a (pluggable) consensus protocol.
  • Validate transactions against an application-specific endorsement policy before committing them to the ledger.
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q

Fabric Channel

A
  • In Fabric channels, participants on a Fabric network establish a sub-network where every member has visibility to a particular set of transactions.
  • Channel works like a network tunnel.
  • If two participants form a channel, then those participants — and no others — have copies of the ledger for that channel.
  • Channels contain Membership Service Provider instances allowing for crypto materials to be derived from different certificate authorities.
  • A channel’s ledger contains a configuration block defining policies, access control lists, and other pertinent information.
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
12
Q

What is system channel

A

Using the system channel ordering service nodes distribute network configuration transactions.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
13
Q

How network and channel configurationsare stored

A
  • Every configuration change results in a new configuration block transaction being generated.
  • All peer nodes have a copy of channel configuration.
  • Every ordering service node will have its own copy of the network configuration.
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
14
Q

Private Data on Fabric

A
  • Private data allows collections between members on a channel, allowing much of the same protection as channels without the maintenance overhead of creating and maintaining a separate channel.
  • Thus, channels keep transactions private from the broader network whereas collections keep data private between subsets of organizations on the channel.
  • The actual private data is sent peer-to-peer via gossip protocol to only the organization(s) authorized to see it can be accessed from chaincode on these authorized peers.
  • A hash of that data, which is endorsed, ordered, and written to the ledgers of every peer on the channel. The hash serves as evidence of the transaction and is used for state validation and can be used for audit purposes.
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
15
Q

Peers

A
  • Peer nodes are the network components where copies of the blockchain ledger are hosted.
  • Peer node configuration has an X.509 identity which associates peer with it’s Organization. Orderer uses the channel configuration to determine peer permissions on this channel.
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
16
Q

Types of Peers

A
  • Committing peer(all peers) can validate and subsequently accept or reject transactions onto their copy of the ledger.
  • Only peer nodes with a smart contract installed (Endorsing peer) can take part in the process of transaction endorsement which is central to the generation of valid transactions.
  • Leader peer is a node which takes responsibility for distributing transactions from the orderer to the other committing peers in the organization.
16
Q

Certificate Authorities

A
  • Each Organization has own CA.
  • Dispenses X.509 certificates that can be used to identify components as belonging to the organization.
  • Can also be used to sign transactions to indicate that an organization endorses the transaction result. X.509 certificates are used in client application transaction proposals and smart contract transaction responses to digitally sign transactions.
17
Q

Transaction Workflow

A
  • Client initiates a transaction
    • An application leveraging a supported SDK (Node, Java, Python) utilizes one of the available API’s to generate a transaction proposal.
  • Endorsing peers verify signature & execute the transaction
    • The set of these values, along with the endorsing peer’s signature is passed back as a “proposal response” to the SDK which parses the payload for the application to consume.
  • Proposal responses are inspected
    • The application verifies the endorsing peer signatures and compares the proposal responses to determine if the proposal responses are the same.
    • If the chaincode is only queried the ledger, the application would inspect the query response and would typically not submit the transaction to the ordering service.
  • Client assembles endorsements into a transaction
    • The transaction will contain the read/write sets, the endorsing peers signatures and the Channel ID.
  • Transaction is validated and committed
    • The blocks of transactions are “delivered” to all peers on the channel.
    • The transactions within the block are validated to ensure endorsement policy is fulfilled and to ensure that there have been no changes to ledger state.
    • Each peer will validate distributed blocks independently, but in a deterministic fashion, ensuring that ledgers remain consistent.
  • Ledger updated
    • Each peer appends the block to the channel’s chain, and for each valid transaction the write sets are committed to current state database.