github.com/muhammedhassanm/blockchain@v0.0.0-20200120143007-697261defd4d/sawtooth-core-master/protos/client_state.proto (about) 1 // Copyright 2017 Intel Corporation 2 // 3 // Licensed under the Apache License, Version 2.0 (the "License"); 4 // you may not use this file except in compliance with the License. 5 // You may obtain a copy of the License at 6 // 7 // http://www.apache.org/licenses/LICENSE-2.0 8 // 9 // Unless required by applicable law or agreed to in writing, software 10 // distributed under the License is distributed on an "AS IS" BASIS, 11 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 // See the License for the specific language governing permissions and 13 // limitations under the License. 14 // ----------------------------------------------------------------------------- 15 16 syntax = "proto3"; 17 18 option java_multiple_files = true; 19 option java_package = "sawtooth.sdk.protobuf"; 20 option go_package = "client_state_pb2"; 21 22 import "client_list_control.proto"; 23 24 25 // A request to list every entry in global state. Defaults to the most current 26 // tree, but can fetch older state by specifying a state root. Results can be 27 // further filtered by specifying a subtree with a partial address. 28 message ClientStateListRequest { 29 string state_root = 1; 30 string address = 3; 31 ClientPagingControls paging = 4; 32 repeated ClientSortControls sorting = 5; 33 } 34 35 // A response that lists the data Entries from global state, filtered by state 36 // root or subtree address according to the request. Returns the state root 37 // used to facilitate future requests. 38 // 39 // Statuses: 40 // * OK - everything worked as expected 41 // * INTERNAL_ERROR - general error, such as protobuf failing to deserialize 42 // * NOT_READY - the validator does not yet have a genesis block 43 // * NO_ROOT - the head block or merkle_root specified was not found 44 // * NO_RESOURCE - the head/root specified is valid, but contains no data 45 // * INVALID_PAGING - the paging controls were malformed or out of range 46 // * INVALID_SORT - the sorting controls were malformed or invalid 47 48 message ClientStateListResponse { 49 enum Status { 50 STATUS_UNSET = 0; 51 OK = 1; 52 INTERNAL_ERROR = 2; 53 NOT_READY = 3; 54 NO_ROOT = 4; 55 NO_RESOURCE = 5; 56 INVALID_PAGING = 6; 57 INVALID_SORT = 7; 58 INVALID_ADDRESS = 8; 59 INVALID_ROOT = 9; 60 } 61 62 // An entry in the State 63 message Entry { 64 string address = 1; 65 bytes data = 2; 66 } 67 68 Status status = 1; 69 repeated Entry entries = 2; 70 string state_root = 3; 71 ClientPagingResponse paging = 4; 72 } 73 74 // A request from a client for a particular entry in global state. 75 // Like State List, it defaults to the newest state, but a state root 76 // can be used to specify older data. Unlike State List the request must be 77 // provided with a full address that corresponds to a single entry. 78 message ClientStateGetRequest { 79 string state_root = 1; 80 string address = 3; 81 } 82 83 // The response to a State Get Request from the client. Sends back just 84 // the data stored at the entry, not the address. Also sends back the 85 // head block id used to facilitate further requests. 86 // 87 // Statuses: 88 // * OK - everything worked as expected 89 // * INTERNAL_ERROR - general error, such as protobuf failing to deserialize 90 // * NOT_READY - the validator does not yet have a genesis block 91 // * NO_ROOT - the state_root specified was not found 92 // * NO_RESOURCE - the address specified doesn't exist 93 // * INVALID_ADDRESS - address isn't a valid, i.e. it's a subtree (truncated) 94 message ClientStateGetResponse { 95 enum Status { 96 STATUS_UNSET = 0; 97 OK = 1; 98 INTERNAL_ERROR = 2; 99 NOT_READY = 3; 100 NO_ROOT = 4; 101 NO_RESOURCE = 5; 102 INVALID_ADDRESS = 6; 103 INVALID_ROOT = 7; 104 } 105 Status status = 1; 106 bytes value = 2; 107 string state_root = 3; 108 }