gRPC services available to smart contract

The general description of smart contract operation with the use of gRPC is stated in the section Docker smart contracts with the use of gRPC.

You can use the official GitHub page for to download all required protobuf files. The list of all files is as follows:

  • address.proto - addresses methods.

  • common.proto - a common file for proper work of others protobuf files.

  • crypto.proto - methods for working with data encryption.

  • permission.proto - permission methods.

  • pki.proto - PKI methods.

  • privacy.proto - privacy methods.

  • util.proto - methods for utility tools.

  • contract.proto - contract methods.

Every protobuf file (except common.proto) contains a set of small blocks (message) that include a set of key-value fields. A list of such blocks for each file is provided below.

address.proto

  • GetAddresses - geting all addresses of participants whose key pairs are stored in the node keystore.

  • GetAddressData - getting all data recorded to address account {address}.

contract.proto

  • Connect - connecting a contract to a node.

  • CommitExecutionSuccess - getting the result of successful contract execution and sending the results to the node.

  • CommitExecutionError - getting a contract execution error and sending the results to the node.

  • GetContractKeys - getting the contract result execution by its ID (contract creation transaction ID).

  • GetContractKey - getting a contract execution value by its ID (contract creation transaction ID) and key {key}.

crypto.proto

  • EncryptSeparate - data encryption separately for the each recipient with the unique key.

  • EncryptCommon - data encryption with a single CEK key for all recipients and the CEK wraps into a unique KEK for the each recipient.

  • Decrypt - data decryption. The decryption is available only if the message recipient’s key is in the node’s keystore.

permission.proto

  • GetPermissions - getting roles (permissions) assigned to specified address {address} which are valid at the moment.

  • GetPermissionsForAddresses - getting roles (permissions) assigned to specified address list which are valid at the moment.

pki.proto

  • Sign - a creation a detached digital signature for sent data.

  • Verify - check the detached digital signature for sent data.

privacy.proto

  • GetPolicyRecipients - getting all addresses of participants, signed to the access group {policy-id}.

  • GetPolicyOwners - getting all addresses of owners, signed to the access group {policy-id}.

  • GetPolicyHashes - getting the array of identified hashes which are written with association to the {policy-id}.

  • GetPolicyItemData - getting the confidential data package by its identified hash.

  • GetPolicyItemInfo - getting the metadata for the confidential data package by the identified hash.

util.proto

  • GetNodeTime - obtaining of the node current time.