Global

Type Definitions


Block

The JSON representation of a GRPC message "Block".
A Block will contain the configuration of the channel or transactions on the channel. The description area below shows the properties of the "Block" object. When the property name does not have a data type next to it (e.g. -- {int}) then assume it is an object and the indented names below it are it's properties. Complex properties shown within the description area are listed under the "Properties" section (e.g. {Header}). Use the links under the "Type" column to see the description of that object type.

When assigning the results of a block query or block event to a variable called block for example, then to get the block number use
var block_num = block.header.number;
or to see the first transaction id in the block use
var tx_id = block.data.data[0].payload.header.channel_header.tx_id;

A "Block" will have the following JSON layout.
header
   number -- {int}
   previous_hash -- {byte}
   data_hash -- {byte}
data
   data -- [array]
      signature -- {byte}
      payload
         header -- {Header}
         data -- {Config | Transaction}
metadata
   metadata -- [array] #each array item has it's own layout
      [0] #SIGNATURES
         signatures -- [array]
            signature_header
               creator
                  Mspid -- {string}
                  IdBytes -- {byte}
               nonce -- {byte}
            signature -- {byte}
      [1] #LAST_CONFIG
         value
            index -- {number}
         signatures -- [array]
            signature_header
               creator
                  Mspid -- {string}
                  IdBytes -- {byte}
               nonce -- {byte}
            signature -- {byte}
      [2] #TRANSACTIONS_FILTER
          [int] #see TxValidationCode in proto/peer/transaction.proto
 
Type:
  • Object
Properties:
Name Type Description
header Header The header of the block
data Config | Transaction The data bytes will be based on the block.header.channel_header.type
See:
  • protos/common/common.proto

Config

The JSON representation of a GRPC message "Config".
The config object will contain the current channel configuration.

A "Config" will have the following JSON layout.
config
   sequence -- {int}
   channel_group -- {ConfigGroup}
last_update
   signature -- {byte}
   payload
      header -- {Header}
      data -- {ConfigUpdate}
Type:
  • Object
Properties:
Name Type Description
header Header
channel_group ConfigGroup
data ConfigUpdate
See:
  • protos/common/common.proto

ConfigGroup

The JSON representation of a GRPC message "ConfigGroup".
The "ConfigGroup" described here is one that represents the whole configuration of the channel. A "ConfigGroup" object is used to describe the current configuration and it is also used to describe the updates to a configuration. Only those fields being updated will be present when used to describe a configuration update.

A channel level "ConfigGroup" will have the following JSON layout.
      version -- {int}
      mod_policy -- {string}
      groups
         Orderer
            version -- {int}
            groups -- [array]
               <orderer> -- {Organization}
            values
               ConsensusType
                  version -- {int}
                  mod_policy -- {string}
                  value
                     type -- {string}
               BatchSize
                  version -- {int}
                  mod_policy -- {string}
                  value
                     maxMessageCount -- {int}
                     absoluteMaxBytes -- {int}
                     preferredMaxBytes -- {int}
               BatchTimeout
                  version -- {int}
                  mod_policy -- {string}
                  value
                     timeout -- {duration}
               ChannelRestrictions
                  version -- {int}
                  mod_policy -- {string}
                  value
                     max_count -- {int}
            policies
               Admins
                  version -- {int}
                  mod_policy -- {string}
                  policy -- {ImplicitMetaPolicy}
               Writers
                  version -- {int}
                  mod_policy -- {string}
                  policy -- {ImplicitMetaPolicy}
               Readers
                  version -- {int}
                  mod_policy -- {string}
                  policy -- {ImplicitMetaPolicy}
               BlockValidation
                  version -- {int}
                  mod_policy -- {string}
                  policy -- {SignaturePolicy}
         Application
            version -- {int}
            groups
               <peer> -- {Organization}
            values
            policies
               Admins -- {ImplicitMetaPolicy}
                  version -- {int}
                  mod_policy -- {string}
                  policy -- {ImplicitMetaPolicy}
               Writers -- {ImplicitMetaPolicy}
                  version -- {int}
                  mod_policy -- {string}
                  policy -- {ImplicitMetaPolicy}
               Readers -- {ImplicitMetaPolicy}
                  version -- {int}
                  mod_policy -- {string}
                  policy -- {ImplicitMetaPolicy}
      values
         OrdererAddresses
            version -- {int}
            mod_policy -- {string}
            value
               addresses -- [array]
                   {string - host:port}
         HashingAlgorithm
            version -- {int}
            mod_policy -- {string}
            value
               name -- {string}
         BlockDataHashingStructure
            version -- {int}
            mod_policy -- {string}
            value
               width -- {int}
         Consortium
            version -- {int}
            mod_policy -- {string}
            value
               name -- {string}
Type:
  • Object
Properties:
Name Type Description
<orderer> Organization These are the defined "Orderer"s on the network
<peer> Organization These are the defined "Peer"s on the network
policy ImplicitMetaPolicy These policies point to other policies
policy SignaturePolicy
See:
  • protos/common/configtx.proto

ConfigUpdate

The JSON representation of a GRPC message "ConfigUpdate".

A "ConfigUpdate" will have the following JSON layout.
   channel_id -- {string}
   read_set -- {ConfigGroup}
   write_set -- {ConfigGroup}
   signatures -- [array]
      signature_header
         creator
            Mspid -- {string}
            Idbytes -- {byte}
         signature -- {byte}
Type:
  • Object
Properties:
Name Type Description
read_set ConfigGroup A top level GRPC message "ConfigGroup" that represents the current version numbers of the all configuration items being updated
write_set ConfigGroup A top level GRPC message "ConfigGroup that represents the all configuration items being updated. Must have a version number one greater than the version number of the same item in the read_set along with the new value.
See:
  • protos/common/configtx.proto

EnrollmentResponse

Type:
  • Object
Properties:
Name Type Description
enrollmentCert string PEM-encoded X509 enrollment certificate
caCertChain string PEM-encoded X509 certificate chain for the issuing certificate authority

The JSON representation of a GRPC message "Header".

A "Header" will have the following JSON layout.
   channel_header
      type -- {string}
      version -- {int}
      timestamp -- {time}
      channel_id -- {string}
      tx_id -- {string}
      epoch -- {int}
   signature_header
      creator
         Mspid -- {string}
            IdBytes -- {byte}
            nonce -- {string}
Type:
  • Object
See:
  • protos/common/common.proto

HTTPEndpoint

Type:
  • Object
Properties:
Name Type Description
hostname string
port number
protocol string

Identity

Type:
  • Object
Properties:
Name Type Description
role Role Any identity of a particular role
OrganizationUnit Any identities belonging to an organization unit per certificate chain of trust
Identity A specific identity

ImplicitMetaPolicy

The JSON representation of a GRPC message "Policy" that are of type "ImplicitMetaPolicy".

A "ImplicitMetaPolicy" will have the following JSON layout.
type -- IMPLICIT_META
policy
   policy
      sub_policy -- {string}
      rule -- ANY | ALL | MAJORITY
Type:
  • Object
See:
  • protos/common/policies

KeyValueAttribute

Type:
  • Object
Properties:
Name Type Description
name string The key used to reference the attribute
value string The value of the attribute

Organization

The JSON representation of a GRPC message "ConfigGroup".
The "ConfigGroup" described here is one that a single Organization on the Channel.

A organizational "ConfigGroup" will have the following JSON layout.
version -- {int}
mod_policy -- {string}
groups
values
   MSP
      version -- {int}
      mod_policy -- {string}
      value
         type -- {int}
         config
            name -- {string}
            root_certs -- [array]
                {string}
            intermediate_certs -- [array]
                {string}
            admins -- [array]
                {string}
            revocation_list -- [array]
                {string}
            signing_identity -- {byte}
            organizational_unit_identifiers -- [array]
                {string}
policies
   Admins
      version -- {int}
      mod_policy -- {string}
      policy -- {SignaturePolicy}
   Writers
      version -- {int}
      mod_policy -- {string}
      policy -- {SignaturePolicy}
   Readers
      version -- {int}
      mod_policy -- {string}
      policy -- {SignaturePolicy}
Type:
  • Object
Properties:
Name Type Description
policy SignaturePolicy These are the polices that have been pointed to by the implicit policies
See:
  • protos/common/configtx.proto

Policy

Defines the endorsement policies
Type:
  • Object
Properties:
Name Type Description
identities Array.<Identity> List of identities to be referenced in the "policy" section
policy Array.<PolicySpec> The specification of the policy using a combination of "signed-by" and "n-of" structures. The design allows recursion

PolicySpec

Type:
  • Object
Properties:
Name Type Description
type Object The type of policy can be "signed-by" for a single identity signature or "n-of" where "n" is a numeric value. If the type property is "signed-by", the value is the numeric index into the array of identities specified in the policy. If the type property is "n-of", the value is an array of PolicySpec objects. As you can see, this structure allows recursive definitions of complex policies.

Role

Type:
  • Object
Properties:
Name Type Description
name string Name of the role. Value can be "member" or "admin"
mspId string The member service provider Id used to process the identity

SignaturePolicy

The JSON representation of a GRPC message "Policy" that are of type "SignaturePolicy".

A "SignaturePolicy" will have the following JSON layout.
type -- SIGNATURE
policy
   policy
      Type -- n_out_of
      n_out_of
         N -- {int}
         policies -- [array]
            Type -- signed_by
            signed_by -- {int}
      identities -- [array]
         principal_classification -- {int}
         msp_identifier -- {string}
         Role -- MEMBER | ADMIN
Type:
  • Object
See:
  • protos/common/policies

TLSOptions

Type:
  • Object
Properties:
Name Type Argument Default Description
trustedRoots Array.<string> Array of PEM-encoded trusted root certificates
verify boolean <optional>
true Determines whether or not to verify the server certificate when using TLS

Transaction

The JSON representation of a GRPC message "Transaction"

A "Transaction" will have the following JSON layout.
actions
   chaincode_proposal_payload
      input -- {byte}
   action
      proposal_response_payload
         proposal_hash -- {byte}
         extension
            results
               data_model -- {int}
               ns_rwset -- [array]
                  namespace -- {string}
                  rwset
                     reads -- [array]
                        key -- {string}
                        version
                           block_num -- {number}
                           tx_num -- {number}
                     range_queries_info -- [array]
                     writes -- [array]
                        key -- {string}
                        is_delete -- {boolean}
                        value -- {string}
            events
               chaincode_id --  {string}
               tx_id -- {string}
               event_name -- {string}
               payload -- {byte}
            response
               status -- {int}
               message -- {string}
               payload -- {byte}
      endorsements -- [array]
         endorser
            Mspid -- {string]
            IdBytes -- {string}
         signature -- {byte}
Type:
  • Object
See:
  • protos/peer/transaction.proto