hyperledger/sawtooth-core
The Linux Foundation 開在 edX 的免費 Hyperledger Sawtooth 開發課程。
Hyperledger Sawtooth for Application Developers
pseudomuto/protoc-gen-doc: Documentation generator plugin for Google Protocol Buffers
git clone https://github.com/hyperledger/sawtooth-core.git /tmp/src/sawtooth
bash tc.sh --gen-proto-doc /tmp/src/sawtooth/protos /tmp/output.md
Top
Field | Type | Label | Description |
header | bytes | | The serialized version of the TransactionHeader |
header_signature | string | | The signature derived from signing the header |
payload | bytes | | The payload is the encoded family specific information of the transaction. Example cbor({'Verb': verb, 'Name': name,'Value': value}) |
Field | Type | Label | Description |
batcher_public_key | string | | Public key for the client who added this transaction to a batch |
dependencies | string | repeated | A list of transaction signatures that describe the transactions that must be processed before this transaction can be valid |
family_name | string | | The family name correlates to the transaction processor's family name that this transaction can be processed on, for example 'intkey' |
family_version | string | | The family version correlates to the transaction processor's family version that this transaction can be processed on, for example "1.0" |
inputs | string | repeated | A list of addresses that are given to the context manager and control what addresses the transaction processor is allowed to read from. |
nonce | string | | A random string that provides uniqueness for transactions with otherwise identical fields. |
outputs | string | repeated | A list of addresses that are given to the context manager and control what addresses the transaction processor is allowed to write to. |
payload_sha512 | string | | The sha512 hash of the encoded payload |
signer_public_key | string | | Public key for the client that signed the TransactionHeader |
A simple list of transactions that needs to be serialized before
it can be transmitted to a batcher.
Field | Type | Label | Description |
transactions | Transaction | repeated | |
Top
A request to get miscellaneous information about the validator
Information about the validator's peers
Field | Type | Label | Description |
endpoint | string | | The peer's public network endpoint |
The status of the response message, not the validator's status
Name | Number | Description |
STATUS_UNSET | 0 | |
OK | 1 | |
ERROR | 2 | |
Top
The message passed between the validator and client, containing the
header fields and content.
Field | Type | Label | Description |
message_type | Message.MessageType | | The type of message, used to determine how to 'route' the message to the appropriate handler as well as how to deserialize the content. |
correlation_id | string | | The identifier used to correlate response messages to their related request messages. correlation_id should be set to a random string for messages which are not responses to previously sent messages. For response messages, correlation_id should be set to the same string as contained in the request message. |
content | bytes | | The content of the message, defined by message_type. In many cases, this data has been serialized with Protocol Buffers or CBOR. |
A list of messages to be transmitted together.
Field | Type | Label | Description |
messages | Message | repeated | |
Name | Number | Description |
DEFAULT | 0 | |
TP_REGISTER_REQUEST | 1 | Registration request from the transaction processor to the validator |
TP_REGISTER_RESPONSE | 2 | Registration response from the validator to the transaction processor |
TP_UNREGISTER_REQUEST | 3 | Tell the validator that the transaction processor won't take any more transactions |
TP_UNREGISTER_RESPONSE | 4 | Response from the validator to the tp that it won't send any more transactions |
TP_PROCESS_REQUEST | 5 | Process Request from the validator/executor to the transaction processor |
TP_PROCESS_RESPONSE | 6 | Process response from the transaction processor to the validator/executor |
TP_STATE_GET_REQUEST | 7 | State get request from the transaction processor to validator/context_manager |
TP_STATE_GET_RESPONSE | 8 | State get response from the validator/context_manager to the transaction processor |
TP_STATE_SET_REQUEST | 9 | State set request from the transaction processor to the validator/context_manager |
TP_STATE_SET_RESPONSE | 10 | State set response from the validator/context_manager to the transaction processor |
TP_STATE_DELETE_REQUEST | 11 | State delete request from the transaction processor to the validator/context_manager |
TP_STATE_DELETE_RESPONSE | 12 | State delete response from the validator/context_manager to the transaction processor |
TP_RECEIPT_ADD_DATA_REQUEST | 13 | Message to append data to a transaction receipt |
TP_RECEIPT_ADD_DATA_RESPONSE | 14 | Response from validator to tell transaction processor that data has been appended |
TP_EVENT_ADD_REQUEST | 15 | Message to add event |
TP_EVENT_ADD_RESPONSE | 16 | Response from validator to tell transaction processor that event has been created |
CLIENT_BATCH_SUBMIT_REQUEST | 100 | Submission of a batchlist from the web api or another client to the validator |
CLIENT_BATCH_SUBMIT_RESPONSE | 101 | Response from the validator to the web api/client that the submission was accepted |
CLIENT_BLOCK_LIST_REQUEST | 102 | A request to list blocks from the web api/client to the validator |
CLIENT_BLOCK_LIST_RESPONSE | 103 | |
CLIENT_BLOCK_GET_BY_ID_REQUEST | 104 | |
CLIENT_BLOCK_GET_RESPONSE | 105 | |
CLIENT_BATCH_LIST_REQUEST | 106 | |
CLIENT_BATCH_LIST_RESPONSE | 107 | |
CLIENT_BATCH_GET_REQUEST | 108 | |
CLIENT_BATCH_GET_RESPONSE | 109 | |
CLIENT_TRANSACTION_LIST_REQUEST | 110 | |
CLIENT_TRANSACTION_LIST_RESPONSE | 111 | |
CLIENT_TRANSACTION_GET_REQUEST | 112 | |
CLIENT_TRANSACTION_GET_RESPONSE | 113 | |
CLIENT_STATE_CURRENT_REQUEST | 114 | Client state request of the current state hash to be retrieved from the journal |
CLIENT_STATE_CURRENT_RESPONSE | 115 | Response with the current state hash |
CLIENT_STATE_LIST_REQUEST | 116 | A request of all the addresses under a particular prefix, for a state hash. |
CLIENT_STATE_LIST_RESPONSE | 117 | The response of the addresses |
CLIENT_STATE_GET_REQUEST | 118 | Get the address:data entry at a particular address |
CLIENT_STATE_GET_RESPONSE | 119 | The response with the entry |
CLIENT_BATCH_STATUS_REQUEST | 120 | A request for the status of a batch or batches |
CLIENT_BATCH_STATUS_RESPONSE | 121 | A response with the batch statuses |
CLIENT_RECEIPT_GET_REQUEST | 122 | A request for one or more transaction receipts |
CLIENT_RECEIPT_GET_RESPONSE | 123 | A response with the receipts |
CLIENT_BLOCK_GET_BY_NUM_REQUEST | 124 | |
CLIENT_PEERS_GET_REQUEST | 125 | A request for a validator's peers |
CLIENT_PEERS_GET_RESPONSE | 126 | A response with the validator's peers |
CLIENT_BLOCK_GET_BY_TRANSACTION_ID_REQUEST | 127 | |
CLIENT_BLOCK_GET_BY_BATCH_ID_REQUEST | 128 | |
CLIENT_STATUS_GET_REQUEST | 129 | A request for a validator's status |
CLIENT_STATUS_GET_RESPONSE | 130 | A response with the validator's status |
CLIENT_EVENTS_SUBSCRIBE_REQUEST | 500 | Message types for events |
CLIENT_EVENTS_SUBSCRIBE_RESPONSE | 501 | |
CLIENT_EVENTS_UNSUBSCRIBE_REQUEST | 502 | |
CLIENT_EVENTS_UNSUBSCRIBE_RESPONSE | 503 | |
CLIENT_EVENTS | 504 | |
CLIENT_EVENTS_GET_REQUEST | 505 | |
CLIENT_EVENTS_GET_RESPONSE | 506 | |
GOSSIP_MESSAGE | 200 | Temp message types until a discussion can be had about gossip msg |
GOSSIP_REGISTER | 201 | |
GOSSIP_UNREGISTER | 202 | |
GOSSIP_BLOCK_REQUEST | 205 | |
GOSSIP_BLOCK_RESPONSE | 206 | |
GOSSIP_BATCH_BY_BATCH_ID_REQUEST | 207 | |
GOSSIP_BATCH_BY_TRANSACTION_ID_REQUEST | 208 | |
GOSSIP_BATCH_RESPONSE | 209 | |
GOSSIP_GET_PEERS_REQUEST | 210 | |
GOSSIP_GET_PEERS_RESPONSE | 211 | |
GOSSIP_CONSENSUS_MESSAGE | 212 | |
NETWORK_ACK | 300 | |
NETWORK_CONNECT | 301 | |
NETWORK_DISCONNECT | 302 | |
AUTHORIZATION_CONNECTION_RESPONSE | 600 | Message types for Authorization Types |
AUTHORIZATION_VIOLATION | 601 | |
AUTHORIZATION_TRUST_REQUEST | 602 | |
AUTHORIZATION_TRUST_RESPONSE | 603 | |
AUTHORIZATION_CHALLENGE_REQUEST | 604 | |
AUTHORIZATION_CHALLENGE_RESPONSE | 605 | |
AUTHORIZATION_CHALLENGE_SUBMIT | 606 | |
AUTHORIZATION_CHALLENGE_RESULT | 607 | |
PING_REQUEST | 700 | |
PING_RESPONSE | 701 | |
CONSENSUS_REGISTER_REQUEST | 800 | Consensus service messages |
CONSENSUS_REGISTER_RESPONSE | 801 | |
CONSENSUS_SEND_TO_REQUEST | 802 | |
CONSENSUS_SEND_TO_RESPONSE | 803 | |
CONSENSUS_BROADCAST_REQUEST | 804 | |
CONSENSUS_BROADCAST_RESPONSE | 805 | |
CONSENSUS_INITIALIZE_BLOCK_REQUEST | 806 | |
CONSENSUS_INITIALIZE_BLOCK_RESPONSE | 807 | |
CONSENSUS_FINALIZE_BLOCK_REQUEST | 808 | |
CONSENSUS_FINALIZE_BLOCK_RESPONSE | 809 | |
CONSENSUS_SUMMARIZE_BLOCK_REQUEST | 828 | |
CONSENSUS_SUMMARIZE_BLOCK_RESPONSE | 829 | |
CONSENSUS_CANCEL_BLOCK_REQUEST | 810 | |
CONSENSUS_CANCEL_BLOCK_RESPONSE | 811 | |
CONSENSUS_CHECK_BLOCKS_REQUEST | 812 | |
CONSENSUS_CHECK_BLOCKS_RESPONSE | 813 | |
CONSENSUS_COMMIT_BLOCK_REQUEST | 814 | |
CONSENSUS_COMMIT_BLOCK_RESPONSE | 815 | |
CONSENSUS_IGNORE_BLOCK_REQUEST | 816 | |
CONSENSUS_IGNORE_BLOCK_RESPONSE | 817 | |
CONSENSUS_FAIL_BLOCK_REQUEST | 818 | |
CONSENSUS_FAIL_BLOCK_RESPONSE | 819 | |
CONSENSUS_SETTINGS_GET_REQUEST | 820 | |
CONSENSUS_SETTINGS_GET_RESPONSE | 821 | |
CONSENSUS_STATE_GET_REQUEST | 822 | |
CONSENSUS_STATE_GET_RESPONSE | 823 | |
CONSENSUS_BLOCKS_GET_REQUEST | 824 | |
CONSENSUS_BLOCKS_GET_RESPONSE | 825 | |
CONSENSUS_CHAIN_HEAD_GET_REQUEST | 826 | |
CONSENSUS_CHAIN_HEAD_GET_RESPONSE | 827 | |
CONSENSUS_NOTIFY_PEER_CONNECTED | 900 | Consensus notification messages |
CONSENSUS_NOTIFY_PEER_DISCONNECTED | 901 | |
CONSENSUS_NOTIFY_PEER_MESSAGE | 902 | |
CONSENSUS_NOTIFY_BLOCK_NEW | 903 | |
CONSENSUS_NOTIFY_BLOCK_VALID | 904 | |
CONSENSUS_NOTIFY_BLOCK_INVALID | 905 | |
CONSENSUS_NOTIFY_BLOCK_COMMIT | 906 | |
CONSENSUS_NOTIFY_ENGINE_ACTIVATED | 907 | |
CONSENSUS_NOTIFY_ENGINE_DEACTIVATED | 908 | |
CONSENSUS_NOTIFY_ACK | 999 | |
Top
All information about a block that is relevant to consensus
Field | Type | Label | Description |
block_id | bytes | | |
previous_id | bytes | | |
signer_id | bytes | | The id of peer that signed this block |
block_num | uint64 | | |
payload | bytes | | |
summary | bytes | | A summary of the contents of the block |
Retrieve consensus-related information about blocks. If some blocks could
not be found, only the blocks that could be found will be returned.
Field | Type | Label | Description |
block_ids | bytes | repeated | |
Broadcast a consensus message to all peers
Field | Type | Label | Description |
content | bytes | | Payload to broadcast peers |
NOTE: This payload will be wrapped up in a ConsensusPeerMessage struct, which includes computing its SHA-512 digest, inserting this engine's registration info, and the validator's public key, and signing everything with the validator's private key. |
| message_type | string | | |
Stop adding batches to the current block and abandon it.
Retrieve consensus-related information about the chain head.
Request that, for each block block in order, the block is checked to
determine whether the block can be committed successfully or not. Blocks
may be checked in parallel. If a new request arrives, it overrides the
previous request allowing the engine to reprioritize the list of blocks to
check.
NOTE: OK does not mean the blocks will all commit successfully, only that
the directive was received successfully. The engine must listen for
notifications from the consuming component to learn if the blocks would
commit or not.
Field | Type | Label | Description |
block_ids | bytes | repeated | |
Request that the block be committed. This request fails if the block has
not already been checked.
NOTE: OK does not mean the block has been committed, only that the directive
was received successfully. The engine must listen for notifications from the
consuming component to learn when the block commits.
Field | Type | Label | Description |
block_id | bytes | | |
Fail this block and any of its descendants and purge them as needed.
Field | Type | Label | Description |
block_id | bytes | | |
Insert the given consensus data into the block and sign it. If this call is
successful, the consensus engine will receive the block afterwards.
Field | Type | Label | Description |
data | bytes | | The consensus data to include in the finalized block |
Inform the consuming component that this block is no longer being considered
and can be held or freed as needed.
Field | Type | Label | Description |
block_id | bytes | | |
Initialize a new block built on the block with the given previous id and
begin adding batches to it. If no previous id is specified, the current
head will be used.
Field | Type | Label | Description |
previous_id | bytes | | |
Confirm that the notification was received. The validator message
correlation id is used to determine which notification this is an ack for.
This block has been committed
Field | Type | Label | Description |
block_id | bytes | | |
This block cannot be committed successfully
Field | Type | Label | Description |
block_id | bytes | | |
A new block was received and passed initial consensus validation
This block can be committed successfully
Field | Type | Label | Description |
block_id | bytes | | |
The engine has been activated
The engine has been deactivated
A new peer was added
An existing peer was dropped
Field | Type | Label | Description |
peer_id | bytes | | |
A new message was received from a peer
Field | Type | Label | Description |
message | ConsensusPeerMessage | | The message sent |
sender_id | bytes | | The node that sent the message, not necessarily the node that created it |
Information about a peer that is relevant to consensus
Field | Type | Label | Description |
peer_id | bytes | | The unique id for this peer. This can be correlated with the signer id on consensus blocks. |
A consensus-related message sent between peers
Field | Type | Label | Description |
header | bytes | | The serialized version of the ConsensusPeerMessageHeader |
header_signature | bytes | | The signature derived from signing the header |
content | bytes | | The opaque payload to send to other nodes |
Field | Type | Label | Description |
signer_id | bytes | | Public key for the component internal to the validator that signed the message |
content_sha512 | bytes | | The sha512 hash of the encoded message |
message_type | string | | Interpretation is left to the consensus engine implementation |
name | string | | Used to identify the consensus engine that produced this message |
version | string | | |
Sent to connect with the validator
Field | Type | Label | Description |
name | string | | The name of this consensus engine |
version | string | | The version of this consensus engine |
additional_protocols | ConsensusRegisterRequest.Protocol | repeated | Any additional name/version pairs the consensus engine supports |
Send a consensus message to a specific, connected peer
Field | Type | Label | Description |
content | bytes | | Payload to send to peer |
NOTE: This payload will be wrapped up in a ConsensusPeerMessage struct, which includes computing its SHA-512 digest, inserting this engine's registration info, and the validator's public key, and signing everything with the validator's private key. |
| message_type | string | | |
| receiver_id | bytes | | Peer that this message is destined for |
A settings key-value pair
Read the values of these settings from state as of the given block. If some
values settings keys cannot be found, the keys that were found will be
returned.
Field | Type | Label | Description |
block_id | bytes | | |
keys | string | repeated | |
A state key-value pair
Read the data at these addresses from state as of the given block. If some
addresses cannot be found, state at the addresses that were found will be
returned.
Field | Type | Label | Description |
block_id | bytes | | |
addresses | string | repeated | |
Stop adding batches to the current block and return a summary of its
contents.
Name | Number | Description |
STATUS_UNSET | 0 | |
OK | 1 | |
BAD_REQUEST | 2 | |
SERVICE_ERROR | 3 | |
NOT_READY | 4 | |
UNKNOWN_BLOCK | 5 | |
NOT_ACTIVE_ENGINE | 6 | |
Name | Number | Description |
STATUS_UNSET | 0 | |
OK | 1 | |
BAD_REQUEST | 2 | |
SERVICE_ERROR | 3 | |
NOT_READY | 4 | |
NOT_ACTIVE_ENGINE | 5 | |
Name | Number | Description |
STATUS_UNSET | 0 | |
OK | 1 | |
BAD_REQUEST | 2 | |
SERVICE_ERROR | 3 | |
NOT_READY | 4 | |
INVALID_STATE | 5 | |
NOT_ACTIVE_ENGINE | 6 | |
Name | Number | Description |
STATUS_UNSET | 0 | |
OK | 1 | |
BAD_REQUEST | 2 | |
SERVICE_ERROR | 3 | |
NOT_READY | 4 | |
NO_CHAIN_HEAD | 5 | |
NOT_ACTIVE_ENGINE | 6 | |
Name | Number | Description |
STATUS_UNSET | 0 | |
OK | 1 | |
BAD_REQUEST | 2 | |
SERVICE_ERROR | 3 | |
NOT_READY | 4 | |
UNKNOWN_BLOCK | 5 | |
NOT_ACTIVE_ENGINE | 6 | |
Name | Number | Description |
STATUS_UNSET | 0 | |
OK | 1 | |
BAD_REQUEST | 2 | |
SERVICE_ERROR | 3 | |
NOT_READY | 4 | |
UNKNOWN_BLOCK | 5 | |
NOT_ACTIVE_ENGINE | 6 | |
Name | Number | Description |
STATUS_UNSET | 0 | |
OK | 1 | |
BAD_REQUEST | 2 | |
SERVICE_ERROR | 3 | |
NOT_READY | 4 | |
UNKNOWN_BLOCK | 5 | |
NOT_ACTIVE_ENGINE | 6 | |
Name | Number | Description |
STATUS_UNSET | 0 | |
OK | 1 | |
BAD_REQUEST | 2 | |
SERVICE_ERROR | 3 | |
NOT_READY | 4 | |
INVALID_STATE | 5 | |
BLOCK_NOT_READY | 6 | |
NOT_ACTIVE_ENGINE | 7 | |
Name | Number | Description |
STATUS_UNSET | 0 | |
OK | 1 | |
BAD_REQUEST | 2 | |
SERVICE_ERROR | 3 | |
NOT_READY | 4 | |
UNKNOWN_BLOCK | 5 | |
NOT_ACTIVE_ENGINE | 6 | |
Name | Number | Description |
STATUS_UNSET | 0 | |
OK | 1 | |
BAD_REQUEST | 2 | |
SERVICE_ERROR | 3 | |
NOT_READY | 4 | |
INVALID_STATE | 5 | |
UNKNOWN_BLOCK | 6 | |
NOT_ACTIVE_ENGINE | 7 | |
Name | Number | Description |
STATUS_UNSET | 0 | |
OK | 1 | |
BAD_REQUEST | 2 | |
SERVICE_ERROR | 3 | |
NOT_READY | 4 | |
Name | Number | Description |
STATUS_UNSET | 0 | |
OK | 1 | |
BAD_REQUEST | 2 | |
SERVICE_ERROR | 3 | |
NOT_READY | 4 | |
UNKNOWN_PEER | 5 | |
NOT_ACTIVE_ENGINE | 6 | |
Name | Number | Description |
STATUS_UNSET | 0 | |
OK | 1 | |
BAD_REQUEST | 2 | |
SERVICE_ERROR | 3 | |
NOT_READY | 4 | |
UNKNOWN_BLOCK | 5 | |
NOT_ACTIVE_ENGINE | 6 | |
Name | Number | Description |
STATUS_UNSET | 0 | |
OK | 1 | |
BAD_REQUEST | 2 | |
SERVICE_ERROR | 3 | |
NOT_READY | 4 | |
UNKNOWN_BLOCK | 5 | |
NOT_ACTIVE_ENGINE | 6 | |
Name | Number | Description |
STATUS_UNSET | 0 | |
OK | 1 | |
BAD_REQUEST | 2 | |
SERVICE_ERROR | 3 | |
NOT_READY | 4 | |
INVALID_STATE | 5 | |
BLOCK_NOT_READY | 6 | |
NOT_ACTIVE_ENGINE | 7 | |
Top
Information about the status of a batch submitted to the validator.
Attributes:
batch_id: The id (header_signature) of the batch
status: The committed status of the batch
invalid_transactions: Info for transactions that failed, if any
Statuses:
COMMITTED - the batch was accepted and has been committed to the chain
INVALID - the batch failed validation, it should be resubmitted
PENDING - the batch is still being processed
UNKNOWN - no status for the batch could be found (possibly invalid)
A request for the status of one or more batches, specified by id.
If wait
is set to true, the validator will wait to respond until all
batches are committed, or until the specified timeout
in seconds has
elapsed. Defaults to 300.
This is a response to a request for the status of specific batches.
Statuses:
- OK - everything with the request worked as expected
- INTERNAL_ERROR - general error, such as protobuf failing to deserialize
- NO_RESOURCE - the response contains no data, likely because
no ids were specified in the request
Submits a list of Batches to be added to the blockchain.
Field | Type | Label | Description |
batches | Batch | repeated | |
This is a response to a submission of one or more Batches.
Statuses:
- OK - everything with the request worked as expected
- INTERNAL_ERROR - general error, such as protobuf failing to deserialize
- INVALID_BATCH - the batch failed validation, likely due to a bad signature
- QUEUE_FULL - the batch is unable to be queued for processing, due to
a full processing queue. The batch may be submitted again.
Name | Number | Description |
STATUS_UNSET | 0 | |
COMMITTED | 1 | |
INVALID | 2 | |
PENDING | 3 | |
UNKNOWN | 4 | |
Name | Number | Description |
STATUS_UNSET | 0 | |
OK | 1 | |
INTERNAL_ERROR | 2 | |
NO_RESOURCE | 5 | |
INVALID_ID | 8 | |
Name | Number | Description |
STATUS_UNSET | 0 | |
OK | 1 | |
INTERNAL_ERROR | 2 | |
INVALID_BATCH | 3 | |
QUEUE_FULL | 4 | |
Top
A request to return a specific block from the validator. The block
containing the given batch is returned. If no block on the current chain
contains the batch, NO_RESOURCE is returned.
Field | Type | Label | Description |
batch_id | string | | |
A request to return a specific block from the validator. The block must be
specified by its unique id, in this case the block's header signature
Field | Type | Label | Description |
block_id | string | | |
A request to return a specific block from the validator. The block must be
specified by its block number
Field | Type | Label | Description |
block_num | uint64 | | |
A request to return a specific block from the validator. The block
containing the given transaction is returned. If no block on the current
chain contains the transaction, NO_RESOURCE is returned.
Field | Type | Label | Description |
transaction_id | string | | |
A response that returns the block specified by a ClientBlockGetByIdRequest
or ClientBlockGetByNumRequest.
Statuses:
- OK - everything worked as expected
- INTERNAL_ERROR - general error, such as protobuf failing to deserialize
- NO_RESOURCE - no block with the specified id exists
A request to return a list of blocks from the validator. May include the id
of a particular block to be the head
of the chain being requested. In that
case the list will include that block (if found), and all blocks previous
to it on the chain. Can be filtered using specific block_ids
.
A response that lists a chain of blocks with the newest at the beginning,
and the oldest (genesis) block at the end.
Statuses:
- OK - everything worked as expected
- INTERNAL_ERROR - general error, such as protobuf failing to deserialize
- NOT_READY - the validator does not yet have a genesis block
- NO_ROOT - the head block specified was not found
- NO_RESOURCE - no blocks were found with the parameters specified
- INVALID_PAGING - the paging controls were malformed or out of range
- INVALID_SORT - the sorting controls were malformed or invalid
Name | Number | Description |
STATUS_UNSET | 0 | |
OK | 1 | |
INTERNAL_ERROR | 2 | |
NO_RESOURCE | 5 | |
INVALID_ID | 8 | |
Name | Number | Description |
STATUS_UNSET | 0 | |
OK | 1 | |
INTERNAL_ERROR | 2 | |
NOT_READY | 3 | |
NO_ROOT | 4 | |
NO_RESOURCE | 5 | |
INVALID_PAGING | 6 | |
INVALID_SORT | 7 | |
INVALID_ID | 8 | |
Top
The request from the validator/executor of the transaction processor
to verify a transaction.
Field | Type | Label | Description |
header | TransactionHeader | | The de-serialized transaction header from client request |
payload | bytes | | The transaction payload |
signature | string | | The transaction header_signature |
context_id | string | | The context_id for state requests. |
header_bytes | bytes | | The serialized header as received by client. Controlled by a flag during transaction processor registration. |
The response from the transaction processor to the validator/executor
used to respond about the validity of a transaction
Field | Type | Label | Description |
status | TpProcessResponse.Status | | |
message | string | | A message to include on responses in the cases where status is either INVALID_TRANSACTION or INTERNAL_ERROR |
extended_data | bytes | | Information that may be included with the response. This information is an opaque, application-specific encoded block of data that will be propagated back to the transaction submitter. |
The registration request from the transaction processor to the
validator/executor.
The protocol_version field is used to check if the validator supports
requested features by a transaction processor.
Following are the versions supported:
1 Transaction processor can request for either raw header bytes or
deserialized TransactionHeader field in the TpProcessRequest
message. The default option is set to send deserialized
TransactionHeader.
Field | Type | Label | Description |
family | string | | A settled upon name for the capabilities of the transaction processor. For example: intkey, xo |
version | string | | The version supported. For example: 1.0 for version 1.0 2.1 for version 2.1 |
namespaces | string | repeated | The namespaces this transaction processor expects to interact with when processing transactions matching this specification; will be enforced by the state API on the validator. |
max_occupancy | uint32 | | The maximum number of transactions that this transaction processor can handle at once. |
protocol_version | uint32 | | Validator can make use of this field to check if the requested features are supported. Registration requests can be either accepted or rejected based on this field. |
request_header_style | TpRegisterRequest.TpProcessRequestHeaderStyle | | Setting it to RAW, validator would fill in serialized transaction header when sending TpProcessRequest to the transaction processor. |
A response sent from the validator to the transaction processor
acknowledging the registration
Field | Type | Label | Description |
status | TpRegisterResponse.Status | | |
protocol_version | uint32 | | Respond back with protocol_version, the value that can be used by SDK to know if validator supports expected feature. |
The unregistration request from the transaction processor to the
validator/executor. The correct handlers are determined from the
zeromq identity of the tp, on the validator side.
A response sent from the validator to the transaction processor
acknowledging the unregistration
Name | Number | Description |
STATUS_UNSET | 0 | |
OK | 1 | |
INVALID_TRANSACTION | 2 | |
INTERNAL_ERROR | 3 | |
enum used to fill in transaction header field in TpProcessRequest.
This field can be set before transaction processor registers with
validator.
Name | Number | Description |
HEADER_STYLE_UNSET | 0 | |
EXPANDED | 1 | |
RAW | 2 | |
Name | Number | Description |
STATUS_UNSET | 0 | |
OK | 1 | |
ERROR | 2 | |
Name | Number | Description |
STATUS_UNSET | 0 | |
OK | 1 | |
ERROR | 2 | |
Top
Fetches a specific txn by its id (header_signature) from the blockchain.
Field | Type | Label | Description |
transaction_id | string | | |
A response that returns the txn specified by a ClientTransactionGetRequest.
Statuses:
- OK - everything worked as expected, txn has been fetched
- INTERNAL_ERROR - general error, such as protobuf failing to deserialize
- NO_RESOURCE - no txn with the specified id exists
A request to return a list of txns from the validator. May include the id
of a particular block to be the head
of the chain being requested. In that
case the list will include the txns from that block, and all txns
previous to that block on the chain. Filter with specific transaction_ids
.
A response that lists transactions from newest to oldest.
Statuses:
- OK - everything worked as expected
- INTERNAL_ERROR - general error, such as protobuf failing to deserialize
- NOT_READY - the validator does not yet have a genesis block
- NO_ROOT - the head block specified was not found
- NO_RESOURCE - no txns were found with the parameters specified
- INVALID_PAGING - the paging controls were malformed or out of range
- INVALID_SORT - the sorting controls were malformed or invalid
Name | Number | Description |
STATUS_UNSET | 0 | |
OK | 1 | |
INTERNAL_ERROR | 2 | |
NO_RESOURCE | 5 | |
INVALID_ID | 8 | |
Name | Number | Description |
STATUS_UNSET | 0 | |
OK | 1 | |
INTERNAL_ERROR | 2 | |
NOT_READY | 3 | |
NO_ROOT | 4 | |
NO_RESOURCE | 5 | |
INVALID_PAGING | 6 | |
INVALID_SORT | 7 | |
INVALID_ID | 8 | |
Top
Paging controls to be sent with List requests.
Attributes:
start: The id of a resource to start the page with
limit: The number of results per page, defaults to 100 and maxes out at 1000
Information about the pagination used, sent back with List responses.
Attributes:
next: The id of the first resource in the next page
start: The id of the first resource in the returned page
limit: The number of results per page, defaults to 100 and maxes out at 1000
Sorting controls to be sent with List requests. More than one can be sent.
If so, the first is used, and additional controls are tie-breakers.
Attributes:
keys: Nested set of keys to sort by (i.e. ['default, block_num'])
reverse: Whether or not to reverse the sort (i.e. descending order)
Field | Type | Label | Description |
keys | string | repeated | |
reverse | bool | | |
Top
Field | Type | Label | Description |
header | bytes | | The serialized version of the BatchHeader |
header_signature | string | | The signature derived from signing the header |
transactions | Transaction | repeated | A list of the transactions that match the list of transaction_ids listed in the batch header |
trace | bool | | A debugging flag which indicates this batch should be traced through the system, resulting in a higher level of debugging output. |
Field | Type | Label | Description |
signer_public_key | string | | Public key for the client that signed the BatchHeader |
transaction_ids | string | repeated | List of transaction.header_signatures that match the order of transactions required for the batch |
Field | Type | Label | Description |
batches | Batch | repeated | |
Top
Field | Type | Label | Description |
event_type | string | | Used to subscribe to events and servers as a hint for how to deserialize event_data and what pairs to expect in attributes. |
attributes | Event.Attribute | repeated | |
data | bytes | | Opaque data defined by the event_type. |
Transparent data defined by the event_type.
Field | Type | Label | Description |
key | string | | EventFilter is used when subscribing to events to limit the events received within a given event type. See validator/server/events/subscription.py for further explanation. |
match_string | string | | |
filter_type | EventFilter.FilterType | | |
Field | Type | Label | Description |
events | Event | repeated | |
Field | Type | Label | Description |
event_type | string | | EventSubscription is used when subscribing to events to specify the type of events being subscribed to, along with any additional filters. See validator/server/events/subscription.py for further explanation. |
filters | EventFilter | repeated | |
Name | Number | Description |
FILTER_TYPE_UNSET | 0 | |
SIMPLE_ANY | 1 | |
SIMPLE_ALL | 2 | |
REGEX_ANY | 3 | |
REGEX_ALL | 4 | |
Top
Field | Type | Label | Description |
name | string | | name of the policy, this should be unique. |
entries | Policy.Entry | repeated | list of Entries The entries will be processed in order from first to last. |
Field | Type | Label | Description |
type | Policy.EntryType | | Whether this is a Permit_KEY or Deny_KEY entry |
key | string | | This should be a public key or * to refer to all participants. |
Policy will be stored in a Policy list to account for state collisions
Field | Type | Label | Description |
policies | Policy | repeated | |
Field | Type | Label | Description |
name | string | | Role name |
policy_name | string | | Name of corresponding policy |
Roles will be stored in a RoleList to account for state collisions
Field | Type | Label | Description |
roles | Role | repeated | |
Name | Number | Description |
ENTRY_TYPE_UNSET | 0 | |
PERMIT_KEY | 1 | |
DENY_KEY | 2 | |
Top
Field | Type | Label | Description |
header | bytes | | The serialized version of the BlockHeader |
header_signature | string | | The signature derived from signing the header |
batches | Batch | repeated | A list of batches. The batches may contain new batches that other validators may not have received yet, or they will be all batches needed for block validation when passed to the journal |
Field | Type | Label | Description |
block_num | uint64 | | Block number in the chain |
previous_block_id | string | | The header_signature of the previous block that was added to the chain. |
signer_public_key | string | | Public key for the component internal to the validator that signed the BlockHeader |
batch_ids | string | repeated | List of batch.header_signatures that match the order of batches required for the block |
consensus | bytes | | Bytes that are set and verified by the consensus algorithm used to create and validate the block |
state_root_hash | string | | The state_root_hash should match the final state_root after all transactions in the batches have been applied, otherwise the block is not valid |
Top
A request from a client for a particular entry in global state.
Like State List, it defaults to the newest state, but a state root
can be used to specify older data. Unlike State List the request must be
provided with a full address that corresponds to a single entry.
The response to a State Get Request from the client. Sends back just
the data stored at the entry, not the address. Also sends back the
head block id used to facilitate further requests.
Statuses:
- OK - everything worked as expected
- INTERNAL_ERROR - general error, such as protobuf failing to deserialize
- NOT_READY - the validator does not yet have a genesis block
- NO_ROOT - the state_root specified was not found
- NO_RESOURCE - the address specified doesn't exist
- INVALID_ADDRESS - address isn't a valid, i.e. it's a subtree (truncated)
A request to list every entry in global state. Defaults to the most current
tree, but can fetch older state by specifying a state root. Results can be
further filtered by specifying a subtree with a partial address.
An entry in the State
Name | Number | Description |
STATUS_UNSET | 0 | |
OK | 1 | |
INTERNAL_ERROR | 2 | |
NOT_READY | 3 | |
NO_ROOT | 4 | |
NO_RESOURCE | 5 | |
INVALID_ADDRESS | 6 | |
INVALID_ROOT | 7 | |
Name | Number | Description |
STATUS_UNSET | 0 | |
OK | 1 | |
INTERNAL_ERROR | 2 | |
NOT_READY | 3 | |
NO_ROOT | 4 | |
NO_RESOURCE | 5 | |
INVALID_PAGING | 6 | |
INVALID_SORT | 7 | |
INVALID_ADDRESS | 8 | |
INVALID_ROOT | 9 | |
Top
Field | Type | Label | Description |
subscriptions | EventSubscription | repeated | |
last_known_block_ids | string | repeated | The block id (or ids, if trying to walk back a fork) the subscriber last received events on. It can be set to empty if it has not yet received the genesis block. |
Name | Number | Description |
STATUS_UNSET | 0 | |
OK | 1 | |
INTERNAL_ERROR | 2 | |
INVALID_FILTER | 3 | |
UNKNOWN_BLOCK | 4 | |
Name | Number | Description |
STATUS_UNSET | 0 | |
OK | 1 | |
INVALID_FILTER | 2 | |
UNKNOWN_BLOCK | 3 | |
Name | Number | Description |
STATUS_UNSET | 0 | |
OK | 1 | |
INTERNAL_ERROR | 2 | |
Top
The request from the transaction processor to the validator append data
to a transaction receipt
Field | Type | Label | Description |
context_id | string | | The context id that references a context in the context manager |
data | bytes | | |
The response from the validator to the transaction processor to verify that
data has been appended to a transaction receipt
A request from the handler/tp to delete state entries at an collection of addresses
Field | Type | Label | Description |
context_id | string | | |
addresses | string | repeated | |
A response form the contextmanager/validator with the addresses that were deleted
An entry in the State
A request from a handler/tp for the values at a series of addresses
Field | Type | Label | Description |
context_id | string | | The context id that references a context in the contextmanager |
addresses | string | repeated | |
A response from the contextmanager/validator with a series of State entries
A request from the handler/tp to put entries in the state of a context
A response from the contextmanager/validator with the addresses that were set
Name | Number | Description |
STATUS_UNSET | 0 | |
OK | 1 | |
ERROR | 2 | |
Name | Number | Description |
STATUS_UNSET | 0 | |
OK | 1 | |
ERROR | 2 | |
Name | Number | Description |
STATUS_UNSET | 0 | |
OK | 1 | |
AUTHORIZATION_ERROR | 2 | |
Name | Number | Description |
STATUS_UNSET | 0 | |
OK | 1 | |
AUTHORIZATION_ERROR | 2 | |
Name | Number | Description |
STATUS_UNSET | 0 | |
OK | 1 | |
AUTHORIZATION_ERROR | 2 | |
Top
Setting Container for on-chain configuration key/value pairs
Field | Type | Label | Description |
entries | Setting.Entry | repeated | List of setting entries - more than one implies a state key collision |
Contains a setting entry (or entries, in the case of collisions).
Top
Field | Type | Label | Description |
block_num | uint64 | | Block number in the chain |
previous_block_id | string | | The header_signature of the previous block that was added to the chain. |
signer_public_key | string | | Public key for the component internal to the validator that signed the BlockHeader |
header_signature | string | | The signature derived from signing the header |
timestamp | uint64 | | Approximately when this block was committed, as a Unix UTC timestamp |
Field | Type | Label | Description |
block | BlockInfo | | The new block to add to state |
target_count | uint64 | | If this is set, the new target number of blocks to store in state |
sync_tolerance | uint64 | | If set, the new network time synchronization tolerance. |
Top
StateChange objects have the type of SET, which is either an insert or
update, or DELETE. Items marked as a DELETE will have no byte value.
A collection of state changes.
Field | Type | Label | Description |
state_changes | StateChange | repeated | |
Field | Type | Label | Description |
state_changes | StateChange | repeated | State changes made by this transaction StateChange is defined in protos/transaction_receipt.proto |
events | Event | repeated | Events fired by this transaction |
data | bytes | repeated | Transaction family defined data |
transaction_id | string | | |
Name | Number | Description |
TYPE_UNSET | 0 | |
SET | 1 | |
DELETE | 2 | |
Top
Fetches a specific batch by its id (header_signature) from the blockchain.
Field | Type | Label | Description |
batch_id | string | | |
A response that returns the batch specified by a ClientBatchGetRequest.
Statuses:
- OK - everything worked as expected, batch has been fetched
- INTERNAL_ERROR - general error, such as protobuf failing to deserialize
- NO_RESOURCE - no batch with the specified id exists
A request to return a list of batches from the validator. May include the id
of a particular block to be the head
of the chain being requested. In that
case the list will include the batches from that block, and all batches
previous to that block on the chain. Filter with specific batch_ids
.
A response that lists batches from newest to oldest.
Statuses:
- OK - everything worked as expected
- INTERNAL_ERROR - general error, such as protobuf failing to deserialize
- NOT_READY - the validator does not yet have a genesis block
- NO_ROOT - the head block specified was not found
- NO_RESOURCE - no batches were found with the parameters specified
- INVALID_PAGING - the paging controls were malformed or out of range
- INVALID_SORT - the sorting controls were malformed or invalid
Name | Number | Description |
STATUS_UNSET | 0 | |
OK | 1 | |
INTERNAL_ERROR | 2 | |
NO_RESOURCE | 5 | |
INVALID_ID | 8 | |
Name | Number | Description |
STATUS_UNSET | 0 | |
OK | 1 | |
INTERNAL_ERROR | 2 | |
NOT_READY | 3 | |
NO_ROOT | 4 | |
NO_RESOURCE | 5 | |
INVALID_PAGING | 6 | |
INVALID_SORT | 7 | |
INVALID_ID | 8 | |
Top
Empty message sent to request a payload to sign
Field | Type | Label | Description |
payload | bytes | | Random payload that the connecting node must sign |
Field | Type | Label | Description |
roles | RoleType | repeated | The approved roles for that connection |
Field | Type | Label | Description |
public_key | string | | public key of node |
signature | string | | signature derived from signing the challenge payload |
roles | RoleType | repeated | A set of requested Roles |
Field | Type | Label | Description |
roles | RoleType | repeated | A set of requested RoleTypes |
public_key | string | | |
Field | Type | Label | Description |
roles | RoleType | repeated | The actual set the requester has access to |
Field | Type | Label | Description |
violation | RoleType | | The Role the requester did not have access to |
Field | Type | Label | Description |
endpoint | string | | This is the first message that must be sent to start off authorization. The endpoint of the connection. |
Authorization Type required for the authorization procedure
Name | Number | Description |
AUTHORIZATION_TYPE_UNSET | 0 | |
TRUST | 1 | |
CHALLENGE | 2 | |
Whether the connection can participate in authorization
Name | Number | Description |
STATUS_UNSET | 0 | |
OK | 1 | |
ERROR | 2 | |
Name | Number | Description |
ROLE_TYPE_UNSET | 0 | |
ALL | 1 | A shorthand request for asking for all allowed roles. |
NETWORK | 2 | Role defining validator to validator communication |
Top
Field | Type | Label | Description |
batches | Batch | repeated | The list of batches that will be applied during the genesis process |
Top
An Entry in the change log for a given state root.
Field | Type | Label | Description |
parent | bytes | | A root hash of a merkle trie this tree was based off. |
additions | bytes | repeated | The hashes that were added for this root. These may be deleted during pruning, if this root is being abandoned. |
successors | ChangeLogEntry.Successor | repeated | The list of successors. |
A state root that succeed this root.
Field | Type | Label | Description |
successor | bytes | | A root hash of a merkle trie based of off this root. |
deletions | bytes | repeated | The keys (i.e. hashes) that were replaced (i.e. deleted) by this successor. These may be deleted during pruning. |
Top
The disconnect message from a client to the server
Field | Type | Label | Description |
peer_endpoints | string | repeated | |
Field | Type | Label | Description |
id | string | | The id of the batch that is being requested |
nonce | string | | A random string that provides uniqueness for requests with otherwise identical fields. |
time_to_live | uint32 | | |
Field | Type | Label | Description |
ids | string | repeated | The id's of the transaction that are in the batches requested |
nonce | string | | A random string that provides uniqueness for requests with otherwise identical fields. |
time_to_live | uint32 | | |
Field | Type | Label | Description |
content | bytes | | The batch |
Field | Type | Label | Description |
block_id | string | | The id of the block that is being requested |
nonce | string | | A random string that provides uniqueness for requests with otherwise identical fields. |
time_to_live | uint32 | | |
Field | Type | Label | Description |
content | bytes | | The block |
A response sent from the validator to the peer acknowledging message
receipt
The registration request from a peer to the validator
Field | Type | Label | Description |
endpoint | string | | |
protocol_version | uint32 | | The current version of the network protocol that is being used by the sender. This version is an increasing value. |
The unregistration request from a peer to the validator
Name | Number | Description |
CONTENT_TYPE_UNSET | 0 | |
BLOCK | 1 | |
BATCH | 2 | |
CONSENSUS | 3 | |
Name | Number | Description |
STATUS_UNSET | 0 | |
OK | 1 | |
ERROR | 2 | |
Top
Name | Number | Description |
STATUS_UNSET | 0 | |
OK | 1 | |
ERROR | 2 | |
Top
Fetches a specific txn by its id (header_signature) from the blockchain.
Field | Type | Label | Description |
transaction_ids | string | repeated | |
A response that returns the txn receipt specified by a
ClientTransactionReceiptGetRequest.
Statuses:
- OK - everything worked as expected, txn receipt has been fetched
- INTERNAL_ERROR - general error, such as protobuf failing to deserialize
- NO_RESOURCE - no receipt exists for the transaction id specified
Name | Number | Description |
STATUS_UNSET | 0 | |
OK | 1 | |
INTERNAL_ERROR | 2 | |
NO_RESOURCE | 5 | |
INVALID_ID | 8 | |
.proto Type | Notes | C++ Type | Java Type | Python Type |
double | | double | double | float |
float | | float | float | float |
int32 | Uses variable-length encoding. Inefficient for encoding negative numbers – if your field is likely to have negative values, use sint32 instead. | int32 | int | int |
int64 | Uses variable-length encoding. Inefficient for encoding negative numbers – if your field is likely to have negative values, use sint64 instead. | int64 | long | int/long |
uint32 | Uses variable-length encoding. | uint32 | int | int/long |
uint64 | Uses variable-length encoding. | uint64 | long | int/long |
sint32 | Uses variable-length encoding. Signed int value. These more efficiently encode negative numbers than regular int32s. | int32 | int | int |
sint64 | Uses variable-length encoding. Signed int value. These more efficiently encode negative numbers than regular int64s. | int64 | long | int/long |
fixed32 | Always four bytes. More efficient than uint32 if values are often greater than 2^28. | uint32 | int | int |
fixed64 | Always eight bytes. More efficient than uint64 if values are often greater than 2^56. | uint64 | long | int/long |
sfixed32 | Always four bytes. | int32 | int | int |
sfixed64 | Always eight bytes. | int64 | long | int/long |
bool | | bool | boolean | boolean |
string | A string must always contain UTF-8 encoded or 7-bit ASCII text. | string | String | str/unicode |
bytes | May contain any arbitrary sequence of bytes. | string | ByteString | str |
.
├── authorization.proto
├── batch.proto
├── block_info.proto
├── block.proto
├── client_batch.proto
├── client_batch_submit.proto
├── client_block.proto
├── client_event.proto
├── client_list_control.proto
├── client_peers.proto
├── client_receipt.proto
├── client_state.proto
├── client_status.proto
├── client_transaction.proto
├── consensus.proto
├── events.proto
├── genesis.proto
├── identity.proto
├── merkle.proto
├── network.proto
├── processor.proto
├── setting.proto
├── state_context.proto
├── transaction.proto
├── transaction_receipt.proto
└── validator.proto
0 directories, 26 files
// Copyright 2016 Intel Corporation
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
// -----------------------------------------------------------------------------
syntax = "proto3";
option java_multiple_files = true;
option java_package = "sawtooth.sdk.protobuf";
option go_package = "transaction_pb2";
message TransactionHeader {
// Public key for the client who added this transaction to a batch
string batcher_public_key = 1;
// A list of transaction signatures that describe the transactions that
// must be processed before this transaction can be valid
repeated string dependencies = 2;
// The family name correlates to the transaction processor's family name
// that this transaction can be processed on, for example 'intkey'
string family_name = 3;
// The family version correlates to the transaction processor's family
// version that this transaction can be processed on, for example "1.0"
string family_version = 4;
// A list of addresses that are given to the context manager and control
// what addresses the transaction processor is allowed to read from.
repeated string inputs = 5;
// A random string that provides uniqueness for transactions with
// otherwise identical fields.
string nonce = 6;
// A list of addresses that are given to the context manager and control
// what addresses the transaction processor is allowed to write to.
repeated string outputs = 7;
//The sha512 hash of the encoded payload
string payload_sha512 = 9;
// Public key for the client that signed the TransactionHeader
string signer_public_key = 10;
}
message Transaction {
// The serialized version of the TransactionHeader
bytes header = 1;
// The signature derived from signing the header
string header_signature = 2;
// The payload is the encoded family specific information of the
// transaction. Example cbor({'Verb': verb, 'Name': name,'Value': value})
bytes payload = 3;
}
// A simple list of transactions that needs to be serialized before
// it can be transmitted to a batcher.
message TransactionList {
repeated Transaction transactions = 1;
}
// Copyright 2017 Intel Corporation
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
// -----------------------------------------------------------------------------
syntax = "proto3";
option java_multiple_files = true;
option java_package = "sawtooth.sdk.protobuf";
option go_package = "client_status";
// A request to get miscellaneous information about the validator
message ClientStatusGetRequest{
}
message ClientStatusGetResponse {
// The status of the response message, not the validator's status
enum Status {
STATUS_UNSET = 0;
OK = 1;
ERROR = 2;
}
// Information about the validator's peers
message Peer {
// The peer's public network endpoint
string endpoint = 1;
}
Status status = 1;
repeated Peer peers = 2;
// The validator's public network endpoint
string endpoint = 3;
}
// Copyright 2016, 2017 Intel Corporation
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
// -----------------------------------------------------------------------------
syntax = "proto3";
option java_multiple_files = true;
option java_package = "sawtooth.sdk.protobuf";
option go_package = "validator_pb2";
// A list of messages to be transmitted together.
message MessageList {
repeated Message messages = 1;
}
// The message passed between the validator and client, containing the
// header fields and content.
message Message {
enum MessageType {
DEFAULT = 0;
// Registration request from the transaction processor to the validator
TP_REGISTER_REQUEST = 1;
// Registration response from the validator to the
// transaction processor
TP_REGISTER_RESPONSE = 2;
// Tell the validator that the transaction processor
// won't take any more transactions
TP_UNREGISTER_REQUEST = 3;
// Response from the validator to the tp that it won't
// send any more transactions
TP_UNREGISTER_RESPONSE = 4;
// Process Request from the validator/executor to the
// transaction processor
TP_PROCESS_REQUEST = 5;
// Process response from the transaction processor to the validator/executor
TP_PROCESS_RESPONSE = 6;
// State get request from the transaction processor to validator/context_manager
TP_STATE_GET_REQUEST = 7;
// State get response from the validator/context_manager to the transaction processor
TP_STATE_GET_RESPONSE = 8;
// State set request from the transaction processor to the validator/context_manager
TP_STATE_SET_REQUEST = 9;
// State set response from the validator/context_manager to the transaction processor
TP_STATE_SET_RESPONSE = 10;
// State delete request from the transaction processor to the validator/context_manager
TP_STATE_DELETE_REQUEST = 11;
// State delete response from the validator/context_manager to the transaction processor
TP_STATE_DELETE_RESPONSE = 12;
// Message to append data to a transaction receipt
TP_RECEIPT_ADD_DATA_REQUEST = 13;
// Response from validator to tell transaction processor that data has been appended
TP_RECEIPT_ADD_DATA_RESPONSE = 14;
// Message to add event
TP_EVENT_ADD_REQUEST = 15;
// Response from validator to tell transaction processor that event has been created
TP_EVENT_ADD_RESPONSE = 16;
// Submission of a batchlist from the web api or another client to the validator
CLIENT_BATCH_SUBMIT_REQUEST = 100;
// Response from the validator to the web api/client that the submission was accepted
CLIENT_BATCH_SUBMIT_RESPONSE = 101;
// A request to list blocks from the web api/client to the validator
CLIENT_BLOCK_LIST_REQUEST = 102;
CLIENT_BLOCK_LIST_RESPONSE = 103;
CLIENT_BLOCK_GET_BY_ID_REQUEST = 104;
CLIENT_BLOCK_GET_RESPONSE = 105;
CLIENT_BATCH_LIST_REQUEST = 106;
CLIENT_BATCH_LIST_RESPONSE = 107;
CLIENT_BATCH_GET_REQUEST = 108;
CLIENT_BATCH_GET_RESPONSE = 109;
CLIENT_TRANSACTION_LIST_REQUEST = 110;
CLIENT_TRANSACTION_LIST_RESPONSE = 111;
CLIENT_TRANSACTION_GET_REQUEST = 112;
CLIENT_TRANSACTION_GET_RESPONSE = 113;
// Client state request of the current state hash to be retrieved from the journal
CLIENT_STATE_CURRENT_REQUEST = 114;
// Response with the current state hash
CLIENT_STATE_CURRENT_RESPONSE = 115;
// A request of all the addresses under a particular prefix, for a state hash.
CLIENT_STATE_LIST_REQUEST = 116;
// The response of the addresses
CLIENT_STATE_LIST_RESPONSE = 117;
// Get the address:data entry at a particular address
CLIENT_STATE_GET_REQUEST = 118;
// The response with the entry
CLIENT_STATE_GET_RESPONSE = 119;
// A request for the status of a batch or batches
CLIENT_BATCH_STATUS_REQUEST = 120;
// A response with the batch statuses
CLIENT_BATCH_STATUS_RESPONSE = 121;
// A request for one or more transaction receipts
CLIENT_RECEIPT_GET_REQUEST = 122;
// A response with the receipts
CLIENT_RECEIPT_GET_RESPONSE = 123;
CLIENT_BLOCK_GET_BY_NUM_REQUEST = 124;
// A request for a validator's peers
CLIENT_PEERS_GET_REQUEST = 125;
// A response with the validator's peers
CLIENT_PEERS_GET_RESPONSE = 126;
CLIENT_BLOCK_GET_BY_TRANSACTION_ID_REQUEST = 127;
CLIENT_BLOCK_GET_BY_BATCH_ID_REQUEST = 128;
// A request for a validator's status
CLIENT_STATUS_GET_REQUEST = 129;
// A response with the validator's status
CLIENT_STATUS_GET_RESPONSE = 130;
// Message types for events
CLIENT_EVENTS_SUBSCRIBE_REQUEST = 500;
CLIENT_EVENTS_SUBSCRIBE_RESPONSE = 501;
CLIENT_EVENTS_UNSUBSCRIBE_REQUEST = 502;
CLIENT_EVENTS_UNSUBSCRIBE_RESPONSE = 503;
CLIENT_EVENTS = 504;
CLIENT_EVENTS_GET_REQUEST = 505;
CLIENT_EVENTS_GET_RESPONSE = 506;
// Temp message types until a discussion can be had about gossip msg
GOSSIP_MESSAGE = 200;
GOSSIP_REGISTER = 201;
GOSSIP_UNREGISTER = 202;
GOSSIP_BLOCK_REQUEST = 205;
GOSSIP_BLOCK_RESPONSE = 206;
GOSSIP_BATCH_BY_BATCH_ID_REQUEST = 207;
GOSSIP_BATCH_BY_TRANSACTION_ID_REQUEST = 208;
GOSSIP_BATCH_RESPONSE = 209;
GOSSIP_GET_PEERS_REQUEST = 210;
GOSSIP_GET_PEERS_RESPONSE = 211;
GOSSIP_CONSENSUS_MESSAGE = 212;
NETWORK_ACK = 300;
NETWORK_CONNECT = 301;
NETWORK_DISCONNECT = 302;
// Message types for Authorization Types
AUTHORIZATION_CONNECTION_RESPONSE = 600;
AUTHORIZATION_VIOLATION = 601;
AUTHORIZATION_TRUST_REQUEST = 602;
AUTHORIZATION_TRUST_RESPONSE = 603;
AUTHORIZATION_CHALLENGE_REQUEST = 604;
AUTHORIZATION_CHALLENGE_RESPONSE = 605;
AUTHORIZATION_CHALLENGE_SUBMIT = 606;
AUTHORIZATION_CHALLENGE_RESULT = 607;
PING_REQUEST = 700;
PING_RESPONSE = 701;
// Consensus service messages
CONSENSUS_REGISTER_REQUEST = 800;
CONSENSUS_REGISTER_RESPONSE = 801;
CONSENSUS_SEND_TO_REQUEST = 802;
CONSENSUS_SEND_TO_RESPONSE = 803;
CONSENSUS_BROADCAST_REQUEST = 804;
CONSENSUS_BROADCAST_RESPONSE = 805;
CONSENSUS_INITIALIZE_BLOCK_REQUEST = 806;
CONSENSUS_INITIALIZE_BLOCK_RESPONSE = 807;
CONSENSUS_FINALIZE_BLOCK_REQUEST = 808;
CONSENSUS_FINALIZE_BLOCK_RESPONSE = 809;
CONSENSUS_SUMMARIZE_BLOCK_REQUEST = 828;
CONSENSUS_SUMMARIZE_BLOCK_RESPONSE = 829;
CONSENSUS_CANCEL_BLOCK_REQUEST = 810;
CONSENSUS_CANCEL_BLOCK_RESPONSE = 811;
CONSENSUS_CHECK_BLOCKS_REQUEST = 812;
CONSENSUS_CHECK_BLOCKS_RESPONSE = 813;
CONSENSUS_COMMIT_BLOCK_REQUEST = 814;
CONSENSUS_COMMIT_BLOCK_RESPONSE = 815;
CONSENSUS_IGNORE_BLOCK_REQUEST = 816;
CONSENSUS_IGNORE_BLOCK_RESPONSE = 817;
CONSENSUS_FAIL_BLOCK_REQUEST = 818;
CONSENSUS_FAIL_BLOCK_RESPONSE = 819;
CONSENSUS_SETTINGS_GET_REQUEST = 820;
CONSENSUS_SETTINGS_GET_RESPONSE = 821;
CONSENSUS_STATE_GET_REQUEST = 822;
CONSENSUS_STATE_GET_RESPONSE = 823;
CONSENSUS_BLOCKS_GET_REQUEST = 824;
CONSENSUS_BLOCKS_GET_RESPONSE = 825;
CONSENSUS_CHAIN_HEAD_GET_REQUEST = 826;
CONSENSUS_CHAIN_HEAD_GET_RESPONSE = 827;
// Consensus notification messages
CONSENSUS_NOTIFY_PEER_CONNECTED = 900;
CONSENSUS_NOTIFY_PEER_DISCONNECTED = 901;
CONSENSUS_NOTIFY_PEER_MESSAGE = 902;
CONSENSUS_NOTIFY_BLOCK_NEW = 903;
CONSENSUS_NOTIFY_BLOCK_VALID = 904;
CONSENSUS_NOTIFY_BLOCK_INVALID = 905;
CONSENSUS_NOTIFY_BLOCK_COMMIT = 906;
CONSENSUS_NOTIFY_ENGINE_ACTIVATED = 907;
CONSENSUS_NOTIFY_ENGINE_DEACTIVATED = 908;
CONSENSUS_NOTIFY_ACK = 999;
}
// The type of message, used to determine how to 'route' the message
// to the appropriate handler as well as how to deserialize the
// content.
MessageType message_type = 1;
// The identifier used to correlate response messages to their related
// request messages. correlation_id should be set to a random string
// for messages which are not responses to previously sent messages. For
// response messages, correlation_id should be set to the same string as
// contained in the request message.
string correlation_id = 2;
// The content of the message, defined by message_type. In many
// cases, this data has been serialized with Protocol Buffers or
// CBOR.
bytes content = 3;
}
// Copyright 2018 Intel Corporation
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
// -----------------------------------------------------------------------------
syntax = "proto3";
// --== Data Structures ==--
message ConsensusPeerMessageHeader {
// Public key for the component internal to the validator that
// signed the message
bytes signer_id = 1;
// The sha512 hash of the encoded message
bytes content_sha512 = 2;
// Interpretation is left to the consensus engine implementation
string message_type = 5;
// Used to identify the consensus engine that produced this message
string name = 3;
string version = 4;
}
// A consensus-related message sent between peers
message ConsensusPeerMessage {
// The serialized version of the ConsensusPeerMessageHeader
bytes header = 1;
// The signature derived from signing the header
bytes header_signature = 3;
// The opaque payload to send to other nodes
bytes content = 2;
}
// All information about a block that is relevant to consensus
message ConsensusBlock {
bytes block_id = 1;
bytes previous_id = 2;
// The id of peer that signed this block
bytes signer_id = 3;
uint64 block_num = 4;
bytes payload = 5;
// A summary of the contents of the block
bytes summary = 6;
}
// Information about a peer that is relevant to consensus
message ConsensusPeerInfo {
// The unique id for this peer. This can be correlated with the signer id
// on consensus blocks.
bytes peer_id = 1;
}
// A settings key-value pair
message ConsensusSettingsEntry {
string key = 1;
string value = 2;
}
// A state key-value pair
message ConsensusStateEntry {
string address = 1;
bytes data = 2;
}
// --== Registration ==--
// Sent to connect with the validator
message ConsensusRegisterRequest {
message Protocol {
string name = 1;
string version = 2;
}
// The name of this consensus engine
string name = 1;
// The version of this consensus engine
string version = 2;
// Any additional name/version pairs the consensus engine supports
repeated Protocol additional_protocols = 3;
}
message ConsensusRegisterResponse {
enum Status {
STATUS_UNSET = 0;
OK = 1;
BAD_REQUEST = 2;
SERVICE_ERROR = 3;
NOT_READY = 4;
}
Status status = 1;
// Startup Info
ConsensusBlock chain_head = 2;
repeated ConsensusPeerInfo peers = 3;
ConsensusPeerInfo local_peer_info = 4;
}
// --== Notifications ==--
// The following are notifications provided by the validator to the consensus
// engine. An ack should be sent in response to all notifications.
// - P2P -
// A new peer was added
message ConsensusNotifyPeerConnected {
ConsensusPeerInfo peer_info = 1;
}
// An existing peer was dropped
message ConsensusNotifyPeerDisconnected {
bytes peer_id = 1;
}
// A new message was received from a peer
message ConsensusNotifyPeerMessage {
// The message sent
ConsensusPeerMessage message = 1;
// The node that sent the message, not necessarily the node that created it
bytes sender_id = 2;
}
// - Blocks -
// A new block was received and passed initial consensus validation
message ConsensusNotifyBlockNew {
ConsensusBlock block = 1;
}
// This block can be committed successfully
message ConsensusNotifyBlockValid {
bytes block_id = 1;
}
// This block cannot be committed successfully
message ConsensusNotifyBlockInvalid {
bytes block_id = 1;
}
// This block has been committed
message ConsensusNotifyBlockCommit {
bytes block_id = 1;
}
// The engine has been activated
message ConsensusNotifyEngineActivated {
// Startup Info
ConsensusBlock chain_head = 1;
repeated ConsensusPeerInfo peers = 2;
ConsensusPeerInfo local_peer_info = 3;
}
// The engine has been deactivated
message ConsensusNotifyEngineDeactivated {}
// Confirm that the notification was received. The validator message
// correlation id is used to determine which notification this is an ack for.
message ConsensusNotifyAck {}
// --== Services Provided ==--
// The following are services provided by the validator to the consensus
// engine. All service messages have at a minimum the following possible return
// statuses:
//
// STATUS_UNSET
// No status was set by the validator, this should never happen
// OK
// The request was completed successfully
// BAD_REQUEST
// The request was malformed in some way
// SERVICE_ERROR
// The validator failed to perform the request
// NOT_READY
// The validator is not accepting requests, usually because it is still
// starting up
// NOT_ACTIVE_ENGINE
// The consensus engine making the request is not the active engine
//
// Additionally, messages may have the following additional return statuses:
//
// INVALID_STATE
// The request is not valid given the current state of the validator
// UNKNOWN_BLOCK
// No block with the given id could be found
// UNKNOWN_PEER
// No peer with the given id could be found
// - P2P Messaging -
// Send a consensus message to a specific, connected peer
message ConsensusSendToRequest {
// Payload to send to peer
//
// NOTE: This payload will be wrapped up in a ConsensusPeerMessage struct,
// which includes computing its SHA-512 digest, inserting this engine's
// registration info, and the validator's public key, and signing everything
// with the validator's private key.
bytes content = 1;
string message_type = 3;
// Peer that this message is destined for
bytes receiver_id = 2;
}
message ConsensusSendToResponse {
enum Status {
STATUS_UNSET = 0;
OK = 1;
BAD_REQUEST = 2;
SERVICE_ERROR = 3;
NOT_READY = 4;
UNKNOWN_PEER = 5;
NOT_ACTIVE_ENGINE = 6;
}
Status status = 1;
}
// Broadcast a consensus message to all peers
message ConsensusBroadcastRequest {
// Payload to broadcast peers
//
// NOTE: This payload will be wrapped up in a ConsensusPeerMessage struct,
// which includes computing its SHA-512 digest, inserting this engine's
// registration info, and the validator's public key, and signing everything
// with the validator's private key.
bytes content = 1;
string message_type = 2;
}
message ConsensusBroadcastResponse {
enum Status {
STATUS_UNSET = 0;
OK = 1;
BAD_REQUEST = 2;
SERVICE_ERROR = 3;
NOT_READY = 4;
NOT_ACTIVE_ENGINE = 5;
}
Status status = 1;
}
// - Block Creation -
// Initialize a new block built on the block with the given previous id and
// begin adding batches to it. If no previous id is specified, the current
// head will be used.
message ConsensusInitializeBlockRequest {
bytes previous_id = 1;
}
message ConsensusInitializeBlockResponse {
enum Status {
STATUS_UNSET = 0;
OK = 1;
BAD_REQUEST = 2;
SERVICE_ERROR = 3;
NOT_READY = 4;
INVALID_STATE = 5;
UNKNOWN_BLOCK = 6;
NOT_ACTIVE_ENGINE = 7;
}
Status status = 1;
}
// Stop adding batches to the current block and return a summary of its
// contents.
message ConsensusSummarizeBlockRequest {}
message ConsensusSummarizeBlockResponse {
enum Status {
STATUS_UNSET = 0;
OK = 1;
BAD_REQUEST = 2;
SERVICE_ERROR = 3;
NOT_READY = 4;
INVALID_STATE = 5;
BLOCK_NOT_READY = 6;
NOT_ACTIVE_ENGINE = 7;
}
Status status = 1;
// A summary of the block contents
bytes summary = 2;
}
// Insert the given consensus data into the block and sign it. If this call is
// successful, the consensus engine will receive the block afterwards.
message ConsensusFinalizeBlockRequest {
// The consensus data to include in the finalized block
bytes data = 1;
}
message ConsensusFinalizeBlockResponse {
enum Status {
STATUS_UNSET = 0;
OK = 1;
BAD_REQUEST = 2;
SERVICE_ERROR = 3;
NOT_READY = 4;
INVALID_STATE = 5;
BLOCK_NOT_READY = 6;
NOT_ACTIVE_ENGINE = 7;
}
Status status = 1;
// The block id of the newly created block
bytes block_id = 2;
}
// Stop adding batches to the current block and abandon it.
message ConsensusCancelBlockRequest {}
message ConsensusCancelBlockResponse {
enum Status {
STATUS_UNSET = 0;
OK = 1;
BAD_REQUEST = 2;
SERVICE_ERROR = 3;
NOT_READY = 4;
INVALID_STATE = 5;
NOT_ACTIVE_ENGINE = 6;
}
Status status = 1;
}
// - Block Directives -
// Request that, for each block block in order, the block is checked to
// determine whether the block can be committed successfully or not. Blocks
// may be checked in parallel. If a new request arrives, it overrides the
// previous request allowing the engine to reprioritize the list of blocks to
// check.
//
// NOTE: OK does not mean the blocks will all commit successfully, only that
// the directive was received successfully. The engine must listen for
// notifications from the consuming component to learn if the blocks would
// commit or not.
message ConsensusCheckBlocksRequest {
repeated bytes block_ids = 1;
}
message ConsensusCheckBlocksResponse {
enum Status {
STATUS_UNSET = 0;
OK = 1;
BAD_REQUEST = 2;
SERVICE_ERROR = 3;
NOT_READY = 4;
UNKNOWN_BLOCK = 5;
NOT_ACTIVE_ENGINE = 6;
}
Status status = 1;
}
// Request that the block be committed. This request fails if the block has
// not already been checked.
//
// NOTE: OK does not mean the block has been committed, only that the directive
// was received successfully. The engine must listen for notifications from the
// consuming component to learn when the block commits.
message ConsensusCommitBlockRequest {
bytes block_id = 1;
}
message ConsensusCommitBlockResponse {
enum Status {
STATUS_UNSET = 0;
OK = 1;
BAD_REQUEST = 2;
SERVICE_ERROR = 3;
NOT_READY = 4;
UNKNOWN_BLOCK = 5;
NOT_ACTIVE_ENGINE = 6;
}
Status status = 1;
}
// Inform the consuming component that this block is no longer being considered
// and can be held or freed as needed.
message ConsensusIgnoreBlockRequest {
bytes block_id = 1;
}
message ConsensusIgnoreBlockResponse {
enum Status {
STATUS_UNSET = 0;
OK = 1;
BAD_REQUEST = 2;
SERVICE_ERROR = 3;
NOT_READY = 4;
UNKNOWN_BLOCK = 5;
NOT_ACTIVE_ENGINE = 6;
}
Status status = 1;
}
// Fail this block and any of its descendants and purge them as needed.
message ConsensusFailBlockRequest {
bytes block_id = 1;
}
message ConsensusFailBlockResponse {
enum Status {
STATUS_UNSET = 0;
OK = 1;
BAD_REQUEST = 2;
SERVICE_ERROR = 3;
NOT_READY = 4;
UNKNOWN_BLOCK = 5;
NOT_ACTIVE_ENGINE = 6;
}
Status status = 1;
}
// - Queries -
// Retrieve consensus-related information about blocks. If some blocks could
// not be found, only the blocks that could be found will be returned.
message ConsensusBlocksGetRequest {
repeated bytes block_ids = 1;
}
message ConsensusBlocksGetResponse {
enum Status {
STATUS_UNSET = 0;
OK = 1;
BAD_REQUEST = 2;
SERVICE_ERROR = 3;
NOT_READY = 4;
UNKNOWN_BLOCK = 5;
NOT_ACTIVE_ENGINE = 6;
}
Status status = 1;
repeated ConsensusBlock blocks = 2;
}
// Retrieve consensus-related information about the chain head.
message ConsensusChainHeadGetRequest {}
message ConsensusChainHeadGetResponse {
enum Status {
STATUS_UNSET = 0;
OK = 1;
BAD_REQUEST = 2;
SERVICE_ERROR = 3;
NOT_READY = 4;
NO_CHAIN_HEAD = 5;
NOT_ACTIVE_ENGINE = 6;
}
Status status = 1;
ConsensusBlock block = 2;
}
// Read the values of these settings from state as of the given block. If some
// values settings keys cannot be found, the keys that were found will be
// returned.
message ConsensusSettingsGetRequest {
bytes block_id = 1;
repeated string keys = 2;
}
message ConsensusSettingsGetResponse {
enum Status {
STATUS_UNSET = 0;
OK = 1;
BAD_REQUEST = 2;
SERVICE_ERROR = 3;
NOT_READY = 4;
UNKNOWN_BLOCK = 5;
NOT_ACTIVE_ENGINE = 6;
}
Status status = 1;
repeated ConsensusSettingsEntry entries = 2;
}
// Read the data at these addresses from state as of the given block. If some
// addresses cannot be found, state at the addresses that were found will be
// returned.
message ConsensusStateGetRequest {
bytes block_id = 1;
repeated string addresses = 2;
}
message ConsensusStateGetResponse {
enum Status {
STATUS_UNSET = 0;
OK = 1;
BAD_REQUEST = 2;
SERVICE_ERROR = 3;
NOT_READY = 4;
UNKNOWN_BLOCK = 5;
NOT_ACTIVE_ENGINE = 6;
}
Status status = 1;
repeated ConsensusStateEntry entries = 2;
}
// Copyright 2017 Intel Corporation
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
// -----------------------------------------------------------------------------
syntax = "proto3";
option java_multiple_files = true;
option java_package = "sawtooth.sdk.protobuf";
option go_package = "client_batch_submit_pb2";
import "batch.proto";
// Information about the status of a batch submitted to the validator.
//
// Attributes:
// batch_id: The id (header_signature) of the batch
// status: The committed status of the batch
// invalid_transactions: Info for transactions that failed, if any
//
// Statuses:
// COMMITTED - the batch was accepted and has been committed to the chain
// INVALID - the batch failed validation, it should be resubmitted
// PENDING - the batch is still being processed
// UNKNOWN - no status for the batch could be found (possibly invalid)
message ClientBatchStatus {
enum Status {
STATUS_UNSET = 0;
COMMITTED = 1;
INVALID = 2;
PENDING = 3;
UNKNOWN = 4;
}
message InvalidTransaction {
string transaction_id = 1;
string message = 2;
bytes extended_data = 3;
}
string batch_id = 1;
Status status = 2;
repeated InvalidTransaction invalid_transactions = 3;
}
// Submits a list of Batches to be added to the blockchain.
message ClientBatchSubmitRequest {
repeated Batch batches = 1;
}
// This is a response to a submission of one or more Batches.
// Statuses:
// * OK - everything with the request worked as expected
// * INTERNAL_ERROR - general error, such as protobuf failing to deserialize
// * INVALID_BATCH - the batch failed validation, likely due to a bad signature
// * QUEUE_FULL - the batch is unable to be queued for processing, due to
// a full processing queue. The batch may be submitted again.
message ClientBatchSubmitResponse {
enum Status {
STATUS_UNSET = 0;
OK = 1;
INTERNAL_ERROR = 2;
INVALID_BATCH = 3;
QUEUE_FULL = 4;
}
Status status = 1;
}
// A request for the status of one or more batches, specified by id.
// If `wait` is set to true, the validator will wait to respond until all
// batches are committed, or until the specified `timeout` in seconds has
// elapsed. Defaults to 300.
message ClientBatchStatusRequest {
repeated string batch_ids = 1;
bool wait = 2;
uint32 timeout = 3;
}
// This is a response to a request for the status of specific batches.
// Statuses:
// * OK - everything with the request worked as expected
// * INTERNAL_ERROR - general error, such as protobuf failing to deserialize
// * NO_RESOURCE - the response contains no data, likely because
// no ids were specified in the request
message ClientBatchStatusResponse {
enum Status {
STATUS_UNSET = 0;
OK = 1;
INTERNAL_ERROR = 2;
NO_RESOURCE = 5;
INVALID_ID = 8;
}
Status status = 1;
repeated ClientBatchStatus batch_statuses = 2;
}
// Copyright 2017 Intel Corporation
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
// -----------------------------------------------------------------------------
syntax = "proto3";
option java_multiple_files = true;
option java_package = "sawtooth.sdk.protobuf";
option go_package = "client_block_pb2";
import "block.proto";
import "client_list_control.proto";
// A request to return a list of blocks from the validator. May include the id
// of a particular block to be the `head` of the chain being requested. In that
// case the list will include that block (if found), and all blocks previous
// to it on the chain. Can be filtered using specific `block_ids`.
message ClientBlockListRequest {
string head_id = 1;
repeated string block_ids = 2;
ClientPagingControls paging = 3;
repeated ClientSortControls sorting = 4;
}
// A response that lists a chain of blocks with the newest at the beginning,
// and the oldest (genesis) block at the end.
//
// Statuses:
// * OK - everything worked as expected
// * INTERNAL_ERROR - general error, such as protobuf failing to deserialize
// * NOT_READY - the validator does not yet have a genesis block
// * NO_ROOT - the head block specified was not found
// * NO_RESOURCE - no blocks were found with the parameters specified
// * INVALID_PAGING - the paging controls were malformed or out of range
// * INVALID_SORT - the sorting controls were malformed or invalid
message ClientBlockListResponse {
enum Status {
STATUS_UNSET = 0;
OK = 1;
INTERNAL_ERROR = 2;
NOT_READY = 3;
NO_ROOT = 4;
NO_RESOURCE = 5;
INVALID_PAGING = 6;
INVALID_SORT = 7;
INVALID_ID = 8;
}
Status status = 1;
repeated Block blocks = 2;
string head_id = 3;
ClientPagingResponse paging = 4;
}
// A request to return a specific block from the validator. The block must be
// specified by its unique id, in this case the block's header signature
message ClientBlockGetByIdRequest {
string block_id = 1;
}
// A request to return a specific block from the validator. The block must be
// specified by its block number
message ClientBlockGetByNumRequest {
uint64 block_num = 1;
}
// A request to return a specific block from the validator. The block
// containing the given transaction is returned. If no block on the current
// chain contains the transaction, NO_RESOURCE is returned.
message ClientBlockGetByTransactionIdRequest {
string transaction_id = 1;
}
// A request to return a specific block from the validator. The block
// containing the given batch is returned. If no block on the current chain
// contains the batch, NO_RESOURCE is returned.
message ClientBlockGetByBatchIdRequest {
string batch_id = 1;
}
// A response that returns the block specified by a ClientBlockGetByIdRequest
// or ClientBlockGetByNumRequest.
//
// Statuses:
// * OK - everything worked as expected
// * INTERNAL_ERROR - general error, such as protobuf failing to deserialize
// * NO_RESOURCE - no block with the specified id exists
message ClientBlockGetResponse {
enum Status {
STATUS_UNSET = 0;
OK = 1;
INTERNAL_ERROR = 2;
NO_RESOURCE = 5;
INVALID_ID = 8;
}
Status status = 1;
Block block = 2;
}
// Copyright 2016 Intel Corporation
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
// -----------------------------------------------------------------------------
syntax = "proto3";
option java_multiple_files = true;
option java_package = "sawtooth.sdk.protobuf";
option go_package = "processor_pb2";
import "transaction.proto";
// The registration request from the transaction processor to the
// validator/executor.
//
// The protocol_version field is used to check if the validator supports
// requested features by a transaction processor.
// Following are the versions supported:
// 1 Transaction processor can request for either raw header bytes or
// deserialized TransactionHeader field in the TpProcessRequest
// message. The default option is set to send deserialized
// TransactionHeader.
message TpRegisterRequest {
// enum used to fill in transaction header field in TpProcessRequest.
// This field can be set before transaction processor registers with
// validator.
enum TpProcessRequestHeaderStyle {
HEADER_STYLE_UNSET = 0;
EXPANDED = 1;
RAW = 2;
}
// A settled upon name for the capabilities of the transaction processor.
// For example: intkey, xo
string family = 1;
// The version supported. For example:
// 1.0 for version 1.0
// 2.1 for version 2.1
string version = 2;
// The namespaces this transaction processor expects to interact with
// when processing transactions matching this specification; will be
// enforced by the state API on the validator.
repeated string namespaces = 4;
// The maximum number of transactions that this transaction processor can
// handle at once.
uint32 max_occupancy = 5;
// Validator can make use of this field to check if the requested features
// are supported. Registration requests can be either accepted or rejected
// based on this field.
uint32 protocol_version = 6;
// Setting it to RAW, validator would fill in serialized transaction header
// when sending TpProcessRequest to the transaction processor.
TpProcessRequestHeaderStyle request_header_style = 7;
}
// A response sent from the validator to the transaction processor
// acknowledging the registration
message TpRegisterResponse {
enum Status {
STATUS_UNSET = 0;
OK = 1;
ERROR = 2;
}
Status status = 1;
// Respond back with protocol_version, the value that can be used by SDK to
// know if validator supports expected feature.
uint32 protocol_version = 2;
}
// The unregistration request from the transaction processor to the
// validator/executor. The correct handlers are determined from the
// zeromq identity of the tp, on the validator side.
message TpUnregisterRequest {
}
// A response sent from the validator to the transaction processor
// acknowledging the unregistration
message TpUnregisterResponse {
enum Status {
STATUS_UNSET = 0;
OK = 1;
ERROR = 2;
}
Status status = 1;
}
// The request from the validator/executor of the transaction processor
// to verify a transaction.
message TpProcessRequest {
// The de-serialized transaction header from client request
TransactionHeader header = 1;
// The transaction payload
bytes payload = 2;
// The transaction header_signature
string signature = 3;
// The context_id for state requests.
string context_id = 4;
// The serialized header as received by client.
// Controlled by a flag during transaction processor registration.
bytes header_bytes = 5;
}
// The response from the transaction processor to the validator/executor
// used to respond about the validity of a transaction
message TpProcessResponse {
enum Status {
STATUS_UNSET = 0;
OK = 1;
INVALID_TRANSACTION = 2;
INTERNAL_ERROR = 3;
}
Status status = 1;
// A message to include on responses in the cases where
// status is either INVALID_TRANSACTION or INTERNAL_ERROR
string message = 2;
// Information that may be included with the response.
// This information is an opaque, application-specific encoded block of
// data that will be propagated back to the transaction submitter.
bytes extended_data = 3;
}
// Copyright 2017 Intel Corporation
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
// -----------------------------------------------------------------------------
syntax = "proto3";
option java_multiple_files = true;
option java_package = "sawtooth.sdk.protobuf";
option go_package = "client_transaction_pb2";
import "transaction.proto";
import "client_list_control.proto";
// A request to return a list of txns from the validator. May include the id
// of a particular block to be the `head` of the chain being requested. In that
// case the list will include the txns from that block, and all txns
// previous to that block on the chain. Filter with specific `transaction_ids`.
message ClientTransactionListRequest {
string head_id = 1;
repeated string transaction_ids = 2;
ClientPagingControls paging = 3;
repeated ClientSortControls sorting = 4;
}
// A response that lists transactions from newest to oldest.
//
// Statuses:
// * OK - everything worked as expected
// * INTERNAL_ERROR - general error, such as protobuf failing to deserialize
// * NOT_READY - the validator does not yet have a genesis block
// * NO_ROOT - the head block specified was not found
// * NO_RESOURCE - no txns were found with the parameters specified
// * INVALID_PAGING - the paging controls were malformed or out of range
// * INVALID_SORT - the sorting controls were malformed or invalid
message ClientTransactionListResponse {
enum Status {
STATUS_UNSET = 0;
OK = 1;
INTERNAL_ERROR = 2;
NOT_READY = 3;
NO_ROOT = 4;
NO_RESOURCE = 5;
INVALID_PAGING = 6;
INVALID_SORT = 7;
INVALID_ID = 8;
}
Status status = 1;
repeated Transaction transactions = 2;
string head_id = 3;
ClientPagingResponse paging = 4;
}
// Fetches a specific txn by its id (header_signature) from the blockchain.
message ClientTransactionGetRequest {
string transaction_id = 1;
}
// A response that returns the txn specified by a ClientTransactionGetRequest.
//
// Statuses:
// * OK - everything worked as expected, txn has been fetched
// * INTERNAL_ERROR - general error, such as protobuf failing to deserialize
// * NO_RESOURCE - no txn with the specified id exists
message ClientTransactionGetResponse {
enum Status {
STATUS_UNSET = 0;
OK = 1;
INTERNAL_ERROR = 2;
NO_RESOURCE = 5;
INVALID_ID = 8;
}
Status status = 1;
Transaction transaction = 2;
}
// Copyright 2017 Intel Corporation
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
// -----------------------------------------------------------------------------
syntax = "proto3";
option java_multiple_files = true;
option java_package = "sawtooth.sdk.protobuf";
option go_package = "client_list_control_pb2";
// Paging controls to be sent with List requests.
// Attributes:
// start: The id of a resource to start the page with
// limit: The number of results per page, defaults to 100 and maxes out at 1000
message ClientPagingControls {
string start = 1;
int32 limit = 2;
}
// Information about the pagination used, sent back with List responses.
// Attributes:
// next: The id of the first resource in the next page
// start: The id of the first resource in the returned page
// limit: The number of results per page, defaults to 100 and maxes out at 1000
message ClientPagingResponse {
string next = 1;
string start = 2;
int32 limit = 3;
}
// Sorting controls to be sent with List requests. More than one can be sent.
// If so, the first is used, and additional controls are tie-breakers.
// Attributes:
// keys: Nested set of keys to sort by (i.e. ['default, block_num'])
// reverse: Whether or not to reverse the sort (i.e. descending order)
message ClientSortControls {
repeated string keys = 1;
bool reverse = 2;
}
// Copyright 2016 Intel Corporation
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
// -----------------------------------------------------------------------------
syntax = "proto3";
option java_multiple_files = true;
option java_package = "sawtooth.sdk.protobuf";
option go_package = "batch_pb2";
import "transaction.proto";
message BatchHeader {
// Public key for the client that signed the BatchHeader
string signer_public_key = 1;
// List of transaction.header_signatures that match the order of
// transactions required for the batch
repeated string transaction_ids = 2;
}
message Batch {
// The serialized version of the BatchHeader
bytes header = 1;
// The signature derived from signing the header
string header_signature = 2;
// A list of the transactions that match the list of
// transaction_ids listed in the batch header
repeated Transaction transactions = 3;
// A debugging flag which indicates this batch should be traced through the
// system, resulting in a higher level of debugging output.
bool trace = 4;
}
message BatchList {
repeated Batch batches = 1;
}
// Copyright 2017 Intel Corporation
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
// -----------------------------------------------------------------------------
syntax = "proto3";
option java_multiple_files = true;
option java_package = "sawtooth.sdk.protobuf";
option go_package = "events_pb2";
message Event {
// Used to subscribe to events and servers as a hint for how to deserialize
// event_data and what pairs to expect in attributes.
string event_type = 1;
// Transparent data defined by the event_type.
message Attribute {
string key = 1;
string value = 2;
}
repeated Attribute attributes = 2;
// Opaque data defined by the event_type.
bytes data = 3;
}
message EventList {
repeated Event events = 1;
}
message EventFilter {
// EventFilter is used when subscribing to events to limit the events
// received within a given event type. See
// validator/server/events/subscription.py for further explanation.
string key = 1;
string match_string = 2;
enum FilterType {
FILTER_TYPE_UNSET = 0;
SIMPLE_ANY = 1;
SIMPLE_ALL = 2;
REGEX_ANY = 3;
REGEX_ALL = 4;
}
FilterType filter_type = 3;
}
message EventSubscription {
// EventSubscription is used when subscribing to events to specify the type
// of events being subscribed to, along with any additional filters. See
// validator/server/events/subscription.py for further explanation.
string event_type = 1;
repeated EventFilter filters = 2;
}
// Copyright 2017 Intel Corporation
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
// -----------------------------------------------------------------------------
syntax = "proto3";
option java_multiple_files = true;
option java_package = "sawtooth.identity.protobuf";
message Policy {
enum EntryType {
ENTRY_TYPE_UNSET = 0;
PERMIT_KEY = 1;
DENY_KEY = 2;
}
message Entry {
// Whether this is a Permit_KEY or Deny_KEY entry
EntryType type = 1;
// This should be a public key or * to refer to all participants.
string key = 2;
}
// name of the policy, this should be unique.
string name = 1;
// list of Entries
// The entries will be processed in order from first to last.
repeated Entry entries = 2;
}
// Policy will be stored in a Policy list to account for state collisions
message PolicyList {
repeated Policy policies = 1;
}
message Role {
// Role name
string name = 1;
// Name of corresponding policy
string policy_name = 2;
}
// Roles will be stored in a RoleList to account for state collisions
message RoleList {
repeated Role roles = 1;
}
// Copyright 2016 Intel Corporation
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
// -----------------------------------------------------------------------------
syntax = "proto3";
option java_multiple_files = true;
option java_package = "sawtooth.sdk.protobuf";
option go_package = "block_pb2";
import "batch.proto";
message BlockHeader {
// Block number in the chain
uint64 block_num = 1;
// The header_signature of the previous block that was added to the chain.
string previous_block_id = 2;
// Public key for the component internal to the validator that
// signed the BlockHeader
string signer_public_key = 3;
// List of batch.header_signatures that match the order of batches
// required for the block
repeated string batch_ids = 4;
// Bytes that are set and verified by the consensus algorithm used to
// create and validate the block
bytes consensus = 5;
// The state_root_hash should match the final state_root after all
// transactions in the batches have been applied, otherwise the block
// is not valid
string state_root_hash = 6;
}
message Block {
// The serialized version of the BlockHeader
bytes header = 1;
// The signature derived from signing the header
string header_signature = 2;
// A list of batches. The batches may contain new batches that other
// validators may not have received yet, or they will be all batches needed
// for block validation when passed to the journal
repeated Batch batches = 3;
}
// Copyright 2017 Intel Corporation
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
// -----------------------------------------------------------------------------
syntax = "proto3";
option java_multiple_files = true;
option java_package = "sawtooth.sdk.protobuf";
option go_package = "client_state_pb2";
import "client_list_control.proto";
// A request to list every entry in global state. Defaults to the most current
// tree, but can fetch older state by specifying a state root. Results can be
// further filtered by specifying a subtree with a partial address.
message ClientStateListRequest {
string state_root = 1;
string address = 3;
ClientPagingControls paging = 4;
repeated ClientSortControls sorting = 5;
}
// A response that lists the data Entries from global state, filtered by state
// root or subtree address according to the request. Returns the state root
// used to facilitate future requests.
//
// Statuses:
// * OK - everything worked as expected
// * INTERNAL_ERROR - general error, such as protobuf failing to deserialize
// * NOT_READY - the validator does not yet have a genesis block
// * NO_ROOT - the head block or merkle_root specified was not found
// * NO_RESOURCE - the head/root specified is valid, but contains no data
// * INVALID_PAGING - the paging controls were malformed or out of range
// * INVALID_SORT - the sorting controls were malformed or invalid
message ClientStateListResponse {
enum Status {
STATUS_UNSET = 0;
OK = 1;
INTERNAL_ERROR = 2;
NOT_READY = 3;
NO_ROOT = 4;
NO_RESOURCE = 5;
INVALID_PAGING = 6;
INVALID_SORT = 7;
INVALID_ADDRESS = 8;
INVALID_ROOT = 9;
}
// An entry in the State
message Entry {
string address = 1;
bytes data = 2;
}
Status status = 1;
repeated Entry entries = 2;
string state_root = 3;
ClientPagingResponse paging = 4;
}
// A request from a client for a particular entry in global state.
// Like State List, it defaults to the newest state, but a state root
// can be used to specify older data. Unlike State List the request must be
// provided with a full address that corresponds to a single entry.
message ClientStateGetRequest {
string state_root = 1;
string address = 3;
}
// The response to a State Get Request from the client. Sends back just
// the data stored at the entry, not the address. Also sends back the
// head block id used to facilitate further requests.
//
// Statuses:
// * OK - everything worked as expected
// * INTERNAL_ERROR - general error, such as protobuf failing to deserialize
// * NOT_READY - the validator does not yet have a genesis block
// * NO_ROOT - the state_root specified was not found
// * NO_RESOURCE - the address specified doesn't exist
// * INVALID_ADDRESS - address isn't a valid, i.e. it's a subtree (truncated)
message ClientStateGetResponse {
enum Status {
STATUS_UNSET = 0;
OK = 1;
INTERNAL_ERROR = 2;
NOT_READY = 3;
NO_ROOT = 4;
NO_RESOURCE = 5;
INVALID_ADDRESS = 6;
INVALID_ROOT = 7;
}
Status status = 1;
bytes value = 2;
string state_root = 3;
}
// Copyright 2017 Intel Corporation
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
// -----------------------------------------------------------------------------
syntax = "proto3";
option java_multiple_files = true;
option java_package = "sawtooth.sdk.protobuf";
option go_package = "client_event_pb2";
import "events.proto";
message ClientEventsSubscribeRequest {
repeated EventSubscription subscriptions = 1;
// The block id (or ids, if trying to walk back a fork) the subscriber last
// received events on. It can be set to empty if it has not yet received the
// genesis block.
repeated string last_known_block_ids = 2;
}
message ClientEventsSubscribeResponse {
enum Status {
STATUS_UNSET = 0;
OK = 1;
INVALID_FILTER = 2;
UNKNOWN_BLOCK = 3;
}
Status status = 1;
// Additional information about the response status
string response_message = 2;
}
message ClientEventsUnsubscribeRequest {}
message ClientEventsUnsubscribeResponse {
enum Status {
STATUS_UNSET = 0;
OK = 1;
INTERNAL_ERROR = 2;
}
Status status = 1;
}
message ClientEventsGetRequest {
repeated EventSubscription subscriptions = 1;
repeated string block_ids = 2;
}
message ClientEventsGetResponse {
enum Status {
STATUS_UNSET = 0;
OK = 1;
INTERNAL_ERROR = 2;
INVALID_FILTER = 3;
UNKNOWN_BLOCK = 4;
}
Status status = 1;
repeated Event events = 2;
}
// Copyright 2016 Intel Corporation
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
// -----------------------------------------------------------------------------
syntax = "proto3";
option java_multiple_files = true;
option java_package = "sawtooth.sdk.protobuf";
option go_package = "state_context_pb2";
import "events.proto";
// An entry in the State
message TpStateEntry {
string address = 1;
bytes data = 2;
}
// A request from a handler/tp for the values at a series of addresses
message TpStateGetRequest {
// The context id that references a context in the contextmanager
string context_id = 1;
repeated string addresses = 2;
}
// A response from the contextmanager/validator with a series of State entries
message TpStateGetResponse {
enum Status {
STATUS_UNSET = 0;
OK = 1;
AUTHORIZATION_ERROR = 2;
}
repeated TpStateEntry entries = 1;
Status status = 2;
}
// A request from the handler/tp to put entries in the state of a context
message TpStateSetRequest {
string context_id = 1;
repeated TpStateEntry entries = 2;
}
// A response from the contextmanager/validator with the addresses that were set
message TpStateSetResponse {
enum Status {
STATUS_UNSET = 0;
OK = 1;
AUTHORIZATION_ERROR = 2;
}
repeated string addresses = 1;
Status status = 2;
}
// A request from the handler/tp to delete state entries at an collection of addresses
message TpStateDeleteRequest {
string context_id = 1;
repeated string addresses = 2;
}
// A response form the contextmanager/validator with the addresses that were deleted
message TpStateDeleteResponse {
enum Status {
STATUS_UNSET = 0;
OK = 1;
AUTHORIZATION_ERROR = 2;
}
repeated string addresses = 1;
Status status = 2;
}
// The request from the transaction processor to the validator append data
// to a transaction receipt
message TpReceiptAddDataRequest {
// The context id that references a context in the context manager
string context_id = 1;
bytes data = 3;
}
// The response from the validator to the transaction processor to verify that
// data has been appended to a transaction receipt
message TpReceiptAddDataResponse {
enum Status {
STATUS_UNSET = 0;
OK = 1;
ERROR = 2;
}
Status status = 2;
}
message TpEventAddRequest {
string context_id = 1;
Event event = 2;
}
message TpEventAddResponse {
enum Status {
STATUS_UNSET = 0;
OK = 1;
ERROR = 2;
}
Status status = 2;
}
// Copyright 2017 Intel Corporation
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
// -----------------------------------------------------------------------------
syntax = "proto3";
option java_multiple_files = true;
option java_package = "sawtooth.sdk.protobuf";
option go_package = "setting_pb2";
// Setting Container for on-chain configuration key/value pairs
message Setting {
// Contains a setting entry (or entries, in the case of collisions).
message Entry {
string key = 1;
string value = 2;
}
// List of setting entries - more than one implies a state key collision
repeated Entry entries = 1;
}
// Copyright 2017 Intel Corporation
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
// -----------------------------------------------------------------------------
syntax = "proto3";
option java_multiple_files = true;
option java_package = "sawtooth.block_info.protobuf";
option go_package = "block_info_pb2";
message BlockInfoConfig {
uint64 latest_block = 1;
uint64 oldest_block = 2;
uint64 target_count = 3;
uint64 sync_tolerance = 4;
}
message BlockInfo {
// Block number in the chain
uint64 block_num = 1;
// The header_signature of the previous block that was added to the chain.
string previous_block_id = 2;
// Public key for the component internal to the validator that
// signed the BlockHeader
string signer_public_key = 3;
// The signature derived from signing the header
string header_signature = 4;
// Approximately when this block was committed, as a Unix UTC timestamp
uint64 timestamp = 5;
}
message BlockInfoTxn {
// The new block to add to state
BlockInfo block = 1;
// If this is set, the new target number of blocks to store in state
uint64 target_count = 2;
// If set, the new network time synchronization tolerance.
uint64 sync_tolerance = 3;
}
// Copyright 2017 Intel Corporation
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
// -----------------------------------------------------------------------------
syntax = "proto3";
option java_multiple_files = true;
option java_package = "sawtooth.sdk.protobuf";
option go_package = "txn_receipt_pb2";
import "events.proto";
message TransactionReceipt {
// State changes made by this transaction
// StateChange is defined in protos/transaction_receipt.proto
repeated StateChange state_changes = 1;
// Events fired by this transaction
repeated Event events = 2;
// Transaction family defined data
repeated bytes data = 3;
string transaction_id = 4;
}
// StateChange objects have the type of SET, which is either an insert or
// update, or DELETE. Items marked as a DELETE will have no byte value.
message StateChange {
enum Type {
TYPE_UNSET = 0;
SET = 1;
DELETE = 2;
}
string address = 1;
bytes value = 2;
Type type = 3;
}
// A collection of state changes.
message StateChangeList {
repeated StateChange state_changes = 1;
}
// Copyright 2017 Intel Corporation
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
// -----------------------------------------------------------------------------
syntax = "proto3";
option java_multiple_files = true;
option java_package = "sawtooth.sdk.protobuf";
option go_package = "client_batch_pb2";
import "batch.proto";
import "client_list_control.proto";
// A request to return a list of batches from the validator. May include the id
// of a particular block to be the `head` of the chain being requested. In that
// case the list will include the batches from that block, and all batches
// previous to that block on the chain. Filter with specific `batch_ids`.
message ClientBatchListRequest {
string head_id = 1;
repeated string batch_ids = 2;
ClientPagingControls paging = 3;
repeated ClientSortControls sorting = 4;
}
// A response that lists batches from newest to oldest.
//
// Statuses:
// * OK - everything worked as expected
// * INTERNAL_ERROR - general error, such as protobuf failing to deserialize
// * NOT_READY - the validator does not yet have a genesis block
// * NO_ROOT - the head block specified was not found
// * NO_RESOURCE - no batches were found with the parameters specified
// * INVALID_PAGING - the paging controls were malformed or out of range
// * INVALID_SORT - the sorting controls were malformed or invalid
message ClientBatchListResponse {
enum Status {
STATUS_UNSET = 0;
OK = 1;
INTERNAL_ERROR = 2;
NOT_READY = 3;
NO_ROOT = 4;
NO_RESOURCE = 5;
INVALID_PAGING = 6;
INVALID_SORT = 7;
INVALID_ID = 8;
}
Status status = 1;
repeated Batch batches = 2;
string head_id = 3;
ClientPagingResponse paging = 4;
}
// Fetches a specific batch by its id (header_signature) from the blockchain.
message ClientBatchGetRequest {
string batch_id = 1;
}
// A response that returns the batch specified by a ClientBatchGetRequest.
//
// Statuses:
// * OK - everything worked as expected, batch has been fetched
// * INTERNAL_ERROR - general error, such as protobuf failing to deserialize
// * NO_RESOURCE - no batch with the specified id exists
message ClientBatchGetResponse {
enum Status {
STATUS_UNSET = 0;
OK = 1;
INTERNAL_ERROR = 2;
NO_RESOURCE = 5;
INVALID_ID = 8;
}
Status status = 1;
Batch batch = 2;
}
// Copyright 2017 Intel Corporation
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
// -----------------------------------------------------------------------------
syntax = "proto3";
option java_multiple_files = true;
option java_package = "sawtooth.sdk.protobuf";
option go_package = "authorization_pb2";
message ConnectionRequest {
// This is the first message that must be sent to start off authorization.
// The endpoint of the connection.
string endpoint = 1;
}
enum RoleType {
ROLE_TYPE_UNSET = 0;
// A shorthand request for asking for all allowed roles.
ALL = 1;
// Role defining validator to validator communication
NETWORK = 2;
}
message ConnectionResponse {
// Whether the connection can participate in authorization
enum Status {
STATUS_UNSET = 0;
OK = 1;
ERROR = 2;
}
//Authorization Type required for the authorization procedure
enum AuthorizationType {
AUTHORIZATION_TYPE_UNSET = 0;
TRUST = 1;
CHALLENGE = 2;
}
message RoleEntry {
// The role type for this role entry
RoleType role = 1;
// The Authorization Type required for the above role
AuthorizationType auth_type = 2;
}
repeated RoleEntry roles = 1;
Status status = 2;
}
message AuthorizationTrustRequest {
// A set of requested RoleTypes
repeated RoleType roles = 1;
string public_key = 2;
}
message AuthorizationTrustResponse {
// The actual set the requester has access to
repeated RoleType roles = 1;
}
message AuthorizationViolation {
// The Role the requester did not have access to
RoleType violation = 1;
}
message AuthorizationChallengeRequest {
// Empty message sent to request a payload to sign
}
message AuthorizationChallengeResponse {
// Random payload that the connecting node must sign
bytes payload = 1;
}
message AuthorizationChallengeSubmit {
// public key of node
string public_key = 1;
// signature derived from signing the challenge payload
string signature = 3;
// A set of requested Roles
repeated RoleType roles = 4;
}
message AuthorizationChallengeResult {
// The approved roles for that connection
repeated RoleType roles = 1;
}
// Copyright 2017 Intel Corporation
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
// -----------------------------------------------------------------------------
syntax = "proto3";
option java_multiple_files = true;
option java_package = "sawtooth.sdk.protobuf";
option go_package = "genesis_pb2";
import "batch.proto";
message GenesisData {
// The list of batches that will be applied during the genesis process
repeated Batch batches = 1;
}
// Copyright 2018 Intel Corporation
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
// -----------------------------------------------------------------------------
syntax = "proto3";
option java_multiple_files = true;
option java_package = "sawtooth.sdk.protobuf";
option go_package = "merkle_pb2";
// An Entry in the change log for a given state root.
message ChangeLogEntry {
// A state root that succeed this root.
message Successor {
// A root hash of a merkle trie based of off this root.
bytes successor = 1;
// The keys (i.e. hashes) that were replaced (i.e. deleted) by this
// successor. These may be deleted during pruning.
repeated bytes deletions = 2;
}
// A root hash of a merkle trie this tree was based off.
bytes parent = 1;
// The hashes that were added for this root. These may be deleted during
// pruning, if this root is being abandoned.
repeated bytes additions = 2;
// The list of successors.
repeated Successor successors = 3;
}
// Copyright 2016, 2017 Intel Corporation
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
// -----------------------------------------------------------------------------
syntax = "proto3";
option java_multiple_files = true;
option java_package = "sawtooth.sdk.protobuf";
option go_package = "network_pb2";
// The disconnect message from a client to the server
message DisconnectMessage {
}
// The registration request from a peer to the validator
message PeerRegisterRequest {
string endpoint = 1;
// The current version of the network protocol that is being used by the
// sender. This version is an increasing value.
uint32 protocol_version = 2;
}
// The unregistration request from a peer to the validator
message PeerUnregisterRequest {
}
message GetPeersRequest {
}
message GetPeersResponse {
repeated string peer_endpoints = 1;
}
message PingRequest {
}
message PingResponse{
}
message GossipMessage {
enum ContentType{
CONTENT_TYPE_UNSET = 0;
BLOCK = 1;
BATCH = 2;
CONSENSUS = 3;
}
bytes content = 1;
ContentType content_type = 2;
uint32 time_to_live = 3;
}
// A response sent from the validator to the peer acknowledging message
// receipt
message NetworkAcknowledgement {
enum Status {
STATUS_UNSET = 0;
OK = 1;
ERROR = 2;
}
Status status = 1;
}
message GossipBlockRequest {
// The id of the block that is being requested
string block_id = 1;
// A random string that provides uniqueness for requests with
// otherwise identical fields.
string nonce = 2;
uint32 time_to_live = 3;
}
message GossipBlockResponse {
// The block
bytes content = 1;
}
message GossipBatchResponse {
//The batch
bytes content = 1;
}
message GossipBatchByBatchIdRequest {
// The id of the batch that is being requested
string id = 1;
// A random string that provides uniqueness for requests with
// otherwise identical fields.
string nonce = 2;
uint32 time_to_live = 3;
}
message GossipBatchByTransactionIdRequest {
// The id's of the transaction that are in the batches requested
repeated string ids = 1;
// A random string that provides uniqueness for requests with
// otherwise identical fields.
string nonce = 2;
uint32 time_to_live = 3;
}
// Copyright 2017 Intel Corporation
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
// -----------------------------------------------------------------------------
syntax = "proto3";
option java_multiple_files = true;
option java_package = "sawtooth.sdk.protobuf";
option go_package = "client_peer";
message ClientPeersGetRequest{
}
message ClientPeersGetResponse {
enum Status {
STATUS_UNSET = 0;
OK = 1;
ERROR = 2;
}
Status status = 1;
repeated string peers = 2;
}
// Copyright 2017 Intel Corporation
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
// -----------------------------------------------------------------------------
syntax = "proto3";
option java_multiple_files = true;
option java_package = "sawtooth.sdk.protobuf";
option go_package = "client_receipt_pb2";
import "transaction_receipt.proto";
// Fetches a specific txn by its id (header_signature) from the blockchain.
message ClientReceiptGetRequest {
repeated string transaction_ids = 1;
}
// A response that returns the txn receipt specified by a
// ClientTransactionReceiptGetRequest.
//
// Statuses:
// * OK - everything worked as expected, txn receipt has been fetched
// * INTERNAL_ERROR - general error, such as protobuf failing to deserialize
// * NO_RESOURCE - no receipt exists for the transaction id specified
message ClientReceiptGetResponse {
enum Status {
STATUS_UNSET = 0;
OK = 1;
INTERNAL_ERROR = 2;
NO_RESOURCE = 5;
INVALID_ID = 8;
}
Status status = 1;
repeated TransactionReceipt receipts = 2;
}