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
-
bitsToBytes(arr)
-
Convert from a bitArray to bytes (refer to SJCL's codec)
Parameters:
Name Type Description arrArray.<number> a bitArray to convert from Returns:
the bytes converted from the bitArray -
bytesToBits(bytes)
-
Convert from bytes to a bitArray (refer to SJCL's codec)
Parameters:
Name Type Description bytesArray.<number> a bytes to convert from Returns:
the bitArray converted from bytes -
newCryptoKeyStore( [keyValueStore])
-
Parameters:
Name Type Argument Description keyValueStoreKeyValueStore <optional>
Optional. The built-in key store saves private keys. The key store must be instance of any KeyValueStore implementations. Returns:
- Type
- CryptoKeyStore
-
newCryptoSuite( [setting])
-
Returns a new instance of the CryptoSuite API implementation. Supports the following: - newCryptoSuite({software: true, keysize: 256, algorithm: EC}) - newCryptoSuite({software: false, lib: '/usr/local/bin/pkcs11.so', slot: 0, pin: '1234'}) - newCryptoSuite({software: false, lib: '/usr/local/bin/pkcs11.so', label: 'ForFabric', pin: '1234'}) - newCryptoSuite({keysize: 384}) - newCryptoSuite()
Parameters:
Name Type Argument Description settingCryptoSetting <optional>
- property `software` default is true (for software based implementation), specific implementation module is specified in the setting 'crypto-suite-software' - property `algorithm` currently supporting ECDSA only with value "EC" - property `keysize` default is value of the setting 'crypto-keysize' -
setLogger(logger)
-
Configures a logger for the entire SDK to use and override the default logger. Unless this method is called, the SDK uses a default logger based on winston. When using the built-in winston based logger, use the configuration setting
hfc-loggingto pass in configurations in the following format:
{ 'error': 'error.log', // 'error' logs are printed to file 'error.log' relative of the current working dir for node.js 'debug': '/tmp/myapp/debug.log', // 'debug' and anything more critical ('info', 'warn', 'error') can also be an absolute path 'info': 'console' // 'console' is a keyword for logging to console }
Parameters:
Name Type Description loggerObject a logger instance that defines the following methods: debug(), info(), warn(), error() with string interpolation methods like util.format.
Type Definitions
-
AffiliationRequest
-
Type:
- Object
- 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.
Properties:
Name Type Description namestring Required. The affiliation path to create canamestring Optional. Name of the CA to send the request to within the Fabric CA server forceboolean Optional. -
AttributeRequest
-
Type:
- Object
Properties:
Name Type Description namestring The name of the attribute to include in the certificate optionalboolean throw an error if the identity does not have the attribute -
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.protoType:
- 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.length;
Get the Id of the first transaction in the block:
var tx_id = block.data.data[0].payload.header.channel_header.tx_id;
-
BroadcastResponse
-
Type:
- Object
Properties:
Name Type Description statusstring Value is 'SUCCESS' or a descriptive error string infostring Optional. Additional information about the status -
BuildDiscoveryRequest
-
This Discovery request is a GRPC object to be signed and sent to the Discovery service of the Peer. The request will be based on either the proposal or the interests parameters. This request must be signed before sending to the peer.
Type:
- Object
Properties:
Name Type Argument Description endorsementEndorsement <optional>
Optional. Include the endorsement instance to build the discovery request based on the proposal. This will get the discovery interest (chaincode names, collections and "no private reads") from the endorsement instance. Use the Proposal#addCollectionInterest to add collections to the endorsement's chaincode. Use the Proposal#setNoPrivateReads to set the proposals "no private reads" setting of the discovery interest. Use the Proposal#addCollectionInterest to add chaincodes, collections, and no private reads that will be used to get an endorsement plan from the peer's discovery service. interestDiscoveryChaincode <optional>
Optional. An array of DiscoveryChaincodeInterest that have chaincodes, collections, and "no private reads" to help the peer's discovery service calculate the endorsement plan. Examples
"single chaincode"
[ { name: "mychaincode"} ]"chaincode to chaincode"
[ { name: "mychaincode"}, { name: "myotherchaincode"} ]"single chaincode with a collection"
[ { name: "mychaincode", collectionNames: ["mycollection"] } ]"single chaincode with a collection allowing no private data reads"
[ { name: "mychaincode", collectionNames: ["mycollection"], noPrivateReads: true } ]"chaincode to chaincode with a collection"
[ { name: "mychaincode", collectionNames: ["mycollection"] }, { name: "myotherchaincode", collectionNames: ["mycollection"] }} ]"chaincode to chaincode with collections"
[ { name: "mychaincode", collectionNames: ["mycollection", "myothercollection"] }, { name: "myotherchaincode", collectionNames: ["mycollection", "myothercollection"] }} ] -
BuildProposalRequest
-
Type:
- Object
Properties:
Name Type Argument Description fcnstring <optional>
Optional. The function name. May be used by the chaincode to control the flow within the chaincode. Default 'invoke' argsArray.<string> <optional>
Optional. The arguments needed by the chaincode execution. These should be strings or byte buffers. These will be converted into byte buffers before building the protobuf object to be sent to the fabric peer for endorsement. transientMapMap <optional>
Optional. A map with the key value pairs of the transient data. initboolean <optional>
Optional. If this proposal should be an chaincode initialization request. This will set the init setting in the protobuf object sent to the peer. -
CAInfoResponse
-
Type:
- Object
Properties:
Name Type Description caNamestring The name of the CA. caChainstring PEM-encoded certificate chain of the server's signing certificate issuerPublicKeystring Proto bytes of the CA's Idemix issuer public key issuerRevocationPublicKeystring PEM-encoded bytes of the CA's Idemix issuer revocation public key versionstring Version of the server -
ChaincodeEvent
-
Type:
- Object
Properties:
Name Type Description chaincode_idstring The name of chaincode that sourced this event. transactionIdstring The transaction ID of this event. statusstring The transaction status of the transaction. eventNamestring The string that is the eventName of this event as set by the chaincode during endorsement. stub.SetEvent(eventName, payload)payloadArray.<byte> Application-specific byte array that the chaincode set when it called stub.SetEvent(eventName, payload) -
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
-
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 policyImplicitMetaPolicy These policies point to other policies and specify a threshold as in "ANY", "MAJORITY" or "ALL" -
CommitBuildRequest
-
Type:
- Object
Properties:
Name Type Description endorsementEndorsement Required. The Endorsement that will be committed. -
CommitSendRequest
-
Type:
- Object
Properties:
Name Type Argument Description targetsArray.<Committers> <optional>
Optional. The Committers to send the endorsements. When not included an handler must be included. ServiceHandler [handler] - Optional. The handler to send the endorsements. When not included, targets must be included. requestTimeoutNumber <optional>
Optional. The request timeout -
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
-
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_setChannelConfigGroup A set of the current version numbers of all configuration items being updated config_update.write_setChannelConfigGroup 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. -
ConnectOptions
-
Type:
- Object
Properties:
Name Type Argument Description urlstring The committer URL with format of 'grpc(s)://host:port'. pemstring The Endorser's TLS certificate, in PEM format, to use with the grpcs protocol. clientKeystring <optional>
Optional. The client private key, in PEM format, to use with the grpcs protocol and mutual TLS. When not provided, the key assigned to this client instance will be used. clientCertstring The public certificate, in PEM format, to use with the grpcs protocol and mutual TLS. When not provided the cert assigned to this client instance will be used. requestTimeoutNumber The timeout to use for request on this connection. ssl-target-name-overridestring 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 *string include any grpc options. These will be passed to the grpc service. A grpc option must have a string key and integer or string value. -
ConnectOpts
-
Type:
- Object
Properties:
Name Type Argument Description protocolstring The protocol to use (either HTTP or HTTPS) hostnamestring The hostname of the Fabric CA server endpoint portnumber <optional>
The port of the Fabric CA server endpoint, Default is 7054 tlsOptionsTLSOptions <optional>
The TLS settings to use when the Fabric CA endpoint uses "https" canamestring <optional>
The optional name of the CA. Fabric-ca servers support multiple Certificate Authorities from a single server. If omitted or null or an empty string, then the default CA is the target of requests -
CryptoSetting
-
Type:
- Object
Properties:
Name Type Description softwareboolean Whether to load a software-based implementation (true) or HSM implementation (false) keysizenumber The key size to use for the crypto suite instance. algorithmstring Digital signature algorithm hashstring 'SHA2' or 'SHA3' -
DiscoverRequest
-
Type:
- Object
Properties:
Name Type Argument Description asLocalhostboolean <optional>
Optional. When discovery is running in a virtual environment, the host name of peers and orderers created by this service may have to converted to localhost for connections to be established. requestTimeoutnumber <optional>
Optional. The request timeout refreshAgenumber <optional>
Optional. The milliseconds before the discovery results will be refreshed automatically. When the Discovery#getDiscoveryResults is called with refresh = true and the age of the discovery results is older then 'refreshAge' the current signed request will be sent to the peer's discovery service. Default: 5 minutes. targetsArray.<Discoverer> Optional. An array of Discoverer instances. When not included the assigned discoverer will be used. The discoverer may be assigned anytime before the DiscoveryService#send is called. -
DiscoveryChaincodeCall
-
Type:
- Object
Properties:
Name Type Argument Description namestring The name of the chaincode collectionNamesArray.<string> <optional>
The names of the related collections noPrivateReadsboolean <optional>
Indicates we do not need to read from private data -
DiscoveryChaincodesInterest
-
Type:
- Object
Properties:
Name Type Description interestArray.<DiscoveryChaincodeCall> An array of DiscoveryChaincodeCall objects. -
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
-
EndorsementResponse
-
This object is the protobuf object returned from the peer when doing an endorsement of a proposal. The following description is from the protobuf file fabric-protos/protos/peer/proposal_response.protos
Type:
- Object
Example
// A ProposalResponse is returned from an endorser to the proposal submitter. // The idea is that this message contains the endorser's response to the // request of a client to perform an action over a chaincode (or more // generically on the ledger); the response might be success/error (conveyed in // the Response field) together with a description of the action and a // signature over it by that endorser. If a sufficient number of distinct // endorsers agree on the same action and produce signature to that effect, a // transaction can be generated and sent for ordering. message ProposalResponse { // Version indicates message protocol version int32 version = 1; // Timestamp is the time that the message // was created as defined by the sender google.protobuf.Timestamp timestamp = 2; // A response message indicating whether the // endorsement of the action was successful Response response = 4; // The payload of response. It is the bytes of ProposalResponsePayload bytes payload = 5; // The endorsement of the proposal, basically // the endorser's signature over the payload Endorsement endorsement = 6; } // A response with a representation similar to an HTTP response that can // be used within another message. message Response { // A status code that should follow the HTTP status codes. int32 status = 1; // A message associated with the response code. string message = 2; // A payload that can be used to include metadata with this response. bytes payload = 3; } message Endorsement { // Identity of the endorser (e.g. its certificate) bytes endorser = 1; // Signature of the payload included in ProposalResponse concatenated with // the endorser's certificate; ie, sign(ProposalResponse.payload + endorser) bytes signature = 2; } -
Enrollment
-
Type:
- Object
Properties:
Name Type Argument Description keyObject <optional>
the private key when CSR is created inline. certificatestring The enrollment certificate in base 64 encoded PEM format rootCertificatestring Base 64 encoded PEM-encoded certificate chain of the CA's signing certificate -
EnrollmentRequest
-
Type:
- Object
Properties:
Name Type Argument Description enrollmentIDstring The registered ID to use for enrollment enrollmentSecretstring The secret associated with the enrollment ID profilestring <optional>
The profile name. Specify the 'tls' profile for a TLS certificate; otherwise, an enrollment certificate is issued. csrstring <optional>
Optional. PEM-encoded PKCS#10 Certificate Signing Request. The message sent from client side to Fabric-ca for the digital identity certificate. attr_reqsArray.<AttributeRequest> <optional>
An array of AttributeRequest subjectstring <optional>
Optional. The X509 Subject to use in generating CSR inline (when csris not specified). If not specified, the default subject is built onenrollmentID -
EnrollmentResponse
-
Type:
- Object
Properties:
Name Type Description enrollmentCertstring PEM-encoded X509 enrollment certificate caCertChainstring PEM-encoded X509 certificate chain for the issuing certificate authority -
EventCallback(error, event)
-
Callback function that takes two parameters
Parameters:
Name Type Description errorError The "error" will be null unless this EventService has been shutdown. The shutdown may be caused by a network, connection error, by a call to the "disconnect()" method or when the fabric event service ends the connection to this EventService. This callback will also be called with an Error when the EventService is shutdown due to the last block being received if the service has been setup with an endBlock to be 'newest' or a specific block number that has been seen. eventEventInfo The "event" will be the EventInfo object. -
EventInfo
-
Type:
- Object
Properties:
Name Type Argument Description eventServiceEventService This EventService. blockNumberLong The block number that contains this event. transactionIdstring <optional>
The transaction ID of this event transactionStatusstring <optional>
The transaction status of this event. endBlockReceivedboolean Indicates if the endBlock as defined by the listener has been seen. chaincodeEventsArray.<ChaincodeEvent> An array of ChaincodeEvent. blockobject <optional>
The decode of the full block received filteredBlockobject <optional>
The decode of the filtered block received privateDataobject <optional>
A data map of any included private data. -
EventRegistrationOptions
-
Type:
- Object
Properties:
Name Type Argument Description unregisterboolean Optional - This options setting indicates the registration should be removed (unregister) when the event is seen or the endBlock 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 types of event listeners. For block listeners the default is false. For transaction listeners the default is true and the listener will be unregistered when a transaction with the id is seen by this listener or the endBlock is seen. For chaincode listeners the default will be false as the match filter might be intended for many transactions rather than a specific transaction. startBlockNumber | string <optional>
Optional. This will have this registered listener look for this event within the block. Blocks that have block numbers less than the startBlock will be ignored by this listener. Note: This EventService must be setup to listen for blocks in this range. endBlockNumber | string <optional>
Optional. This will have the registered listener stop looking at blocks when the block number is equal to or greater than the endBlock of this listener. The registered listener will be unregistered if the unregister option is set to true. Note: This EventService must be setup to listen for blocks in this range. -
Header
-
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
-
HTTPEndpoint
-
Type:
- Object
Properties:
Name Type Description hostnamestring portnumber protocolstring -
IdentityRequest
-
Type:
- Object
Properties:
Name Type Description enrollmentIDstring Required. The enrollment ID which uniquely identifies an identity affiliationstring Required. The affiliation path of the new identity attrsArray.<KeyValueAttribute> Array of KeyValueAttribute attributes to assign to the user typestring Optional. The type of the identity (e.g. *user*, *app*, *peer*, *orderer*, etc) enrollmentSecretstring Optional. The enrollment secret. If not provided, a random secret is generated. maxEnrollmentsnumber 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. canamestring 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 | MAJORITYType:
- Object
-
KeyValueAttribute
-
Type:
- Object
Properties:
Name Type Argument Description namestring The key used to reference the attribute valuestring The value of the attribute ecertboolean <optional>
Optional, A value of true indicates that this attribute should be included in an enrollment certificate by default -
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
-
MspConfig
-
Type:
- Object
Properties:
Name Type Description idstring The identifier for this MSP, Typically the organization name. namestring The name for this MSP, Typically the organization name. To avoid confusion the name and ID should be the same. This will be key to finding this MSP configuration. organizationalUnitIdentifiersArray.<string> rootCertsArray.<string> List of root certificates trusted by this MSP. They are used upon certificate validation. intermediateCertsArray.<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 Intermediate Certificates pool. adminsstring Identity denoting the administrator of this MSP tlsRootCertsstring TLS root certificates trusted by this MSP tlsIntermediateCertsstring TLS intermediate certificates trusted by this MSP -
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
-
ProcessedTransaction
-
Type:
- Object
Properties:
Name Type Description validationCodenumber See this list for all the defined validation codes transactionEnvelopeObject Encapsulates the transaction and the signature over it. It has the following structure: signature -- {byte[]} payload -- {} header -- {Header} data -- {Transaction} -
ProposalResponse
-
Type:
- Object
Properties:
Name Type Description errorsArray.<Error> errors returned from the endorsement responsesArray.<EndorsementResponse> The endorsements returned from the endorsing peers. queryResultsArray.<Buffer> the results as extracted from the endorsement EndorsementResponse from an Query endorsement that was only a query and will not be committed. -
RegisterRequest
-
Type:
- Object
Properties:
Name Type Description enrollmentIDstring ID which will be used for enrollment enrollmentSecretstring Optional enrollment secret to set for the registered user. If not provided, the server will generate one. rolestring Optional arbitrary string representing a role value for the user affiliationstring Affiliation with which this user will be associated, like a company or an organization maxEnrollmentsnumber The maximum number of times this user will be permitted to enroll attrsArray.<KeyValueAttribute> Array of KeyValueAttribute attributes to assign to the user -
RegistrationOpts
-
Type:
- Object
Properties:
Name Type Argument Description startBlocknumber | string | Long <optional>
Optional. The starting block number for event checking. When included, the peer's 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. endBlocknumber | string | Long <optional>
Optional. The ending block number for event checking. When included, the peer's 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 than the current channel block height. unregisterboolean Optional - This options setting indicates the registration should be removed (unregister) when the event is seen. When the application is using a timeout to 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 types 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. For all listeners if not set and the endBlock has been set, the listener will be automatically unregistered. -
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 'requestTimeout' setting or passed on a call that makes an outbound request
Type:
- Error
Examples
'client.setConfigSetting('requestTimeout', 3000)''channel.sendTranaction(request, 3000)'
-
Restriction
-
Type:
- Object
Properties:
Name Type Description revokedBeforeDate Include certificates that were revoked before this UTC timestamp (in RFC3339 format) in the CRL revokedAfterDate Include certificates that were revoked after this UTC timestamp (in RFC3339 format) in the CRL expireBeforeDate Include revoked certificates that expire before this UTC timestamp (in RFC3339 format) in the CRL expireAfterDate Include revoked certificates that expire after this UTC timestamp (in RFC3339 format) in the CRL -
SendProposalRequest
-
Type:
- Object
Properties:
Name Type Argument Description targetsArray.<Endorser> <optional>
Optional. The peers to send the proposal. ServiceHandler [handler] - Optional. The handler to send the proposal. requestTimeoutNumber <optional>
Optional. The request timeout -
ServiceResponse
-
Type:
- Object
Properties:
Name Type Description Successboolean Boolean indicating if the request was successful ResultObject The result of this request ErrorsArray.<ServiceResponseMessage> An array of error messages (code and message) MessagesArray.<ServiceResponseMessage> An array of information messages (code and message) -
ServiceResponseMessage
-
Type:
- Object
Properties:
Name Type Description codenumber Integer code denoting the type of message messagestring 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 | ADMINType:
- Object
-
StartEventRequest
-
Type:
- Object
Properties:
Name Type Argument Description targetsArray.<Eventer> The Eventers to send the start stream request. requestTimeoutNumber <optional>
Optional. The request timeout -
StartRequestOptions
-
Type:
- Object
Properties:
Name Type Argument Description blockTypestring <optional>
Optional. To indicate that the event service on the peer will be sending full blocks, filtered blocks or private data blocks to this EventService. The default will be 'filtered' with 'full' for full blocks and 'private' for blocks with private data. Filtered blocks have the required information to provided transaction status and chaincode event names, however no chaincode event payload. When using the non filtered blocks (full blocks or private data) the user will be required to have access to receive full blocks and the private data. Registering a block listener when listening for filtered blocks may not provide sufficient information in the blocks received. startBlockNumber | string <optional>
Optional. This will have the service setup to start sending blocks back to the event hub at the block with this number. If the service should start with the last block this instance has seen use the string 'last_seen'. If the service should start with the oldest block on the ledger use the string 'oldest'. If the service should start with the latest block on the ledger, use the string 'latest' or do not include a 'startBlock'. Default is to start with the latest block on the ledger. endBlockNumber | string <optional>
Optional. This will have the service setup to end sending blocks back to the event hub at the block with this number. If the service should end with the last block it has seen use the string 'last_seen'. If the service should end with the current block on the ledger use the string 'newest'. Default is to continue to send. -
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 'requestTimeout' setting or passed on a call that makes an outbound request
Type:
- Error
Examples
'client.setConfigSetting('requestTimeout', 3000)''channel.sendTranaction(request, 3000)'
-
TLSOptions
-
Type:
- Object
Properties:
Name Type Argument Default Description trustedRootsArray.<string> Array of PEM-encoded trusted root certificates verifyboolean <optional>
true Determines whether or not to verify the server certificate when using TLS -
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