Global

Members


<constant> CLIENT

CLIENT indicates that an identity is acting as a client

<constant> HFAFFILIATIONMGR

HFAFFILIATIONMGR is a boolean attribute that allows an identity to manage affiliations

<constant> HFGENCRL

HFGENCRL is an attribute that allows an identity to generate a CRL

<constant> HFINTERMEDIATECA

HFINTERMEDIATECA is a boolean attribute that allows an identity to enroll as an intermediate CA

<constant> HFREGISTRARATTRIBUTES

HFREGISTRARATTRIBUTES is an attribute that has a list of attributes that the registrar is allowed to register for an identity

<constant> HFREGISTRARDELEGATEROLES

HFREGISTRARDELEGATEROLES is an attribute that allows a registrar to give the roles specified to a registree for its 'hf.Registrar.Roles' attribute

<constant> HFREGISTRARROLES

HFREGISTRARROLES is an attribute that allows a registrar to manage identities of the specified roles

<constant> HFREVOKER

HFREVOKER is a boolean attribute that allows an identity to revoker a user and/or certificates

<constant> ORDERER

ORDERER indicates that an identity is acting as an orderer

<constant> PEER

PEER indicates that an identity is acting as a peer

<constant> USER

USER indicates that an identity is acting as a user

Methods


loadConfigGroup(config_items, versions, group, name, org, top)

utility method to load in a config group
Parameters:
Name Type Description
config_items Object holder of values found in the configuration
versions Object
group Object used for recursive calls
name string used to help with the recursive calls
org string Organizational name
top bool to handle the differences in the structure of groups
See:
  • /protos/common/configtx.proto

loadConfigValue()

utility method to load in a config value
See:
  • /protos/common/configtx.proto
  • /protos/msp/mspconfig.proto
  • /protos/orderer/configuration.proto
  • /protos/peer/configuration.proto

package(chaincodePath, chaincodeType, devmode, metadataPath)

Utility function to package a chaincode. The contents will be returned as a byte array.
Parameters:
Name Type Description
chaincodePath string required - String of the path to location of the source code of the chaincode
chaincodeType string String of the type of chaincode ['golang', 'node', 'car', 'java'] (default 'golang')
devmode boolean Set to true to use chaincode development mode
metadataPath string Optional. The path to the top-level directory containing metadata descriptors
Returns:
A promise for the data as a byte array
Type
Promise

toEnvelope(signature, proposal_bytes)

convert proposal.proto:SignedProposal to be common.proto:Envelope
Parameters:
Name Type Description
signature
proposal_bytes

Type Definitions


AffiliationRequest

Type:
  • Object
Properties:
Name Type Description
name string Required. The affiliation path to create
caname string Optional. Name of the CA to send the request to within the Fabric CA server
force boolean Optional.
  • For create affiliation request, if any of the parent affiliations do not exist and 'force' is true, create all parent affiliations also.
  • For delete affiliation request, if force is true and there are any child affiliations or any identities are associated with this affiliation or child affiliations, these identities and child affiliations will be deleted; otherwise, an error is returned.
  • For update affiliation request, if any identities are associated with this affiliation, 'force' is true causes these identities' affiliations to be renamed; otherwise, an error is returned.

Block

An object of a fully decoded protobuf message "Block".

A Block may contain the configuration of the channel or transactions on the channel.

A Block object will have the following object structure.
header
	number -- {int}
	previous_hash -- {byte[]}
	data_hash -- {byte[]}
data
	data -- {array}
		signature -- {byte[]}
		payload
			header -- {Header}
			data -- {ConfigEnvelope | Transaction}
metadata
	metadata -- {array} #each array item has it's own layout
		[0] #SIGNATURES
			signatures -- {MetadataSignature[]}
		[1] #LAST_CONFIG
			value
				index -- {number}
				signatures -- {MetadataSignature[]}
		[2] #TRANSACTIONS_FILTER
				{int[]} #see TxValidationCode in proto/peer/transaction.proto
Type:
  • Object
Examples

Get the block number:

var block_num = block.header.number;

Get the number of transactions, including the invalid transactions:

var block_num = block.data.data.legnth;

Get the Id of the first transaction in the block:

var tx_id = block.data.data[0].payload.header.channel_header.tx_id;

BlockchainInfo

Type:
  • Object
Properties:
Name Type Description
height number How many blocks exist on the channel's ledger
currentBlockHash Array.<byte> A block hash is calculated by hashing over the concatenated ASN.1 encoded bytes of: the block number, previous block hash, and current block data hash. It's the chain of the block hashs that guarantees the immutability of the ledger
previousBlockHash Array.<byte> The block hash of the previous block.

BroadcastResponse

Type:
  • Object
Properties:
Name Type Description
status string Value is 'SUCCESS' or a descriptive error string
info string Optional. Additional information about the status

ChaincodeEvent

Type:
  • Object
Properties:
Name Type Description
chaincode_id string
tx_id string
event_name string
payload Array.<byte> Application-specific byte array that the chaincode set when it called stub.SetEvent(event_name, payload)

ChaincodeInfo

Type:
  • Object
Properties:
Name Type Description
name string
version string
path string the path as specified by the install/instantiate transaction
input string the chaincode function upon instantiation and its arguments. This will be blank if the query is returning information about installed chaincodes.
escc string the name of the ESCC for this chaincode. This will be blank if the query is returning information about installed chaincodes.
vscc string the name of the VSCC for this chaincode. This will be blank if the query is returning information about installed chaincodes.

ChaincodeInstallRequest

Type:
  • Object
Properties:
Name Type Description
targets Array.<Peer> | Array.<string> Optional. An array of Peer objects or peer names where the chaincode will be installed. When excluded, the peers assigned to this client's organization will be used as defined in the network configuration. If the 'channelNames' property is included, the target peers will be based the peers defined in the channels.
chaincodePath string Required. The path to the location of the source code of the chaincode. If the chaincode type is golang, then this path is the fully qualified package name, such as 'mycompany.com/myproject/mypackage/mychaincode'
metadataPath string Optional. The path to the top-level directory containing metadata descriptors.
chaincodeId string Required. Name of the chaincode
chaincodeVersion string Required. Version string of the chaincode, such as 'v1'
chaincodePackage Array.<byte> Optional. Byte array of the archive content for the chaincode source. The archive must have a 'src' folder containing subfolders corresponding to the 'chaincodePath' field. For instance, if the chaincodePath is 'mycompany.com/myproject/mypackage/mychaincode', then the archive must contain a folder 'src/mycompany.com/myproject/mypackage/mychaincode', where the chaincode source code resides.
chaincodeType string Optional. Type of chaincode. One of 'golang', 'car', 'node' or 'java'. Default is 'golang'.
channelNames Array.<string> | string Optional. When no targets are provided. The loaded network configuration will be searched for suitable target peers. Peers that are defined in the channels named by this property and in this client's organization and that are in the endorsing or chain code query role on the named channel will be selected.
txId TransactionID Optional. TransactionID object for this request.

ChaincodeInstantiateUpgradeRequest

Type:
  • Object
Properties:
Name Type Description
targets Array.<Peer> | Array.<string> Optional. An array of endorsing Peer objects or peer names as the targets of the request. When this parameter is omitted the target list will include peers assigned to this channel instance that are in the endorsing role.
chaincodeType string Optional. Type of chaincode. One of 'golang', 'car', 'java' or 'node'. Default is 'golang'. Note that 'java' is not yet supported.
chaincodeId string Required. The name of the chaincode
chaincodeVersion string Required. Version string of the chaincode, such as 'v1'
txId TransactionID Required. Object with the transaction id and nonce
collections-config string Optional. The path to the collections config. More details can be found at this tutorial
transientMap map Optional. map that can be used by the chaincode during initialization, but not saved in the ledger. Data such as cryptographic information for encryption can be passed to the chaincode using this technique.
fcn string Optional. The function name to be returned when calling stub.GetFunctionAndParameters() in the target chaincode. Default is 'init'.
args Array.<string> Optional. Array of string arguments to pass to the function identified by the fcn value.
endorsement-policy Object Optional. EndorsementPolicy object for this chaincode (see examples below). If not specified, a default policy of "a signature by any member from any of the organizations corresponding to the array of member service providers" is used. WARNING: The default policy is NOT recommended for production, because this allows an application to bypass the proposal endorsement and send a manually constructed transaction, with arbitrary output in the write set, to the orderer directly. The user context assigned to the client instance that creates the signature will allow the transaction to be successfully validated and committed to the ledger.
Examples

Endorsement policy: "Signed by any member from one of the organizations"

{
  identities: [
    { role: { name: "member", mspId: "org1" }},
    { role: { name: "member", mspId: "org2" }}
  ],
  policy: {
    "1-of": [{ "signed-by": 0 }, { "signed-by": 1 }]
  }
}

Endorsement policy: "Signed by admin of the ordererOrg and any member from one of the peer organizations"

{
  identities: [
    { role: { name: "member", mspId: "peerOrg1" }},
    { role: { name: "member", mspId: "peerOrg2" }},
    { role: { name: "admin", mspId: "ordererOrg" }}
  ],
  policy: {
    "2-of": [
      { "signed-by": 2},
      { "1-of": [{ "signed-by": 0 }, { "signed-by": 1 }]}
    ]
  }
}

ChaincodeInvocationSpec

An endorsement proposal, which includes the name of the chaincode to be invoked and the arguments to be passed to the chaincode.

A "ChaincodeInvocationSpec" has the following object structure.
chaincode_spec
	type -- {int}
	chaincode_id
		path -- {string}
		name -- {string}
		version -- {string}
	input
		args -- {byte[][]}
		decorations -- {map of string to byte[]}
	timeout -- {int}
Type:
  • Object

ChaincodeInvokeRequest

Type:
  • Object
Properties:
Name Type Description
targets Array.<Peer> | Array.<string> Optional. The peers that will receive this request, when not provided the list of peers added to this channel object will be used. When this channel has been initialized using the discovery service the proposal will be sent to the peers on the list provided discovery service if no targets are specified.
chaincodeId string Required. The id of the chaincode to process the transaction proposal
endorsement_hint DiscoveryChaincodeIntereset Optional. A of DiscoveryChaincodeInterest object that will be used by discovery service to calculate an appropriate endorsement plan. The parameter is only required when the endorsement will be preformed by a chaincode that will call other chaincodes or if the endorsement should be made by only peers within a collection or collections.
txId TransactionID Optional. TransactionID object with the transaction id and nonce. txId is required for sendTransactionProposal and optional for generateUnsignedProposal
transientMap map Optional. map that can be used by the chaincode but not saved in the ledger, such as cryptographic information for encryption
fcn string Optional. The function name to be returned when calling stub.GetFunctionAndParameters() in the target chaincode. Default is 'invoke'
args Array.<string> An array of string arguments specific to the chaincode's 'Invoke' method
ignore Array.<string> Optional. An array of strings that represent the names of peers that should be ignored by the endorsement. This list only applies to endorsements using the discovery service.
preferred Array.<string> Optional. An array of strings that represent the names of peers that should be given priority by the endorsement. This list only applies to endorsements using the discovery service.

ChaincodeQueryRequest

Type:
  • Object
Properties:
Name Type Description
targets Array.<Peer> Optional. The peers that will receive this request, when not provided the list of peers added to this channel object will be used.
chaincodeId string Required. The id of the chaincode to process the transaction proposal
transientMap map Optional. map that can be used by the chaincode but not saved in the ledger, such as cryptographic information for encryption
fcn string Optional. The function name to be returned when calling stub.GetFunctionAndParameters() in the target chaincode. Default is 'invoke'
args Array.<string> An array of string arguments specific to the chaincode's 'Invoke' method
request_timeout integer The timeout value to use for this request

ChaincodeQueryResponse

Type:
  • Object
Properties:
Name Type Description
chaincodes Array.<ChaincodeInfo>

ChannelConfigGroup

The configuration settings that govern how the fabric should maintain a channel are included in the blocks of the channel itself. When a block contains the channel configuration, the channel configuration record is the only item in the block's data array. Every block, including the configuration blocks themselves, has a pointer to the latest configuration block, making it easy to query for the latest channel configuration settings.

A channel configuration record will have the following object structure.
version -- {int}
mod_policy -- {string}
groups
	Orderer
		version -- {int}
		groups
			<orderer_org_name> -- {OrganizationConfigGroup}
		values
			ConsensusType
				version -- {int}
				mod_policy -- {string}
				value
					type -- {string}
			BatchSize
				version -- {int}
				mod_policy -- {string}
				value
					max_message_count -- {int}
					absolute_max_bytes -- {int}
					preferred_max_bytes -- {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_org_name> -- {OrganizationConfigGroup}
		values
		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}
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
groups.Orderer.groups.<orderer_org_name> OrganizationConfigGroup These are the orderer organizatoin names defined on the network
groups.Application.groups.<peer_org_name> OrganizationConfigGroup These are the peer organization names defined on the network
policy ImplicitMetaPolicy These policies point to other policies and specify a threshold as in "ANY", "MAJORITY" or "ALL"

ChannelInfo

Type:
  • Object
Properties:
Name Type Description
channel_id string

ChannelPeerRoles

Type:
  • Object
Properties:
Name Type Description
endorsingPeer boolean Optional. This peer may be sent transaction proposals for endorsements. The peer must have the chaincode installed. The app can also use this property to decide which peers to send the chaincode install request. Default: true
chaincodeQuery boolean Optional. This peer may be sent transaction proposals meant only as a query. The peer must have the chaincode installed. The app can also use this property to decide which peers to send the chaincode install request. Default: true
ledgerQuery boolean Optional. This peer may be sent query proposals that do not require chaincodes, like queryBlock(), queryTransaction(), etc. Default: true
eventSource boolean Optional. This peer may be the target of a event listener registration? All peers can produce events, but the appliatiion typically only needs to connect to one. Default: true
discover boolean Optional. This peer may be the target of service discovery. Default: true

ChannelQueryResponse

Type:
  • Object
Properties:
Name Type Description
channels Array.<ChannelInfo>

ChannelRequest

Type:
  • Object
Properties:
Name Type Description
name string Required. The name of the new channel
orderer Orderer | string Required. An Orderer object or an orderer name representing the orderer node to send the channel create request
envelope Array.<byte> Optional. Bytes of the envelope object containing all required settings and signatures to initialize this channel. This envelope would have been created by the command line tool configtxgen or configtxlator
config Array.<byte> Optional. Protobuf ConfigUpdate object extracted from a ConfigEnvelope created by the configtxgen tool. See extractChannelConfig(). The ConfigUpdate object may also be created by the configtxlator tool.
signatures Array.<ConfigSignature> | Array.<string> Required. The list of signatures required by the channel creation or update policy when using the `config` parameter.
txId TransactionID Required. TransactionID object with the transaction id and nonce

collectionConfig

Type:
  • Object
Properties:
Name Type Description
name string
policy
maxPeerCount number integer
requiredPeerCount number integer
blockToLive Long | number | string | Object param will be converted to unsigned int64 as Long

ConfigEnvelope

A ConfigEnvelope contains the channel configurations data and is the main content of a configuration block. Another type of blocks are those that contain endorser transactions, where the main content is an array of Transaction.

A "ConfigEnvelope" will have the following object structure.
config
	sequence -- {int}
	channel_group -- {ConfigGroup}
	type -- {int}
last_update
	signature -- {byte[]}
	payload
		header -- {Header}
		data -- {ConfigUpdateEnvelope}
Type:
  • Object

ConfigSignature

Type:
  • Object
Properties:
Name Type Description
signature_header Array.<byte> Encoded bytes of a SignatureHeader
signature Array.<byte> Encoded bytes of the signature over the concatenation of the signatureHeader bytes and config bytes

ConfigUpdateEnvelope

An object of a protobuf message "ConfigUpdateEnvelope".

A "ConfigUpdateEnvelope" will have the following object structure.
config_update
	channel_id -- {string}
	read_set -- {ChannelConfigGroup}
	write_set -- {ChannelConfigGroup}
	type -- {int}
signatures -- {array}
	signature_header -- {SignatureHeader}
	signature -- {byte[]}
Type:
  • Object
Properties:
Name Type Description
config_update.read_set ChannelConfigGroup A set of the current version numbers of all configuration items being updated
config_update.write_set ChannelConfigGroup A set of 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.

ConnectionOpts

Type:
  • Object
Properties:
Name Type Description
name string Optional. To gives this remote endpoint a name. The endpoint will be known by its URL if no name is provided.
request-timeout string An integer value in milliseconds to be used as maximum amount of time to wait on the request to respond.
pem string The certificate file, in PEM format, to use with the gRPC protocol (that is, with TransportCredentials). Required when using the grpcs protocol.
ssl-target-name-override string Used in test environment only, when the server certificate's hostname (in the 'CN' field) does not match the actual host endpoint that the server process runs at, the application can work around the client TLS verify failure by setting this property to the value of the server certificate's hostname
<any> any any other standard grpc call options will be passed to the grpc service calls directly

CouchDBOpts

Type:
  • Object
Properties:
Name Type Description
url string The CouchDB instance url, in the form of http(s)://:@host:port
name string Optional. Identifies the name of the database to use. Default: member_db.

CryptoContent

Type:
  • Object
Properties:
Name Type Description
privateKey string the PEM file path for the private key
privateKeyPEM string the PEM string for the private key (not required if privateKey or privateKeyObj is set)
privateKeyObj module:api.Key private key object (not required if privateKey or privateKeyPEM is set)
signedCert string the PEM file path for the certificate
signedCertPEM string the PEM string for the certificate (not required if signedCert is set)

CryptoSetting

Type:
  • Object
Properties:
Name Type Description
software boolean Whether to load a software-based implementation (true) or HSM implementation (false) default is true (for software based implementation), specific implementation module is specified in the setting 'crypto-suite-software'
keysize number The key size to use for the crypto suite instance. default is value of the setting 'crypto-keysize'
algorithm string Digital signature algorithm, currently supporting ECDSA only with value 'EC'
hash string 'SHA2' or 'SHA3'

DiscoveryChaincodeCall

Type:
  • Object
Properties:
Name Type Description
name string The name of the chaincode
collection_names Array.<string> The names of the related collections
Examples

"single chaincode"

{ name: "mychaincode"}

"chaincode to chaincode"

[ { name: "mychaincode"}, { name: "myotherchaincode"} ]

"single chaincode with a collection"

{ name: "mychaincode", collection_names: ["mycollection"] }

"chaincode to chaincode with a collection"

[
    { name: "mychaincode", collection_names: ["mycollection"] },
    { name: "myotherchaincode", collection_names: ["mycollection"] }}
  ]

"chaincode to chaincode with collections"

[
    { name: "mychaincode", collection_names: ["mycollection", "myothercollection"] },
    { name: "myotherchaincode", collection_names: ["mycollection", "myothercollection"] }}
  ]

DiscoveryChaincodeInterest

Type:
  • Object
Properties:
Name Type Description
chaincodes Array.<DiscoveryChaincodeCall> The chaincodes names and collections that will be sent to the discovery service to calculate an endorsement plan.

DiscoveryChaincodeQuery

Requests DiscoveryResults for a given list invocations. Each interest is a separate invocation of one or more chaincodes, which may include invocation on collections. The endorsement policy is evaluated independantly for each given interest.
Type:
  • Object
Properties:
Name Type Description
interests Array.<DiscoveryChaincodeInterest> defines interests in an invocations of chaincodes
Examples

"chaincode and no collection"

{
  interests: [
    { chaincodes: [{ name: "mychaincode"}]}
  ]
}

"chaincode with collection"

{
  interests: [
    { chaincodes: [{ name: "mychaincode", collection_names: ["mycollection"] }]}
  ]
}

"chaincode to chaincode with collection"

{
  interests: [
     { chaincodes: [
         { name: "mychaincode", collection_names: ["mycollection"] }},
         { name: "myotherchaincode", collection_names: ["mycollection"] }}
       ]
     }
  ]
}

"query for multiple invocations"

{
  interests: [
     { chaincodes: [
         { name: "mychaincode", collection_names: ["mycollection"] }},
         { name: "myotherchaincode", collection_names: ["mycollection"] }}
       ]
     },
    { chaincodes: [{ name: "mychaincode", collection_names: ["mycollection"] }]},
    { chaincodes: [{ name: "mychaincode"}]}
  ]
}

DiscoveryResultChaincode

Type:
  • Object
Properties:
Name Type Description
name string
version string

DiscoveryResultEndorsementGroup

Type:
  • Object
Properties:
Name Type Description
peers Array.<DiscoveryResultPeer> the peers in this group

DiscoveryResultEndorsementLayout

lists the group names, and the amount of signatures needed from each group.
Type:
  • Object.<string, number>

DiscoveryResultEndorsementPlan

Type:
  • Object
Properties:
Name Type Description
chaincode string The chaincode name that is the first chaincode in the interest that was used to calculate this plan.
plan_id string The string of the JSON object that represents the hint that was used to build the query for this result. The hint is a DiscoveryChaincodeInterest that contains chaincode names and collections that the discovery service uses to calculate the returned plan.
groups Object.<string, DiscoveryResultEndorsementGroup> Specifies the endorsers, separated to groups.
layouts Array.<DiscoveryResultEndorsementLayout> Specifies options of fulfulling the endorsement policy

DiscoveryResultEndpoint

Type:
  • Object
Properties:
Name Type Description
host string
port number
name string Optional. the name of this endpoint

DiscoveryResultEndpoints

Type:
  • Object
Properties:
Name Type Description
endpoints Array.<DiscoveryResultEndpoint>

DiscoveryResultMSPConfig

Type:
  • Object
Properties:
Name Type Description
rootCerts string List of root certificates trusted by this MSP. They are used upon certificate validation.
intermediateCerts string List of intermediate certificates trusted by this MSP. They are used upon certificate validation as follows: Validation attempts to build a path from the certificate to be validated (which is at one end of the path) and one of the certs in the RootCerts field (which is at the other end of the path). If the path is longer than 2, certificates in the middle are searched within the IntermediateCerts pool.
admins string Identity denoting the administrator of this MSP
id string the identifier of the MSP
orgs Array.<string> fabric organizational unit identifiers that belong to this MSP configuration
tls_root_certs string TLS root certificates trusted by this MSP
tls_intermediate_certs string TLS intermediate certificates trusted by this MSP

DiscoveryResultPeer

Type:
  • Object
Properties:
Name Type Description
mspid string
endpoint string host:port for this peer
ledger_height Long
name string
chaincodes Array.<DiscoveryResultChaincode>

DiscoveryResultPeers

Type:
  • Object
Properties:
Name Type Description
peers Array.<DiscoveryResultPeer>

DiscoveryResults

Type:
  • Object
Properties:
Name Type Description
msps Object.<string, DiscoveryResultMSPConfig> Optional. The msp config found.
orderers Object.<string, DiscoveryResultEndpoints> Optional. The orderers found.
peers_by_org Object.<string, DiscoveryResultPeers> Optional. The peers by org found.
endorsement_plans Array.<DiscoveryResultEndorsementPlan> Optional.
timestamp number The timestamp at which the discovery results are updated.

Endorsement

An endorsement is a signature of an endorser over a proposal response. By producing an endorsement message, an endorser implicitly "approves" that proposal response and the actions contained therein. When enough endorsements have been collected, a transaction can be generated out of a set of proposal responses

An endorsement message has the following structure:
endorser
	Mspid -- {string]
	IdBytes -- {byte[]}
signature -- {byte[]}
Type:
  • Object

EventHubRegistrationRequest

Type:
  • Object
Properties:
Name Type Description
identity Identity the identity who is doing this registration
txId TransactionID a transaction id for this registration
certificate string The certificate file, in PEM format
mspId string The member service provider Id used to process the identity

Headers describe basic information about a transaction record, such as its type (configuration update, or endorser transaction, etc.), the id of the channel it belongs to, the transaction id and so on. The header message also contains a common field SignatureHeader that describes critical information about how to verify signatures.

A "Header" will have the following object structure.
channel_header
	type -- {string}
	version -- {int}
	timestamp -- {time}
	channel_id -- {string}
	tx_id -- {string}
	epoch -- {int}
signature_header -- {SignatureHeader}
Type:
  • Object

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

IdentityRequest

Type:
  • Object
Properties:
Name Type Description
enrollmentID string Required. The enrollment ID which uniquely identifies an identity
affiliation string Required. The affiliation path of the new identity
attrs Array.<KeyValueAttribute> Array of KeyValueAttribute attributes to assign to the user
type string Optional. The type of the identity (e.g. *user*, *app*, *peer*, *orderer*, etc)
enrollmentSecret string Optional. The enrollment secret. If not provided, a random secret is generated.
maxEnrollments number Optional. The maximum number of times that the secret can be used to enroll. If 0, use the configured max_enrollments of the fabric-ca-server; If > 0 and <= configured max enrollments of the fabric-ca-server, use max_enrollments; If > configured max enrollments of the fabric-ca-server, error.
caname string Optional. Name of the CA to send the request to within the Fabric CA server

ImplicitMetaPolicy

ImplicitMetaPolicy is a policy type which depends on the hierarchical nature of the configuration It is implicit because the rule is generate implicitly based on the number of sub policies It is meta because it depends only on the result of other policies

When evaluated, this policy iterates over all immediate child sub-groups, retrieves the policy of name sub_policy, evaluates the collection and applies the rule.

For example, with 4 sub-groups, and a policy name of "Readers", ImplicitMetaPolicy retrieves each sub-group, retrieves policy "Readers" for each subgroup, evaluates it, and, in the case of ANY 1 satisfied is sufficient, ALL would require 4 signatures, and MAJORITY would require 3 signatures.

An "ImplicitMetaPolicy" will have the following object structure.
type -- IMPLICIT_META
policy
	sub_policy -- {string}
	rule -- ANY | ALL | MAJORITY
Type:
  • Object

InitializeRequest

Type:
  • Object
Properties:
Name Type Description
target string | Peer | ChannelPeer Optional. The target peer to be used to make the initialization requests for configuration information. Default is to use the first ChannelPeer assigned to this channel.
discover boolean Optional. Use the discovery service on the the target peer to load the configuration and network information. Default is true. When set to false the target peer will use base Peer query to load only the configuration information.
endorsementHandler string Optional. The path to a custom endorsement handler implementing EndorsementHandler.
commitHandler string Optional. The path to a custom commit handler implementing CommitHandler.
asLocalhost boolean Optional. Convert discovered host addresses to be 'localhost'. Will be needed when running a docker composed fabric network on the local system.
configUpdate Array.<byte> Optional. To initialize this channel with a serialized ConfigUpdate protobuf object.

JoinChannelRequest

Type:
  • Object
Properties:
Name Type Description
targets Array.<Peer> | Array.<string> Optional. An array of Peer objects or Peer names that will be asked to join this channel. When using Peer names or left empty (use default targets) there must be a loaded network configuration. See loadFromConfig()
block Array.<byte> The encoded bytes of the channel's genesis block. See getGenesisBlock() method
txId TransactionID Required. TransactionID object with the transaction id and nonce

MetadataSignature

A signature over the metadata of a block, to ensure the authenticity of the metadata that describes a Block.
signature_header {SignatureHeader}
signature -- {byte[]}
Type:
  • Object

OrdererRequest

Type:
  • Object
Properties:
Name Type Description
txId TransactionID Optional. Object with the transaction id and nonce
orderer Orderer Optional. The orderer instance or string name of the orderer to retrieve genesis block from

OrganizationConfigGroup

Each participating organization of the channel gets represented in a section in the configuration block as described below. Critical information about the organzation such as its Membership Service Provider (MSP) content and its pre-defined policies that form the basis of the channel's access control policies (Admins, Writers and Readers) are contained in these sections.

A organizational configuration will have the following object structure.
version -- {int}
mod_policy -- {string}
values
	MSP
		version -- {int}
		mod_policy -- {string}
		value
			type -- {int}
			config
				name -- {string}
				root_certs -- {string[]}
				intermediate_certs -- {string[]}
				admins -- {string[]}
				revocation_list -- {string[]}
				signing_identity -- {byte[]}
				organizational_unit_identifiers -- {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

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.

ProcessedTransaction

Type:
  • Object
Properties:
Name Type Description
validationCode number See this list for all the defined validation codes
transactionEnvelope Object Encapsulates the transaction and the signature over it. It has the following structure:
signature -- {byte[]}
payload -- {}
	header -- {Header}
	data -- {Transaction}

ProposalRequest

Type:
  • Object
Properties:
Name Type Description
fcn string Required. The function name.
args Array.<string> Required. Arguments to send to chaincode.
chaincodeId string Required. ChaincodeId.
argbytes Buffer Optional. Include when an argument must be included as bytes.
transientMap map Optional. The Map that can be used by the chaincode but not saved in the ledger, such as cryptographic information for encryption.

ProposalResponse

A protobuf message that gets returned by endorsing peers on proposal requests. The peer node runs the target chaincode, as designated by the proposal, and decides on whether to endorse the proposal or not, and sends back the endorsement result along with the read and write sets inside the proposal response message.
Type:
  • Object
Properties:
Name Type Description
version number
timestamp Timestamp Time the proposal was created by the submitter
response Response
payload Array.<byte> The payload of the response. It is the encoded bytes of the "ProposalResponsePayload" protobuf message
endorsement Endorsement The endorsement of the proposal, basically the endorser's signature over the payload

ProposalResponseObject

All calls to the endorsing peers for proposal endorsement return this standard array of objects.
Type:
  • array
Properties:
Name Type Description
index:0 Array.<ProposalResponse> Array of ProposalResponse objects from the endorsing peers
index:1 Object The original Proposal object needed when sending the transaction request to the orderer

RegistrationOpts

Type:
  • Object
Properties:
Name Type Description
startBlock integer Optional - The starting block number for event checking. When included, the peer's channel event service will be asked to start sending blocks from this block number. This is how to resume or replay missed blocks that were added to the ledger. Default is the latest block on the ledger. Setting a startBlock may confuse other event listeners, therefore only one listener will be allowed on a ChannelEventHub when a startBlock is being used.
endBlock integer | 'newest' Optional - The ending block number for event checking. The value 'newest' to indicate that endBlock will be calculated by the peer as the newest block on the ledger. This allows the application to replay up to the latest block on the ledger and then the listener will stop and be notified by the 'onError' callback. When included, the peer's channel event service will be asked to stop sending blocks once this block is delivered. This is how to replay missed blocks that were added to the ledger. When a startBlock is not included, the endBlock must be equal to or larger the current channel block height. Setting an endBlock may confuse other event listeners, therefore only one listener will be allowed on a ChannelEventHub when an endBlock is being used.
unregister boolean Optional - This options setting indicates the registration should be removed (unregister) when the event is seen. When the application is using a timeout to only wait a specified amount of time for the transaction to be seen, the timeout processing should included the manual 'unregister' of the transaction event listener to avoid the event callbacks being called unexpectedly. The default for this setting is different for the different type of event listeners. For block listeners the default is true, however the event listener is assumed to have seen the final event only if the end_block was set as a option and that end_block was seen by the the listener. For transaction listeners the default is true and the listener will be unregistered when a transaction with the id is seen by this listener. For chaincode listeners the default will be false as the match filter might be intended for many transactions rather than a specific transaction or block as in the other listeners.
disconnect boolean Optional - This option setting Indicates to the ChannelEventHub instance to automatically disconnect itself from the peer's channel event service once the event has been seen. The default is false unless the endBlock has been set, then it it will be true.

REQUEST_TIMEOUT

The Error message string that indicates that the request operation has timed out due to a remote node issue. If there is an issue with the local system a 'SYSTEM_TIMEOUT' error message will be returned. The operation will only use one timer for both types of timeouts. The timer will start running as the operation begins. If the timer expires before the local instance is able to make the outbound request then 'SYSTEM_TIMEOUT' error will be returned. If the local instance is able to make the outbound request and the timer expires before the remote node responds then the 'REQUEST_TIMEOUT' is returned. The timer is controlled by the 'request-timeout' setting or passed on a call that makes an outbound request
Type:
  • Error
Examples
'client.setConfigSetting('request-timeout', 3000)'
          
'channel.sendTranaction(request, 3000)'

Response

A response message indicating whether the endorsement of the proposal was successful
Type:
  • Object
Properties:
Name Type Description
status number Status code. Follows HTTP status code definitions
message string A message associated with the response status code
payload Array.<byte> A payload that can be used to include metadata with this response

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

ServiceResponse

Type:
  • Object
Properties:
Name Type Description
Success boolean Boolean indicating if the request was successful
Result Object The result of this request
Errors Array.<ServiceResponseMessage> An array of error messages (code and message)
Messages Array.<ServiceResponseMessage> An array of information messages (code and message)

ServiceResponseMessage

Type:
  • Object
Properties:
Name Type Description
code number Integer code denoting the type of message
message string A more specific message

SignatureHeader

An object that is part of all signatures in Hyperledger Fabric. The "creator" field has two important pieces of information about the identity of the signer, the organization (Mspid) that the signer belongs to, and the certificate (IdBytes). The "nonce" field is a unique value to guard against replay attacks.
creator
	Mspid -- {string}
	IdBytes -- {byte[]}
nonce -- {byte[]}
Type:
  • Object

SignaturePolicy

SignaturePolicy is a recursive message structure which defines a featherweight DSL for describing policies which are more complicated than 'exactly this signature'. The NOutOf operator is sufficent to express AND as well as OR, as well as of course N out of the following M policies.

SignedBy implies that the signature is from a valid certificate which is signed by the trusted authority specified in the bytes. This will be the certificate itself for a self-signed certificate and will be the CA for more traditional certificates

A "SignaturePolicy" will have the following object structure.
type -- SIGNATURE
rule
	Type -- n_out_of
	n_out_of
		N -- {int}
		rules -- {array}
			Type -- signed_by
			signed_by -- {int}
	identities -- {array}
		principal_classification -- {int}
		msp_identifier -- {string}
		Role -- MEMBER | ADMIN
Type:
  • Object

SignedCommitProposal

Type:
  • Object
Properties:
Name Type Description
request TransactionRequest Required. The commit request
signedTransaction Buffer Required. The signed transaction
orderer Orderer | string Optional. The orderer instance or string name of the orderer to operate. See Client.getTargetOrderer

SignedEvent

Type:
  • Object
Properties:
Name Type Description
signature Buffer the signature over this payload
payload Buffer the payload byte array to be send to peer

SignedProposal

Type:
  • Object
Properties:
Name Type Description
targets Array.<Peer> Required. The function name.
signedProposal Buffer Required. The signed endorse proposal

SYSTEM_TIMEOUT

The Error message string that indicates that the request operation has timed out due to a system issue. This will indicate that the issue is local rather than remote. If there is an issue with the remote node a 'REQUEST_TIMEOUT' error message will be returned. The operation will only use one timer for both types of timeouts. The timer will start running as the operation begins. If the timer expires before the local instance is able to make the outbound request then 'SYSTEM_TIMEOUT' error will be returned. If the local instance is able to make the outbound request and the timer expires before the remote node responds then the 'REQUEST_TIMEOUT' is returned. The timer is controlled by the 'request-timeout' setting or passed on a call that makes an outbound request
Type:
  • Error
Examples
'client.setConfigSetting('request-timeout', 3000)'
          
'channel.sendTranaction(request, 3000)'

Transaction

A Transaction, or "Endorser Transaction", is the result of invoking chaincodes to collect endorsements, getting globally ordered in the context of a channel, and getting validated by the committer peer as part of a block before finally being formally "committed" to the ledger inside a Block. Each transaction contains an array of "actions" representing different steps for executing a transaction, and those steps will be processed atomically, meaning if any one step failed then the whole transaction will be marked as rejected.

Each entry of the "actions" array contains a chaincode proposal and corresponding proposal responses that encapsulate the endorsing peer's decisions on whether the proposal is considered valid. Note that even if a transaction proposal(s) is considered valid by the endorsing peers, it may still be rejected by the committers during transaction validation. Whether a transaction as a whole is valid or not, is not reflected in the transaction record itself, but rather recorded in a separate field in the Block's metadata.

A "Transaction" will have the following object structure.
actions {array}
	header -- {SignatureHeader}
	payload
		chaincode_proposal_payload
			input -- {ChaincodeInvocationSpec} for a endorser transaction
		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}
								metadata_writes -- {array}
									key -- {string}
									entries -- {array}
										name -- {string}
										value -- {byte[]}
						collection_hashed_rwset -- {array}
							collection_name -- {string}
							hashed_rwset
								hashed_reads -- {array}
									key_hash -- {byte[]}
									version
										block_num -- {number}
										tx_num -- {number}
								hashed_writes -- {array}
									key_hash -- {byte[]}
									is_delete -- {boolean}
									value_hash -- {byte[]}
								metadata_writes -- {array}
									key_hash -- {byte[]}
									entries -- {array}
										name -- {string}
										value -- {byte[]}
							pvt_rwset_hash -- {byte[]}
					events
						chaincode_id --  {string}
						tx_id -- {string}
						event_name -- {string}
						payload -- {byte[]}
					response
						status -- {int}
						message -- {string}
						payload -- {byte[]}
			endorsements -- {Endorsement[]}
Type:
  • Object

TransactionRequest

Type:
  • Object
Properties:
Name Type Description
proposalResponses Array.<ProposalResponse> An array of or a single ProposalResponse object containing the response from the endorsement call
proposal Proposal A Proposal object containing the original request for endorsement(s)
txID TransactionId Optional. - Must be the transaction ID object used in the proposal endorsement. The transactionID will only be used to determine if the signing of the request should be done by the admin identity or the user assigned to the client instance.
orderer Orderer | string Optional. The orderer instance or string name of the orderer to operate. See Client.getTargetOrderer

UserNamePasswordObject

An alternate object to use on the 'setUserContext' call in place of the 'User' object. When using this object it is assumed that the current 'Client' instance has been loaded with a network configuration.
Type:
  • Object
Properties:
Name Type Description
username string Required. A string representing the user name of the user
password string Optional. A string repsesenting the password of the user
caName string Optional. A string repsesenting the name of the Certificate Authority. If not specified, will use the first Certifcate Authority on the list.

UserOpts

Type:
  • Object
Properties:
Name Type Description
username string the user name used for enrollment
mspid string the MSP id
cryptoContent CryptoContent the private key and certificate
skipPersistence boolean whether to save this new user object into persistence.