├── .gitignore ├── LICENSE ├── Makefile ├── README.md ├── go.mod ├── go.sum ├── golang ├── iotexapi │ ├── api.pb.go │ ├── api_grpc.pb.go │ ├── mock_iotexapi │ │ └── mock_iotexapi.go │ └── read_state.pb.go ├── iotexrpc │ └── rpc.pb.go ├── iotextypes │ ├── action.pb.go │ ├── blockchain.pb.go │ ├── consensus.pb.go │ ├── election.pb.go │ ├── endorsement.pb.go │ ├── genesis.pb.go │ ├── node.pb.go │ ├── receiptstatus.pb.go │ ├── state_data.pb.go │ └── transaction_log.pb.go ├── protocol │ └── const.go ├── testingpb │ └── testing.pb.go └── utils.go ├── misc └── scripts │ └── mockgen.sh └── proto ├── api ├── api.proto └── read_state.proto ├── rpc └── rpc.proto ├── testing └── testing.proto └── types ├── action.proto ├── blockchain.proto ├── consensus.proto ├── election.proto ├── endorsement.proto ├── genesis.proto ├── node.proto ├── receiptstatus.proto ├── state_data.proto └── transaction_log.proto /.gitignore: -------------------------------------------------------------------------------- 1 | .idea 2 | *.iml 3 | *.db 4 | 5 | .cache 6 | 7 | *.DS_Store 8 | .AppleDouble 9 | .LSOverride 10 | 11 | # profiling output 12 | pprof* 13 | 14 | # Binaries for programs and plugins 15 | *.exe 16 | *.dll 17 | *.dylib 18 | *.pyc 19 | 20 | # Test binary, build with `go test -c` 21 | *.test 22 | 23 | #git patch 24 | *.patch 25 | 26 | # Output of the go coverage tool, specifically when used with LiteIDE 27 | *.out 28 | 29 | # vendor 30 | vendor/* 31 | 32 | # binary 33 | bin/* 34 | **/release 35 | coverage.txt 36 | lint.log 37 | .editorconfig 38 | 39 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | Apache License 2 | Version 2.0, January 2004 3 | http://www.apache.org/licenses/ 4 | 5 | TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION 6 | 7 | 1. Definitions. 8 | 9 | "License" shall mean the terms and conditions for use, reproduction, 10 | and distribution as defined by Sections 1 through 9 of this document. 11 | 12 | "Licensor" shall mean the copyright owner or entity authorized by 13 | the copyright owner that is granting the License. 14 | 15 | "Legal Entity" shall mean the union of the acting entity and all 16 | other entities that control, are controlled by, or are under common 17 | control with that entity. For the purposes of this definition, 18 | "control" means (i) the power, direct or indirect, to cause the 19 | direction or management of such entity, whether by contract or 20 | otherwise, or (ii) ownership of fifty percent (50%) or more of the 21 | outstanding shares, or (iii) beneficial ownership of such entity. 22 | 23 | "You" (or "Your") shall mean an individual or Legal Entity 24 | exercising permissions granted by this License. 25 | 26 | "Source" form shall mean the preferred form for making modifications, 27 | including but not limited to software source code, documentation 28 | source, and configuration files. 29 | 30 | "Object" form shall mean any form resulting from mechanical 31 | transformation or translation of a Source form, including but 32 | not limited to compiled object code, generated documentation, 33 | and conversions to other media types. 34 | 35 | "Work" shall mean the work of authorship, whether in Source or 36 | Object form, made available under the License, as indicated by a 37 | copyright notice that is included in or attached to the work 38 | (an example is provided in the Appendix below). 39 | 40 | "Derivative Works" shall mean any work, whether in Source or Object 41 | form, that is based on (or derived from) the Work and for which the 42 | editorial revisions, annotations, elaborations, or other modifications 43 | represent, as a whole, an original work of authorship. For the purposes 44 | of this License, Derivative Works shall not include works that remain 45 | separable from, or merely link (or bind by name) to the interfaces of, 46 | the Work and Derivative Works thereof. 47 | 48 | "Contribution" shall mean any work of authorship, including 49 | the original version of the Work and any modifications or additions 50 | to that Work or Derivative Works thereof, that is intentionally 51 | submitted to Licensor for inclusion in the Work by the copyright owner 52 | or by an individual or Legal Entity authorized to submit on behalf of 53 | the copyright owner. For the purposes of this definition, "submitted" 54 | means any form of electronic, verbal, or written communication sent 55 | to the Licensor or its representatives, including but not limited to 56 | communication on electronic mailing lists, source code control systems, 57 | and issue tracking systems that are managed by, or on behalf of, the 58 | Licensor for the purpose of discussing and improving the Work, but 59 | excluding communication that is conspicuously marked or otherwise 60 | designated in writing by the copyright owner as "Not a Contribution." 61 | 62 | "Contributor" shall mean Licensor and any individual or Legal Entity 63 | on behalf of whom a Contribution has been received by Licensor and 64 | subsequently incorporated within the Work. 65 | 66 | 2. Grant of Copyright License. Subject to the terms and conditions of 67 | this License, each Contributor hereby grants to You a perpetual, 68 | worldwide, non-exclusive, no-charge, royalty-free, irrevocable 69 | copyright license to reproduce, prepare Derivative Works of, 70 | publicly display, publicly perform, sublicense, and distribute the 71 | Work and such Derivative Works in Source or Object form. 72 | 73 | 3. Grant of Patent License. Subject to the terms and conditions of 74 | this License, each Contributor hereby grants to You a perpetual, 75 | worldwide, non-exclusive, no-charge, royalty-free, irrevocable 76 | (except as stated in this section) patent license to make, have made, 77 | use, offer to sell, sell, import, and otherwise transfer the Work, 78 | where such license applies only to those patent claims licensable 79 | by such Contributor that are necessarily infringed by their 80 | Contribution(s) alone or by combination of their Contribution(s) 81 | with the Work to which such Contribution(s) was submitted. If You 82 | institute patent litigation against any entity (including a 83 | cross-claim or counterclaim in a lawsuit) alleging that the Work 84 | or a Contribution incorporated within the Work constitutes direct 85 | or contributory patent infringement, then any patent licenses 86 | granted to You under this License for that Work shall terminate 87 | as of the date such litigation is filed. 88 | 89 | 4. Redistribution. You may reproduce and distribute copies of the 90 | Work or Derivative Works thereof in any medium, with or without 91 | modifications, and in Source or Object form, provided that You 92 | meet the following conditions: 93 | 94 | (a) You must give any other recipients of the Work or 95 | Derivative Works a copy of this License; and 96 | 97 | (b) You must cause any modified files to carry prominent notices 98 | stating that You changed the files; and 99 | 100 | (c) You must retain, in the Source form of any Derivative Works 101 | that You distribute, all copyright, patent, trademark, and 102 | attribution notices from the Source form of the Work, 103 | excluding those notices that do not pertain to any part of 104 | the Derivative Works; and 105 | 106 | (d) If the Work includes a "NOTICE" text file as part of its 107 | distribution, then any Derivative Works that You distribute must 108 | include a readable copy of the attribution notices contained 109 | within such NOTICE file, excluding those notices that do not 110 | pertain to any part of the Derivative Works, in at least one 111 | of the following places: within a NOTICE text file distributed 112 | as part of the Derivative Works; within the Source form or 113 | documentation, if provided along with the Derivative Works; or, 114 | within a display generated by the Derivative Works, if and 115 | wherever such third-party notices normally appear. The contents 116 | of the NOTICE file are for informational purposes only and 117 | do not modify the License. You may add Your own attribution 118 | notices within Derivative Works that You distribute, alongside 119 | or as an addendum to the NOTICE text from the Work, provided 120 | that such additional attribution notices cannot be construed 121 | as modifying the License. 122 | 123 | You may add Your own copyright statement to Your modifications and 124 | may provide additional or different license terms and conditions 125 | for use, reproduction, or distribution of Your modifications, or 126 | for any such Derivative Works as a whole, provided Your use, 127 | reproduction, and distribution of the Work otherwise complies with 128 | the conditions stated in this License. 129 | 130 | 5. Submission of Contributions. Unless You explicitly state otherwise, 131 | any Contribution intentionally submitted for inclusion in the Work 132 | by You to the Licensor shall be under the terms and conditions of 133 | this License, without any additional terms or conditions. 134 | Notwithstanding the above, nothing herein shall supersede or modify 135 | the terms of any separate license agreement you may have executed 136 | with Licensor regarding such Contributions. 137 | 138 | 6. Trademarks. This License does not grant permission to use the trade 139 | names, trademarks, service marks, or product names of the Licensor, 140 | except as required for reasonable and customary use in describing the 141 | origin of the Work and reproducing the content of the NOTICE file. 142 | 143 | 7. Disclaimer of Warranty. Unless required by applicable law or 144 | agreed to in writing, Licensor provides the Work (and each 145 | Contributor provides its Contributions) on an "AS IS" BASIS, 146 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 147 | implied, including, without limitation, any warranties or conditions 148 | of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A 149 | PARTICULAR PURPOSE. You are solely responsible for determining the 150 | appropriateness of using or redistributing the Work and assume any 151 | risks associated with Your exercise of permissions under this License. 152 | 153 | 8. Limitation of Liability. In no event and under no legal theory, 154 | whether in tort (including negligence), contract, or otherwise, 155 | unless required by applicable law (such as deliberate and grossly 156 | negligent acts) or agreed to in writing, shall any Contributor be 157 | liable to You for damages, including any direct, indirect, special, 158 | incidental, or consequential damages of any character arising as a 159 | result of this License or out of the use or inability to use the 160 | Work (including but not limited to damages for loss of goodwill, 161 | work stoppage, computer failure or malfunction, or any and all 162 | other commercial damages or losses), even if such Contributor 163 | has been advised of the possibility of such damages. 164 | 165 | 9. Accepting Warranty or Additional Liability. While redistributing 166 | the Work or Derivative Works thereof, You may choose to offer, 167 | and charge a fee for, acceptance of support, warranty, indemnity, 168 | or other liability obligations and/or rights consistent with this 169 | License. However, in accepting such obligations, You may act only 170 | on Your own behalf and on Your sole responsibility, not on behalf 171 | of any other Contributor, and only if You agree to indemnify, 172 | defend, and hold each Contributor harmless for any liability 173 | incurred by, or claims asserted against, such Contributor by reason 174 | of your accepting any such warranty or additional liability. 175 | 176 | END OF TERMS AND CONDITIONS 177 | 178 | APPENDIX: How to apply the Apache License to your work. 179 | 180 | To apply the Apache License to your work, attach the following 181 | boilerplate notice, with the fields enclosed by brackets "[]" 182 | replaced with your own identifying information. (Don't include 183 | the brackets!) The text should be enclosed in the appropriate 184 | comment syntax for the file format. We also recommend that a 185 | file or class name and description of purpose be included on the 186 | same "printed page" as the copyright notice for easier 187 | identification within third-party archives. 188 | 189 | Copyright [yyyy] [name of copyright owner] 190 | 191 | Licensed under the Apache License, Version 2.0 (the "License"); 192 | you may not use this file except in compliance with the License. 193 | You may obtain a copy of the License at 194 | 195 | http://www.apache.org/licenses/LICENSE-2.0 196 | 197 | Unless required by applicable law or agreed to in writing, software 198 | distributed under the License is distributed on an "AS IS" BASIS, 199 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 200 | See the License for the specific language governing permissions and 201 | limitations under the License. 202 | -------------------------------------------------------------------------------- /Makefile: -------------------------------------------------------------------------------- 1 | ######################################################################################################################## 2 | # Copyright (c) 2018 IoTeX 3 | # This is an alpha (internal) release and is not suitable for production. This source code is provided 'as is' and no 4 | # warranties are given as to title or non-infringement, merchantability or fitness for purpose and, to the extent 5 | # permitted by law, all liability for your use of the code is disclaimed. This source code is governed by Apache 6 | # License 2.0 that can be found in the LICENSE file. 7 | ######################################################################################################################## 8 | 9 | # Go parameters 10 | GOCMD=go 11 | GOLINT=golint 12 | GOBUILD=$(GOCMD) build 13 | GOINSTALL=$(GOCMD) install 14 | GOCLEAN=$(GOCMD) clean 15 | GOTEST=$(GOCMD) test 16 | GOGET=$(GOCMD) get 17 | 18 | PKG_PATH=/github.com/iotexproject/iotex-proto/golang 19 | 20 | .PHONY: gogen 21 | gogen: 22 | @mkdir -p ./temp 23 | @protoc --go_out=./temp --go-grpc_out=require_unimplemented_servers=false:./temp ./proto/types/* 24 | @protoc --go_out=./temp --go-grpc_out=require_unimplemented_servers=false:./temp ./proto/rpc/* 25 | @protoc --go_out=./temp --go-grpc_out=require_unimplemented_servers=false:./temp ./proto/testing/* 26 | @protoc -I. -I./proto/types --go_out=./temp --go-grpc_out=require_unimplemented_servers=false:./temp ./proto/api/* 27 | @protoc -I. --grpc-gateway_out=logtostderr=true:./temp ./proto/api/* 28 | @rm -rf ./golang/iotexapi ./golang/iotexrpc ./golang/iotextypes ./golang/testingpb 29 | @cp -r ./temp/${PKG_PATH}/* ./golang 30 | @rm -rf ./temp 31 | .PHONY: mockgen 32 | mockgen: 33 | @./misc/scripts/mockgen.sh 34 | 35 | .PHONY: gen 36 | gen: gogen mockgen 37 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # iotex-proto 2 | Protobuf and utility package for IoTeX blockchain transaction and gRPC API 3 | 4 | - `\proto` includes protobuf definition for all core data objects and gRPC API used by IoTeX blockchain 5 | 6 | - `\golang` includes the generated protobuf files for go language 7 | 8 | # Getting Started 9 | ## Installing 10 | ### Install protoc 11 | Install the Google protocol buffers compiler `protoc` v3.12.0 or above from https://github.com/protocolbuffers/protobuf/releases 12 | 13 | Install protoc-gen-go 14 | ``` 15 | go install google.golang.org/protobuf/cmd/protoc-gen-go@latest 16 | go install google.golang.org/grpc/cmd/protoc-gen-go-grpc@latest 17 | ``` 18 | 19 | Enable go mod. Install grpc-gateway https://github.com/grpc-ecosystem/grpc-gateway. Basically this is what you need: 20 | 21 | ``` 22 | go get -u github.com/grpc-ecosystem/grpc-gateway/protoc-gen-grpc-gateway 23 | go get -u github.com/grpc-ecosystem/grpc-gateway/protoc-gen-swagger 24 | ``` 25 | 26 | ### Install mockgen 27 | Install golang mock generator `mockgen` v1.4.4 or above to generate mock files. 28 | 29 | ``` 30 | go get -u github.com/golang/mock/mockgen 31 | ``` 32 | 33 | ## Compiling 34 | ``` 35 | make gen 36 | ``` 37 | This generates the protobuf files and put into \golang directory 38 | 39 | ## Sign IoTeX blockchain transaction 40 | secp256k1 ECDSA algorithm is used by IoTeX blockchain to sign and verify transaction. The signature of an IoTeX transaction is computed as the secp256k1 signature of hash of raw transaction 41 | ``` 42 | signature = secp256k1.Sign(hash of raw transaction) 43 | ``` 44 | The signature is in 65-byte [R, S, V] format where the last byte V is the recovery id for public key recovery 45 | 46 | The following guide used sender address `io1mwekae7qqwlr23220k5n9z3fmjxz72tuchra3m` and recipient address `io187wzp08vnhjjpkydnr97qlh8kh0dpkkytfam8j` as example. Replace your actual address and recipient address when creating and signing the transaction 47 | 48 | ### Create raw transaction 49 | 1. construct a message Transfer as defined in `\proto\type\action.proto`, amount is in unit of 10^-18 IOTX token 50 | 51 | For example, to transfer 1.2 IOTX token, set amount = “1200000000000000000” 52 | 53 | Set recipient = "io187wzp08vnhjjpkydnr97qlh8kh0dpkkytfam8j" 54 | 55 | payload = hex-bytes of message you want to attach to transaction, can be nil/NULL 56 | 57 | 2. construct a message ActionCore as defined in `\proto\type\action.proto`, with action = transfer message in 1 58 | 59 | Set version = 1, gasLimit = 10000, gasPrice = 1000000000000, that is 0.000001 IOTX 60 | 61 | For nonce, issue a gRPC request GetAccount(GetAccountRequest) as defined in `\proto\api\api.proto` use the value of "pendingNonce" field in the reply 62 | 63 | ### Sign raw transaction 64 | 1. serialize the ActionCore message using protobuf 65 | ``` 66 | bytes = proto.Serialize(ActionCore message above) 67 | ``` 68 | 2. hash of raw transaction is computed as the 32-byte Keccak256 hash of the bytes 69 | ``` 70 | hash = Keccak256(bytes) 71 | ``` 72 | 3. sign the hash using sender's private key 73 | ``` 74 | sig = secp256k1.Sign(hash) 75 | ``` 76 | 77 | ### Send signed transaction to IoTeX blockchain 78 | 1. construct a message Action as defined in \proto\type\action.proto 79 | 80 | Set action = ActionCore above, senderPubKey = bytes representation of sender's public key, signature = sig above 81 | 82 | 2. issue a gRPC request SendAction(SendActionRequest) to IoTeX blockchain endpoint 83 | 84 | ### Go example 85 | 86 | The examples folder contains a few [examples](golang/examples) demonstrating functionality. 87 | 88 | To run an example, navigate to it's directory, then go run the file. For example: 89 | 90 | ``` 91 | $ cd golang/examples/transfer 92 | $ go run main.go 93 | ``` 94 | -------------------------------------------------------------------------------- /go.mod: -------------------------------------------------------------------------------- 1 | module github.com/iotexproject/iotex-proto 2 | 3 | go 1.21 4 | 5 | require ( 6 | github.com/golang/mock v1.6.0 7 | google.golang.org/grpc v1.65.0 8 | google.golang.org/protobuf v1.34.2 9 | ) 10 | 11 | require golang.org/x/net v0.25.0 // indirect 12 | 13 | require ( 14 | golang.org/x/sys v0.20.0 // indirect 15 | golang.org/x/text v0.15.0 // indirect 16 | google.golang.org/genproto v0.0.0-20230127162408-596548ed4efa // indirect 17 | ) 18 | -------------------------------------------------------------------------------- /go.sum: -------------------------------------------------------------------------------- 1 | github.com/golang/mock v1.6.0 h1:ErTB+efbowRARo13NNdxyJji2egdxLGQhRaY+DUumQc= 2 | github.com/golang/mock v1.6.0/go.mod h1:p6yTPP+5HYm5mzsMV8JkE6ZKdX+/wYM6Hr+LicevLPs= 3 | github.com/google/go-cmp v0.6.0 h1:ofyhxvXcZhMsU5ulbFiLKl/XBFqE1GSq7atu8tAmTRI= 4 | github.com/google/go-cmp v0.6.0/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY= 5 | github.com/yuin/goldmark v1.3.5/go.mod h1:mwnBkeHKe2W/ZEtQ+71ViKU8L12m81fl3OWwC1Zlc8k= 6 | golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= 7 | golang.org/x/crypto v0.0.0-20191011191535-87dc89f01550/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= 8 | golang.org/x/mod v0.4.2/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= 9 | golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= 10 | golang.org/x/net v0.0.0-20190620200207-3b0461eec859/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= 11 | golang.org/x/net v0.0.0-20210405180319-a5a99cb37ef4/go.mod h1:p54w0d4576C0XHj96bSt6lcn1PtDYWL6XObtHCRCNQM= 12 | golang.org/x/net v0.25.0 h1:d/OCCoBEUq33pjydKrGQhw7IlUPI2Oylr+8qLx49kac= 13 | golang.org/x/net v0.25.0/go.mod h1:JkAGAh7GEvH74S6FOH42FLoXpXbE/aqXSrIQjXgsiwM= 14 | golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= 15 | golang.org/x/sync v0.0.0-20210220032951-036812b2e83c/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= 16 | golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= 17 | golang.org/x/sys v0.0.0-20190412213103-97732733099d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= 18 | golang.org/x/sys v0.0.0-20201119102817-f84b799fce68/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= 19 | golang.org/x/sys v0.0.0-20210330210617-4fbd30eecc44/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= 20 | golang.org/x/sys v0.0.0-20210510120138-977fb7262007/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= 21 | golang.org/x/sys v0.20.0 h1:Od9JTbYCk261bKm4M/mw7AklTlFYIa0bIp9BgSm1S8Y= 22 | golang.org/x/sys v0.20.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= 23 | golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= 24 | golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= 25 | golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= 26 | golang.org/x/text v0.15.0 h1:h1V/4gjBv8v9cjcR6+AR5+/cIYK5N/WAgiv4xlsEtAk= 27 | golang.org/x/text v0.15.0/go.mod h1:18ZOQIKpY8NJVqYksKHtTdi31H5itFRjB5/qKTNYzSU= 28 | golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= 29 | golang.org/x/tools v0.0.0-20191119224855-298f0cb1881e/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= 30 | golang.org/x/tools v0.1.1/go.mod h1:o0xws9oXOQQZyjljx8fwUC0k7L1pTE6eaCbjGeHmOkk= 31 | golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= 32 | golang.org/x/xerrors v0.0.0-20191011141410-1b5146add898/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= 33 | golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= 34 | google.golang.org/genproto v0.0.0-20230127162408-596548ed4efa h1:GZXdWYIKckxQE2EcLHLvF+KLF+bIwoxGdMUxTZizueg= 35 | google.golang.org/genproto v0.0.0-20230127162408-596548ed4efa/go.mod h1:RGgjbofJ8xD9Sq1VVhDM1Vok1vRONV+rg+CjzG4SZKM= 36 | google.golang.org/grpc v1.65.0 h1:bs/cUb4lp1G5iImFFd3u5ixQzweKizoZJAwBNLR42lc= 37 | google.golang.org/grpc v1.65.0/go.mod h1:WgYC2ypjlB0EiQi6wdKixMqukr6lBc0Vo+oOgjrM5ZQ= 38 | google.golang.org/protobuf v1.34.2 h1:6xV6lTsCfpGD21XK49h7MhtcApnLqkfYgPcdHftf6hg= 39 | google.golang.org/protobuf v1.34.2/go.mod h1:qYOHts0dSfpeUzUFpOMr/WGzszTmLH+DiWniOlNbLDw= 40 | -------------------------------------------------------------------------------- /golang/iotexrpc/rpc.pb.go: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2018 IoTeX 2 | // This is an alpha (internal) release and is not suitable for production. This source code is provided 'as is' and no 3 | // warranties are given as to title or non-infringement, merchantability or fitness for purpose and, to the extent 4 | // permitted by law, all liability for your use of the code is disclaimed. This source code is governed by Apache 5 | // License 2.0 that can be found in the LICENSE file. 6 | 7 | // To compile the proto, run: 8 | // protoc -I. -I ./../types --go_out=plugins=grpc:$GOPATH/src *.proto 9 | 10 | // Code generated by protoc-gen-go. DO NOT EDIT. 11 | // versions: 12 | // protoc-gen-go v1.34.2 13 | // protoc v5.27.1 14 | // source: proto/rpc/rpc.proto 15 | 16 | package iotexrpc 17 | 18 | import ( 19 | protoreflect "google.golang.org/protobuf/reflect/protoreflect" 20 | protoimpl "google.golang.org/protobuf/runtime/protoimpl" 21 | timestamppb "google.golang.org/protobuf/types/known/timestamppb" 22 | reflect "reflect" 23 | sync "sync" 24 | ) 25 | 26 | const ( 27 | // Verify that this generated code is sufficiently up-to-date. 28 | _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) 29 | // Verify that runtime/protoimpl is sufficiently up-to-date. 30 | _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) 31 | ) 32 | 33 | type MessageType int32 34 | 35 | const ( 36 | MessageType_UNKNOWN MessageType = 0 37 | MessageType_ACTION MessageType = 1 38 | MessageType_BLOCK MessageType = 2 39 | MessageType_CONSENSUS MessageType = 3 40 | MessageType_BLOCK_REQUEST MessageType = 4 41 | MessageType_NODE_INFO_REQUEST MessageType = 5 42 | MessageType_NODE_INFO MessageType = 6 43 | MessageType_ACTIONS MessageType = 7 44 | MessageType_ACTION_HASH MessageType = 8 45 | MessageType_ACTION_REQUEST MessageType = 9 46 | MessageType_TEST MessageType = 10001 47 | ) 48 | 49 | // Enum value maps for MessageType. 50 | var ( 51 | MessageType_name = map[int32]string{ 52 | 0: "UNKNOWN", 53 | 1: "ACTION", 54 | 2: "BLOCK", 55 | 3: "CONSENSUS", 56 | 4: "BLOCK_REQUEST", 57 | 5: "NODE_INFO_REQUEST", 58 | 6: "NODE_INFO", 59 | 7: "ACTIONS", 60 | 8: "ACTION_HASH", 61 | 9: "ACTION_REQUEST", 62 | 10001: "TEST", 63 | } 64 | MessageType_value = map[string]int32{ 65 | "UNKNOWN": 0, 66 | "ACTION": 1, 67 | "BLOCK": 2, 68 | "CONSENSUS": 3, 69 | "BLOCK_REQUEST": 4, 70 | "NODE_INFO_REQUEST": 5, 71 | "NODE_INFO": 6, 72 | "ACTIONS": 7, 73 | "ACTION_HASH": 8, 74 | "ACTION_REQUEST": 9, 75 | "TEST": 10001, 76 | } 77 | ) 78 | 79 | func (x MessageType) Enum() *MessageType { 80 | p := new(MessageType) 81 | *p = x 82 | return p 83 | } 84 | 85 | func (x MessageType) String() string { 86 | return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x)) 87 | } 88 | 89 | func (MessageType) Descriptor() protoreflect.EnumDescriptor { 90 | return file_proto_rpc_rpc_proto_enumTypes[0].Descriptor() 91 | } 92 | 93 | func (MessageType) Type() protoreflect.EnumType { 94 | return &file_proto_rpc_rpc_proto_enumTypes[0] 95 | } 96 | 97 | func (x MessageType) Number() protoreflect.EnumNumber { 98 | return protoreflect.EnumNumber(x) 99 | } 100 | 101 | // Deprecated: Use MessageType.Descriptor instead. 102 | func (MessageType) EnumDescriptor() ([]byte, []int) { 103 | return file_proto_rpc_rpc_proto_rawDescGZIP(), []int{0} 104 | } 105 | 106 | type BlockSync struct { 107 | state protoimpl.MessageState 108 | sizeCache protoimpl.SizeCache 109 | unknownFields protoimpl.UnknownFields 110 | 111 | Start uint64 `protobuf:"varint,2,opt,name=start,proto3" json:"start,omitempty"` 112 | End uint64 `protobuf:"varint,3,opt,name=end,proto3" json:"end,omitempty"` 113 | } 114 | 115 | func (x *BlockSync) Reset() { 116 | *x = BlockSync{} 117 | if protoimpl.UnsafeEnabled { 118 | mi := &file_proto_rpc_rpc_proto_msgTypes[0] 119 | ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) 120 | ms.StoreMessageInfo(mi) 121 | } 122 | } 123 | 124 | func (x *BlockSync) String() string { 125 | return protoimpl.X.MessageStringOf(x) 126 | } 127 | 128 | func (*BlockSync) ProtoMessage() {} 129 | 130 | func (x *BlockSync) ProtoReflect() protoreflect.Message { 131 | mi := &file_proto_rpc_rpc_proto_msgTypes[0] 132 | if protoimpl.UnsafeEnabled && x != nil { 133 | ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) 134 | if ms.LoadMessageInfo() == nil { 135 | ms.StoreMessageInfo(mi) 136 | } 137 | return ms 138 | } 139 | return mi.MessageOf(x) 140 | } 141 | 142 | // Deprecated: Use BlockSync.ProtoReflect.Descriptor instead. 143 | func (*BlockSync) Descriptor() ([]byte, []int) { 144 | return file_proto_rpc_rpc_proto_rawDescGZIP(), []int{0} 145 | } 146 | 147 | func (x *BlockSync) GetStart() uint64 { 148 | if x != nil { 149 | return x.Start 150 | } 151 | return 0 152 | } 153 | 154 | func (x *BlockSync) GetEnd() uint64 { 155 | if x != nil { 156 | return x.End 157 | } 158 | return 0 159 | } 160 | 161 | type ActionSync struct { 162 | state protoimpl.MessageState 163 | sizeCache protoimpl.SizeCache 164 | unknownFields protoimpl.UnknownFields 165 | 166 | Hashes [][]byte `protobuf:"bytes,1,rep,name=hashes,proto3" json:"hashes,omitempty"` 167 | } 168 | 169 | func (x *ActionSync) Reset() { 170 | *x = ActionSync{} 171 | if protoimpl.UnsafeEnabled { 172 | mi := &file_proto_rpc_rpc_proto_msgTypes[1] 173 | ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) 174 | ms.StoreMessageInfo(mi) 175 | } 176 | } 177 | 178 | func (x *ActionSync) String() string { 179 | return protoimpl.X.MessageStringOf(x) 180 | } 181 | 182 | func (*ActionSync) ProtoMessage() {} 183 | 184 | func (x *ActionSync) ProtoReflect() protoreflect.Message { 185 | mi := &file_proto_rpc_rpc_proto_msgTypes[1] 186 | if protoimpl.UnsafeEnabled && x != nil { 187 | ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) 188 | if ms.LoadMessageInfo() == nil { 189 | ms.StoreMessageInfo(mi) 190 | } 191 | return ms 192 | } 193 | return mi.MessageOf(x) 194 | } 195 | 196 | // Deprecated: Use ActionSync.ProtoReflect.Descriptor instead. 197 | func (*ActionSync) Descriptor() ([]byte, []int) { 198 | return file_proto_rpc_rpc_proto_rawDescGZIP(), []int{1} 199 | } 200 | 201 | func (x *ActionSync) GetHashes() [][]byte { 202 | if x != nil { 203 | return x.Hashes 204 | } 205 | return nil 206 | } 207 | 208 | type BroadcastMsg struct { 209 | state protoimpl.MessageState 210 | sizeCache protoimpl.SizeCache 211 | unknownFields protoimpl.UnknownFields 212 | 213 | ChainId uint32 `protobuf:"varint,1,opt,name=chain_id,json=chainId,proto3" json:"chain_id,omitempty"` 214 | MsgType MessageType `protobuf:"varint,2,opt,name=msg_type,json=msgType,proto3,enum=iotexrpc.MessageType" json:"msg_type,omitempty"` 215 | MsgBody []byte `protobuf:"bytes,3,opt,name=msg_body,json=msgBody,proto3" json:"msg_body,omitempty"` 216 | PeerId string `protobuf:"bytes,4,opt,name=peer_id,json=peerId,proto3" json:"peer_id,omitempty"` 217 | Timestamp *timestamppb.Timestamp `protobuf:"bytes,5,opt,name=timestamp,proto3" json:"timestamp,omitempty"` 218 | } 219 | 220 | func (x *BroadcastMsg) Reset() { 221 | *x = BroadcastMsg{} 222 | if protoimpl.UnsafeEnabled { 223 | mi := &file_proto_rpc_rpc_proto_msgTypes[2] 224 | ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) 225 | ms.StoreMessageInfo(mi) 226 | } 227 | } 228 | 229 | func (x *BroadcastMsg) String() string { 230 | return protoimpl.X.MessageStringOf(x) 231 | } 232 | 233 | func (*BroadcastMsg) ProtoMessage() {} 234 | 235 | func (x *BroadcastMsg) ProtoReflect() protoreflect.Message { 236 | mi := &file_proto_rpc_rpc_proto_msgTypes[2] 237 | if protoimpl.UnsafeEnabled && x != nil { 238 | ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) 239 | if ms.LoadMessageInfo() == nil { 240 | ms.StoreMessageInfo(mi) 241 | } 242 | return ms 243 | } 244 | return mi.MessageOf(x) 245 | } 246 | 247 | // Deprecated: Use BroadcastMsg.ProtoReflect.Descriptor instead. 248 | func (*BroadcastMsg) Descriptor() ([]byte, []int) { 249 | return file_proto_rpc_rpc_proto_rawDescGZIP(), []int{2} 250 | } 251 | 252 | func (x *BroadcastMsg) GetChainId() uint32 { 253 | if x != nil { 254 | return x.ChainId 255 | } 256 | return 0 257 | } 258 | 259 | func (x *BroadcastMsg) GetMsgType() MessageType { 260 | if x != nil { 261 | return x.MsgType 262 | } 263 | return MessageType_UNKNOWN 264 | } 265 | 266 | func (x *BroadcastMsg) GetMsgBody() []byte { 267 | if x != nil { 268 | return x.MsgBody 269 | } 270 | return nil 271 | } 272 | 273 | func (x *BroadcastMsg) GetPeerId() string { 274 | if x != nil { 275 | return x.PeerId 276 | } 277 | return "" 278 | } 279 | 280 | func (x *BroadcastMsg) GetTimestamp() *timestamppb.Timestamp { 281 | if x != nil { 282 | return x.Timestamp 283 | } 284 | return nil 285 | } 286 | 287 | type UnicastMsg struct { 288 | state protoimpl.MessageState 289 | sizeCache protoimpl.SizeCache 290 | unknownFields protoimpl.UnknownFields 291 | 292 | ChainId uint32 `protobuf:"varint,1,opt,name=chain_id,json=chainId,proto3" json:"chain_id,omitempty"` 293 | Addr string `protobuf:"bytes,2,opt,name=addr,proto3" json:"addr,omitempty"` 294 | MsgType MessageType `protobuf:"varint,3,opt,name=msg_type,json=msgType,proto3,enum=iotexrpc.MessageType" json:"msg_type,omitempty"` 295 | MsgBody []byte `protobuf:"bytes,4,opt,name=msg_body,json=msgBody,proto3" json:"msg_body,omitempty"` 296 | PeerId string `protobuf:"bytes,5,opt,name=peer_id,json=peerId,proto3" json:"peer_id,omitempty"` 297 | Timestamp *timestamppb.Timestamp `protobuf:"bytes,6,opt,name=timestamp,proto3" json:"timestamp,omitempty"` 298 | } 299 | 300 | func (x *UnicastMsg) Reset() { 301 | *x = UnicastMsg{} 302 | if protoimpl.UnsafeEnabled { 303 | mi := &file_proto_rpc_rpc_proto_msgTypes[3] 304 | ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) 305 | ms.StoreMessageInfo(mi) 306 | } 307 | } 308 | 309 | func (x *UnicastMsg) String() string { 310 | return protoimpl.X.MessageStringOf(x) 311 | } 312 | 313 | func (*UnicastMsg) ProtoMessage() {} 314 | 315 | func (x *UnicastMsg) ProtoReflect() protoreflect.Message { 316 | mi := &file_proto_rpc_rpc_proto_msgTypes[3] 317 | if protoimpl.UnsafeEnabled && x != nil { 318 | ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) 319 | if ms.LoadMessageInfo() == nil { 320 | ms.StoreMessageInfo(mi) 321 | } 322 | return ms 323 | } 324 | return mi.MessageOf(x) 325 | } 326 | 327 | // Deprecated: Use UnicastMsg.ProtoReflect.Descriptor instead. 328 | func (*UnicastMsg) Descriptor() ([]byte, []int) { 329 | return file_proto_rpc_rpc_proto_rawDescGZIP(), []int{3} 330 | } 331 | 332 | func (x *UnicastMsg) GetChainId() uint32 { 333 | if x != nil { 334 | return x.ChainId 335 | } 336 | return 0 337 | } 338 | 339 | func (x *UnicastMsg) GetAddr() string { 340 | if x != nil { 341 | return x.Addr 342 | } 343 | return "" 344 | } 345 | 346 | func (x *UnicastMsg) GetMsgType() MessageType { 347 | if x != nil { 348 | return x.MsgType 349 | } 350 | return MessageType_UNKNOWN 351 | } 352 | 353 | func (x *UnicastMsg) GetMsgBody() []byte { 354 | if x != nil { 355 | return x.MsgBody 356 | } 357 | return nil 358 | } 359 | 360 | func (x *UnicastMsg) GetPeerId() string { 361 | if x != nil { 362 | return x.PeerId 363 | } 364 | return "" 365 | } 366 | 367 | func (x *UnicastMsg) GetTimestamp() *timestamppb.Timestamp { 368 | if x != nil { 369 | return x.Timestamp 370 | } 371 | return nil 372 | } 373 | 374 | var File_proto_rpc_rpc_proto protoreflect.FileDescriptor 375 | 376 | var file_proto_rpc_rpc_proto_rawDesc = []byte{ 377 | 0x0a, 0x13, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2f, 0x72, 0x70, 0x63, 0x2f, 0x72, 0x70, 0x63, 0x2e, 378 | 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x08, 0x69, 0x6f, 0x74, 0x65, 0x78, 0x72, 0x70, 0x63, 0x1a, 379 | 0x1f, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 380 | 0x2f, 0x74, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 381 | 0x22, 0x33, 0x0a, 0x09, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x53, 0x79, 0x6e, 0x63, 0x12, 0x14, 0x0a, 382 | 0x05, 0x73, 0x74, 0x61, 0x72, 0x74, 0x18, 0x02, 0x20, 0x01, 0x28, 0x04, 0x52, 0x05, 0x73, 0x74, 383 | 0x61, 0x72, 0x74, 0x12, 0x10, 0x0a, 0x03, 0x65, 0x6e, 0x64, 0x18, 0x03, 0x20, 0x01, 0x28, 0x04, 384 | 0x52, 0x03, 0x65, 0x6e, 0x64, 0x22, 0x24, 0x0a, 0x0a, 0x41, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x53, 385 | 0x79, 0x6e, 0x63, 0x12, 0x16, 0x0a, 0x06, 0x68, 0x61, 0x73, 0x68, 0x65, 0x73, 0x18, 0x01, 0x20, 386 | 0x03, 0x28, 0x0c, 0x52, 0x06, 0x68, 0x61, 0x73, 0x68, 0x65, 0x73, 0x22, 0xc9, 0x01, 0x0a, 0x0c, 387 | 0x42, 0x72, 0x6f, 0x61, 0x64, 0x63, 0x61, 0x73, 0x74, 0x4d, 0x73, 0x67, 0x12, 0x19, 0x0a, 0x08, 388 | 0x63, 0x68, 0x61, 0x69, 0x6e, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x07, 389 | 0x63, 0x68, 0x61, 0x69, 0x6e, 0x49, 0x64, 0x12, 0x30, 0x0a, 0x08, 0x6d, 0x73, 0x67, 0x5f, 0x74, 390 | 0x79, 0x70, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x15, 0x2e, 0x69, 0x6f, 0x74, 0x65, 391 | 0x78, 0x72, 0x70, 0x63, 0x2e, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x54, 0x79, 0x70, 0x65, 392 | 0x52, 0x07, 0x6d, 0x73, 0x67, 0x54, 0x79, 0x70, 0x65, 0x12, 0x19, 0x0a, 0x08, 0x6d, 0x73, 0x67, 393 | 0x5f, 0x62, 0x6f, 0x64, 0x79, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x07, 0x6d, 0x73, 0x67, 394 | 0x42, 0x6f, 0x64, 0x79, 0x12, 0x17, 0x0a, 0x07, 0x70, 0x65, 0x65, 0x72, 0x5f, 0x69, 0x64, 0x18, 395 | 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x70, 0x65, 0x65, 0x72, 0x49, 0x64, 0x12, 0x38, 0x0a, 396 | 0x09, 0x74, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x18, 0x05, 0x20, 0x01, 0x28, 0x0b, 397 | 0x32, 0x1a, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 398 | 0x75, 0x66, 0x2e, 0x54, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x52, 0x09, 0x74, 0x69, 399 | 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x22, 0xdb, 0x01, 0x0a, 0x0a, 0x55, 0x6e, 0x69, 0x63, 400 | 0x61, 0x73, 0x74, 0x4d, 0x73, 0x67, 0x12, 0x19, 0x0a, 0x08, 0x63, 0x68, 0x61, 0x69, 0x6e, 0x5f, 401 | 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x07, 0x63, 0x68, 0x61, 0x69, 0x6e, 0x49, 402 | 0x64, 0x12, 0x12, 0x0a, 0x04, 0x61, 0x64, 0x64, 0x72, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 403 | 0x04, 0x61, 0x64, 0x64, 0x72, 0x12, 0x30, 0x0a, 0x08, 0x6d, 0x73, 0x67, 0x5f, 0x74, 0x79, 0x70, 404 | 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x15, 0x2e, 0x69, 0x6f, 0x74, 0x65, 0x78, 0x72, 405 | 0x70, 0x63, 0x2e, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x54, 0x79, 0x70, 0x65, 0x52, 0x07, 406 | 0x6d, 0x73, 0x67, 0x54, 0x79, 0x70, 0x65, 0x12, 0x19, 0x0a, 0x08, 0x6d, 0x73, 0x67, 0x5f, 0x62, 407 | 0x6f, 0x64, 0x79, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x07, 0x6d, 0x73, 0x67, 0x42, 0x6f, 408 | 0x64, 0x79, 0x12, 0x17, 0x0a, 0x07, 0x70, 0x65, 0x65, 0x72, 0x5f, 0x69, 0x64, 0x18, 0x05, 0x20, 409 | 0x01, 0x28, 0x09, 0x52, 0x06, 0x70, 0x65, 0x65, 0x72, 0x49, 0x64, 0x12, 0x38, 0x0a, 0x09, 0x74, 410 | 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x18, 0x06, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, 411 | 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 412 | 0x2e, 0x54, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x52, 0x09, 0x74, 0x69, 0x6d, 0x65, 413 | 0x73, 0x74, 0x61, 0x6d, 0x70, 0x2a, 0xb6, 0x01, 0x0a, 0x0b, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 414 | 0x65, 0x54, 0x79, 0x70, 0x65, 0x12, 0x0b, 0x0a, 0x07, 0x55, 0x4e, 0x4b, 0x4e, 0x4f, 0x57, 0x4e, 415 | 0x10, 0x00, 0x12, 0x0a, 0x0a, 0x06, 0x41, 0x43, 0x54, 0x49, 0x4f, 0x4e, 0x10, 0x01, 0x12, 0x09, 416 | 0x0a, 0x05, 0x42, 0x4c, 0x4f, 0x43, 0x4b, 0x10, 0x02, 0x12, 0x0d, 0x0a, 0x09, 0x43, 0x4f, 0x4e, 417 | 0x53, 0x45, 0x4e, 0x53, 0x55, 0x53, 0x10, 0x03, 0x12, 0x11, 0x0a, 0x0d, 0x42, 0x4c, 0x4f, 0x43, 418 | 0x4b, 0x5f, 0x52, 0x45, 0x51, 0x55, 0x45, 0x53, 0x54, 0x10, 0x04, 0x12, 0x15, 0x0a, 0x11, 0x4e, 419 | 0x4f, 0x44, 0x45, 0x5f, 0x49, 0x4e, 0x46, 0x4f, 0x5f, 0x52, 0x45, 0x51, 0x55, 0x45, 0x53, 0x54, 420 | 0x10, 0x05, 0x12, 0x0d, 0x0a, 0x09, 0x4e, 0x4f, 0x44, 0x45, 0x5f, 0x49, 0x4e, 0x46, 0x4f, 0x10, 421 | 0x06, 0x12, 0x0b, 0x0a, 0x07, 0x41, 0x43, 0x54, 0x49, 0x4f, 0x4e, 0x53, 0x10, 0x07, 0x12, 0x0f, 422 | 0x0a, 0x0b, 0x41, 0x43, 0x54, 0x49, 0x4f, 0x4e, 0x5f, 0x48, 0x41, 0x53, 0x48, 0x10, 0x08, 0x12, 423 | 0x12, 0x0a, 0x0e, 0x41, 0x43, 0x54, 0x49, 0x4f, 0x4e, 0x5f, 0x52, 0x45, 0x51, 0x55, 0x45, 0x53, 424 | 0x54, 0x10, 0x09, 0x12, 0x09, 0x0a, 0x04, 0x54, 0x45, 0x53, 0x54, 0x10, 0x91, 0x4e, 0x42, 0x59, 425 | 0x0a, 0x20, 0x63, 0x6f, 0x6d, 0x2e, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x69, 0x6f, 0x74, 426 | 0x65, 0x78, 0x70, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x2e, 0x67, 0x72, 0x70, 0x63, 0x2e, 0x72, 427 | 0x70, 0x63, 0x50, 0x01, 0x5a, 0x33, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 428 | 0x2f, 0x69, 0x6f, 0x74, 0x65, 0x78, 0x70, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x2f, 0x69, 0x6f, 429 | 0x74, 0x65, 0x78, 0x2d, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2f, 0x67, 0x6f, 0x6c, 0x61, 0x6e, 0x67, 430 | 0x2f, 0x69, 0x6f, 0x74, 0x65, 0x78, 0x72, 0x70, 0x63, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 431 | 0x33, 432 | } 433 | 434 | var ( 435 | file_proto_rpc_rpc_proto_rawDescOnce sync.Once 436 | file_proto_rpc_rpc_proto_rawDescData = file_proto_rpc_rpc_proto_rawDesc 437 | ) 438 | 439 | func file_proto_rpc_rpc_proto_rawDescGZIP() []byte { 440 | file_proto_rpc_rpc_proto_rawDescOnce.Do(func() { 441 | file_proto_rpc_rpc_proto_rawDescData = protoimpl.X.CompressGZIP(file_proto_rpc_rpc_proto_rawDescData) 442 | }) 443 | return file_proto_rpc_rpc_proto_rawDescData 444 | } 445 | 446 | var file_proto_rpc_rpc_proto_enumTypes = make([]protoimpl.EnumInfo, 1) 447 | var file_proto_rpc_rpc_proto_msgTypes = make([]protoimpl.MessageInfo, 4) 448 | var file_proto_rpc_rpc_proto_goTypes = []any{ 449 | (MessageType)(0), // 0: iotexrpc.MessageType 450 | (*BlockSync)(nil), // 1: iotexrpc.BlockSync 451 | (*ActionSync)(nil), // 2: iotexrpc.ActionSync 452 | (*BroadcastMsg)(nil), // 3: iotexrpc.BroadcastMsg 453 | (*UnicastMsg)(nil), // 4: iotexrpc.UnicastMsg 454 | (*timestamppb.Timestamp)(nil), // 5: google.protobuf.Timestamp 455 | } 456 | var file_proto_rpc_rpc_proto_depIdxs = []int32{ 457 | 0, // 0: iotexrpc.BroadcastMsg.msg_type:type_name -> iotexrpc.MessageType 458 | 5, // 1: iotexrpc.BroadcastMsg.timestamp:type_name -> google.protobuf.Timestamp 459 | 0, // 2: iotexrpc.UnicastMsg.msg_type:type_name -> iotexrpc.MessageType 460 | 5, // 3: iotexrpc.UnicastMsg.timestamp:type_name -> google.protobuf.Timestamp 461 | 4, // [4:4] is the sub-list for method output_type 462 | 4, // [4:4] is the sub-list for method input_type 463 | 4, // [4:4] is the sub-list for extension type_name 464 | 4, // [4:4] is the sub-list for extension extendee 465 | 0, // [0:4] is the sub-list for field type_name 466 | } 467 | 468 | func init() { file_proto_rpc_rpc_proto_init() } 469 | func file_proto_rpc_rpc_proto_init() { 470 | if File_proto_rpc_rpc_proto != nil { 471 | return 472 | } 473 | if !protoimpl.UnsafeEnabled { 474 | file_proto_rpc_rpc_proto_msgTypes[0].Exporter = func(v any, i int) any { 475 | switch v := v.(*BlockSync); i { 476 | case 0: 477 | return &v.state 478 | case 1: 479 | return &v.sizeCache 480 | case 2: 481 | return &v.unknownFields 482 | default: 483 | return nil 484 | } 485 | } 486 | file_proto_rpc_rpc_proto_msgTypes[1].Exporter = func(v any, i int) any { 487 | switch v := v.(*ActionSync); i { 488 | case 0: 489 | return &v.state 490 | case 1: 491 | return &v.sizeCache 492 | case 2: 493 | return &v.unknownFields 494 | default: 495 | return nil 496 | } 497 | } 498 | file_proto_rpc_rpc_proto_msgTypes[2].Exporter = func(v any, i int) any { 499 | switch v := v.(*BroadcastMsg); i { 500 | case 0: 501 | return &v.state 502 | case 1: 503 | return &v.sizeCache 504 | case 2: 505 | return &v.unknownFields 506 | default: 507 | return nil 508 | } 509 | } 510 | file_proto_rpc_rpc_proto_msgTypes[3].Exporter = func(v any, i int) any { 511 | switch v := v.(*UnicastMsg); i { 512 | case 0: 513 | return &v.state 514 | case 1: 515 | return &v.sizeCache 516 | case 2: 517 | return &v.unknownFields 518 | default: 519 | return nil 520 | } 521 | } 522 | } 523 | type x struct{} 524 | out := protoimpl.TypeBuilder{ 525 | File: protoimpl.DescBuilder{ 526 | GoPackagePath: reflect.TypeOf(x{}).PkgPath(), 527 | RawDescriptor: file_proto_rpc_rpc_proto_rawDesc, 528 | NumEnums: 1, 529 | NumMessages: 4, 530 | NumExtensions: 0, 531 | NumServices: 0, 532 | }, 533 | GoTypes: file_proto_rpc_rpc_proto_goTypes, 534 | DependencyIndexes: file_proto_rpc_rpc_proto_depIdxs, 535 | EnumInfos: file_proto_rpc_rpc_proto_enumTypes, 536 | MessageInfos: file_proto_rpc_rpc_proto_msgTypes, 537 | }.Build() 538 | File_proto_rpc_rpc_proto = out.File 539 | file_proto_rpc_rpc_proto_rawDesc = nil 540 | file_proto_rpc_rpc_proto_goTypes = nil 541 | file_proto_rpc_rpc_proto_depIdxs = nil 542 | } 543 | -------------------------------------------------------------------------------- /golang/iotextypes/consensus.pb.go: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2019 IoTeX 2 | // This is an alpha (internal) release and is not suitable for production. This source code is provided 'as is' and no 3 | // warranties are given as to title or non-infringement, merchantability or fitness for purpose and, to the extent 4 | // permitted by law, all liability for your use of the code is disclaimed. This source code is governed by Apache 5 | // License 2.0 that can be found in the LICENSE file. 6 | 7 | // To compile the proto, run: 8 | // protoc --go_out=plugins=grpc:$GOPATH/src *.proto 9 | 10 | // Code generated by protoc-gen-go. DO NOT EDIT. 11 | // versions: 12 | // protoc-gen-go v1.34.2 13 | // protoc v5.27.1 14 | // source: proto/types/consensus.proto 15 | 16 | package iotextypes 17 | 18 | import ( 19 | protoreflect "google.golang.org/protobuf/reflect/protoreflect" 20 | protoimpl "google.golang.org/protobuf/runtime/protoimpl" 21 | reflect "reflect" 22 | sync "sync" 23 | ) 24 | 25 | const ( 26 | // Verify that this generated code is sufficiently up-to-date. 27 | _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) 28 | // Verify that runtime/protoimpl is sufficiently up-to-date. 29 | _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) 30 | ) 31 | 32 | type ConsensusVote_Topic int32 33 | 34 | const ( 35 | ConsensusVote_PROPOSAL ConsensusVote_Topic = 0 36 | ConsensusVote_LOCK ConsensusVote_Topic = 1 37 | ConsensusVote_COMMIT ConsensusVote_Topic = 2 38 | ) 39 | 40 | // Enum value maps for ConsensusVote_Topic. 41 | var ( 42 | ConsensusVote_Topic_name = map[int32]string{ 43 | 0: "PROPOSAL", 44 | 1: "LOCK", 45 | 2: "COMMIT", 46 | } 47 | ConsensusVote_Topic_value = map[string]int32{ 48 | "PROPOSAL": 0, 49 | "LOCK": 1, 50 | "COMMIT": 2, 51 | } 52 | ) 53 | 54 | func (x ConsensusVote_Topic) Enum() *ConsensusVote_Topic { 55 | p := new(ConsensusVote_Topic) 56 | *p = x 57 | return p 58 | } 59 | 60 | func (x ConsensusVote_Topic) String() string { 61 | return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x)) 62 | } 63 | 64 | func (ConsensusVote_Topic) Descriptor() protoreflect.EnumDescriptor { 65 | return file_proto_types_consensus_proto_enumTypes[0].Descriptor() 66 | } 67 | 68 | func (ConsensusVote_Topic) Type() protoreflect.EnumType { 69 | return &file_proto_types_consensus_proto_enumTypes[0] 70 | } 71 | 72 | func (x ConsensusVote_Topic) Number() protoreflect.EnumNumber { 73 | return protoreflect.EnumNumber(x) 74 | } 75 | 76 | // Deprecated: Use ConsensusVote_Topic.Descriptor instead. 77 | func (ConsensusVote_Topic) EnumDescriptor() ([]byte, []int) { 78 | return file_proto_types_consensus_proto_rawDescGZIP(), []int{1, 0} 79 | } 80 | 81 | type BlockProposal struct { 82 | state protoimpl.MessageState 83 | sizeCache protoimpl.SizeCache 84 | unknownFields protoimpl.UnknownFields 85 | 86 | Block *Block `protobuf:"bytes,1,opt,name=block,proto3" json:"block,omitempty"` 87 | Endorsements []*Endorsement `protobuf:"bytes,2,rep,name=endorsements,proto3" json:"endorsements,omitempty"` 88 | } 89 | 90 | func (x *BlockProposal) Reset() { 91 | *x = BlockProposal{} 92 | if protoimpl.UnsafeEnabled { 93 | mi := &file_proto_types_consensus_proto_msgTypes[0] 94 | ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) 95 | ms.StoreMessageInfo(mi) 96 | } 97 | } 98 | 99 | func (x *BlockProposal) String() string { 100 | return protoimpl.X.MessageStringOf(x) 101 | } 102 | 103 | func (*BlockProposal) ProtoMessage() {} 104 | 105 | func (x *BlockProposal) ProtoReflect() protoreflect.Message { 106 | mi := &file_proto_types_consensus_proto_msgTypes[0] 107 | if protoimpl.UnsafeEnabled && x != nil { 108 | ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) 109 | if ms.LoadMessageInfo() == nil { 110 | ms.StoreMessageInfo(mi) 111 | } 112 | return ms 113 | } 114 | return mi.MessageOf(x) 115 | } 116 | 117 | // Deprecated: Use BlockProposal.ProtoReflect.Descriptor instead. 118 | func (*BlockProposal) Descriptor() ([]byte, []int) { 119 | return file_proto_types_consensus_proto_rawDescGZIP(), []int{0} 120 | } 121 | 122 | func (x *BlockProposal) GetBlock() *Block { 123 | if x != nil { 124 | return x.Block 125 | } 126 | return nil 127 | } 128 | 129 | func (x *BlockProposal) GetEndorsements() []*Endorsement { 130 | if x != nil { 131 | return x.Endorsements 132 | } 133 | return nil 134 | } 135 | 136 | type ConsensusVote struct { 137 | state protoimpl.MessageState 138 | sizeCache protoimpl.SizeCache 139 | unknownFields protoimpl.UnknownFields 140 | 141 | BlockHash []byte `protobuf:"bytes,1,opt,name=blockHash,proto3" json:"blockHash,omitempty"` 142 | Topic ConsensusVote_Topic `protobuf:"varint,2,opt,name=topic,proto3,enum=iotextypes.ConsensusVote_Topic" json:"topic,omitempty"` 143 | } 144 | 145 | func (x *ConsensusVote) Reset() { 146 | *x = ConsensusVote{} 147 | if protoimpl.UnsafeEnabled { 148 | mi := &file_proto_types_consensus_proto_msgTypes[1] 149 | ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) 150 | ms.StoreMessageInfo(mi) 151 | } 152 | } 153 | 154 | func (x *ConsensusVote) String() string { 155 | return protoimpl.X.MessageStringOf(x) 156 | } 157 | 158 | func (*ConsensusVote) ProtoMessage() {} 159 | 160 | func (x *ConsensusVote) ProtoReflect() protoreflect.Message { 161 | mi := &file_proto_types_consensus_proto_msgTypes[1] 162 | if protoimpl.UnsafeEnabled && x != nil { 163 | ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) 164 | if ms.LoadMessageInfo() == nil { 165 | ms.StoreMessageInfo(mi) 166 | } 167 | return ms 168 | } 169 | return mi.MessageOf(x) 170 | } 171 | 172 | // Deprecated: Use ConsensusVote.ProtoReflect.Descriptor instead. 173 | func (*ConsensusVote) Descriptor() ([]byte, []int) { 174 | return file_proto_types_consensus_proto_rawDescGZIP(), []int{1} 175 | } 176 | 177 | func (x *ConsensusVote) GetBlockHash() []byte { 178 | if x != nil { 179 | return x.BlockHash 180 | } 181 | return nil 182 | } 183 | 184 | func (x *ConsensusVote) GetTopic() ConsensusVote_Topic { 185 | if x != nil { 186 | return x.Topic 187 | } 188 | return ConsensusVote_PROPOSAL 189 | } 190 | 191 | type ConsensusMessage struct { 192 | state protoimpl.MessageState 193 | sizeCache protoimpl.SizeCache 194 | unknownFields protoimpl.UnknownFields 195 | 196 | Height uint64 `protobuf:"varint,1,opt,name=height,proto3" json:"height,omitempty"` 197 | Endorsement *Endorsement `protobuf:"bytes,2,opt,name=endorsement,proto3" json:"endorsement,omitempty"` 198 | // Types that are assignable to Msg: 199 | // 200 | // *ConsensusMessage_BlockProposal 201 | // *ConsensusMessage_Vote 202 | Msg isConsensusMessage_Msg `protobuf_oneof:"msg"` 203 | } 204 | 205 | func (x *ConsensusMessage) Reset() { 206 | *x = ConsensusMessage{} 207 | if protoimpl.UnsafeEnabled { 208 | mi := &file_proto_types_consensus_proto_msgTypes[2] 209 | ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) 210 | ms.StoreMessageInfo(mi) 211 | } 212 | } 213 | 214 | func (x *ConsensusMessage) String() string { 215 | return protoimpl.X.MessageStringOf(x) 216 | } 217 | 218 | func (*ConsensusMessage) ProtoMessage() {} 219 | 220 | func (x *ConsensusMessage) ProtoReflect() protoreflect.Message { 221 | mi := &file_proto_types_consensus_proto_msgTypes[2] 222 | if protoimpl.UnsafeEnabled && x != nil { 223 | ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) 224 | if ms.LoadMessageInfo() == nil { 225 | ms.StoreMessageInfo(mi) 226 | } 227 | return ms 228 | } 229 | return mi.MessageOf(x) 230 | } 231 | 232 | // Deprecated: Use ConsensusMessage.ProtoReflect.Descriptor instead. 233 | func (*ConsensusMessage) Descriptor() ([]byte, []int) { 234 | return file_proto_types_consensus_proto_rawDescGZIP(), []int{2} 235 | } 236 | 237 | func (x *ConsensusMessage) GetHeight() uint64 { 238 | if x != nil { 239 | return x.Height 240 | } 241 | return 0 242 | } 243 | 244 | func (x *ConsensusMessage) GetEndorsement() *Endorsement { 245 | if x != nil { 246 | return x.Endorsement 247 | } 248 | return nil 249 | } 250 | 251 | func (m *ConsensusMessage) GetMsg() isConsensusMessage_Msg { 252 | if m != nil { 253 | return m.Msg 254 | } 255 | return nil 256 | } 257 | 258 | func (x *ConsensusMessage) GetBlockProposal() *BlockProposal { 259 | if x, ok := x.GetMsg().(*ConsensusMessage_BlockProposal); ok { 260 | return x.BlockProposal 261 | } 262 | return nil 263 | } 264 | 265 | func (x *ConsensusMessage) GetVote() *ConsensusVote { 266 | if x, ok := x.GetMsg().(*ConsensusMessage_Vote); ok { 267 | return x.Vote 268 | } 269 | return nil 270 | } 271 | 272 | type isConsensusMessage_Msg interface { 273 | isConsensusMessage_Msg() 274 | } 275 | 276 | type ConsensusMessage_BlockProposal struct { 277 | BlockProposal *BlockProposal `protobuf:"bytes,100,opt,name=blockProposal,proto3,oneof"` 278 | } 279 | 280 | type ConsensusMessage_Vote struct { 281 | Vote *ConsensusVote `protobuf:"bytes,101,opt,name=vote,proto3,oneof"` 282 | } 283 | 284 | func (*ConsensusMessage_BlockProposal) isConsensusMessage_Msg() {} 285 | 286 | func (*ConsensusMessage_Vote) isConsensusMessage_Msg() {} 287 | 288 | var File_proto_types_consensus_proto protoreflect.FileDescriptor 289 | 290 | var file_proto_types_consensus_proto_rawDesc = []byte{ 291 | 0x0a, 0x1b, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2f, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2f, 0x63, 0x6f, 292 | 0x6e, 0x73, 0x65, 0x6e, 0x73, 0x75, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x0a, 0x69, 293 | 0x6f, 0x74, 0x65, 0x78, 0x74, 0x79, 0x70, 0x65, 0x73, 0x1a, 0x1c, 0x70, 0x72, 0x6f, 0x74, 0x6f, 294 | 0x2f, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2f, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x63, 0x68, 0x61, 0x69, 295 | 0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x1d, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2f, 0x74, 296 | 0x79, 0x70, 0x65, 0x73, 0x2f, 0x65, 0x6e, 0x64, 0x6f, 0x72, 0x73, 0x65, 0x6d, 0x65, 0x6e, 0x74, 297 | 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0x75, 0x0a, 0x0d, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x50, 298 | 0x72, 0x6f, 0x70, 0x6f, 0x73, 0x61, 0x6c, 0x12, 0x27, 0x0a, 0x05, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 299 | 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x11, 0x2e, 0x69, 0x6f, 0x74, 0x65, 0x78, 0x74, 0x79, 300 | 0x70, 0x65, 0x73, 0x2e, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x52, 0x05, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 301 | 0x12, 0x3b, 0x0a, 0x0c, 0x65, 0x6e, 0x64, 0x6f, 0x72, 0x73, 0x65, 0x6d, 0x65, 0x6e, 0x74, 0x73, 302 | 0x18, 0x02, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x17, 0x2e, 0x69, 0x6f, 0x74, 0x65, 0x78, 0x74, 0x79, 303 | 0x70, 0x65, 0x73, 0x2e, 0x45, 0x6e, 0x64, 0x6f, 0x72, 0x73, 0x65, 0x6d, 0x65, 0x6e, 0x74, 0x52, 304 | 0x0c, 0x65, 0x6e, 0x64, 0x6f, 0x72, 0x73, 0x65, 0x6d, 0x65, 0x6e, 0x74, 0x73, 0x22, 0x91, 0x01, 305 | 0x0a, 0x0d, 0x43, 0x6f, 0x6e, 0x73, 0x65, 0x6e, 0x73, 0x75, 0x73, 0x56, 0x6f, 0x74, 0x65, 0x12, 306 | 0x1c, 0x0a, 0x09, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x48, 0x61, 0x73, 0x68, 0x18, 0x01, 0x20, 0x01, 307 | 0x28, 0x0c, 0x52, 0x09, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x48, 0x61, 0x73, 0x68, 0x12, 0x35, 0x0a, 308 | 0x05, 0x74, 0x6f, 0x70, 0x69, 0x63, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x1f, 0x2e, 0x69, 309 | 0x6f, 0x74, 0x65, 0x78, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2e, 0x43, 0x6f, 0x6e, 0x73, 0x65, 0x6e, 310 | 0x73, 0x75, 0x73, 0x56, 0x6f, 0x74, 0x65, 0x2e, 0x54, 0x6f, 0x70, 0x69, 0x63, 0x52, 0x05, 0x74, 311 | 0x6f, 0x70, 0x69, 0x63, 0x22, 0x2b, 0x0a, 0x05, 0x54, 0x6f, 0x70, 0x69, 0x63, 0x12, 0x0c, 0x0a, 312 | 0x08, 0x50, 0x52, 0x4f, 0x50, 0x4f, 0x53, 0x41, 0x4c, 0x10, 0x00, 0x12, 0x08, 0x0a, 0x04, 0x4c, 313 | 0x4f, 0x43, 0x4b, 0x10, 0x01, 0x12, 0x0a, 0x0a, 0x06, 0x43, 0x4f, 0x4d, 0x4d, 0x49, 0x54, 0x10, 314 | 0x02, 0x22, 0xe0, 0x01, 0x0a, 0x10, 0x43, 0x6f, 0x6e, 0x73, 0x65, 0x6e, 0x73, 0x75, 0x73, 0x4d, 315 | 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x12, 0x16, 0x0a, 0x06, 0x68, 0x65, 0x69, 0x67, 0x68, 0x74, 316 | 0x18, 0x01, 0x20, 0x01, 0x28, 0x04, 0x52, 0x06, 0x68, 0x65, 0x69, 0x67, 0x68, 0x74, 0x12, 0x39, 317 | 0x0a, 0x0b, 0x65, 0x6e, 0x64, 0x6f, 0x72, 0x73, 0x65, 0x6d, 0x65, 0x6e, 0x74, 0x18, 0x02, 0x20, 318 | 0x01, 0x28, 0x0b, 0x32, 0x17, 0x2e, 0x69, 0x6f, 0x74, 0x65, 0x78, 0x74, 0x79, 0x70, 0x65, 0x73, 319 | 0x2e, 0x45, 0x6e, 0x64, 0x6f, 0x72, 0x73, 0x65, 0x6d, 0x65, 0x6e, 0x74, 0x52, 0x0b, 0x65, 0x6e, 320 | 0x64, 0x6f, 0x72, 0x73, 0x65, 0x6d, 0x65, 0x6e, 0x74, 0x12, 0x41, 0x0a, 0x0d, 0x62, 0x6c, 0x6f, 321 | 0x63, 0x6b, 0x50, 0x72, 0x6f, 0x70, 0x6f, 0x73, 0x61, 0x6c, 0x18, 0x64, 0x20, 0x01, 0x28, 0x0b, 322 | 0x32, 0x19, 0x2e, 0x69, 0x6f, 0x74, 0x65, 0x78, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2e, 0x42, 0x6c, 323 | 0x6f, 0x63, 0x6b, 0x50, 0x72, 0x6f, 0x70, 0x6f, 0x73, 0x61, 0x6c, 0x48, 0x00, 0x52, 0x0d, 0x62, 324 | 0x6c, 0x6f, 0x63, 0x6b, 0x50, 0x72, 0x6f, 0x70, 0x6f, 0x73, 0x61, 0x6c, 0x12, 0x2f, 0x0a, 0x04, 325 | 0x76, 0x6f, 0x74, 0x65, 0x18, 0x65, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x19, 0x2e, 0x69, 0x6f, 0x74, 326 | 0x65, 0x78, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2e, 0x43, 0x6f, 0x6e, 0x73, 0x65, 0x6e, 0x73, 0x75, 327 | 0x73, 0x56, 0x6f, 0x74, 0x65, 0x48, 0x00, 0x52, 0x04, 0x76, 0x6f, 0x74, 0x65, 0x42, 0x05, 0x0a, 328 | 0x03, 0x6d, 0x73, 0x67, 0x42, 0x5d, 0x0a, 0x22, 0x63, 0x6f, 0x6d, 0x2e, 0x67, 0x69, 0x74, 0x68, 329 | 0x75, 0x62, 0x2e, 0x69, 0x6f, 0x74, 0x65, 0x78, 0x70, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x2e, 330 | 0x67, 0x72, 0x70, 0x63, 0x2e, 0x74, 0x79, 0x70, 0x65, 0x73, 0x50, 0x01, 0x5a, 0x35, 0x67, 0x69, 331 | 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x69, 0x6f, 0x74, 0x65, 0x78, 0x70, 0x72, 332 | 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x2f, 0x69, 0x6f, 0x74, 0x65, 0x78, 0x2d, 0x70, 0x72, 0x6f, 0x74, 333 | 0x6f, 0x2f, 0x67, 0x6f, 0x6c, 0x61, 0x6e, 0x67, 0x2f, 0x69, 0x6f, 0x74, 0x65, 0x78, 0x74, 0x79, 334 | 0x70, 0x65, 0x73, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, 335 | } 336 | 337 | var ( 338 | file_proto_types_consensus_proto_rawDescOnce sync.Once 339 | file_proto_types_consensus_proto_rawDescData = file_proto_types_consensus_proto_rawDesc 340 | ) 341 | 342 | func file_proto_types_consensus_proto_rawDescGZIP() []byte { 343 | file_proto_types_consensus_proto_rawDescOnce.Do(func() { 344 | file_proto_types_consensus_proto_rawDescData = protoimpl.X.CompressGZIP(file_proto_types_consensus_proto_rawDescData) 345 | }) 346 | return file_proto_types_consensus_proto_rawDescData 347 | } 348 | 349 | var file_proto_types_consensus_proto_enumTypes = make([]protoimpl.EnumInfo, 1) 350 | var file_proto_types_consensus_proto_msgTypes = make([]protoimpl.MessageInfo, 3) 351 | var file_proto_types_consensus_proto_goTypes = []any{ 352 | (ConsensusVote_Topic)(0), // 0: iotextypes.ConsensusVote.Topic 353 | (*BlockProposal)(nil), // 1: iotextypes.BlockProposal 354 | (*ConsensusVote)(nil), // 2: iotextypes.ConsensusVote 355 | (*ConsensusMessage)(nil), // 3: iotextypes.ConsensusMessage 356 | (*Block)(nil), // 4: iotextypes.Block 357 | (*Endorsement)(nil), // 5: iotextypes.Endorsement 358 | } 359 | var file_proto_types_consensus_proto_depIdxs = []int32{ 360 | 4, // 0: iotextypes.BlockProposal.block:type_name -> iotextypes.Block 361 | 5, // 1: iotextypes.BlockProposal.endorsements:type_name -> iotextypes.Endorsement 362 | 0, // 2: iotextypes.ConsensusVote.topic:type_name -> iotextypes.ConsensusVote.Topic 363 | 5, // 3: iotextypes.ConsensusMessage.endorsement:type_name -> iotextypes.Endorsement 364 | 1, // 4: iotextypes.ConsensusMessage.blockProposal:type_name -> iotextypes.BlockProposal 365 | 2, // 5: iotextypes.ConsensusMessage.vote:type_name -> iotextypes.ConsensusVote 366 | 6, // [6:6] is the sub-list for method output_type 367 | 6, // [6:6] is the sub-list for method input_type 368 | 6, // [6:6] is the sub-list for extension type_name 369 | 6, // [6:6] is the sub-list for extension extendee 370 | 0, // [0:6] is the sub-list for field type_name 371 | } 372 | 373 | func init() { file_proto_types_consensus_proto_init() } 374 | func file_proto_types_consensus_proto_init() { 375 | if File_proto_types_consensus_proto != nil { 376 | return 377 | } 378 | file_proto_types_blockchain_proto_init() 379 | file_proto_types_endorsement_proto_init() 380 | if !protoimpl.UnsafeEnabled { 381 | file_proto_types_consensus_proto_msgTypes[0].Exporter = func(v any, i int) any { 382 | switch v := v.(*BlockProposal); i { 383 | case 0: 384 | return &v.state 385 | case 1: 386 | return &v.sizeCache 387 | case 2: 388 | return &v.unknownFields 389 | default: 390 | return nil 391 | } 392 | } 393 | file_proto_types_consensus_proto_msgTypes[1].Exporter = func(v any, i int) any { 394 | switch v := v.(*ConsensusVote); i { 395 | case 0: 396 | return &v.state 397 | case 1: 398 | return &v.sizeCache 399 | case 2: 400 | return &v.unknownFields 401 | default: 402 | return nil 403 | } 404 | } 405 | file_proto_types_consensus_proto_msgTypes[2].Exporter = func(v any, i int) any { 406 | switch v := v.(*ConsensusMessage); i { 407 | case 0: 408 | return &v.state 409 | case 1: 410 | return &v.sizeCache 411 | case 2: 412 | return &v.unknownFields 413 | default: 414 | return nil 415 | } 416 | } 417 | } 418 | file_proto_types_consensus_proto_msgTypes[2].OneofWrappers = []any{ 419 | (*ConsensusMessage_BlockProposal)(nil), 420 | (*ConsensusMessage_Vote)(nil), 421 | } 422 | type x struct{} 423 | out := protoimpl.TypeBuilder{ 424 | File: protoimpl.DescBuilder{ 425 | GoPackagePath: reflect.TypeOf(x{}).PkgPath(), 426 | RawDescriptor: file_proto_types_consensus_proto_rawDesc, 427 | NumEnums: 1, 428 | NumMessages: 3, 429 | NumExtensions: 0, 430 | NumServices: 0, 431 | }, 432 | GoTypes: file_proto_types_consensus_proto_goTypes, 433 | DependencyIndexes: file_proto_types_consensus_proto_depIdxs, 434 | EnumInfos: file_proto_types_consensus_proto_enumTypes, 435 | MessageInfos: file_proto_types_consensus_proto_msgTypes, 436 | }.Build() 437 | File_proto_types_consensus_proto = out.File 438 | file_proto_types_consensus_proto_rawDesc = nil 439 | file_proto_types_consensus_proto_goTypes = nil 440 | file_proto_types_consensus_proto_depIdxs = nil 441 | } 442 | -------------------------------------------------------------------------------- /golang/iotextypes/election.pb.go: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2019 IoTeX 2 | // This is an alpha (internal) release and is not suitable for production. This source code is provided 'as is' and no 3 | // warranties are given as to title or non-infringement, merchantability or fitness for purpose and, to the extent 4 | // permitted by law, all liability for your use of the code is disclaimed. This source code is governed by Apache 5 | // License 2.0 that can be found in the LICENSE file. 6 | 7 | // To compile the proto, run: 8 | // protoc --go_out=plugins=grpc:$GOPATH/src *.proto 9 | 10 | // Code generated by protoc-gen-go. DO NOT EDIT. 11 | // versions: 12 | // protoc-gen-go v1.34.2 13 | // protoc v5.27.1 14 | // source: proto/types/election.proto 15 | 16 | package iotextypes 17 | 18 | import ( 19 | protoreflect "google.golang.org/protobuf/reflect/protoreflect" 20 | protoimpl "google.golang.org/protobuf/runtime/protoimpl" 21 | durationpb "google.golang.org/protobuf/types/known/durationpb" 22 | timestamppb "google.golang.org/protobuf/types/known/timestamppb" 23 | reflect "reflect" 24 | sync "sync" 25 | ) 26 | 27 | const ( 28 | // Verify that this generated code is sufficiently up-to-date. 29 | _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) 30 | // Verify that runtime/protoimpl is sufficiently up-to-date. 31 | _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) 32 | ) 33 | 34 | type ElectionBucket struct { 35 | state protoimpl.MessageState 36 | sizeCache protoimpl.SizeCache 37 | unknownFields protoimpl.UnknownFields 38 | 39 | Voter []byte `protobuf:"bytes,1,opt,name=voter,proto3" json:"voter,omitempty"` 40 | Candidate []byte `protobuf:"bytes,2,opt,name=candidate,proto3" json:"candidate,omitempty"` 41 | Amount []byte `protobuf:"bytes,3,opt,name=amount,proto3" json:"amount,omitempty"` 42 | StartTime *timestamppb.Timestamp `protobuf:"bytes,4,opt,name=startTime,proto3" json:"startTime,omitempty"` 43 | Duration *durationpb.Duration `protobuf:"bytes,5,opt,name=duration,proto3" json:"duration,omitempty"` 44 | Decay bool `protobuf:"varint,6,opt,name=decay,proto3" json:"decay,omitempty"` 45 | } 46 | 47 | func (x *ElectionBucket) Reset() { 48 | *x = ElectionBucket{} 49 | if protoimpl.UnsafeEnabled { 50 | mi := &file_proto_types_election_proto_msgTypes[0] 51 | ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) 52 | ms.StoreMessageInfo(mi) 53 | } 54 | } 55 | 56 | func (x *ElectionBucket) String() string { 57 | return protoimpl.X.MessageStringOf(x) 58 | } 59 | 60 | func (*ElectionBucket) ProtoMessage() {} 61 | 62 | func (x *ElectionBucket) ProtoReflect() protoreflect.Message { 63 | mi := &file_proto_types_election_proto_msgTypes[0] 64 | if protoimpl.UnsafeEnabled && x != nil { 65 | ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) 66 | if ms.LoadMessageInfo() == nil { 67 | ms.StoreMessageInfo(mi) 68 | } 69 | return ms 70 | } 71 | return mi.MessageOf(x) 72 | } 73 | 74 | // Deprecated: Use ElectionBucket.ProtoReflect.Descriptor instead. 75 | func (*ElectionBucket) Descriptor() ([]byte, []int) { 76 | return file_proto_types_election_proto_rawDescGZIP(), []int{0} 77 | } 78 | 79 | func (x *ElectionBucket) GetVoter() []byte { 80 | if x != nil { 81 | return x.Voter 82 | } 83 | return nil 84 | } 85 | 86 | func (x *ElectionBucket) GetCandidate() []byte { 87 | if x != nil { 88 | return x.Candidate 89 | } 90 | return nil 91 | } 92 | 93 | func (x *ElectionBucket) GetAmount() []byte { 94 | if x != nil { 95 | return x.Amount 96 | } 97 | return nil 98 | } 99 | 100 | func (x *ElectionBucket) GetStartTime() *timestamppb.Timestamp { 101 | if x != nil { 102 | return x.StartTime 103 | } 104 | return nil 105 | } 106 | 107 | func (x *ElectionBucket) GetDuration() *durationpb.Duration { 108 | if x != nil { 109 | return x.Duration 110 | } 111 | return nil 112 | } 113 | 114 | func (x *ElectionBucket) GetDecay() bool { 115 | if x != nil { 116 | return x.Decay 117 | } 118 | return false 119 | } 120 | 121 | var File_proto_types_election_proto protoreflect.FileDescriptor 122 | 123 | var file_proto_types_election_proto_rawDesc = []byte{ 124 | 0x0a, 0x1a, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2f, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2f, 0x65, 0x6c, 125 | 0x65, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x0a, 0x69, 0x6f, 126 | 0x74, 0x65, 0x78, 0x74, 0x79, 0x70, 0x65, 0x73, 0x1a, 0x1e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 127 | 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2f, 0x64, 0x75, 0x72, 0x61, 0x74, 0x69, 128 | 0x6f, 0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x1f, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 129 | 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2f, 0x74, 0x69, 0x6d, 0x65, 0x73, 0x74, 130 | 0x61, 0x6d, 0x70, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0xe3, 0x01, 0x0a, 0x0e, 0x45, 0x6c, 131 | 0x65, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x42, 0x75, 0x63, 0x6b, 0x65, 0x74, 0x12, 0x14, 0x0a, 0x05, 132 | 0x76, 0x6f, 0x74, 0x65, 0x72, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x05, 0x76, 0x6f, 0x74, 133 | 0x65, 0x72, 0x12, 0x1c, 0x0a, 0x09, 0x63, 0x61, 0x6e, 0x64, 0x69, 0x64, 0x61, 0x74, 0x65, 0x18, 134 | 0x02, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x09, 0x63, 0x61, 0x6e, 0x64, 0x69, 0x64, 0x61, 0x74, 0x65, 135 | 0x12, 0x16, 0x0a, 0x06, 0x61, 0x6d, 0x6f, 0x75, 0x6e, 0x74, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0c, 136 | 0x52, 0x06, 0x61, 0x6d, 0x6f, 0x75, 0x6e, 0x74, 0x12, 0x38, 0x0a, 0x09, 0x73, 0x74, 0x61, 0x72, 137 | 0x74, 0x54, 0x69, 0x6d, 0x65, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x67, 0x6f, 138 | 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x54, 0x69, 139 | 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x52, 0x09, 0x73, 0x74, 0x61, 0x72, 0x74, 0x54, 0x69, 140 | 0x6d, 0x65, 0x12, 0x35, 0x0a, 0x08, 0x64, 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x05, 141 | 0x20, 0x01, 0x28, 0x0b, 0x32, 0x19, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 142 | 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x44, 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 143 | 0x08, 0x64, 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x14, 0x0a, 0x05, 0x64, 0x65, 0x63, 144 | 0x61, 0x79, 0x18, 0x06, 0x20, 0x01, 0x28, 0x08, 0x52, 0x05, 0x64, 0x65, 0x63, 0x61, 0x79, 0x42, 145 | 0x5d, 0x0a, 0x22, 0x63, 0x6f, 0x6d, 0x2e, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x69, 0x6f, 146 | 0x74, 0x65, 0x78, 0x70, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x2e, 0x67, 0x72, 0x70, 0x63, 0x2e, 147 | 0x74, 0x79, 0x70, 0x65, 0x73, 0x50, 0x01, 0x5a, 0x35, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 148 | 0x63, 0x6f, 0x6d, 0x2f, 0x69, 0x6f, 0x74, 0x65, 0x78, 0x70, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 149 | 0x2f, 0x69, 0x6f, 0x74, 0x65, 0x78, 0x2d, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2f, 0x67, 0x6f, 0x6c, 150 | 0x61, 0x6e, 0x67, 0x2f, 0x69, 0x6f, 0x74, 0x65, 0x78, 0x74, 0x79, 0x70, 0x65, 0x73, 0x62, 0x06, 151 | 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, 152 | } 153 | 154 | var ( 155 | file_proto_types_election_proto_rawDescOnce sync.Once 156 | file_proto_types_election_proto_rawDescData = file_proto_types_election_proto_rawDesc 157 | ) 158 | 159 | func file_proto_types_election_proto_rawDescGZIP() []byte { 160 | file_proto_types_election_proto_rawDescOnce.Do(func() { 161 | file_proto_types_election_proto_rawDescData = protoimpl.X.CompressGZIP(file_proto_types_election_proto_rawDescData) 162 | }) 163 | return file_proto_types_election_proto_rawDescData 164 | } 165 | 166 | var file_proto_types_election_proto_msgTypes = make([]protoimpl.MessageInfo, 1) 167 | var file_proto_types_election_proto_goTypes = []any{ 168 | (*ElectionBucket)(nil), // 0: iotextypes.ElectionBucket 169 | (*timestamppb.Timestamp)(nil), // 1: google.protobuf.Timestamp 170 | (*durationpb.Duration)(nil), // 2: google.protobuf.Duration 171 | } 172 | var file_proto_types_election_proto_depIdxs = []int32{ 173 | 1, // 0: iotextypes.ElectionBucket.startTime:type_name -> google.protobuf.Timestamp 174 | 2, // 1: iotextypes.ElectionBucket.duration:type_name -> google.protobuf.Duration 175 | 2, // [2:2] is the sub-list for method output_type 176 | 2, // [2:2] is the sub-list for method input_type 177 | 2, // [2:2] is the sub-list for extension type_name 178 | 2, // [2:2] is the sub-list for extension extendee 179 | 0, // [0:2] is the sub-list for field type_name 180 | } 181 | 182 | func init() { file_proto_types_election_proto_init() } 183 | func file_proto_types_election_proto_init() { 184 | if File_proto_types_election_proto != nil { 185 | return 186 | } 187 | if !protoimpl.UnsafeEnabled { 188 | file_proto_types_election_proto_msgTypes[0].Exporter = func(v any, i int) any { 189 | switch v := v.(*ElectionBucket); i { 190 | case 0: 191 | return &v.state 192 | case 1: 193 | return &v.sizeCache 194 | case 2: 195 | return &v.unknownFields 196 | default: 197 | return nil 198 | } 199 | } 200 | } 201 | type x struct{} 202 | out := protoimpl.TypeBuilder{ 203 | File: protoimpl.DescBuilder{ 204 | GoPackagePath: reflect.TypeOf(x{}).PkgPath(), 205 | RawDescriptor: file_proto_types_election_proto_rawDesc, 206 | NumEnums: 0, 207 | NumMessages: 1, 208 | NumExtensions: 0, 209 | NumServices: 0, 210 | }, 211 | GoTypes: file_proto_types_election_proto_goTypes, 212 | DependencyIndexes: file_proto_types_election_proto_depIdxs, 213 | MessageInfos: file_proto_types_election_proto_msgTypes, 214 | }.Build() 215 | File_proto_types_election_proto = out.File 216 | file_proto_types_election_proto_rawDesc = nil 217 | file_proto_types_election_proto_goTypes = nil 218 | file_proto_types_election_proto_depIdxs = nil 219 | } 220 | -------------------------------------------------------------------------------- /golang/iotextypes/endorsement.pb.go: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2018 IoTeX 2 | // This is an alpha (internal) release and is not suitable for production. This source code is provided 'as is' and no 3 | // warranties are given as to title or non-infringement, merchantability or fitness for purpose and, to the extent 4 | // permitted by law, all liability for your use of the code is disclaimed. This source code is governed by Apache 5 | // License 2.0 that can be found in the LICENSE file. 6 | 7 | // To compile the proto, run: 8 | // protoc --go_out=plugins=grpc:$GOPATH/src *.proto 9 | 10 | // Code generated by protoc-gen-go. DO NOT EDIT. 11 | // versions: 12 | // protoc-gen-go v1.34.2 13 | // protoc v5.27.1 14 | // source: proto/types/endorsement.proto 15 | 16 | package iotextypes 17 | 18 | import ( 19 | protoreflect "google.golang.org/protobuf/reflect/protoreflect" 20 | protoimpl "google.golang.org/protobuf/runtime/protoimpl" 21 | timestamppb "google.golang.org/protobuf/types/known/timestamppb" 22 | reflect "reflect" 23 | sync "sync" 24 | ) 25 | 26 | const ( 27 | // Verify that this generated code is sufficiently up-to-date. 28 | _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) 29 | // Verify that runtime/protoimpl is sufficiently up-to-date. 30 | _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) 31 | ) 32 | 33 | type Endorsement struct { 34 | state protoimpl.MessageState 35 | sizeCache protoimpl.SizeCache 36 | unknownFields protoimpl.UnknownFields 37 | 38 | Timestamp *timestamppb.Timestamp `protobuf:"bytes,1,opt,name=timestamp,proto3" json:"timestamp,omitempty"` 39 | Endorser []byte `protobuf:"bytes,2,opt,name=endorser,proto3" json:"endorser,omitempty"` 40 | Signature []byte `protobuf:"bytes,3,opt,name=signature,proto3" json:"signature,omitempty"` 41 | } 42 | 43 | func (x *Endorsement) Reset() { 44 | *x = Endorsement{} 45 | if protoimpl.UnsafeEnabled { 46 | mi := &file_proto_types_endorsement_proto_msgTypes[0] 47 | ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) 48 | ms.StoreMessageInfo(mi) 49 | } 50 | } 51 | 52 | func (x *Endorsement) String() string { 53 | return protoimpl.X.MessageStringOf(x) 54 | } 55 | 56 | func (*Endorsement) ProtoMessage() {} 57 | 58 | func (x *Endorsement) ProtoReflect() protoreflect.Message { 59 | mi := &file_proto_types_endorsement_proto_msgTypes[0] 60 | if protoimpl.UnsafeEnabled && x != nil { 61 | ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) 62 | if ms.LoadMessageInfo() == nil { 63 | ms.StoreMessageInfo(mi) 64 | } 65 | return ms 66 | } 67 | return mi.MessageOf(x) 68 | } 69 | 70 | // Deprecated: Use Endorsement.ProtoReflect.Descriptor instead. 71 | func (*Endorsement) Descriptor() ([]byte, []int) { 72 | return file_proto_types_endorsement_proto_rawDescGZIP(), []int{0} 73 | } 74 | 75 | func (x *Endorsement) GetTimestamp() *timestamppb.Timestamp { 76 | if x != nil { 77 | return x.Timestamp 78 | } 79 | return nil 80 | } 81 | 82 | func (x *Endorsement) GetEndorser() []byte { 83 | if x != nil { 84 | return x.Endorser 85 | } 86 | return nil 87 | } 88 | 89 | func (x *Endorsement) GetSignature() []byte { 90 | if x != nil { 91 | return x.Signature 92 | } 93 | return nil 94 | } 95 | 96 | var File_proto_types_endorsement_proto protoreflect.FileDescriptor 97 | 98 | var file_proto_types_endorsement_proto_rawDesc = []byte{ 99 | 0x0a, 0x1d, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2f, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2f, 0x65, 0x6e, 100 | 0x64, 0x6f, 0x72, 0x73, 0x65, 0x6d, 0x65, 0x6e, 0x74, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 101 | 0x0a, 0x69, 0x6f, 0x74, 0x65, 0x78, 0x74, 0x79, 0x70, 0x65, 0x73, 0x1a, 0x1f, 0x67, 0x6f, 0x6f, 102 | 0x67, 0x6c, 0x65, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2f, 0x74, 0x69, 0x6d, 103 | 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0x81, 0x01, 0x0a, 104 | 0x0b, 0x45, 0x6e, 0x64, 0x6f, 0x72, 0x73, 0x65, 0x6d, 0x65, 0x6e, 0x74, 0x12, 0x38, 0x0a, 0x09, 105 | 0x74, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 106 | 0x1a, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 107 | 0x66, 0x2e, 0x54, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x52, 0x09, 0x74, 0x69, 0x6d, 108 | 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x12, 0x1a, 0x0a, 0x08, 0x65, 0x6e, 0x64, 0x6f, 0x72, 0x73, 109 | 0x65, 0x72, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x08, 0x65, 0x6e, 0x64, 0x6f, 0x72, 0x73, 110 | 0x65, 0x72, 0x12, 0x1c, 0x0a, 0x09, 0x73, 0x69, 0x67, 0x6e, 0x61, 0x74, 0x75, 0x72, 0x65, 0x18, 111 | 0x03, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x09, 0x73, 0x69, 0x67, 0x6e, 0x61, 0x74, 0x75, 0x72, 0x65, 112 | 0x42, 0x5d, 0x0a, 0x22, 0x63, 0x6f, 0x6d, 0x2e, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x69, 113 | 0x6f, 0x74, 0x65, 0x78, 0x70, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x2e, 0x67, 0x72, 0x70, 0x63, 114 | 0x2e, 0x74, 0x79, 0x70, 0x65, 0x73, 0x50, 0x01, 0x5a, 0x35, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 115 | 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x69, 0x6f, 0x74, 0x65, 0x78, 0x70, 0x72, 0x6f, 0x6a, 0x65, 0x63, 116 | 0x74, 0x2f, 0x69, 0x6f, 0x74, 0x65, 0x78, 0x2d, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2f, 0x67, 0x6f, 117 | 0x6c, 0x61, 0x6e, 0x67, 0x2f, 0x69, 0x6f, 0x74, 0x65, 0x78, 0x74, 0x79, 0x70, 0x65, 0x73, 0x62, 118 | 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, 119 | } 120 | 121 | var ( 122 | file_proto_types_endorsement_proto_rawDescOnce sync.Once 123 | file_proto_types_endorsement_proto_rawDescData = file_proto_types_endorsement_proto_rawDesc 124 | ) 125 | 126 | func file_proto_types_endorsement_proto_rawDescGZIP() []byte { 127 | file_proto_types_endorsement_proto_rawDescOnce.Do(func() { 128 | file_proto_types_endorsement_proto_rawDescData = protoimpl.X.CompressGZIP(file_proto_types_endorsement_proto_rawDescData) 129 | }) 130 | return file_proto_types_endorsement_proto_rawDescData 131 | } 132 | 133 | var file_proto_types_endorsement_proto_msgTypes = make([]protoimpl.MessageInfo, 1) 134 | var file_proto_types_endorsement_proto_goTypes = []any{ 135 | (*Endorsement)(nil), // 0: iotextypes.Endorsement 136 | (*timestamppb.Timestamp)(nil), // 1: google.protobuf.Timestamp 137 | } 138 | var file_proto_types_endorsement_proto_depIdxs = []int32{ 139 | 1, // 0: iotextypes.Endorsement.timestamp:type_name -> google.protobuf.Timestamp 140 | 1, // [1:1] is the sub-list for method output_type 141 | 1, // [1:1] is the sub-list for method input_type 142 | 1, // [1:1] is the sub-list for extension type_name 143 | 1, // [1:1] is the sub-list for extension extendee 144 | 0, // [0:1] is the sub-list for field type_name 145 | } 146 | 147 | func init() { file_proto_types_endorsement_proto_init() } 148 | func file_proto_types_endorsement_proto_init() { 149 | if File_proto_types_endorsement_proto != nil { 150 | return 151 | } 152 | if !protoimpl.UnsafeEnabled { 153 | file_proto_types_endorsement_proto_msgTypes[0].Exporter = func(v any, i int) any { 154 | switch v := v.(*Endorsement); i { 155 | case 0: 156 | return &v.state 157 | case 1: 158 | return &v.sizeCache 159 | case 2: 160 | return &v.unknownFields 161 | default: 162 | return nil 163 | } 164 | } 165 | } 166 | type x struct{} 167 | out := protoimpl.TypeBuilder{ 168 | File: protoimpl.DescBuilder{ 169 | GoPackagePath: reflect.TypeOf(x{}).PkgPath(), 170 | RawDescriptor: file_proto_types_endorsement_proto_rawDesc, 171 | NumEnums: 0, 172 | NumMessages: 1, 173 | NumExtensions: 0, 174 | NumServices: 0, 175 | }, 176 | GoTypes: file_proto_types_endorsement_proto_goTypes, 177 | DependencyIndexes: file_proto_types_endorsement_proto_depIdxs, 178 | MessageInfos: file_proto_types_endorsement_proto_msgTypes, 179 | }.Build() 180 | File_proto_types_endorsement_proto = out.File 181 | file_proto_types_endorsement_proto_rawDesc = nil 182 | file_proto_types_endorsement_proto_goTypes = nil 183 | file_proto_types_endorsement_proto_depIdxs = nil 184 | } 185 | -------------------------------------------------------------------------------- /golang/iotextypes/genesis.pb.go: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2019 IoTeX 2 | // This is an alpha (internal) release and is not suitable for production. This source code is provided 'as is' and no 3 | // warranties are given as to title or non-infringement, merchantability or fitness for purpose and, to the extent 4 | // permitted by law, all liability for your use of the code is disclaimed. This source code is governed by Apache 5 | // License 2.0 that can be found in the LICENSE file. 6 | 7 | // To compile the proto, run: 8 | // protoc --go_out=plugins=grpc:$GOPATH/src *.proto 9 | 10 | // Code generated by protoc-gen-go. DO NOT EDIT. 11 | // versions: 12 | // protoc-gen-go v1.34.2 13 | // protoc v5.27.1 14 | // source: proto/types/genesis.proto 15 | 16 | package iotextypes 17 | 18 | import ( 19 | protoreflect "google.golang.org/protobuf/reflect/protoreflect" 20 | protoimpl "google.golang.org/protobuf/runtime/protoimpl" 21 | reflect "reflect" 22 | sync "sync" 23 | ) 24 | 25 | const ( 26 | // Verify that this generated code is sufficiently up-to-date. 27 | _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) 28 | // Verify that runtime/protoimpl is sufficiently up-to-date. 29 | _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) 30 | ) 31 | 32 | type Genesis struct { 33 | state protoimpl.MessageState 34 | sizeCache protoimpl.SizeCache 35 | unknownFields protoimpl.UnknownFields 36 | 37 | Blockchain *GenesisBlockchain `protobuf:"bytes,1,opt,name=blockchain,proto3" json:"blockchain,omitempty"` 38 | Account *GenesisAccount `protobuf:"bytes,2,opt,name=account,proto3" json:"account,omitempty"` 39 | Poll *GenesisPoll `protobuf:"bytes,3,opt,name=poll,proto3" json:"poll,omitempty"` 40 | Rewarding *GenesisRewarding `protobuf:"bytes,4,opt,name=rewarding,proto3" json:"rewarding,omitempty"` 41 | } 42 | 43 | func (x *Genesis) Reset() { 44 | *x = Genesis{} 45 | if protoimpl.UnsafeEnabled { 46 | mi := &file_proto_types_genesis_proto_msgTypes[0] 47 | ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) 48 | ms.StoreMessageInfo(mi) 49 | } 50 | } 51 | 52 | func (x *Genesis) String() string { 53 | return protoimpl.X.MessageStringOf(x) 54 | } 55 | 56 | func (*Genesis) ProtoMessage() {} 57 | 58 | func (x *Genesis) ProtoReflect() protoreflect.Message { 59 | mi := &file_proto_types_genesis_proto_msgTypes[0] 60 | if protoimpl.UnsafeEnabled && x != nil { 61 | ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) 62 | if ms.LoadMessageInfo() == nil { 63 | ms.StoreMessageInfo(mi) 64 | } 65 | return ms 66 | } 67 | return mi.MessageOf(x) 68 | } 69 | 70 | // Deprecated: Use Genesis.ProtoReflect.Descriptor instead. 71 | func (*Genesis) Descriptor() ([]byte, []int) { 72 | return file_proto_types_genesis_proto_rawDescGZIP(), []int{0} 73 | } 74 | 75 | func (x *Genesis) GetBlockchain() *GenesisBlockchain { 76 | if x != nil { 77 | return x.Blockchain 78 | } 79 | return nil 80 | } 81 | 82 | func (x *Genesis) GetAccount() *GenesisAccount { 83 | if x != nil { 84 | return x.Account 85 | } 86 | return nil 87 | } 88 | 89 | func (x *Genesis) GetPoll() *GenesisPoll { 90 | if x != nil { 91 | return x.Poll 92 | } 93 | return nil 94 | } 95 | 96 | func (x *Genesis) GetRewarding() *GenesisRewarding { 97 | if x != nil { 98 | return x.Rewarding 99 | } 100 | return nil 101 | } 102 | 103 | type GenesisBlockchain struct { 104 | state protoimpl.MessageState 105 | sizeCache protoimpl.SizeCache 106 | unknownFields protoimpl.UnknownFields 107 | 108 | Timestamp int64 `protobuf:"varint,1,opt,name=timestamp,proto3" json:"timestamp,omitempty"` 109 | BlockGasLimit uint64 `protobuf:"varint,2,opt,name=blockGasLimit,proto3" json:"blockGasLimit,omitempty"` 110 | ActionGasLimit uint64 `protobuf:"varint,3,opt,name=actionGasLimit,proto3" json:"actionGasLimit,omitempty"` 111 | BlockInterval int64 `protobuf:"varint,4,opt,name=blockInterval,proto3" json:"blockInterval,omitempty"` 112 | NumSubEpochs uint64 `protobuf:"varint,5,opt,name=numSubEpochs,proto3" json:"numSubEpochs,omitempty"` 113 | NumDelegates uint64 `protobuf:"varint,6,opt,name=numDelegates,proto3" json:"numDelegates,omitempty"` 114 | NumCandidateDelegates uint64 `protobuf:"varint,7,opt,name=numCandidateDelegates,proto3" json:"numCandidateDelegates,omitempty"` 115 | TimeBasedRotation bool `protobuf:"varint,8,opt,name=timeBasedRotation,proto3" json:"timeBasedRotation,omitempty"` 116 | } 117 | 118 | func (x *GenesisBlockchain) Reset() { 119 | *x = GenesisBlockchain{} 120 | if protoimpl.UnsafeEnabled { 121 | mi := &file_proto_types_genesis_proto_msgTypes[1] 122 | ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) 123 | ms.StoreMessageInfo(mi) 124 | } 125 | } 126 | 127 | func (x *GenesisBlockchain) String() string { 128 | return protoimpl.X.MessageStringOf(x) 129 | } 130 | 131 | func (*GenesisBlockchain) ProtoMessage() {} 132 | 133 | func (x *GenesisBlockchain) ProtoReflect() protoreflect.Message { 134 | mi := &file_proto_types_genesis_proto_msgTypes[1] 135 | if protoimpl.UnsafeEnabled && x != nil { 136 | ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) 137 | if ms.LoadMessageInfo() == nil { 138 | ms.StoreMessageInfo(mi) 139 | } 140 | return ms 141 | } 142 | return mi.MessageOf(x) 143 | } 144 | 145 | // Deprecated: Use GenesisBlockchain.ProtoReflect.Descriptor instead. 146 | func (*GenesisBlockchain) Descriptor() ([]byte, []int) { 147 | return file_proto_types_genesis_proto_rawDescGZIP(), []int{1} 148 | } 149 | 150 | func (x *GenesisBlockchain) GetTimestamp() int64 { 151 | if x != nil { 152 | return x.Timestamp 153 | } 154 | return 0 155 | } 156 | 157 | func (x *GenesisBlockchain) GetBlockGasLimit() uint64 { 158 | if x != nil { 159 | return x.BlockGasLimit 160 | } 161 | return 0 162 | } 163 | 164 | func (x *GenesisBlockchain) GetActionGasLimit() uint64 { 165 | if x != nil { 166 | return x.ActionGasLimit 167 | } 168 | return 0 169 | } 170 | 171 | func (x *GenesisBlockchain) GetBlockInterval() int64 { 172 | if x != nil { 173 | return x.BlockInterval 174 | } 175 | return 0 176 | } 177 | 178 | func (x *GenesisBlockchain) GetNumSubEpochs() uint64 { 179 | if x != nil { 180 | return x.NumSubEpochs 181 | } 182 | return 0 183 | } 184 | 185 | func (x *GenesisBlockchain) GetNumDelegates() uint64 { 186 | if x != nil { 187 | return x.NumDelegates 188 | } 189 | return 0 190 | } 191 | 192 | func (x *GenesisBlockchain) GetNumCandidateDelegates() uint64 { 193 | if x != nil { 194 | return x.NumCandidateDelegates 195 | } 196 | return 0 197 | } 198 | 199 | func (x *GenesisBlockchain) GetTimeBasedRotation() bool { 200 | if x != nil { 201 | return x.TimeBasedRotation 202 | } 203 | return false 204 | } 205 | 206 | type GenesisAccount struct { 207 | state protoimpl.MessageState 208 | sizeCache protoimpl.SizeCache 209 | unknownFields protoimpl.UnknownFields 210 | 211 | InitBalanceAddrs []string `protobuf:"bytes,1,rep,name=initBalanceAddrs,proto3" json:"initBalanceAddrs,omitempty"` 212 | InitBalances []string `protobuf:"bytes,2,rep,name=initBalances,proto3" json:"initBalances,omitempty"` 213 | } 214 | 215 | func (x *GenesisAccount) Reset() { 216 | *x = GenesisAccount{} 217 | if protoimpl.UnsafeEnabled { 218 | mi := &file_proto_types_genesis_proto_msgTypes[2] 219 | ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) 220 | ms.StoreMessageInfo(mi) 221 | } 222 | } 223 | 224 | func (x *GenesisAccount) String() string { 225 | return protoimpl.X.MessageStringOf(x) 226 | } 227 | 228 | func (*GenesisAccount) ProtoMessage() {} 229 | 230 | func (x *GenesisAccount) ProtoReflect() protoreflect.Message { 231 | mi := &file_proto_types_genesis_proto_msgTypes[2] 232 | if protoimpl.UnsafeEnabled && x != nil { 233 | ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) 234 | if ms.LoadMessageInfo() == nil { 235 | ms.StoreMessageInfo(mi) 236 | } 237 | return ms 238 | } 239 | return mi.MessageOf(x) 240 | } 241 | 242 | // Deprecated: Use GenesisAccount.ProtoReflect.Descriptor instead. 243 | func (*GenesisAccount) Descriptor() ([]byte, []int) { 244 | return file_proto_types_genesis_proto_rawDescGZIP(), []int{2} 245 | } 246 | 247 | func (x *GenesisAccount) GetInitBalanceAddrs() []string { 248 | if x != nil { 249 | return x.InitBalanceAddrs 250 | } 251 | return nil 252 | } 253 | 254 | func (x *GenesisAccount) GetInitBalances() []string { 255 | if x != nil { 256 | return x.InitBalances 257 | } 258 | return nil 259 | } 260 | 261 | type GenesisPoll struct { 262 | state protoimpl.MessageState 263 | sizeCache protoimpl.SizeCache 264 | unknownFields protoimpl.UnknownFields 265 | 266 | EnableGravityChainVoting bool `protobuf:"varint,1,opt,name=enableGravityChainVoting,proto3" json:"enableGravityChainVoting,omitempty"` 267 | GravityChainStartHeight uint64 `protobuf:"varint,2,opt,name=gravityChainStartHeight,proto3" json:"gravityChainStartHeight,omitempty"` 268 | RegisterContractAddress string `protobuf:"bytes,3,opt,name=registerContractAddress,proto3" json:"registerContractAddress,omitempty"` 269 | StakingContractAddress string `protobuf:"bytes,4,opt,name=stakingContractAddress,proto3" json:"stakingContractAddress,omitempty"` 270 | VoteThreshold string `protobuf:"bytes,5,opt,name=voteThreshold,proto3" json:"voteThreshold,omitempty"` 271 | ScoreThreshold string `protobuf:"bytes,6,opt,name=scoreThreshold,proto3" json:"scoreThreshold,omitempty"` 272 | SelfStakingThreshold string `protobuf:"bytes,7,opt,name=selfStakingThreshold,proto3" json:"selfStakingThreshold,omitempty"` 273 | Delegates []*GenesisDelegate `protobuf:"bytes,8,rep,name=delegates,proto3" json:"delegates,omitempty"` 274 | } 275 | 276 | func (x *GenesisPoll) Reset() { 277 | *x = GenesisPoll{} 278 | if protoimpl.UnsafeEnabled { 279 | mi := &file_proto_types_genesis_proto_msgTypes[3] 280 | ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) 281 | ms.StoreMessageInfo(mi) 282 | } 283 | } 284 | 285 | func (x *GenesisPoll) String() string { 286 | return protoimpl.X.MessageStringOf(x) 287 | } 288 | 289 | func (*GenesisPoll) ProtoMessage() {} 290 | 291 | func (x *GenesisPoll) ProtoReflect() protoreflect.Message { 292 | mi := &file_proto_types_genesis_proto_msgTypes[3] 293 | if protoimpl.UnsafeEnabled && x != nil { 294 | ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) 295 | if ms.LoadMessageInfo() == nil { 296 | ms.StoreMessageInfo(mi) 297 | } 298 | return ms 299 | } 300 | return mi.MessageOf(x) 301 | } 302 | 303 | // Deprecated: Use GenesisPoll.ProtoReflect.Descriptor instead. 304 | func (*GenesisPoll) Descriptor() ([]byte, []int) { 305 | return file_proto_types_genesis_proto_rawDescGZIP(), []int{3} 306 | } 307 | 308 | func (x *GenesisPoll) GetEnableGravityChainVoting() bool { 309 | if x != nil { 310 | return x.EnableGravityChainVoting 311 | } 312 | return false 313 | } 314 | 315 | func (x *GenesisPoll) GetGravityChainStartHeight() uint64 { 316 | if x != nil { 317 | return x.GravityChainStartHeight 318 | } 319 | return 0 320 | } 321 | 322 | func (x *GenesisPoll) GetRegisterContractAddress() string { 323 | if x != nil { 324 | return x.RegisterContractAddress 325 | } 326 | return "" 327 | } 328 | 329 | func (x *GenesisPoll) GetStakingContractAddress() string { 330 | if x != nil { 331 | return x.StakingContractAddress 332 | } 333 | return "" 334 | } 335 | 336 | func (x *GenesisPoll) GetVoteThreshold() string { 337 | if x != nil { 338 | return x.VoteThreshold 339 | } 340 | return "" 341 | } 342 | 343 | func (x *GenesisPoll) GetScoreThreshold() string { 344 | if x != nil { 345 | return x.ScoreThreshold 346 | } 347 | return "" 348 | } 349 | 350 | func (x *GenesisPoll) GetSelfStakingThreshold() string { 351 | if x != nil { 352 | return x.SelfStakingThreshold 353 | } 354 | return "" 355 | } 356 | 357 | func (x *GenesisPoll) GetDelegates() []*GenesisDelegate { 358 | if x != nil { 359 | return x.Delegates 360 | } 361 | return nil 362 | } 363 | 364 | type GenesisDelegate struct { 365 | state protoimpl.MessageState 366 | sizeCache protoimpl.SizeCache 367 | unknownFields protoimpl.UnknownFields 368 | 369 | OperatorAddr string `protobuf:"bytes,1,opt,name=operatorAddr,proto3" json:"operatorAddr,omitempty"` 370 | RewardAddr string `protobuf:"bytes,2,opt,name=rewardAddr,proto3" json:"rewardAddr,omitempty"` 371 | Votes string `protobuf:"bytes,3,opt,name=votes,proto3" json:"votes,omitempty"` 372 | } 373 | 374 | func (x *GenesisDelegate) Reset() { 375 | *x = GenesisDelegate{} 376 | if protoimpl.UnsafeEnabled { 377 | mi := &file_proto_types_genesis_proto_msgTypes[4] 378 | ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) 379 | ms.StoreMessageInfo(mi) 380 | } 381 | } 382 | 383 | func (x *GenesisDelegate) String() string { 384 | return protoimpl.X.MessageStringOf(x) 385 | } 386 | 387 | func (*GenesisDelegate) ProtoMessage() {} 388 | 389 | func (x *GenesisDelegate) ProtoReflect() protoreflect.Message { 390 | mi := &file_proto_types_genesis_proto_msgTypes[4] 391 | if protoimpl.UnsafeEnabled && x != nil { 392 | ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) 393 | if ms.LoadMessageInfo() == nil { 394 | ms.StoreMessageInfo(mi) 395 | } 396 | return ms 397 | } 398 | return mi.MessageOf(x) 399 | } 400 | 401 | // Deprecated: Use GenesisDelegate.ProtoReflect.Descriptor instead. 402 | func (*GenesisDelegate) Descriptor() ([]byte, []int) { 403 | return file_proto_types_genesis_proto_rawDescGZIP(), []int{4} 404 | } 405 | 406 | func (x *GenesisDelegate) GetOperatorAddr() string { 407 | if x != nil { 408 | return x.OperatorAddr 409 | } 410 | return "" 411 | } 412 | 413 | func (x *GenesisDelegate) GetRewardAddr() string { 414 | if x != nil { 415 | return x.RewardAddr 416 | } 417 | return "" 418 | } 419 | 420 | func (x *GenesisDelegate) GetVotes() string { 421 | if x != nil { 422 | return x.Votes 423 | } 424 | return "" 425 | } 426 | 427 | type GenesisRewarding struct { 428 | state protoimpl.MessageState 429 | sizeCache protoimpl.SizeCache 430 | unknownFields protoimpl.UnknownFields 431 | 432 | InitAdminAddr string `protobuf:"bytes,1,opt,name=initAdminAddr,proto3" json:"initAdminAddr,omitempty"` 433 | InitBalance string `protobuf:"bytes,2,opt,name=initBalance,proto3" json:"initBalance,omitempty"` 434 | BlockReward string `protobuf:"bytes,3,opt,name=blockReward,proto3" json:"blockReward,omitempty"` 435 | EpochReward string `protobuf:"bytes,4,opt,name=epochReward,proto3" json:"epochReward,omitempty"` 436 | NumDelegatesForEpochReward uint64 `protobuf:"varint,5,opt,name=numDelegatesForEpochReward,proto3" json:"numDelegatesForEpochReward,omitempty"` 437 | FoundationBonus string `protobuf:"bytes,6,opt,name=foundationBonus,proto3" json:"foundationBonus,omitempty"` 438 | NumDelegatesForFoundationBonus uint64 `protobuf:"varint,7,opt,name=numDelegatesForFoundationBonus,proto3" json:"numDelegatesForFoundationBonus,omitempty"` 439 | FoundationBonusLastEpoch uint64 `protobuf:"varint,8,opt,name=foundationBonusLastEpoch,proto3" json:"foundationBonusLastEpoch,omitempty"` 440 | ProductivityThreshold uint64 `protobuf:"varint,9,opt,name=productivityThreshold,proto3" json:"productivityThreshold,omitempty"` 441 | } 442 | 443 | func (x *GenesisRewarding) Reset() { 444 | *x = GenesisRewarding{} 445 | if protoimpl.UnsafeEnabled { 446 | mi := &file_proto_types_genesis_proto_msgTypes[5] 447 | ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) 448 | ms.StoreMessageInfo(mi) 449 | } 450 | } 451 | 452 | func (x *GenesisRewarding) String() string { 453 | return protoimpl.X.MessageStringOf(x) 454 | } 455 | 456 | func (*GenesisRewarding) ProtoMessage() {} 457 | 458 | func (x *GenesisRewarding) ProtoReflect() protoreflect.Message { 459 | mi := &file_proto_types_genesis_proto_msgTypes[5] 460 | if protoimpl.UnsafeEnabled && x != nil { 461 | ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) 462 | if ms.LoadMessageInfo() == nil { 463 | ms.StoreMessageInfo(mi) 464 | } 465 | return ms 466 | } 467 | return mi.MessageOf(x) 468 | } 469 | 470 | // Deprecated: Use GenesisRewarding.ProtoReflect.Descriptor instead. 471 | func (*GenesisRewarding) Descriptor() ([]byte, []int) { 472 | return file_proto_types_genesis_proto_rawDescGZIP(), []int{5} 473 | } 474 | 475 | func (x *GenesisRewarding) GetInitAdminAddr() string { 476 | if x != nil { 477 | return x.InitAdminAddr 478 | } 479 | return "" 480 | } 481 | 482 | func (x *GenesisRewarding) GetInitBalance() string { 483 | if x != nil { 484 | return x.InitBalance 485 | } 486 | return "" 487 | } 488 | 489 | func (x *GenesisRewarding) GetBlockReward() string { 490 | if x != nil { 491 | return x.BlockReward 492 | } 493 | return "" 494 | } 495 | 496 | func (x *GenesisRewarding) GetEpochReward() string { 497 | if x != nil { 498 | return x.EpochReward 499 | } 500 | return "" 501 | } 502 | 503 | func (x *GenesisRewarding) GetNumDelegatesForEpochReward() uint64 { 504 | if x != nil { 505 | return x.NumDelegatesForEpochReward 506 | } 507 | return 0 508 | } 509 | 510 | func (x *GenesisRewarding) GetFoundationBonus() string { 511 | if x != nil { 512 | return x.FoundationBonus 513 | } 514 | return "" 515 | } 516 | 517 | func (x *GenesisRewarding) GetNumDelegatesForFoundationBonus() uint64 { 518 | if x != nil { 519 | return x.NumDelegatesForFoundationBonus 520 | } 521 | return 0 522 | } 523 | 524 | func (x *GenesisRewarding) GetFoundationBonusLastEpoch() uint64 { 525 | if x != nil { 526 | return x.FoundationBonusLastEpoch 527 | } 528 | return 0 529 | } 530 | 531 | func (x *GenesisRewarding) GetProductivityThreshold() uint64 { 532 | if x != nil { 533 | return x.ProductivityThreshold 534 | } 535 | return 0 536 | } 537 | 538 | var File_proto_types_genesis_proto protoreflect.FileDescriptor 539 | 540 | var file_proto_types_genesis_proto_rawDesc = []byte{ 541 | 0x0a, 0x19, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2f, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2f, 0x67, 0x65, 542 | 0x6e, 0x65, 0x73, 0x69, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x0a, 0x69, 0x6f, 0x74, 543 | 0x65, 0x78, 0x74, 0x79, 0x70, 0x65, 0x73, 0x22, 0xe7, 0x01, 0x0a, 0x07, 0x47, 0x65, 0x6e, 0x65, 544 | 0x73, 0x69, 0x73, 0x12, 0x3d, 0x0a, 0x0a, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x63, 0x68, 0x61, 0x69, 545 | 0x6e, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1d, 0x2e, 0x69, 0x6f, 0x74, 0x65, 0x78, 0x74, 546 | 0x79, 0x70, 0x65, 0x73, 0x2e, 0x47, 0x65, 0x6e, 0x65, 0x73, 0x69, 0x73, 0x42, 0x6c, 0x6f, 0x63, 547 | 0x6b, 0x63, 0x68, 0x61, 0x69, 0x6e, 0x52, 0x0a, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x63, 0x68, 0x61, 548 | 0x69, 0x6e, 0x12, 0x34, 0x0a, 0x07, 0x61, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x18, 0x02, 0x20, 549 | 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x69, 0x6f, 0x74, 0x65, 0x78, 0x74, 0x79, 0x70, 0x65, 0x73, 550 | 0x2e, 0x47, 0x65, 0x6e, 0x65, 0x73, 0x69, 0x73, 0x41, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x52, 551 | 0x07, 0x61, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x12, 0x2b, 0x0a, 0x04, 0x70, 0x6f, 0x6c, 0x6c, 552 | 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x17, 0x2e, 0x69, 0x6f, 0x74, 0x65, 0x78, 0x74, 0x79, 553 | 0x70, 0x65, 0x73, 0x2e, 0x47, 0x65, 0x6e, 0x65, 0x73, 0x69, 0x73, 0x50, 0x6f, 0x6c, 0x6c, 0x52, 554 | 0x04, 0x70, 0x6f, 0x6c, 0x6c, 0x12, 0x3a, 0x0a, 0x09, 0x72, 0x65, 0x77, 0x61, 0x72, 0x64, 0x69, 555 | 0x6e, 0x67, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1c, 0x2e, 0x69, 0x6f, 0x74, 0x65, 0x78, 556 | 0x74, 0x79, 0x70, 0x65, 0x73, 0x2e, 0x47, 0x65, 0x6e, 0x65, 0x73, 0x69, 0x73, 0x52, 0x65, 0x77, 557 | 0x61, 0x72, 0x64, 0x69, 0x6e, 0x67, 0x52, 0x09, 0x72, 0x65, 0x77, 0x61, 0x72, 0x64, 0x69, 0x6e, 558 | 0x67, 0x22, 0xd1, 0x02, 0x0a, 0x11, 0x47, 0x65, 0x6e, 0x65, 0x73, 0x69, 0x73, 0x42, 0x6c, 0x6f, 559 | 0x63, 0x6b, 0x63, 0x68, 0x61, 0x69, 0x6e, 0x12, 0x1c, 0x0a, 0x09, 0x74, 0x69, 0x6d, 0x65, 0x73, 560 | 0x74, 0x61, 0x6d, 0x70, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, 0x09, 0x74, 0x69, 0x6d, 0x65, 561 | 0x73, 0x74, 0x61, 0x6d, 0x70, 0x12, 0x24, 0x0a, 0x0d, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x47, 0x61, 562 | 0x73, 0x4c, 0x69, 0x6d, 0x69, 0x74, 0x18, 0x02, 0x20, 0x01, 0x28, 0x04, 0x52, 0x0d, 0x62, 0x6c, 563 | 0x6f, 0x63, 0x6b, 0x47, 0x61, 0x73, 0x4c, 0x69, 0x6d, 0x69, 0x74, 0x12, 0x26, 0x0a, 0x0e, 0x61, 564 | 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x47, 0x61, 0x73, 0x4c, 0x69, 0x6d, 0x69, 0x74, 0x18, 0x03, 0x20, 565 | 0x01, 0x28, 0x04, 0x52, 0x0e, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x47, 0x61, 0x73, 0x4c, 0x69, 566 | 0x6d, 0x69, 0x74, 0x12, 0x24, 0x0a, 0x0d, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x49, 0x6e, 0x74, 0x65, 567 | 0x72, 0x76, 0x61, 0x6c, 0x18, 0x04, 0x20, 0x01, 0x28, 0x03, 0x52, 0x0d, 0x62, 0x6c, 0x6f, 0x63, 568 | 0x6b, 0x49, 0x6e, 0x74, 0x65, 0x72, 0x76, 0x61, 0x6c, 0x12, 0x22, 0x0a, 0x0c, 0x6e, 0x75, 0x6d, 569 | 0x53, 0x75, 0x62, 0x45, 0x70, 0x6f, 0x63, 0x68, 0x73, 0x18, 0x05, 0x20, 0x01, 0x28, 0x04, 0x52, 570 | 0x0c, 0x6e, 0x75, 0x6d, 0x53, 0x75, 0x62, 0x45, 0x70, 0x6f, 0x63, 0x68, 0x73, 0x12, 0x22, 0x0a, 571 | 0x0c, 0x6e, 0x75, 0x6d, 0x44, 0x65, 0x6c, 0x65, 0x67, 0x61, 0x74, 0x65, 0x73, 0x18, 0x06, 0x20, 572 | 0x01, 0x28, 0x04, 0x52, 0x0c, 0x6e, 0x75, 0x6d, 0x44, 0x65, 0x6c, 0x65, 0x67, 0x61, 0x74, 0x65, 573 | 0x73, 0x12, 0x34, 0x0a, 0x15, 0x6e, 0x75, 0x6d, 0x43, 0x61, 0x6e, 0x64, 0x69, 0x64, 0x61, 0x74, 574 | 0x65, 0x44, 0x65, 0x6c, 0x65, 0x67, 0x61, 0x74, 0x65, 0x73, 0x18, 0x07, 0x20, 0x01, 0x28, 0x04, 575 | 0x52, 0x15, 0x6e, 0x75, 0x6d, 0x43, 0x61, 0x6e, 0x64, 0x69, 0x64, 0x61, 0x74, 0x65, 0x44, 0x65, 576 | 0x6c, 0x65, 0x67, 0x61, 0x74, 0x65, 0x73, 0x12, 0x2c, 0x0a, 0x11, 0x74, 0x69, 0x6d, 0x65, 0x42, 577 | 0x61, 0x73, 0x65, 0x64, 0x52, 0x6f, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x08, 0x20, 0x01, 578 | 0x28, 0x08, 0x52, 0x11, 0x74, 0x69, 0x6d, 0x65, 0x42, 0x61, 0x73, 0x65, 0x64, 0x52, 0x6f, 0x74, 579 | 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x22, 0x60, 0x0a, 0x0e, 0x47, 0x65, 0x6e, 0x65, 0x73, 0x69, 0x73, 580 | 0x41, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x12, 0x2a, 0x0a, 0x10, 0x69, 0x6e, 0x69, 0x74, 0x42, 581 | 0x61, 0x6c, 0x61, 0x6e, 0x63, 0x65, 0x41, 0x64, 0x64, 0x72, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 582 | 0x09, 0x52, 0x10, 0x69, 0x6e, 0x69, 0x74, 0x42, 0x61, 0x6c, 0x61, 0x6e, 0x63, 0x65, 0x41, 0x64, 583 | 0x64, 0x72, 0x73, 0x12, 0x22, 0x0a, 0x0c, 0x69, 0x6e, 0x69, 0x74, 0x42, 0x61, 0x6c, 0x61, 0x6e, 584 | 0x63, 0x65, 0x73, 0x18, 0x02, 0x20, 0x03, 0x28, 0x09, 0x52, 0x0c, 0x69, 0x6e, 0x69, 0x74, 0x42, 585 | 0x61, 0x6c, 0x61, 0x6e, 0x63, 0x65, 0x73, 0x22, 0xb2, 0x03, 0x0a, 0x0b, 0x47, 0x65, 0x6e, 0x65, 586 | 0x73, 0x69, 0x73, 0x50, 0x6f, 0x6c, 0x6c, 0x12, 0x3a, 0x0a, 0x18, 0x65, 0x6e, 0x61, 0x62, 0x6c, 587 | 0x65, 0x47, 0x72, 0x61, 0x76, 0x69, 0x74, 0x79, 0x43, 0x68, 0x61, 0x69, 0x6e, 0x56, 0x6f, 0x74, 588 | 0x69, 0x6e, 0x67, 0x18, 0x01, 0x20, 0x01, 0x28, 0x08, 0x52, 0x18, 0x65, 0x6e, 0x61, 0x62, 0x6c, 589 | 0x65, 0x47, 0x72, 0x61, 0x76, 0x69, 0x74, 0x79, 0x43, 0x68, 0x61, 0x69, 0x6e, 0x56, 0x6f, 0x74, 590 | 0x69, 0x6e, 0x67, 0x12, 0x38, 0x0a, 0x17, 0x67, 0x72, 0x61, 0x76, 0x69, 0x74, 0x79, 0x43, 0x68, 591 | 0x61, 0x69, 0x6e, 0x53, 0x74, 0x61, 0x72, 0x74, 0x48, 0x65, 0x69, 0x67, 0x68, 0x74, 0x18, 0x02, 592 | 0x20, 0x01, 0x28, 0x04, 0x52, 0x17, 0x67, 0x72, 0x61, 0x76, 0x69, 0x74, 0x79, 0x43, 0x68, 0x61, 593 | 0x69, 0x6e, 0x53, 0x74, 0x61, 0x72, 0x74, 0x48, 0x65, 0x69, 0x67, 0x68, 0x74, 0x12, 0x38, 0x0a, 594 | 0x17, 0x72, 0x65, 0x67, 0x69, 0x73, 0x74, 0x65, 0x72, 0x43, 0x6f, 0x6e, 0x74, 0x72, 0x61, 0x63, 595 | 0x74, 0x41, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x17, 596 | 0x72, 0x65, 0x67, 0x69, 0x73, 0x74, 0x65, 0x72, 0x43, 0x6f, 0x6e, 0x74, 0x72, 0x61, 0x63, 0x74, 597 | 0x41, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x12, 0x36, 0x0a, 0x16, 0x73, 0x74, 0x61, 0x6b, 0x69, 598 | 0x6e, 0x67, 0x43, 0x6f, 0x6e, 0x74, 0x72, 0x61, 0x63, 0x74, 0x41, 0x64, 0x64, 0x72, 0x65, 0x73, 599 | 0x73, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x16, 0x73, 0x74, 0x61, 0x6b, 0x69, 0x6e, 0x67, 600 | 0x43, 0x6f, 0x6e, 0x74, 0x72, 0x61, 0x63, 0x74, 0x41, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x12, 601 | 0x24, 0x0a, 0x0d, 0x76, 0x6f, 0x74, 0x65, 0x54, 0x68, 0x72, 0x65, 0x73, 0x68, 0x6f, 0x6c, 0x64, 602 | 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0d, 0x76, 0x6f, 0x74, 0x65, 0x54, 0x68, 0x72, 0x65, 603 | 0x73, 0x68, 0x6f, 0x6c, 0x64, 0x12, 0x26, 0x0a, 0x0e, 0x73, 0x63, 0x6f, 0x72, 0x65, 0x54, 0x68, 604 | 0x72, 0x65, 0x73, 0x68, 0x6f, 0x6c, 0x64, 0x18, 0x06, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0e, 0x73, 605 | 0x63, 0x6f, 0x72, 0x65, 0x54, 0x68, 0x72, 0x65, 0x73, 0x68, 0x6f, 0x6c, 0x64, 0x12, 0x32, 0x0a, 606 | 0x14, 0x73, 0x65, 0x6c, 0x66, 0x53, 0x74, 0x61, 0x6b, 0x69, 0x6e, 0x67, 0x54, 0x68, 0x72, 0x65, 607 | 0x73, 0x68, 0x6f, 0x6c, 0x64, 0x18, 0x07, 0x20, 0x01, 0x28, 0x09, 0x52, 0x14, 0x73, 0x65, 0x6c, 608 | 0x66, 0x53, 0x74, 0x61, 0x6b, 0x69, 0x6e, 0x67, 0x54, 0x68, 0x72, 0x65, 0x73, 0x68, 0x6f, 0x6c, 609 | 0x64, 0x12, 0x39, 0x0a, 0x09, 0x64, 0x65, 0x6c, 0x65, 0x67, 0x61, 0x74, 0x65, 0x73, 0x18, 0x08, 610 | 0x20, 0x03, 0x28, 0x0b, 0x32, 0x1b, 0x2e, 0x69, 0x6f, 0x74, 0x65, 0x78, 0x74, 0x79, 0x70, 0x65, 611 | 0x73, 0x2e, 0x47, 0x65, 0x6e, 0x65, 0x73, 0x69, 0x73, 0x44, 0x65, 0x6c, 0x65, 0x67, 0x61, 0x74, 612 | 0x65, 0x52, 0x09, 0x64, 0x65, 0x6c, 0x65, 0x67, 0x61, 0x74, 0x65, 0x73, 0x22, 0x6b, 0x0a, 0x0f, 613 | 0x47, 0x65, 0x6e, 0x65, 0x73, 0x69, 0x73, 0x44, 0x65, 0x6c, 0x65, 0x67, 0x61, 0x74, 0x65, 0x12, 614 | 0x22, 0x0a, 0x0c, 0x6f, 0x70, 0x65, 0x72, 0x61, 0x74, 0x6f, 0x72, 0x41, 0x64, 0x64, 0x72, 0x18, 615 | 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0c, 0x6f, 0x70, 0x65, 0x72, 0x61, 0x74, 0x6f, 0x72, 0x41, 616 | 0x64, 0x64, 0x72, 0x12, 0x1e, 0x0a, 0x0a, 0x72, 0x65, 0x77, 0x61, 0x72, 0x64, 0x41, 0x64, 0x64, 617 | 0x72, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0a, 0x72, 0x65, 0x77, 0x61, 0x72, 0x64, 0x41, 618 | 0x64, 0x64, 0x72, 0x12, 0x14, 0x0a, 0x05, 0x76, 0x6f, 0x74, 0x65, 0x73, 0x18, 0x03, 0x20, 0x01, 619 | 0x28, 0x09, 0x52, 0x05, 0x76, 0x6f, 0x74, 0x65, 0x73, 0x22, 0xc2, 0x03, 0x0a, 0x10, 0x47, 0x65, 620 | 0x6e, 0x65, 0x73, 0x69, 0x73, 0x52, 0x65, 0x77, 0x61, 0x72, 0x64, 0x69, 0x6e, 0x67, 0x12, 0x24, 621 | 0x0a, 0x0d, 0x69, 0x6e, 0x69, 0x74, 0x41, 0x64, 0x6d, 0x69, 0x6e, 0x41, 0x64, 0x64, 0x72, 0x18, 622 | 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0d, 0x69, 0x6e, 0x69, 0x74, 0x41, 0x64, 0x6d, 0x69, 0x6e, 623 | 0x41, 0x64, 0x64, 0x72, 0x12, 0x20, 0x0a, 0x0b, 0x69, 0x6e, 0x69, 0x74, 0x42, 0x61, 0x6c, 0x61, 624 | 0x6e, 0x63, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, 0x69, 0x6e, 0x69, 0x74, 0x42, 625 | 0x61, 0x6c, 0x61, 0x6e, 0x63, 0x65, 0x12, 0x20, 0x0a, 0x0b, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x52, 626 | 0x65, 0x77, 0x61, 0x72, 0x64, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, 0x62, 0x6c, 0x6f, 627 | 0x63, 0x6b, 0x52, 0x65, 0x77, 0x61, 0x72, 0x64, 0x12, 0x20, 0x0a, 0x0b, 0x65, 0x70, 0x6f, 0x63, 628 | 0x68, 0x52, 0x65, 0x77, 0x61, 0x72, 0x64, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, 0x65, 629 | 0x70, 0x6f, 0x63, 0x68, 0x52, 0x65, 0x77, 0x61, 0x72, 0x64, 0x12, 0x3e, 0x0a, 0x1a, 0x6e, 0x75, 630 | 0x6d, 0x44, 0x65, 0x6c, 0x65, 0x67, 0x61, 0x74, 0x65, 0x73, 0x46, 0x6f, 0x72, 0x45, 0x70, 0x6f, 631 | 0x63, 0x68, 0x52, 0x65, 0x77, 0x61, 0x72, 0x64, 0x18, 0x05, 0x20, 0x01, 0x28, 0x04, 0x52, 0x1a, 632 | 0x6e, 0x75, 0x6d, 0x44, 0x65, 0x6c, 0x65, 0x67, 0x61, 0x74, 0x65, 0x73, 0x46, 0x6f, 0x72, 0x45, 633 | 0x70, 0x6f, 0x63, 0x68, 0x52, 0x65, 0x77, 0x61, 0x72, 0x64, 0x12, 0x28, 0x0a, 0x0f, 0x66, 0x6f, 634 | 0x75, 0x6e, 0x64, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x42, 0x6f, 0x6e, 0x75, 0x73, 0x18, 0x06, 0x20, 635 | 0x01, 0x28, 0x09, 0x52, 0x0f, 0x66, 0x6f, 0x75, 0x6e, 0x64, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x42, 636 | 0x6f, 0x6e, 0x75, 0x73, 0x12, 0x46, 0x0a, 0x1e, 0x6e, 0x75, 0x6d, 0x44, 0x65, 0x6c, 0x65, 0x67, 637 | 0x61, 0x74, 0x65, 0x73, 0x46, 0x6f, 0x72, 0x46, 0x6f, 0x75, 0x6e, 0x64, 0x61, 0x74, 0x69, 0x6f, 638 | 0x6e, 0x42, 0x6f, 0x6e, 0x75, 0x73, 0x18, 0x07, 0x20, 0x01, 0x28, 0x04, 0x52, 0x1e, 0x6e, 0x75, 639 | 0x6d, 0x44, 0x65, 0x6c, 0x65, 0x67, 0x61, 0x74, 0x65, 0x73, 0x46, 0x6f, 0x72, 0x46, 0x6f, 0x75, 640 | 0x6e, 0x64, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x42, 0x6f, 0x6e, 0x75, 0x73, 0x12, 0x3a, 0x0a, 0x18, 641 | 0x66, 0x6f, 0x75, 0x6e, 0x64, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x42, 0x6f, 0x6e, 0x75, 0x73, 0x4c, 642 | 0x61, 0x73, 0x74, 0x45, 0x70, 0x6f, 0x63, 0x68, 0x18, 0x08, 0x20, 0x01, 0x28, 0x04, 0x52, 0x18, 643 | 0x66, 0x6f, 0x75, 0x6e, 0x64, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x42, 0x6f, 0x6e, 0x75, 0x73, 0x4c, 644 | 0x61, 0x73, 0x74, 0x45, 0x70, 0x6f, 0x63, 0x68, 0x12, 0x34, 0x0a, 0x15, 0x70, 0x72, 0x6f, 0x64, 645 | 0x75, 0x63, 0x74, 0x69, 0x76, 0x69, 0x74, 0x79, 0x54, 0x68, 0x72, 0x65, 0x73, 0x68, 0x6f, 0x6c, 646 | 0x64, 0x18, 0x09, 0x20, 0x01, 0x28, 0x04, 0x52, 0x15, 0x70, 0x72, 0x6f, 0x64, 0x75, 0x63, 0x74, 647 | 0x69, 0x76, 0x69, 0x74, 0x79, 0x54, 0x68, 0x72, 0x65, 0x73, 0x68, 0x6f, 0x6c, 0x64, 0x42, 0x5d, 648 | 0x0a, 0x22, 0x63, 0x6f, 0x6d, 0x2e, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x69, 0x6f, 0x74, 649 | 0x65, 0x78, 0x70, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x2e, 0x67, 0x72, 0x70, 0x63, 0x2e, 0x74, 650 | 0x79, 0x70, 0x65, 0x73, 0x50, 0x01, 0x5a, 0x35, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 651 | 0x6f, 0x6d, 0x2f, 0x69, 0x6f, 0x74, 0x65, 0x78, 0x70, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x2f, 652 | 0x69, 0x6f, 0x74, 0x65, 0x78, 0x2d, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2f, 0x67, 0x6f, 0x6c, 0x61, 653 | 0x6e, 0x67, 0x2f, 0x69, 0x6f, 0x74, 0x65, 0x78, 0x74, 0x79, 0x70, 0x65, 0x73, 0x62, 0x06, 0x70, 654 | 0x72, 0x6f, 0x74, 0x6f, 0x33, 655 | } 656 | 657 | var ( 658 | file_proto_types_genesis_proto_rawDescOnce sync.Once 659 | file_proto_types_genesis_proto_rawDescData = file_proto_types_genesis_proto_rawDesc 660 | ) 661 | 662 | func file_proto_types_genesis_proto_rawDescGZIP() []byte { 663 | file_proto_types_genesis_proto_rawDescOnce.Do(func() { 664 | file_proto_types_genesis_proto_rawDescData = protoimpl.X.CompressGZIP(file_proto_types_genesis_proto_rawDescData) 665 | }) 666 | return file_proto_types_genesis_proto_rawDescData 667 | } 668 | 669 | var file_proto_types_genesis_proto_msgTypes = make([]protoimpl.MessageInfo, 6) 670 | var file_proto_types_genesis_proto_goTypes = []any{ 671 | (*Genesis)(nil), // 0: iotextypes.Genesis 672 | (*GenesisBlockchain)(nil), // 1: iotextypes.GenesisBlockchain 673 | (*GenesisAccount)(nil), // 2: iotextypes.GenesisAccount 674 | (*GenesisPoll)(nil), // 3: iotextypes.GenesisPoll 675 | (*GenesisDelegate)(nil), // 4: iotextypes.GenesisDelegate 676 | (*GenesisRewarding)(nil), // 5: iotextypes.GenesisRewarding 677 | } 678 | var file_proto_types_genesis_proto_depIdxs = []int32{ 679 | 1, // 0: iotextypes.Genesis.blockchain:type_name -> iotextypes.GenesisBlockchain 680 | 2, // 1: iotextypes.Genesis.account:type_name -> iotextypes.GenesisAccount 681 | 3, // 2: iotextypes.Genesis.poll:type_name -> iotextypes.GenesisPoll 682 | 5, // 3: iotextypes.Genesis.rewarding:type_name -> iotextypes.GenesisRewarding 683 | 4, // 4: iotextypes.GenesisPoll.delegates:type_name -> iotextypes.GenesisDelegate 684 | 5, // [5:5] is the sub-list for method output_type 685 | 5, // [5:5] is the sub-list for method input_type 686 | 5, // [5:5] is the sub-list for extension type_name 687 | 5, // [5:5] is the sub-list for extension extendee 688 | 0, // [0:5] is the sub-list for field type_name 689 | } 690 | 691 | func init() { file_proto_types_genesis_proto_init() } 692 | func file_proto_types_genesis_proto_init() { 693 | if File_proto_types_genesis_proto != nil { 694 | return 695 | } 696 | if !protoimpl.UnsafeEnabled { 697 | file_proto_types_genesis_proto_msgTypes[0].Exporter = func(v any, i int) any { 698 | switch v := v.(*Genesis); i { 699 | case 0: 700 | return &v.state 701 | case 1: 702 | return &v.sizeCache 703 | case 2: 704 | return &v.unknownFields 705 | default: 706 | return nil 707 | } 708 | } 709 | file_proto_types_genesis_proto_msgTypes[1].Exporter = func(v any, i int) any { 710 | switch v := v.(*GenesisBlockchain); i { 711 | case 0: 712 | return &v.state 713 | case 1: 714 | return &v.sizeCache 715 | case 2: 716 | return &v.unknownFields 717 | default: 718 | return nil 719 | } 720 | } 721 | file_proto_types_genesis_proto_msgTypes[2].Exporter = func(v any, i int) any { 722 | switch v := v.(*GenesisAccount); i { 723 | case 0: 724 | return &v.state 725 | case 1: 726 | return &v.sizeCache 727 | case 2: 728 | return &v.unknownFields 729 | default: 730 | return nil 731 | } 732 | } 733 | file_proto_types_genesis_proto_msgTypes[3].Exporter = func(v any, i int) any { 734 | switch v := v.(*GenesisPoll); i { 735 | case 0: 736 | return &v.state 737 | case 1: 738 | return &v.sizeCache 739 | case 2: 740 | return &v.unknownFields 741 | default: 742 | return nil 743 | } 744 | } 745 | file_proto_types_genesis_proto_msgTypes[4].Exporter = func(v any, i int) any { 746 | switch v := v.(*GenesisDelegate); i { 747 | case 0: 748 | return &v.state 749 | case 1: 750 | return &v.sizeCache 751 | case 2: 752 | return &v.unknownFields 753 | default: 754 | return nil 755 | } 756 | } 757 | file_proto_types_genesis_proto_msgTypes[5].Exporter = func(v any, i int) any { 758 | switch v := v.(*GenesisRewarding); i { 759 | case 0: 760 | return &v.state 761 | case 1: 762 | return &v.sizeCache 763 | case 2: 764 | return &v.unknownFields 765 | default: 766 | return nil 767 | } 768 | } 769 | } 770 | type x struct{} 771 | out := protoimpl.TypeBuilder{ 772 | File: protoimpl.DescBuilder{ 773 | GoPackagePath: reflect.TypeOf(x{}).PkgPath(), 774 | RawDescriptor: file_proto_types_genesis_proto_rawDesc, 775 | NumEnums: 0, 776 | NumMessages: 6, 777 | NumExtensions: 0, 778 | NumServices: 0, 779 | }, 780 | GoTypes: file_proto_types_genesis_proto_goTypes, 781 | DependencyIndexes: file_proto_types_genesis_proto_depIdxs, 782 | MessageInfos: file_proto_types_genesis_proto_msgTypes, 783 | }.Build() 784 | File_proto_types_genesis_proto = out.File 785 | file_proto_types_genesis_proto_rawDesc = nil 786 | file_proto_types_genesis_proto_goTypes = nil 787 | file_proto_types_genesis_proto_depIdxs = nil 788 | } 789 | -------------------------------------------------------------------------------- /golang/iotextypes/node.pb.go: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2018 IoTeX 2 | // This is an alpha (internal) release and is not suitable for production. This source code is provided 'as is' and no 3 | // warranties are given as to title or non-infringement, merchantability or fitness for purpose and, to the extent 4 | // permitted by law, all liability for your use of the code is disclaimed. This source code is governed by Apache 5 | // License 2.0 that can be found in the LICENSE file. 6 | 7 | // To compile the proto, run: 8 | // protoc --go_out=plugins=grpc:$GOPATH/src *.proto 9 | 10 | // Code generated by protoc-gen-go. DO NOT EDIT. 11 | // versions: 12 | // protoc-gen-go v1.34.2 13 | // protoc v5.27.1 14 | // source: proto/types/node.proto 15 | 16 | package iotextypes 17 | 18 | import ( 19 | protoreflect "google.golang.org/protobuf/reflect/protoreflect" 20 | protoimpl "google.golang.org/protobuf/runtime/protoimpl" 21 | timestamppb "google.golang.org/protobuf/types/known/timestamppb" 22 | reflect "reflect" 23 | sync "sync" 24 | ) 25 | 26 | const ( 27 | // Verify that this generated code is sufficiently up-to-date. 28 | _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) 29 | // Verify that runtime/protoimpl is sufficiently up-to-date. 30 | _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) 31 | ) 32 | 33 | // Server Metadata 34 | type ServerMeta struct { 35 | state protoimpl.MessageState 36 | sizeCache protoimpl.SizeCache 37 | unknownFields protoimpl.UnknownFields 38 | 39 | PackageVersion string `protobuf:"bytes,1,opt,name=packageVersion,proto3" json:"packageVersion,omitempty"` 40 | PackageCommitID string `protobuf:"bytes,2,opt,name=packageCommitID,proto3" json:"packageCommitID,omitempty"` 41 | GitStatus string `protobuf:"bytes,3,opt,name=gitStatus,proto3" json:"gitStatus,omitempty"` 42 | GoVersion string `protobuf:"bytes,4,opt,name=goVersion,proto3" json:"goVersion,omitempty"` 43 | BuildTime string `protobuf:"bytes,5,opt,name=buildTime,proto3" json:"buildTime,omitempty"` 44 | } 45 | 46 | func (x *ServerMeta) Reset() { 47 | *x = ServerMeta{} 48 | if protoimpl.UnsafeEnabled { 49 | mi := &file_proto_types_node_proto_msgTypes[0] 50 | ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) 51 | ms.StoreMessageInfo(mi) 52 | } 53 | } 54 | 55 | func (x *ServerMeta) String() string { 56 | return protoimpl.X.MessageStringOf(x) 57 | } 58 | 59 | func (*ServerMeta) ProtoMessage() {} 60 | 61 | func (x *ServerMeta) ProtoReflect() protoreflect.Message { 62 | mi := &file_proto_types_node_proto_msgTypes[0] 63 | if protoimpl.UnsafeEnabled && x != nil { 64 | ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) 65 | if ms.LoadMessageInfo() == nil { 66 | ms.StoreMessageInfo(mi) 67 | } 68 | return ms 69 | } 70 | return mi.MessageOf(x) 71 | } 72 | 73 | // Deprecated: Use ServerMeta.ProtoReflect.Descriptor instead. 74 | func (*ServerMeta) Descriptor() ([]byte, []int) { 75 | return file_proto_types_node_proto_rawDescGZIP(), []int{0} 76 | } 77 | 78 | func (x *ServerMeta) GetPackageVersion() string { 79 | if x != nil { 80 | return x.PackageVersion 81 | } 82 | return "" 83 | } 84 | 85 | func (x *ServerMeta) GetPackageCommitID() string { 86 | if x != nil { 87 | return x.PackageCommitID 88 | } 89 | return "" 90 | } 91 | 92 | func (x *ServerMeta) GetGitStatus() string { 93 | if x != nil { 94 | return x.GitStatus 95 | } 96 | return "" 97 | } 98 | 99 | func (x *ServerMeta) GetGoVersion() string { 100 | if x != nil { 101 | return x.GoVersion 102 | } 103 | return "" 104 | } 105 | 106 | func (x *ServerMeta) GetBuildTime() string { 107 | if x != nil { 108 | return x.BuildTime 109 | } 110 | return "" 111 | } 112 | 113 | type NodeInfoCore struct { 114 | state protoimpl.MessageState 115 | sizeCache protoimpl.SizeCache 116 | unknownFields protoimpl.UnknownFields 117 | 118 | Version string `protobuf:"bytes,1,opt,name=version,proto3" json:"version,omitempty"` 119 | Height uint64 `protobuf:"varint,2,opt,name=height,proto3" json:"height,omitempty"` 120 | Timestamp *timestamppb.Timestamp `protobuf:"bytes,3,opt,name=timestamp,proto3" json:"timestamp,omitempty"` 121 | Address string `protobuf:"bytes,4,opt,name=address,proto3" json:"address,omitempty"` 122 | } 123 | 124 | func (x *NodeInfoCore) Reset() { 125 | *x = NodeInfoCore{} 126 | if protoimpl.UnsafeEnabled { 127 | mi := &file_proto_types_node_proto_msgTypes[1] 128 | ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) 129 | ms.StoreMessageInfo(mi) 130 | } 131 | } 132 | 133 | func (x *NodeInfoCore) String() string { 134 | return protoimpl.X.MessageStringOf(x) 135 | } 136 | 137 | func (*NodeInfoCore) ProtoMessage() {} 138 | 139 | func (x *NodeInfoCore) ProtoReflect() protoreflect.Message { 140 | mi := &file_proto_types_node_proto_msgTypes[1] 141 | if protoimpl.UnsafeEnabled && x != nil { 142 | ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) 143 | if ms.LoadMessageInfo() == nil { 144 | ms.StoreMessageInfo(mi) 145 | } 146 | return ms 147 | } 148 | return mi.MessageOf(x) 149 | } 150 | 151 | // Deprecated: Use NodeInfoCore.ProtoReflect.Descriptor instead. 152 | func (*NodeInfoCore) Descriptor() ([]byte, []int) { 153 | return file_proto_types_node_proto_rawDescGZIP(), []int{1} 154 | } 155 | 156 | func (x *NodeInfoCore) GetVersion() string { 157 | if x != nil { 158 | return x.Version 159 | } 160 | return "" 161 | } 162 | 163 | func (x *NodeInfoCore) GetHeight() uint64 { 164 | if x != nil { 165 | return x.Height 166 | } 167 | return 0 168 | } 169 | 170 | func (x *NodeInfoCore) GetTimestamp() *timestamppb.Timestamp { 171 | if x != nil { 172 | return x.Timestamp 173 | } 174 | return nil 175 | } 176 | 177 | func (x *NodeInfoCore) GetAddress() string { 178 | if x != nil { 179 | return x.Address 180 | } 181 | return "" 182 | } 183 | 184 | type NodeInfo struct { 185 | state protoimpl.MessageState 186 | sizeCache protoimpl.SizeCache 187 | unknownFields protoimpl.UnknownFields 188 | 189 | Info *NodeInfoCore `protobuf:"bytes,1,opt,name=info,proto3" json:"info,omitempty"` 190 | Signature []byte `protobuf:"bytes,2,opt,name=signature,proto3" json:"signature,omitempty"` 191 | } 192 | 193 | func (x *NodeInfo) Reset() { 194 | *x = NodeInfo{} 195 | if protoimpl.UnsafeEnabled { 196 | mi := &file_proto_types_node_proto_msgTypes[2] 197 | ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) 198 | ms.StoreMessageInfo(mi) 199 | } 200 | } 201 | 202 | func (x *NodeInfo) String() string { 203 | return protoimpl.X.MessageStringOf(x) 204 | } 205 | 206 | func (*NodeInfo) ProtoMessage() {} 207 | 208 | func (x *NodeInfo) ProtoReflect() protoreflect.Message { 209 | mi := &file_proto_types_node_proto_msgTypes[2] 210 | if protoimpl.UnsafeEnabled && x != nil { 211 | ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) 212 | if ms.LoadMessageInfo() == nil { 213 | ms.StoreMessageInfo(mi) 214 | } 215 | return ms 216 | } 217 | return mi.MessageOf(x) 218 | } 219 | 220 | // Deprecated: Use NodeInfo.ProtoReflect.Descriptor instead. 221 | func (*NodeInfo) Descriptor() ([]byte, []int) { 222 | return file_proto_types_node_proto_rawDescGZIP(), []int{2} 223 | } 224 | 225 | func (x *NodeInfo) GetInfo() *NodeInfoCore { 226 | if x != nil { 227 | return x.Info 228 | } 229 | return nil 230 | } 231 | 232 | func (x *NodeInfo) GetSignature() []byte { 233 | if x != nil { 234 | return x.Signature 235 | } 236 | return nil 237 | } 238 | 239 | type NodeInfoRequest struct { 240 | state protoimpl.MessageState 241 | sizeCache protoimpl.SizeCache 242 | unknownFields protoimpl.UnknownFields 243 | } 244 | 245 | func (x *NodeInfoRequest) Reset() { 246 | *x = NodeInfoRequest{} 247 | if protoimpl.UnsafeEnabled { 248 | mi := &file_proto_types_node_proto_msgTypes[3] 249 | ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) 250 | ms.StoreMessageInfo(mi) 251 | } 252 | } 253 | 254 | func (x *NodeInfoRequest) String() string { 255 | return protoimpl.X.MessageStringOf(x) 256 | } 257 | 258 | func (*NodeInfoRequest) ProtoMessage() {} 259 | 260 | func (x *NodeInfoRequest) ProtoReflect() protoreflect.Message { 261 | mi := &file_proto_types_node_proto_msgTypes[3] 262 | if protoimpl.UnsafeEnabled && x != nil { 263 | ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) 264 | if ms.LoadMessageInfo() == nil { 265 | ms.StoreMessageInfo(mi) 266 | } 267 | return ms 268 | } 269 | return mi.MessageOf(x) 270 | } 271 | 272 | // Deprecated: Use NodeInfoRequest.ProtoReflect.Descriptor instead. 273 | func (*NodeInfoRequest) Descriptor() ([]byte, []int) { 274 | return file_proto_types_node_proto_rawDescGZIP(), []int{3} 275 | } 276 | 277 | var File_proto_types_node_proto protoreflect.FileDescriptor 278 | 279 | var file_proto_types_node_proto_rawDesc = []byte{ 280 | 0x0a, 0x16, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2f, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2f, 0x6e, 0x6f, 281 | 0x64, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x0a, 0x69, 0x6f, 0x74, 0x65, 0x78, 0x74, 282 | 0x79, 0x70, 0x65, 0x73, 0x1a, 0x1f, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x70, 0x72, 0x6f, 283 | 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2f, 0x74, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x2e, 284 | 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0xb8, 0x01, 0x0a, 0x0a, 0x53, 0x65, 0x72, 0x76, 0x65, 0x72, 285 | 0x4d, 0x65, 0x74, 0x61, 0x12, 0x26, 0x0a, 0x0e, 0x70, 0x61, 0x63, 0x6b, 0x61, 0x67, 0x65, 0x56, 286 | 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0e, 0x70, 0x61, 287 | 0x63, 0x6b, 0x61, 0x67, 0x65, 0x56, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x12, 0x28, 0x0a, 0x0f, 288 | 0x70, 0x61, 0x63, 0x6b, 0x61, 0x67, 0x65, 0x43, 0x6f, 0x6d, 0x6d, 0x69, 0x74, 0x49, 0x44, 0x18, 289 | 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0f, 0x70, 0x61, 0x63, 0x6b, 0x61, 0x67, 0x65, 0x43, 0x6f, 290 | 0x6d, 0x6d, 0x69, 0x74, 0x49, 0x44, 0x12, 0x1c, 0x0a, 0x09, 0x67, 0x69, 0x74, 0x53, 0x74, 0x61, 291 | 0x74, 0x75, 0x73, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x67, 0x69, 0x74, 0x53, 0x74, 292 | 0x61, 0x74, 0x75, 0x73, 0x12, 0x1c, 0x0a, 0x09, 0x67, 0x6f, 0x56, 0x65, 0x72, 0x73, 0x69, 0x6f, 293 | 0x6e, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x67, 0x6f, 0x56, 0x65, 0x72, 0x73, 0x69, 294 | 0x6f, 0x6e, 0x12, 0x1c, 0x0a, 0x09, 0x62, 0x75, 0x69, 0x6c, 0x64, 0x54, 0x69, 0x6d, 0x65, 0x18, 295 | 0x05, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x62, 0x75, 0x69, 0x6c, 0x64, 0x54, 0x69, 0x6d, 0x65, 296 | 0x22, 0x94, 0x01, 0x0a, 0x0c, 0x4e, 0x6f, 0x64, 0x65, 0x49, 0x6e, 0x66, 0x6f, 0x43, 0x6f, 0x72, 297 | 0x65, 0x12, 0x18, 0x0a, 0x07, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x18, 0x01, 0x20, 0x01, 298 | 0x28, 0x09, 0x52, 0x07, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x12, 0x16, 0x0a, 0x06, 0x68, 299 | 0x65, 0x69, 0x67, 0x68, 0x74, 0x18, 0x02, 0x20, 0x01, 0x28, 0x04, 0x52, 0x06, 0x68, 0x65, 0x69, 300 | 0x67, 0x68, 0x74, 0x12, 0x38, 0x0a, 0x09, 0x74, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 301 | 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 302 | 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x54, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 303 | 0x6d, 0x70, 0x52, 0x09, 0x74, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x12, 0x18, 0x0a, 304 | 0x07, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 305 | 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x22, 0x56, 0x0a, 0x08, 0x4e, 0x6f, 0x64, 0x65, 0x49, 306 | 0x6e, 0x66, 0x6f, 0x12, 0x2c, 0x0a, 0x04, 0x69, 0x6e, 0x66, 0x6f, 0x18, 0x01, 0x20, 0x01, 0x28, 307 | 0x0b, 0x32, 0x18, 0x2e, 0x69, 0x6f, 0x74, 0x65, 0x78, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2e, 0x4e, 308 | 0x6f, 0x64, 0x65, 0x49, 0x6e, 0x66, 0x6f, 0x43, 0x6f, 0x72, 0x65, 0x52, 0x04, 0x69, 0x6e, 0x66, 309 | 0x6f, 0x12, 0x1c, 0x0a, 0x09, 0x73, 0x69, 0x67, 0x6e, 0x61, 0x74, 0x75, 0x72, 0x65, 0x18, 0x02, 310 | 0x20, 0x01, 0x28, 0x0c, 0x52, 0x09, 0x73, 0x69, 0x67, 0x6e, 0x61, 0x74, 0x75, 0x72, 0x65, 0x22, 311 | 0x11, 0x0a, 0x0f, 0x4e, 0x6f, 0x64, 0x65, 0x49, 0x6e, 0x66, 0x6f, 0x52, 0x65, 0x71, 0x75, 0x65, 312 | 0x73, 0x74, 0x42, 0x5d, 0x0a, 0x22, 0x63, 0x6f, 0x6d, 0x2e, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 313 | 0x2e, 0x69, 0x6f, 0x74, 0x65, 0x78, 0x70, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x2e, 0x67, 0x72, 314 | 0x70, 0x63, 0x2e, 0x74, 0x79, 0x70, 0x65, 0x73, 0x50, 0x01, 0x5a, 0x35, 0x67, 0x69, 0x74, 0x68, 315 | 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x69, 0x6f, 0x74, 0x65, 0x78, 0x70, 0x72, 0x6f, 0x6a, 316 | 0x65, 0x63, 0x74, 0x2f, 0x69, 0x6f, 0x74, 0x65, 0x78, 0x2d, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2f, 317 | 0x67, 0x6f, 0x6c, 0x61, 0x6e, 0x67, 0x2f, 0x69, 0x6f, 0x74, 0x65, 0x78, 0x74, 0x79, 0x70, 0x65, 318 | 0x73, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, 319 | } 320 | 321 | var ( 322 | file_proto_types_node_proto_rawDescOnce sync.Once 323 | file_proto_types_node_proto_rawDescData = file_proto_types_node_proto_rawDesc 324 | ) 325 | 326 | func file_proto_types_node_proto_rawDescGZIP() []byte { 327 | file_proto_types_node_proto_rawDescOnce.Do(func() { 328 | file_proto_types_node_proto_rawDescData = protoimpl.X.CompressGZIP(file_proto_types_node_proto_rawDescData) 329 | }) 330 | return file_proto_types_node_proto_rawDescData 331 | } 332 | 333 | var file_proto_types_node_proto_msgTypes = make([]protoimpl.MessageInfo, 4) 334 | var file_proto_types_node_proto_goTypes = []any{ 335 | (*ServerMeta)(nil), // 0: iotextypes.ServerMeta 336 | (*NodeInfoCore)(nil), // 1: iotextypes.NodeInfoCore 337 | (*NodeInfo)(nil), // 2: iotextypes.NodeInfo 338 | (*NodeInfoRequest)(nil), // 3: iotextypes.NodeInfoRequest 339 | (*timestamppb.Timestamp)(nil), // 4: google.protobuf.Timestamp 340 | } 341 | var file_proto_types_node_proto_depIdxs = []int32{ 342 | 4, // 0: iotextypes.NodeInfoCore.timestamp:type_name -> google.protobuf.Timestamp 343 | 1, // 1: iotextypes.NodeInfo.info:type_name -> iotextypes.NodeInfoCore 344 | 2, // [2:2] is the sub-list for method output_type 345 | 2, // [2:2] is the sub-list for method input_type 346 | 2, // [2:2] is the sub-list for extension type_name 347 | 2, // [2:2] is the sub-list for extension extendee 348 | 0, // [0:2] is the sub-list for field type_name 349 | } 350 | 351 | func init() { file_proto_types_node_proto_init() } 352 | func file_proto_types_node_proto_init() { 353 | if File_proto_types_node_proto != nil { 354 | return 355 | } 356 | if !protoimpl.UnsafeEnabled { 357 | file_proto_types_node_proto_msgTypes[0].Exporter = func(v any, i int) any { 358 | switch v := v.(*ServerMeta); i { 359 | case 0: 360 | return &v.state 361 | case 1: 362 | return &v.sizeCache 363 | case 2: 364 | return &v.unknownFields 365 | default: 366 | return nil 367 | } 368 | } 369 | file_proto_types_node_proto_msgTypes[1].Exporter = func(v any, i int) any { 370 | switch v := v.(*NodeInfoCore); i { 371 | case 0: 372 | return &v.state 373 | case 1: 374 | return &v.sizeCache 375 | case 2: 376 | return &v.unknownFields 377 | default: 378 | return nil 379 | } 380 | } 381 | file_proto_types_node_proto_msgTypes[2].Exporter = func(v any, i int) any { 382 | switch v := v.(*NodeInfo); i { 383 | case 0: 384 | return &v.state 385 | case 1: 386 | return &v.sizeCache 387 | case 2: 388 | return &v.unknownFields 389 | default: 390 | return nil 391 | } 392 | } 393 | file_proto_types_node_proto_msgTypes[3].Exporter = func(v any, i int) any { 394 | switch v := v.(*NodeInfoRequest); i { 395 | case 0: 396 | return &v.state 397 | case 1: 398 | return &v.sizeCache 399 | case 2: 400 | return &v.unknownFields 401 | default: 402 | return nil 403 | } 404 | } 405 | } 406 | type x struct{} 407 | out := protoimpl.TypeBuilder{ 408 | File: protoimpl.DescBuilder{ 409 | GoPackagePath: reflect.TypeOf(x{}).PkgPath(), 410 | RawDescriptor: file_proto_types_node_proto_rawDesc, 411 | NumEnums: 0, 412 | NumMessages: 4, 413 | NumExtensions: 0, 414 | NumServices: 0, 415 | }, 416 | GoTypes: file_proto_types_node_proto_goTypes, 417 | DependencyIndexes: file_proto_types_node_proto_depIdxs, 418 | MessageInfos: file_proto_types_node_proto_msgTypes, 419 | }.Build() 420 | File_proto_types_node_proto = out.File 421 | file_proto_types_node_proto_rawDesc = nil 422 | file_proto_types_node_proto_goTypes = nil 423 | file_proto_types_node_proto_depIdxs = nil 424 | } 425 | -------------------------------------------------------------------------------- /golang/iotextypes/receiptstatus.pb.go: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2018 IoTeX 2 | // This is an alpha (internal) release and is not suitable for production. This source code is provided 'as is' and no 3 | // warranties are given as to title or non-infringement, merchantability or fitness for purpose and, to the extent 4 | // permitted by law, all liability for your use of the code is disclaimed. This source code is governed by Apache 5 | // License 2.0 that can be found in the LICENSE file. 6 | 7 | // To compile the proto, run: 8 | // protoc --go_out=plugins=grpc:$GOPATH/src *.proto 9 | 10 | // Code generated by protoc-gen-go. DO NOT EDIT. 11 | // versions: 12 | // protoc-gen-go v1.34.2 13 | // protoc v5.27.1 14 | // source: proto/types/receiptstatus.proto 15 | 16 | package iotextypes 17 | 18 | import ( 19 | protoreflect "google.golang.org/protobuf/reflect/protoreflect" 20 | protoimpl "google.golang.org/protobuf/runtime/protoimpl" 21 | reflect "reflect" 22 | sync "sync" 23 | ) 24 | 25 | const ( 26 | // Verify that this generated code is sufficiently up-to-date. 27 | _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) 28 | // Verify that runtime/protoimpl is sufficiently up-to-date. 29 | _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) 30 | ) 31 | 32 | // BELOW ARE DEFINITIONS FOR EVM ERROR CLASSIFICATION IN RECEIPT STATUS 33 | type ReceiptStatus int32 34 | 35 | const ( 36 | ReceiptStatus_Failure ReceiptStatus = 0 37 | ReceiptStatus_Success ReceiptStatus = 1 38 | // 1xx for EVM ErrorCode 39 | ReceiptStatus_ErrUnknown ReceiptStatus = 100 40 | ReceiptStatus_ErrOutOfGas ReceiptStatus = 101 41 | ReceiptStatus_ErrCodeStoreOutOfGas ReceiptStatus = 102 42 | ReceiptStatus_ErrDepth ReceiptStatus = 103 43 | ReceiptStatus_ErrContractAddressCollision ReceiptStatus = 104 44 | ReceiptStatus_ErrNoCompatibleInterpreter ReceiptStatus = 105 45 | ReceiptStatus_ErrExecutionReverted ReceiptStatus = 106 46 | ReceiptStatus_ErrMaxCodeSizeExceeded ReceiptStatus = 107 47 | ReceiptStatus_ErrWriteProtection ReceiptStatus = 108 48 | ReceiptStatus_ErrInvalidSubroutineEntry ReceiptStatus = 109 49 | ReceiptStatus_ErrInsufficientBalance ReceiptStatus = 110 50 | ReceiptStatus_ErrInvalidJump ReceiptStatus = 111 51 | ReceiptStatus_ErrReturnDataOutOfBounds ReceiptStatus = 112 52 | ReceiptStatus_ErrGasUintOverflow ReceiptStatus = 113 53 | ReceiptStatus_ErrInvalidRetsub ReceiptStatus = 114 54 | ReceiptStatus_ErrReturnStackExceeded ReceiptStatus = 115 55 | ReceiptStatus_ErrInvalidCode ReceiptStatus = 116 56 | // 2xx for Staking ErrorCode 57 | ReceiptStatus_ErrLoadAccount ReceiptStatus = 200 58 | ReceiptStatus_ErrNotEnoughBalance ReceiptStatus = 201 59 | ReceiptStatus_ErrInvalidBucketIndex ReceiptStatus = 202 60 | ReceiptStatus_ErrUnauthorizedOperator ReceiptStatus = 203 61 | ReceiptStatus_ErrInvalidBucketType ReceiptStatus = 204 62 | ReceiptStatus_ErrCandidateNotExist ReceiptStatus = 205 63 | ReceiptStatus_ErrReduceDurationBeforeMaturity ReceiptStatus = 206 64 | ReceiptStatus_ErrUnstakeBeforeMaturity ReceiptStatus = 207 65 | ReceiptStatus_ErrWithdrawBeforeUnstake ReceiptStatus = 208 66 | ReceiptStatus_ErrWithdrawBeforeMaturity ReceiptStatus = 209 67 | ReceiptStatus_ErrCandidateAlreadyExist ReceiptStatus = 210 68 | ReceiptStatus_ErrCandidateConflict ReceiptStatus = 211 69 | ReceiptStatus_ErrInvalidBucketAmount ReceiptStatus = 212 70 | ReceiptStatus_ErrWriteAccount ReceiptStatus = 213 71 | ReceiptStatus_ErrWriteBucket ReceiptStatus = 214 72 | ReceiptStatus_ErrWriteCandidate ReceiptStatus = 215 73 | ) 74 | 75 | // Enum value maps for ReceiptStatus. 76 | var ( 77 | ReceiptStatus_name = map[int32]string{ 78 | 0: "Failure", 79 | 1: "Success", 80 | 100: "ErrUnknown", 81 | 101: "ErrOutOfGas", 82 | 102: "ErrCodeStoreOutOfGas", 83 | 103: "ErrDepth", 84 | 104: "ErrContractAddressCollision", 85 | 105: "ErrNoCompatibleInterpreter", 86 | 106: "ErrExecutionReverted", 87 | 107: "ErrMaxCodeSizeExceeded", 88 | 108: "ErrWriteProtection", 89 | 109: "ErrInvalidSubroutineEntry", 90 | 110: "ErrInsufficientBalance", 91 | 111: "ErrInvalidJump", 92 | 112: "ErrReturnDataOutOfBounds", 93 | 113: "ErrGasUintOverflow", 94 | 114: "ErrInvalidRetsub", 95 | 115: "ErrReturnStackExceeded", 96 | 116: "ErrInvalidCode", 97 | 200: "ErrLoadAccount", 98 | 201: "ErrNotEnoughBalance", 99 | 202: "ErrInvalidBucketIndex", 100 | 203: "ErrUnauthorizedOperator", 101 | 204: "ErrInvalidBucketType", 102 | 205: "ErrCandidateNotExist", 103 | 206: "ErrReduceDurationBeforeMaturity", 104 | 207: "ErrUnstakeBeforeMaturity", 105 | 208: "ErrWithdrawBeforeUnstake", 106 | 209: "ErrWithdrawBeforeMaturity", 107 | 210: "ErrCandidateAlreadyExist", 108 | 211: "ErrCandidateConflict", 109 | 212: "ErrInvalidBucketAmount", 110 | 213: "ErrWriteAccount", 111 | 214: "ErrWriteBucket", 112 | 215: "ErrWriteCandidate", 113 | } 114 | ReceiptStatus_value = map[string]int32{ 115 | "Failure": 0, 116 | "Success": 1, 117 | "ErrUnknown": 100, 118 | "ErrOutOfGas": 101, 119 | "ErrCodeStoreOutOfGas": 102, 120 | "ErrDepth": 103, 121 | "ErrContractAddressCollision": 104, 122 | "ErrNoCompatibleInterpreter": 105, 123 | "ErrExecutionReverted": 106, 124 | "ErrMaxCodeSizeExceeded": 107, 125 | "ErrWriteProtection": 108, 126 | "ErrInvalidSubroutineEntry": 109, 127 | "ErrInsufficientBalance": 110, 128 | "ErrInvalidJump": 111, 129 | "ErrReturnDataOutOfBounds": 112, 130 | "ErrGasUintOverflow": 113, 131 | "ErrInvalidRetsub": 114, 132 | "ErrReturnStackExceeded": 115, 133 | "ErrInvalidCode": 116, 134 | "ErrLoadAccount": 200, 135 | "ErrNotEnoughBalance": 201, 136 | "ErrInvalidBucketIndex": 202, 137 | "ErrUnauthorizedOperator": 203, 138 | "ErrInvalidBucketType": 204, 139 | "ErrCandidateNotExist": 205, 140 | "ErrReduceDurationBeforeMaturity": 206, 141 | "ErrUnstakeBeforeMaturity": 207, 142 | "ErrWithdrawBeforeUnstake": 208, 143 | "ErrWithdrawBeforeMaturity": 209, 144 | "ErrCandidateAlreadyExist": 210, 145 | "ErrCandidateConflict": 211, 146 | "ErrInvalidBucketAmount": 212, 147 | "ErrWriteAccount": 213, 148 | "ErrWriteBucket": 214, 149 | "ErrWriteCandidate": 215, 150 | } 151 | ) 152 | 153 | func (x ReceiptStatus) Enum() *ReceiptStatus { 154 | p := new(ReceiptStatus) 155 | *p = x 156 | return p 157 | } 158 | 159 | func (x ReceiptStatus) String() string { 160 | return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x)) 161 | } 162 | 163 | func (ReceiptStatus) Descriptor() protoreflect.EnumDescriptor { 164 | return file_proto_types_receiptstatus_proto_enumTypes[0].Descriptor() 165 | } 166 | 167 | func (ReceiptStatus) Type() protoreflect.EnumType { 168 | return &file_proto_types_receiptstatus_proto_enumTypes[0] 169 | } 170 | 171 | func (x ReceiptStatus) Number() protoreflect.EnumNumber { 172 | return protoreflect.EnumNumber(x) 173 | } 174 | 175 | // Deprecated: Use ReceiptStatus.Descriptor instead. 176 | func (ReceiptStatus) EnumDescriptor() ([]byte, []int) { 177 | return file_proto_types_receiptstatus_proto_rawDescGZIP(), []int{0} 178 | } 179 | 180 | var File_proto_types_receiptstatus_proto protoreflect.FileDescriptor 181 | 182 | var file_proto_types_receiptstatus_proto_rawDesc = []byte{ 183 | 0x0a, 0x1f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2f, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2f, 0x72, 0x65, 184 | 0x63, 0x65, 0x69, 0x70, 0x74, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 185 | 0x6f, 0x12, 0x0a, 0x69, 0x6f, 0x74, 0x65, 0x78, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2a, 0x89, 0x07, 186 | 0x0a, 0x0d, 0x52, 0x65, 0x63, 0x65, 0x69, 0x70, 0x74, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x12, 187 | 0x0b, 0x0a, 0x07, 0x46, 0x61, 0x69, 0x6c, 0x75, 0x72, 0x65, 0x10, 0x00, 0x12, 0x0b, 0x0a, 0x07, 188 | 0x53, 0x75, 0x63, 0x63, 0x65, 0x73, 0x73, 0x10, 0x01, 0x12, 0x0e, 0x0a, 0x0a, 0x45, 0x72, 0x72, 189 | 0x55, 0x6e, 0x6b, 0x6e, 0x6f, 0x77, 0x6e, 0x10, 0x64, 0x12, 0x0f, 0x0a, 0x0b, 0x45, 0x72, 0x72, 190 | 0x4f, 0x75, 0x74, 0x4f, 0x66, 0x47, 0x61, 0x73, 0x10, 0x65, 0x12, 0x18, 0x0a, 0x14, 0x45, 0x72, 191 | 0x72, 0x43, 0x6f, 0x64, 0x65, 0x53, 0x74, 0x6f, 0x72, 0x65, 0x4f, 0x75, 0x74, 0x4f, 0x66, 0x47, 192 | 0x61, 0x73, 0x10, 0x66, 0x12, 0x0c, 0x0a, 0x08, 0x45, 0x72, 0x72, 0x44, 0x65, 0x70, 0x74, 0x68, 193 | 0x10, 0x67, 0x12, 0x1f, 0x0a, 0x1b, 0x45, 0x72, 0x72, 0x43, 0x6f, 0x6e, 0x74, 0x72, 0x61, 0x63, 194 | 0x74, 0x41, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x43, 0x6f, 0x6c, 0x6c, 0x69, 0x73, 0x69, 0x6f, 195 | 0x6e, 0x10, 0x68, 0x12, 0x1e, 0x0a, 0x1a, 0x45, 0x72, 0x72, 0x4e, 0x6f, 0x43, 0x6f, 0x6d, 0x70, 196 | 0x61, 0x74, 0x69, 0x62, 0x6c, 0x65, 0x49, 0x6e, 0x74, 0x65, 0x72, 0x70, 0x72, 0x65, 0x74, 0x65, 197 | 0x72, 0x10, 0x69, 0x12, 0x18, 0x0a, 0x14, 0x45, 0x72, 0x72, 0x45, 0x78, 0x65, 0x63, 0x75, 0x74, 198 | 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x76, 0x65, 0x72, 0x74, 0x65, 0x64, 0x10, 0x6a, 0x12, 0x1a, 0x0a, 199 | 0x16, 0x45, 0x72, 0x72, 0x4d, 0x61, 0x78, 0x43, 0x6f, 0x64, 0x65, 0x53, 0x69, 0x7a, 0x65, 0x45, 200 | 0x78, 0x63, 0x65, 0x65, 0x64, 0x65, 0x64, 0x10, 0x6b, 0x12, 0x16, 0x0a, 0x12, 0x45, 0x72, 0x72, 201 | 0x57, 0x72, 0x69, 0x74, 0x65, 0x50, 0x72, 0x6f, 0x74, 0x65, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x10, 202 | 0x6c, 0x12, 0x1d, 0x0a, 0x19, 0x45, 0x72, 0x72, 0x49, 0x6e, 0x76, 0x61, 0x6c, 0x69, 0x64, 0x53, 203 | 0x75, 0x62, 0x72, 0x6f, 0x75, 0x74, 0x69, 0x6e, 0x65, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x10, 0x6d, 204 | 0x12, 0x1a, 0x0a, 0x16, 0x45, 0x72, 0x72, 0x49, 0x6e, 0x73, 0x75, 0x66, 0x66, 0x69, 0x63, 0x69, 205 | 0x65, 0x6e, 0x74, 0x42, 0x61, 0x6c, 0x61, 0x6e, 0x63, 0x65, 0x10, 0x6e, 0x12, 0x12, 0x0a, 0x0e, 206 | 0x45, 0x72, 0x72, 0x49, 0x6e, 0x76, 0x61, 0x6c, 0x69, 0x64, 0x4a, 0x75, 0x6d, 0x70, 0x10, 0x6f, 207 | 0x12, 0x1c, 0x0a, 0x18, 0x45, 0x72, 0x72, 0x52, 0x65, 0x74, 0x75, 0x72, 0x6e, 0x44, 0x61, 0x74, 208 | 0x61, 0x4f, 0x75, 0x74, 0x4f, 0x66, 0x42, 0x6f, 0x75, 0x6e, 0x64, 0x73, 0x10, 0x70, 0x12, 0x16, 209 | 0x0a, 0x12, 0x45, 0x72, 0x72, 0x47, 0x61, 0x73, 0x55, 0x69, 0x6e, 0x74, 0x4f, 0x76, 0x65, 0x72, 210 | 0x66, 0x6c, 0x6f, 0x77, 0x10, 0x71, 0x12, 0x14, 0x0a, 0x10, 0x45, 0x72, 0x72, 0x49, 0x6e, 0x76, 211 | 0x61, 0x6c, 0x69, 0x64, 0x52, 0x65, 0x74, 0x73, 0x75, 0x62, 0x10, 0x72, 0x12, 0x1a, 0x0a, 0x16, 212 | 0x45, 0x72, 0x72, 0x52, 0x65, 0x74, 0x75, 0x72, 0x6e, 0x53, 0x74, 0x61, 0x63, 0x6b, 0x45, 0x78, 213 | 0x63, 0x65, 0x65, 0x64, 0x65, 0x64, 0x10, 0x73, 0x12, 0x12, 0x0a, 0x0e, 0x45, 0x72, 0x72, 0x49, 214 | 0x6e, 0x76, 0x61, 0x6c, 0x69, 0x64, 0x43, 0x6f, 0x64, 0x65, 0x10, 0x74, 0x12, 0x13, 0x0a, 0x0e, 215 | 0x45, 0x72, 0x72, 0x4c, 0x6f, 0x61, 0x64, 0x41, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x10, 0xc8, 216 | 0x01, 0x12, 0x18, 0x0a, 0x13, 0x45, 0x72, 0x72, 0x4e, 0x6f, 0x74, 0x45, 0x6e, 0x6f, 0x75, 0x67, 217 | 0x68, 0x42, 0x61, 0x6c, 0x61, 0x6e, 0x63, 0x65, 0x10, 0xc9, 0x01, 0x12, 0x1a, 0x0a, 0x15, 0x45, 218 | 0x72, 0x72, 0x49, 0x6e, 0x76, 0x61, 0x6c, 0x69, 0x64, 0x42, 0x75, 0x63, 0x6b, 0x65, 0x74, 0x49, 219 | 0x6e, 0x64, 0x65, 0x78, 0x10, 0xca, 0x01, 0x12, 0x1c, 0x0a, 0x17, 0x45, 0x72, 0x72, 0x55, 0x6e, 220 | 0x61, 0x75, 0x74, 0x68, 0x6f, 0x72, 0x69, 0x7a, 0x65, 0x64, 0x4f, 0x70, 0x65, 0x72, 0x61, 0x74, 221 | 0x6f, 0x72, 0x10, 0xcb, 0x01, 0x12, 0x19, 0x0a, 0x14, 0x45, 0x72, 0x72, 0x49, 0x6e, 0x76, 0x61, 222 | 0x6c, 0x69, 0x64, 0x42, 0x75, 0x63, 0x6b, 0x65, 0x74, 0x54, 0x79, 0x70, 0x65, 0x10, 0xcc, 0x01, 223 | 0x12, 0x19, 0x0a, 0x14, 0x45, 0x72, 0x72, 0x43, 0x61, 0x6e, 0x64, 0x69, 0x64, 0x61, 0x74, 0x65, 224 | 0x4e, 0x6f, 0x74, 0x45, 0x78, 0x69, 0x73, 0x74, 0x10, 0xcd, 0x01, 0x12, 0x24, 0x0a, 0x1f, 0x45, 225 | 0x72, 0x72, 0x52, 0x65, 0x64, 0x75, 0x63, 0x65, 0x44, 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 226 | 0x42, 0x65, 0x66, 0x6f, 0x72, 0x65, 0x4d, 0x61, 0x74, 0x75, 0x72, 0x69, 0x74, 0x79, 0x10, 0xce, 227 | 0x01, 0x12, 0x1d, 0x0a, 0x18, 0x45, 0x72, 0x72, 0x55, 0x6e, 0x73, 0x74, 0x61, 0x6b, 0x65, 0x42, 228 | 0x65, 0x66, 0x6f, 0x72, 0x65, 0x4d, 0x61, 0x74, 0x75, 0x72, 0x69, 0x74, 0x79, 0x10, 0xcf, 0x01, 229 | 0x12, 0x1d, 0x0a, 0x18, 0x45, 0x72, 0x72, 0x57, 0x69, 0x74, 0x68, 0x64, 0x72, 0x61, 0x77, 0x42, 230 | 0x65, 0x66, 0x6f, 0x72, 0x65, 0x55, 0x6e, 0x73, 0x74, 0x61, 0x6b, 0x65, 0x10, 0xd0, 0x01, 0x12, 231 | 0x1e, 0x0a, 0x19, 0x45, 0x72, 0x72, 0x57, 0x69, 0x74, 0x68, 0x64, 0x72, 0x61, 0x77, 0x42, 0x65, 232 | 0x66, 0x6f, 0x72, 0x65, 0x4d, 0x61, 0x74, 0x75, 0x72, 0x69, 0x74, 0x79, 0x10, 0xd1, 0x01, 0x12, 233 | 0x1d, 0x0a, 0x18, 0x45, 0x72, 0x72, 0x43, 0x61, 0x6e, 0x64, 0x69, 0x64, 0x61, 0x74, 0x65, 0x41, 234 | 0x6c, 0x72, 0x65, 0x61, 0x64, 0x79, 0x45, 0x78, 0x69, 0x73, 0x74, 0x10, 0xd2, 0x01, 0x12, 0x19, 235 | 0x0a, 0x14, 0x45, 0x72, 0x72, 0x43, 0x61, 0x6e, 0x64, 0x69, 0x64, 0x61, 0x74, 0x65, 0x43, 0x6f, 236 | 0x6e, 0x66, 0x6c, 0x69, 0x63, 0x74, 0x10, 0xd3, 0x01, 0x12, 0x1b, 0x0a, 0x16, 0x45, 0x72, 0x72, 237 | 0x49, 0x6e, 0x76, 0x61, 0x6c, 0x69, 0x64, 0x42, 0x75, 0x63, 0x6b, 0x65, 0x74, 0x41, 0x6d, 0x6f, 238 | 0x75, 0x6e, 0x74, 0x10, 0xd4, 0x01, 0x12, 0x14, 0x0a, 0x0f, 0x45, 0x72, 0x72, 0x57, 0x72, 0x69, 239 | 0x74, 0x65, 0x41, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x10, 0xd5, 0x01, 0x12, 0x13, 0x0a, 0x0e, 240 | 0x45, 0x72, 0x72, 0x57, 0x72, 0x69, 0x74, 0x65, 0x42, 0x75, 0x63, 0x6b, 0x65, 0x74, 0x10, 0xd6, 241 | 0x01, 0x12, 0x16, 0x0a, 0x11, 0x45, 0x72, 0x72, 0x57, 0x72, 0x69, 0x74, 0x65, 0x43, 0x61, 0x6e, 242 | 0x64, 0x69, 0x64, 0x61, 0x74, 0x65, 0x10, 0xd7, 0x01, 0x42, 0x5d, 0x0a, 0x22, 0x63, 0x6f, 0x6d, 243 | 0x2e, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x69, 0x6f, 0x74, 0x65, 0x78, 0x70, 0x72, 0x6f, 244 | 0x6a, 0x65, 0x63, 0x74, 0x2e, 0x67, 0x72, 0x70, 0x63, 0x2e, 0x74, 0x79, 0x70, 0x65, 0x73, 0x50, 245 | 0x01, 0x5a, 0x35, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x69, 0x6f, 246 | 0x74, 0x65, 0x78, 0x70, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x2f, 0x69, 0x6f, 0x74, 0x65, 0x78, 247 | 0x2d, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2f, 0x67, 0x6f, 0x6c, 0x61, 0x6e, 0x67, 0x2f, 0x69, 0x6f, 248 | 0x74, 0x65, 0x78, 0x74, 0x79, 0x70, 0x65, 0x73, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, 249 | } 250 | 251 | var ( 252 | file_proto_types_receiptstatus_proto_rawDescOnce sync.Once 253 | file_proto_types_receiptstatus_proto_rawDescData = file_proto_types_receiptstatus_proto_rawDesc 254 | ) 255 | 256 | func file_proto_types_receiptstatus_proto_rawDescGZIP() []byte { 257 | file_proto_types_receiptstatus_proto_rawDescOnce.Do(func() { 258 | file_proto_types_receiptstatus_proto_rawDescData = protoimpl.X.CompressGZIP(file_proto_types_receiptstatus_proto_rawDescData) 259 | }) 260 | return file_proto_types_receiptstatus_proto_rawDescData 261 | } 262 | 263 | var file_proto_types_receiptstatus_proto_enumTypes = make([]protoimpl.EnumInfo, 1) 264 | var file_proto_types_receiptstatus_proto_goTypes = []any{ 265 | (ReceiptStatus)(0), // 0: iotextypes.ReceiptStatus 266 | } 267 | var file_proto_types_receiptstatus_proto_depIdxs = []int32{ 268 | 0, // [0:0] is the sub-list for method output_type 269 | 0, // [0:0] is the sub-list for method input_type 270 | 0, // [0:0] is the sub-list for extension type_name 271 | 0, // [0:0] is the sub-list for extension extendee 272 | 0, // [0:0] is the sub-list for field type_name 273 | } 274 | 275 | func init() { file_proto_types_receiptstatus_proto_init() } 276 | func file_proto_types_receiptstatus_proto_init() { 277 | if File_proto_types_receiptstatus_proto != nil { 278 | return 279 | } 280 | type x struct{} 281 | out := protoimpl.TypeBuilder{ 282 | File: protoimpl.DescBuilder{ 283 | GoPackagePath: reflect.TypeOf(x{}).PkgPath(), 284 | RawDescriptor: file_proto_types_receiptstatus_proto_rawDesc, 285 | NumEnums: 1, 286 | NumMessages: 0, 287 | NumExtensions: 0, 288 | NumServices: 0, 289 | }, 290 | GoTypes: file_proto_types_receiptstatus_proto_goTypes, 291 | DependencyIndexes: file_proto_types_receiptstatus_proto_depIdxs, 292 | EnumInfos: file_proto_types_receiptstatus_proto_enumTypes, 293 | }.Build() 294 | File_proto_types_receiptstatus_proto = out.File 295 | file_proto_types_receiptstatus_proto_rawDesc = nil 296 | file_proto_types_receiptstatus_proto_goTypes = nil 297 | file_proto_types_receiptstatus_proto_depIdxs = nil 298 | } 299 | -------------------------------------------------------------------------------- /golang/iotextypes/transaction_log.pb.go: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2020 IoTeX 2 | // This is an alpha (internal) release and is not suitable for production. This source code is provided 'as is' and no 3 | // warranties are given as to title or non-infringement, merchantability or fitness for purpose and, to the extent 4 | // permitted by law, all liability for your use of the code is disclaimed. This source code is governed by Apache 5 | // License 2.0 that can be found in the LICENSE file. 6 | 7 | // To compile the proto, run: 8 | // protoc --go_out=plugins=grpc:$GOPATH/src *.proto 9 | 10 | // Code generated by protoc-gen-go. DO NOT EDIT. 11 | // versions: 12 | // protoc-gen-go v1.34.2 13 | // protoc v5.27.1 14 | // source: proto/types/transaction_log.proto 15 | 16 | package iotextypes 17 | 18 | import ( 19 | protoreflect "google.golang.org/protobuf/reflect/protoreflect" 20 | protoimpl "google.golang.org/protobuf/runtime/protoimpl" 21 | reflect "reflect" 22 | sync "sync" 23 | ) 24 | 25 | const ( 26 | // Verify that this generated code is sufficiently up-to-date. 27 | _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) 28 | // Verify that runtime/protoimpl is sufficiently up-to-date. 29 | _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) 30 | ) 31 | 32 | type TransactionLogType int32 33 | 34 | const ( 35 | TransactionLogType_IN_CONTRACT_TRANSFER TransactionLogType = 0 36 | TransactionLogType_WITHDRAW_BUCKET TransactionLogType = 1 37 | TransactionLogType_CREATE_BUCKET TransactionLogType = 2 38 | TransactionLogType_DEPOSIT_TO_BUCKET TransactionLogType = 3 39 | TransactionLogType_CANDIDATE_SELF_STAKE TransactionLogType = 4 40 | TransactionLogType_CANDIDATE_REGISTRATION_FEE TransactionLogType = 5 41 | TransactionLogType_GAS_FEE TransactionLogType = 6 42 | TransactionLogType_NATIVE_TRANSFER TransactionLogType = 7 43 | TransactionLogType_DEPOSIT_TO_REWARDING_FUND TransactionLogType = 8 44 | TransactionLogType_CLAIM_FROM_REWARDING_FUND TransactionLogType = 9 45 | TransactionLogType_BLOB_FEE TransactionLogType = 10 46 | TransactionLogType_PRIORITY_FEE TransactionLogType = 11 47 | ) 48 | 49 | // Enum value maps for TransactionLogType. 50 | var ( 51 | TransactionLogType_name = map[int32]string{ 52 | 0: "IN_CONTRACT_TRANSFER", 53 | 1: "WITHDRAW_BUCKET", 54 | 2: "CREATE_BUCKET", 55 | 3: "DEPOSIT_TO_BUCKET", 56 | 4: "CANDIDATE_SELF_STAKE", 57 | 5: "CANDIDATE_REGISTRATION_FEE", 58 | 6: "GAS_FEE", 59 | 7: "NATIVE_TRANSFER", 60 | 8: "DEPOSIT_TO_REWARDING_FUND", 61 | 9: "CLAIM_FROM_REWARDING_FUND", 62 | 10: "BLOB_FEE", 63 | 11: "PRIORITY_FEE", 64 | } 65 | TransactionLogType_value = map[string]int32{ 66 | "IN_CONTRACT_TRANSFER": 0, 67 | "WITHDRAW_BUCKET": 1, 68 | "CREATE_BUCKET": 2, 69 | "DEPOSIT_TO_BUCKET": 3, 70 | "CANDIDATE_SELF_STAKE": 4, 71 | "CANDIDATE_REGISTRATION_FEE": 5, 72 | "GAS_FEE": 6, 73 | "NATIVE_TRANSFER": 7, 74 | "DEPOSIT_TO_REWARDING_FUND": 8, 75 | "CLAIM_FROM_REWARDING_FUND": 9, 76 | "BLOB_FEE": 10, 77 | "PRIORITY_FEE": 11, 78 | } 79 | ) 80 | 81 | func (x TransactionLogType) Enum() *TransactionLogType { 82 | p := new(TransactionLogType) 83 | *p = x 84 | return p 85 | } 86 | 87 | func (x TransactionLogType) String() string { 88 | return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x)) 89 | } 90 | 91 | func (TransactionLogType) Descriptor() protoreflect.EnumDescriptor { 92 | return file_proto_types_transaction_log_proto_enumTypes[0].Descriptor() 93 | } 94 | 95 | func (TransactionLogType) Type() protoreflect.EnumType { 96 | return &file_proto_types_transaction_log_proto_enumTypes[0] 97 | } 98 | 99 | func (x TransactionLogType) Number() protoreflect.EnumNumber { 100 | return protoreflect.EnumNumber(x) 101 | } 102 | 103 | // Deprecated: Use TransactionLogType.Descriptor instead. 104 | func (TransactionLogType) EnumDescriptor() ([]byte, []int) { 105 | return file_proto_types_transaction_log_proto_rawDescGZIP(), []int{0} 106 | } 107 | 108 | type TransactionLog struct { 109 | state protoimpl.MessageState 110 | sizeCache protoimpl.SizeCache 111 | unknownFields protoimpl.UnknownFields 112 | 113 | ActionHash []byte `protobuf:"bytes,1,opt,name=actionHash,proto3" json:"actionHash,omitempty"` 114 | NumTransactions uint64 `protobuf:"varint,2,opt,name=numTransactions,proto3" json:"numTransactions,omitempty"` 115 | Transactions []*TransactionLog_Transaction `protobuf:"bytes,3,rep,name=transactions,proto3" json:"transactions,omitempty"` 116 | } 117 | 118 | func (x *TransactionLog) Reset() { 119 | *x = TransactionLog{} 120 | if protoimpl.UnsafeEnabled { 121 | mi := &file_proto_types_transaction_log_proto_msgTypes[0] 122 | ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) 123 | ms.StoreMessageInfo(mi) 124 | } 125 | } 126 | 127 | func (x *TransactionLog) String() string { 128 | return protoimpl.X.MessageStringOf(x) 129 | } 130 | 131 | func (*TransactionLog) ProtoMessage() {} 132 | 133 | func (x *TransactionLog) ProtoReflect() protoreflect.Message { 134 | mi := &file_proto_types_transaction_log_proto_msgTypes[0] 135 | if protoimpl.UnsafeEnabled && x != nil { 136 | ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) 137 | if ms.LoadMessageInfo() == nil { 138 | ms.StoreMessageInfo(mi) 139 | } 140 | return ms 141 | } 142 | return mi.MessageOf(x) 143 | } 144 | 145 | // Deprecated: Use TransactionLog.ProtoReflect.Descriptor instead. 146 | func (*TransactionLog) Descriptor() ([]byte, []int) { 147 | return file_proto_types_transaction_log_proto_rawDescGZIP(), []int{0} 148 | } 149 | 150 | func (x *TransactionLog) GetActionHash() []byte { 151 | if x != nil { 152 | return x.ActionHash 153 | } 154 | return nil 155 | } 156 | 157 | func (x *TransactionLog) GetNumTransactions() uint64 { 158 | if x != nil { 159 | return x.NumTransactions 160 | } 161 | return 0 162 | } 163 | 164 | func (x *TransactionLog) GetTransactions() []*TransactionLog_Transaction { 165 | if x != nil { 166 | return x.Transactions 167 | } 168 | return nil 169 | } 170 | 171 | type TransactionLogs struct { 172 | state protoimpl.MessageState 173 | sizeCache protoimpl.SizeCache 174 | unknownFields protoimpl.UnknownFields 175 | 176 | Logs []*TransactionLog `protobuf:"bytes,1,rep,name=logs,proto3" json:"logs,omitempty"` 177 | } 178 | 179 | func (x *TransactionLogs) Reset() { 180 | *x = TransactionLogs{} 181 | if protoimpl.UnsafeEnabled { 182 | mi := &file_proto_types_transaction_log_proto_msgTypes[1] 183 | ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) 184 | ms.StoreMessageInfo(mi) 185 | } 186 | } 187 | 188 | func (x *TransactionLogs) String() string { 189 | return protoimpl.X.MessageStringOf(x) 190 | } 191 | 192 | func (*TransactionLogs) ProtoMessage() {} 193 | 194 | func (x *TransactionLogs) ProtoReflect() protoreflect.Message { 195 | mi := &file_proto_types_transaction_log_proto_msgTypes[1] 196 | if protoimpl.UnsafeEnabled && x != nil { 197 | ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) 198 | if ms.LoadMessageInfo() == nil { 199 | ms.StoreMessageInfo(mi) 200 | } 201 | return ms 202 | } 203 | return mi.MessageOf(x) 204 | } 205 | 206 | // Deprecated: Use TransactionLogs.ProtoReflect.Descriptor instead. 207 | func (*TransactionLogs) Descriptor() ([]byte, []int) { 208 | return file_proto_types_transaction_log_proto_rawDescGZIP(), []int{1} 209 | } 210 | 211 | func (x *TransactionLogs) GetLogs() []*TransactionLog { 212 | if x != nil { 213 | return x.Logs 214 | } 215 | return nil 216 | } 217 | 218 | type TransactionStructLog struct { 219 | state protoimpl.MessageState 220 | sizeCache protoimpl.SizeCache 221 | unknownFields protoimpl.UnknownFields 222 | 223 | Pc uint64 `protobuf:"varint,1,opt,name=pc,proto3" json:"pc,omitempty"` 224 | Op uint64 `protobuf:"varint,2,opt,name=op,proto3" json:"op,omitempty"` 225 | Gas uint64 `protobuf:"varint,3,opt,name=gas,proto3" json:"gas,omitempty"` 226 | GasCost uint64 `protobuf:"varint,4,opt,name=gasCost,proto3" json:"gasCost,omitempty"` 227 | Memory string `protobuf:"bytes,5,opt,name=memory,proto3" json:"memory,omitempty"` 228 | MemSize int32 `protobuf:"varint,6,opt,name=memSize,proto3" json:"memSize,omitempty"` 229 | Stack []string `protobuf:"bytes,7,rep,name=stack,proto3" json:"stack,omitempty"` 230 | ReturnData string `protobuf:"bytes,8,opt,name=returnData,proto3" json:"returnData,omitempty"` 231 | Depth int32 `protobuf:"varint,9,opt,name=depth,proto3" json:"depth,omitempty"` 232 | Refund uint64 `protobuf:"varint,10,opt,name=refund,proto3" json:"refund,omitempty"` 233 | OpName string `protobuf:"bytes,11,opt,name=opName,proto3" json:"opName,omitempty"` 234 | Error string `protobuf:"bytes,12,opt,name=error,proto3" json:"error,omitempty"` 235 | } 236 | 237 | func (x *TransactionStructLog) Reset() { 238 | *x = TransactionStructLog{} 239 | if protoimpl.UnsafeEnabled { 240 | mi := &file_proto_types_transaction_log_proto_msgTypes[2] 241 | ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) 242 | ms.StoreMessageInfo(mi) 243 | } 244 | } 245 | 246 | func (x *TransactionStructLog) String() string { 247 | return protoimpl.X.MessageStringOf(x) 248 | } 249 | 250 | func (*TransactionStructLog) ProtoMessage() {} 251 | 252 | func (x *TransactionStructLog) ProtoReflect() protoreflect.Message { 253 | mi := &file_proto_types_transaction_log_proto_msgTypes[2] 254 | if protoimpl.UnsafeEnabled && x != nil { 255 | ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) 256 | if ms.LoadMessageInfo() == nil { 257 | ms.StoreMessageInfo(mi) 258 | } 259 | return ms 260 | } 261 | return mi.MessageOf(x) 262 | } 263 | 264 | // Deprecated: Use TransactionStructLog.ProtoReflect.Descriptor instead. 265 | func (*TransactionStructLog) Descriptor() ([]byte, []int) { 266 | return file_proto_types_transaction_log_proto_rawDescGZIP(), []int{2} 267 | } 268 | 269 | func (x *TransactionStructLog) GetPc() uint64 { 270 | if x != nil { 271 | return x.Pc 272 | } 273 | return 0 274 | } 275 | 276 | func (x *TransactionStructLog) GetOp() uint64 { 277 | if x != nil { 278 | return x.Op 279 | } 280 | return 0 281 | } 282 | 283 | func (x *TransactionStructLog) GetGas() uint64 { 284 | if x != nil { 285 | return x.Gas 286 | } 287 | return 0 288 | } 289 | 290 | func (x *TransactionStructLog) GetGasCost() uint64 { 291 | if x != nil { 292 | return x.GasCost 293 | } 294 | return 0 295 | } 296 | 297 | func (x *TransactionStructLog) GetMemory() string { 298 | if x != nil { 299 | return x.Memory 300 | } 301 | return "" 302 | } 303 | 304 | func (x *TransactionStructLog) GetMemSize() int32 { 305 | if x != nil { 306 | return x.MemSize 307 | } 308 | return 0 309 | } 310 | 311 | func (x *TransactionStructLog) GetStack() []string { 312 | if x != nil { 313 | return x.Stack 314 | } 315 | return nil 316 | } 317 | 318 | func (x *TransactionStructLog) GetReturnData() string { 319 | if x != nil { 320 | return x.ReturnData 321 | } 322 | return "" 323 | } 324 | 325 | func (x *TransactionStructLog) GetDepth() int32 { 326 | if x != nil { 327 | return x.Depth 328 | } 329 | return 0 330 | } 331 | 332 | func (x *TransactionStructLog) GetRefund() uint64 { 333 | if x != nil { 334 | return x.Refund 335 | } 336 | return 0 337 | } 338 | 339 | func (x *TransactionStructLog) GetOpName() string { 340 | if x != nil { 341 | return x.OpName 342 | } 343 | return "" 344 | } 345 | 346 | func (x *TransactionStructLog) GetError() string { 347 | if x != nil { 348 | return x.Error 349 | } 350 | return "" 351 | } 352 | 353 | type TransactionLog_Transaction struct { 354 | state protoimpl.MessageState 355 | sizeCache protoimpl.SizeCache 356 | unknownFields protoimpl.UnknownFields 357 | 358 | Topic []byte `protobuf:"bytes,1,opt,name=topic,proto3" json:"topic,omitempty"` 359 | Amount string `protobuf:"bytes,2,opt,name=amount,proto3" json:"amount,omitempty"` 360 | Sender string `protobuf:"bytes,3,opt,name=sender,proto3" json:"sender,omitempty"` 361 | Recipient string `protobuf:"bytes,4,opt,name=recipient,proto3" json:"recipient,omitempty"` 362 | Type TransactionLogType `protobuf:"varint,5,opt,name=type,proto3,enum=iotextypes.TransactionLogType" json:"type,omitempty"` 363 | } 364 | 365 | func (x *TransactionLog_Transaction) Reset() { 366 | *x = TransactionLog_Transaction{} 367 | if protoimpl.UnsafeEnabled { 368 | mi := &file_proto_types_transaction_log_proto_msgTypes[3] 369 | ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) 370 | ms.StoreMessageInfo(mi) 371 | } 372 | } 373 | 374 | func (x *TransactionLog_Transaction) String() string { 375 | return protoimpl.X.MessageStringOf(x) 376 | } 377 | 378 | func (*TransactionLog_Transaction) ProtoMessage() {} 379 | 380 | func (x *TransactionLog_Transaction) ProtoReflect() protoreflect.Message { 381 | mi := &file_proto_types_transaction_log_proto_msgTypes[3] 382 | if protoimpl.UnsafeEnabled && x != nil { 383 | ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) 384 | if ms.LoadMessageInfo() == nil { 385 | ms.StoreMessageInfo(mi) 386 | } 387 | return ms 388 | } 389 | return mi.MessageOf(x) 390 | } 391 | 392 | // Deprecated: Use TransactionLog_Transaction.ProtoReflect.Descriptor instead. 393 | func (*TransactionLog_Transaction) Descriptor() ([]byte, []int) { 394 | return file_proto_types_transaction_log_proto_rawDescGZIP(), []int{0, 0} 395 | } 396 | 397 | func (x *TransactionLog_Transaction) GetTopic() []byte { 398 | if x != nil { 399 | return x.Topic 400 | } 401 | return nil 402 | } 403 | 404 | func (x *TransactionLog_Transaction) GetAmount() string { 405 | if x != nil { 406 | return x.Amount 407 | } 408 | return "" 409 | } 410 | 411 | func (x *TransactionLog_Transaction) GetSender() string { 412 | if x != nil { 413 | return x.Sender 414 | } 415 | return "" 416 | } 417 | 418 | func (x *TransactionLog_Transaction) GetRecipient() string { 419 | if x != nil { 420 | return x.Recipient 421 | } 422 | return "" 423 | } 424 | 425 | func (x *TransactionLog_Transaction) GetType() TransactionLogType { 426 | if x != nil { 427 | return x.Type 428 | } 429 | return TransactionLogType_IN_CONTRACT_TRANSFER 430 | } 431 | 432 | var File_proto_types_transaction_log_proto protoreflect.FileDescriptor 433 | 434 | var file_proto_types_transaction_log_proto_rawDesc = []byte{ 435 | 0x0a, 0x21, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2f, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2f, 0x74, 0x72, 436 | 0x61, 0x6e, 0x73, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x6c, 0x6f, 0x67, 0x2e, 0x70, 0x72, 437 | 0x6f, 0x74, 0x6f, 0x12, 0x0a, 0x69, 0x6f, 0x74, 0x65, 0x78, 0x74, 0x79, 0x70, 0x65, 0x73, 0x22, 438 | 0xce, 0x02, 0x0a, 0x0e, 0x54, 0x72, 0x61, 0x6e, 0x73, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x4c, 439 | 0x6f, 0x67, 0x12, 0x1e, 0x0a, 0x0a, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x48, 0x61, 0x73, 0x68, 440 | 0x18, 0x01, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x0a, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x48, 0x61, 441 | 0x73, 0x68, 0x12, 0x28, 0x0a, 0x0f, 0x6e, 0x75, 0x6d, 0x54, 0x72, 0x61, 0x6e, 0x73, 0x61, 0x63, 442 | 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x18, 0x02, 0x20, 0x01, 0x28, 0x04, 0x52, 0x0f, 0x6e, 0x75, 0x6d, 443 | 0x54, 0x72, 0x61, 0x6e, 0x73, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x12, 0x4a, 0x0a, 0x0c, 444 | 0x74, 0x72, 0x61, 0x6e, 0x73, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x18, 0x03, 0x20, 0x03, 445 | 0x28, 0x0b, 0x32, 0x26, 0x2e, 0x69, 0x6f, 0x74, 0x65, 0x78, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2e, 446 | 0x54, 0x72, 0x61, 0x6e, 0x73, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x4c, 0x6f, 0x67, 0x2e, 0x54, 447 | 0x72, 0x61, 0x6e, 0x73, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x0c, 0x74, 0x72, 0x61, 0x6e, 448 | 0x73, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x1a, 0xa5, 0x01, 0x0a, 0x0b, 0x54, 0x72, 0x61, 449 | 0x6e, 0x73, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x14, 0x0a, 0x05, 0x74, 0x6f, 0x70, 0x69, 450 | 0x63, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x05, 0x74, 0x6f, 0x70, 0x69, 0x63, 0x12, 0x16, 451 | 0x0a, 0x06, 0x61, 0x6d, 0x6f, 0x75, 0x6e, 0x74, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 452 | 0x61, 0x6d, 0x6f, 0x75, 0x6e, 0x74, 0x12, 0x16, 0x0a, 0x06, 0x73, 0x65, 0x6e, 0x64, 0x65, 0x72, 453 | 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x73, 0x65, 0x6e, 0x64, 0x65, 0x72, 0x12, 0x1c, 454 | 0x0a, 0x09, 0x72, 0x65, 0x63, 0x69, 0x70, 0x69, 0x65, 0x6e, 0x74, 0x18, 0x04, 0x20, 0x01, 0x28, 455 | 0x09, 0x52, 0x09, 0x72, 0x65, 0x63, 0x69, 0x70, 0x69, 0x65, 0x6e, 0x74, 0x12, 0x32, 0x0a, 0x04, 456 | 0x74, 0x79, 0x70, 0x65, 0x18, 0x05, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x1e, 0x2e, 0x69, 0x6f, 0x74, 457 | 0x65, 0x78, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2e, 0x54, 0x72, 0x61, 0x6e, 0x73, 0x61, 0x63, 0x74, 458 | 0x69, 0x6f, 0x6e, 0x4c, 0x6f, 0x67, 0x54, 0x79, 0x70, 0x65, 0x52, 0x04, 0x74, 0x79, 0x70, 0x65, 459 | 0x22, 0x41, 0x0a, 0x0f, 0x54, 0x72, 0x61, 0x6e, 0x73, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x4c, 460 | 0x6f, 0x67, 0x73, 0x12, 0x2e, 0x0a, 0x04, 0x6c, 0x6f, 0x67, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 461 | 0x0b, 0x32, 0x1a, 0x2e, 0x69, 0x6f, 0x74, 0x65, 0x78, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2e, 0x54, 462 | 0x72, 0x61, 0x6e, 0x73, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x4c, 0x6f, 0x67, 0x52, 0x04, 0x6c, 463 | 0x6f, 0x67, 0x73, 0x22, 0xa6, 0x02, 0x0a, 0x14, 0x54, 0x72, 0x61, 0x6e, 0x73, 0x61, 0x63, 0x74, 464 | 0x69, 0x6f, 0x6e, 0x53, 0x74, 0x72, 0x75, 0x63, 0x74, 0x4c, 0x6f, 0x67, 0x12, 0x0e, 0x0a, 0x02, 465 | 0x70, 0x63, 0x18, 0x01, 0x20, 0x01, 0x28, 0x04, 0x52, 0x02, 0x70, 0x63, 0x12, 0x0e, 0x0a, 0x02, 466 | 0x6f, 0x70, 0x18, 0x02, 0x20, 0x01, 0x28, 0x04, 0x52, 0x02, 0x6f, 0x70, 0x12, 0x10, 0x0a, 0x03, 467 | 0x67, 0x61, 0x73, 0x18, 0x03, 0x20, 0x01, 0x28, 0x04, 0x52, 0x03, 0x67, 0x61, 0x73, 0x12, 0x18, 468 | 0x0a, 0x07, 0x67, 0x61, 0x73, 0x43, 0x6f, 0x73, 0x74, 0x18, 0x04, 0x20, 0x01, 0x28, 0x04, 0x52, 469 | 0x07, 0x67, 0x61, 0x73, 0x43, 0x6f, 0x73, 0x74, 0x12, 0x16, 0x0a, 0x06, 0x6d, 0x65, 0x6d, 0x6f, 470 | 0x72, 0x79, 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x6d, 0x65, 0x6d, 0x6f, 0x72, 0x79, 471 | 0x12, 0x18, 0x0a, 0x07, 0x6d, 0x65, 0x6d, 0x53, 0x69, 0x7a, 0x65, 0x18, 0x06, 0x20, 0x01, 0x28, 472 | 0x05, 0x52, 0x07, 0x6d, 0x65, 0x6d, 0x53, 0x69, 0x7a, 0x65, 0x12, 0x14, 0x0a, 0x05, 0x73, 0x74, 473 | 0x61, 0x63, 0x6b, 0x18, 0x07, 0x20, 0x03, 0x28, 0x09, 0x52, 0x05, 0x73, 0x74, 0x61, 0x63, 0x6b, 474 | 0x12, 0x1e, 0x0a, 0x0a, 0x72, 0x65, 0x74, 0x75, 0x72, 0x6e, 0x44, 0x61, 0x74, 0x61, 0x18, 0x08, 475 | 0x20, 0x01, 0x28, 0x09, 0x52, 0x0a, 0x72, 0x65, 0x74, 0x75, 0x72, 0x6e, 0x44, 0x61, 0x74, 0x61, 476 | 0x12, 0x14, 0x0a, 0x05, 0x64, 0x65, 0x70, 0x74, 0x68, 0x18, 0x09, 0x20, 0x01, 0x28, 0x05, 0x52, 477 | 0x05, 0x64, 0x65, 0x70, 0x74, 0x68, 0x12, 0x16, 0x0a, 0x06, 0x72, 0x65, 0x66, 0x75, 0x6e, 0x64, 478 | 0x18, 0x0a, 0x20, 0x01, 0x28, 0x04, 0x52, 0x06, 0x72, 0x65, 0x66, 0x75, 0x6e, 0x64, 0x12, 0x16, 479 | 0x0a, 0x06, 0x6f, 0x70, 0x4e, 0x61, 0x6d, 0x65, 0x18, 0x0b, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 480 | 0x6f, 0x70, 0x4e, 0x61, 0x6d, 0x65, 0x12, 0x14, 0x0a, 0x05, 0x65, 0x72, 0x72, 0x6f, 0x72, 0x18, 481 | 0x0c, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x65, 0x72, 0x72, 0x6f, 0x72, 0x2a, 0xa7, 0x02, 0x0a, 482 | 0x12, 0x54, 0x72, 0x61, 0x6e, 0x73, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x4c, 0x6f, 0x67, 0x54, 483 | 0x79, 0x70, 0x65, 0x12, 0x18, 0x0a, 0x14, 0x49, 0x4e, 0x5f, 0x43, 0x4f, 0x4e, 0x54, 0x52, 0x41, 484 | 0x43, 0x54, 0x5f, 0x54, 0x52, 0x41, 0x4e, 0x53, 0x46, 0x45, 0x52, 0x10, 0x00, 0x12, 0x13, 0x0a, 485 | 0x0f, 0x57, 0x49, 0x54, 0x48, 0x44, 0x52, 0x41, 0x57, 0x5f, 0x42, 0x55, 0x43, 0x4b, 0x45, 0x54, 486 | 0x10, 0x01, 0x12, 0x11, 0x0a, 0x0d, 0x43, 0x52, 0x45, 0x41, 0x54, 0x45, 0x5f, 0x42, 0x55, 0x43, 487 | 0x4b, 0x45, 0x54, 0x10, 0x02, 0x12, 0x15, 0x0a, 0x11, 0x44, 0x45, 0x50, 0x4f, 0x53, 0x49, 0x54, 488 | 0x5f, 0x54, 0x4f, 0x5f, 0x42, 0x55, 0x43, 0x4b, 0x45, 0x54, 0x10, 0x03, 0x12, 0x18, 0x0a, 0x14, 489 | 0x43, 0x41, 0x4e, 0x44, 0x49, 0x44, 0x41, 0x54, 0x45, 0x5f, 0x53, 0x45, 0x4c, 0x46, 0x5f, 0x53, 490 | 0x54, 0x41, 0x4b, 0x45, 0x10, 0x04, 0x12, 0x1e, 0x0a, 0x1a, 0x43, 0x41, 0x4e, 0x44, 0x49, 0x44, 491 | 0x41, 0x54, 0x45, 0x5f, 0x52, 0x45, 0x47, 0x49, 0x53, 0x54, 0x52, 0x41, 0x54, 0x49, 0x4f, 0x4e, 492 | 0x5f, 0x46, 0x45, 0x45, 0x10, 0x05, 0x12, 0x0b, 0x0a, 0x07, 0x47, 0x41, 0x53, 0x5f, 0x46, 0x45, 493 | 0x45, 0x10, 0x06, 0x12, 0x13, 0x0a, 0x0f, 0x4e, 0x41, 0x54, 0x49, 0x56, 0x45, 0x5f, 0x54, 0x52, 494 | 0x41, 0x4e, 0x53, 0x46, 0x45, 0x52, 0x10, 0x07, 0x12, 0x1d, 0x0a, 0x19, 0x44, 0x45, 0x50, 0x4f, 495 | 0x53, 0x49, 0x54, 0x5f, 0x54, 0x4f, 0x5f, 0x52, 0x45, 0x57, 0x41, 0x52, 0x44, 0x49, 0x4e, 0x47, 496 | 0x5f, 0x46, 0x55, 0x4e, 0x44, 0x10, 0x08, 0x12, 0x1d, 0x0a, 0x19, 0x43, 0x4c, 0x41, 0x49, 0x4d, 497 | 0x5f, 0x46, 0x52, 0x4f, 0x4d, 0x5f, 0x52, 0x45, 0x57, 0x41, 0x52, 0x44, 0x49, 0x4e, 0x47, 0x5f, 498 | 0x46, 0x55, 0x4e, 0x44, 0x10, 0x09, 0x12, 0x0c, 0x0a, 0x08, 0x42, 0x4c, 0x4f, 0x42, 0x5f, 0x46, 499 | 0x45, 0x45, 0x10, 0x0a, 0x12, 0x10, 0x0a, 0x0c, 0x50, 0x52, 0x49, 0x4f, 0x52, 0x49, 0x54, 0x59, 500 | 0x5f, 0x46, 0x45, 0x45, 0x10, 0x0b, 0x42, 0x5d, 0x0a, 0x22, 0x63, 0x6f, 0x6d, 0x2e, 0x67, 0x69, 501 | 0x74, 0x68, 0x75, 0x62, 0x2e, 0x69, 0x6f, 0x74, 0x65, 0x78, 0x70, 0x72, 0x6f, 0x6a, 0x65, 0x63, 502 | 0x74, 0x2e, 0x67, 0x72, 0x70, 0x63, 0x2e, 0x74, 0x79, 0x70, 0x65, 0x73, 0x50, 0x01, 0x5a, 0x35, 503 | 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x69, 0x6f, 0x74, 0x65, 0x78, 504 | 0x70, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x2f, 0x69, 0x6f, 0x74, 0x65, 0x78, 0x2d, 0x70, 0x72, 505 | 0x6f, 0x74, 0x6f, 0x2f, 0x67, 0x6f, 0x6c, 0x61, 0x6e, 0x67, 0x2f, 0x69, 0x6f, 0x74, 0x65, 0x78, 506 | 0x74, 0x79, 0x70, 0x65, 0x73, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, 507 | } 508 | 509 | var ( 510 | file_proto_types_transaction_log_proto_rawDescOnce sync.Once 511 | file_proto_types_transaction_log_proto_rawDescData = file_proto_types_transaction_log_proto_rawDesc 512 | ) 513 | 514 | func file_proto_types_transaction_log_proto_rawDescGZIP() []byte { 515 | file_proto_types_transaction_log_proto_rawDescOnce.Do(func() { 516 | file_proto_types_transaction_log_proto_rawDescData = protoimpl.X.CompressGZIP(file_proto_types_transaction_log_proto_rawDescData) 517 | }) 518 | return file_proto_types_transaction_log_proto_rawDescData 519 | } 520 | 521 | var file_proto_types_transaction_log_proto_enumTypes = make([]protoimpl.EnumInfo, 1) 522 | var file_proto_types_transaction_log_proto_msgTypes = make([]protoimpl.MessageInfo, 4) 523 | var file_proto_types_transaction_log_proto_goTypes = []any{ 524 | (TransactionLogType)(0), // 0: iotextypes.TransactionLogType 525 | (*TransactionLog)(nil), // 1: iotextypes.TransactionLog 526 | (*TransactionLogs)(nil), // 2: iotextypes.TransactionLogs 527 | (*TransactionStructLog)(nil), // 3: iotextypes.TransactionStructLog 528 | (*TransactionLog_Transaction)(nil), // 4: iotextypes.TransactionLog.Transaction 529 | } 530 | var file_proto_types_transaction_log_proto_depIdxs = []int32{ 531 | 4, // 0: iotextypes.TransactionLog.transactions:type_name -> iotextypes.TransactionLog.Transaction 532 | 1, // 1: iotextypes.TransactionLogs.logs:type_name -> iotextypes.TransactionLog 533 | 0, // 2: iotextypes.TransactionLog.Transaction.type:type_name -> iotextypes.TransactionLogType 534 | 3, // [3:3] is the sub-list for method output_type 535 | 3, // [3:3] is the sub-list for method input_type 536 | 3, // [3:3] is the sub-list for extension type_name 537 | 3, // [3:3] is the sub-list for extension extendee 538 | 0, // [0:3] is the sub-list for field type_name 539 | } 540 | 541 | func init() { file_proto_types_transaction_log_proto_init() } 542 | func file_proto_types_transaction_log_proto_init() { 543 | if File_proto_types_transaction_log_proto != nil { 544 | return 545 | } 546 | if !protoimpl.UnsafeEnabled { 547 | file_proto_types_transaction_log_proto_msgTypes[0].Exporter = func(v any, i int) any { 548 | switch v := v.(*TransactionLog); i { 549 | case 0: 550 | return &v.state 551 | case 1: 552 | return &v.sizeCache 553 | case 2: 554 | return &v.unknownFields 555 | default: 556 | return nil 557 | } 558 | } 559 | file_proto_types_transaction_log_proto_msgTypes[1].Exporter = func(v any, i int) any { 560 | switch v := v.(*TransactionLogs); i { 561 | case 0: 562 | return &v.state 563 | case 1: 564 | return &v.sizeCache 565 | case 2: 566 | return &v.unknownFields 567 | default: 568 | return nil 569 | } 570 | } 571 | file_proto_types_transaction_log_proto_msgTypes[2].Exporter = func(v any, i int) any { 572 | switch v := v.(*TransactionStructLog); i { 573 | case 0: 574 | return &v.state 575 | case 1: 576 | return &v.sizeCache 577 | case 2: 578 | return &v.unknownFields 579 | default: 580 | return nil 581 | } 582 | } 583 | file_proto_types_transaction_log_proto_msgTypes[3].Exporter = func(v any, i int) any { 584 | switch v := v.(*TransactionLog_Transaction); i { 585 | case 0: 586 | return &v.state 587 | case 1: 588 | return &v.sizeCache 589 | case 2: 590 | return &v.unknownFields 591 | default: 592 | return nil 593 | } 594 | } 595 | } 596 | type x struct{} 597 | out := protoimpl.TypeBuilder{ 598 | File: protoimpl.DescBuilder{ 599 | GoPackagePath: reflect.TypeOf(x{}).PkgPath(), 600 | RawDescriptor: file_proto_types_transaction_log_proto_rawDesc, 601 | NumEnums: 1, 602 | NumMessages: 4, 603 | NumExtensions: 0, 604 | NumServices: 0, 605 | }, 606 | GoTypes: file_proto_types_transaction_log_proto_goTypes, 607 | DependencyIndexes: file_proto_types_transaction_log_proto_depIdxs, 608 | EnumInfos: file_proto_types_transaction_log_proto_enumTypes, 609 | MessageInfos: file_proto_types_transaction_log_proto_msgTypes, 610 | }.Build() 611 | File_proto_types_transaction_log_proto = out.File 612 | file_proto_types_transaction_log_proto_rawDesc = nil 613 | file_proto_types_transaction_log_proto_goTypes = nil 614 | file_proto_types_transaction_log_proto_depIdxs = nil 615 | } 616 | -------------------------------------------------------------------------------- /golang/protocol/const.go: -------------------------------------------------------------------------------- 1 | package protocol 2 | 3 | const ( 4 | RewardingProtocolID = "rewarding" 5 | ReadAvailableBalanceMethodName = "AvailableBalance" 6 | ReadTotalBalanceMethodName = "TotalBalance" 7 | ReadUnclaimedBalanceMethodName = "UnclaimedBalance" 8 | ) 9 | 10 | const ( 11 | StakingProtcolID = "staking" 12 | ) 13 | -------------------------------------------------------------------------------- /golang/testingpb/testing.pb.go: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2018 IoTeX 2 | // This is an alpha (internal) release and is not suitable for production. This source code is provided 'as is' and no 3 | // warranties are given as to title or non-infringement, merchantability or fitness for purpose and, to the extent 4 | // permitted by law, all liability for your use of the code is disclaimed. This source code is governed by Apache 5 | // License 2.0 that can be found in the LICENSE file. 6 | 7 | // To compile the proto, run: 8 | // protoc --go_out=plugins=grpc:$GOPATH/src *.proto 9 | 10 | // Code generated by protoc-gen-go. DO NOT EDIT. 11 | // versions: 12 | // protoc-gen-go v1.34.2 13 | // protoc v5.27.1 14 | // source: proto/testing/testing.proto 15 | 16 | package testingpb 17 | 18 | import ( 19 | protoreflect "google.golang.org/protobuf/reflect/protoreflect" 20 | protoimpl "google.golang.org/protobuf/runtime/protoimpl" 21 | reflect "reflect" 22 | sync "sync" 23 | ) 24 | 25 | const ( 26 | // Verify that this generated code is sufficiently up-to-date. 27 | _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) 28 | // Verify that runtime/protoimpl is sufficiently up-to-date. 29 | _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) 30 | ) 31 | 32 | type TestPayload struct { 33 | state protoimpl.MessageState 34 | sizeCache protoimpl.SizeCache 35 | unknownFields protoimpl.UnknownFields 36 | 37 | MsgBody []byte `protobuf:"bytes,1,opt,name=msg_body,json=msgBody,proto3" json:"msg_body,omitempty"` 38 | } 39 | 40 | func (x *TestPayload) Reset() { 41 | *x = TestPayload{} 42 | if protoimpl.UnsafeEnabled { 43 | mi := &file_proto_testing_testing_proto_msgTypes[0] 44 | ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) 45 | ms.StoreMessageInfo(mi) 46 | } 47 | } 48 | 49 | func (x *TestPayload) String() string { 50 | return protoimpl.X.MessageStringOf(x) 51 | } 52 | 53 | func (*TestPayload) ProtoMessage() {} 54 | 55 | func (x *TestPayload) ProtoReflect() protoreflect.Message { 56 | mi := &file_proto_testing_testing_proto_msgTypes[0] 57 | if protoimpl.UnsafeEnabled && x != nil { 58 | ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) 59 | if ms.LoadMessageInfo() == nil { 60 | ms.StoreMessageInfo(mi) 61 | } 62 | return ms 63 | } 64 | return mi.MessageOf(x) 65 | } 66 | 67 | // Deprecated: Use TestPayload.ProtoReflect.Descriptor instead. 68 | func (*TestPayload) Descriptor() ([]byte, []int) { 69 | return file_proto_testing_testing_proto_rawDescGZIP(), []int{0} 70 | } 71 | 72 | func (x *TestPayload) GetMsgBody() []byte { 73 | if x != nil { 74 | return x.MsgBody 75 | } 76 | return nil 77 | } 78 | 79 | var File_proto_testing_testing_proto protoreflect.FileDescriptor 80 | 81 | var file_proto_testing_testing_proto_rawDesc = []byte{ 82 | 0x0a, 0x1b, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2f, 0x74, 0x65, 0x73, 0x74, 0x69, 0x6e, 0x67, 0x2f, 83 | 0x74, 0x65, 0x73, 0x74, 0x69, 0x6e, 0x67, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x09, 0x74, 84 | 0x65, 0x73, 0x74, 0x69, 0x6e, 0x67, 0x70, 0x62, 0x22, 0x28, 0x0a, 0x0b, 0x54, 0x65, 0x73, 0x74, 85 | 0x50, 0x61, 0x79, 0x6c, 0x6f, 0x61, 0x64, 0x12, 0x19, 0x0a, 0x08, 0x6d, 0x73, 0x67, 0x5f, 0x62, 86 | 0x6f, 0x64, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x07, 0x6d, 0x73, 0x67, 0x42, 0x6f, 87 | 0x64, 0x79, 0x42, 0x5e, 0x0a, 0x24, 0x63, 0x6f, 0x6d, 0x2e, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 88 | 0x2e, 0x69, 0x6f, 0x74, 0x65, 0x78, 0x70, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x2e, 0x67, 0x72, 89 | 0x70, 0x63, 0x2e, 0x74, 0x65, 0x73, 0x74, 0x69, 0x6e, 0x67, 0x50, 0x01, 0x5a, 0x34, 0x67, 0x69, 90 | 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x69, 0x6f, 0x74, 0x65, 0x78, 0x70, 0x72, 91 | 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x2f, 0x69, 0x6f, 0x74, 0x65, 0x78, 0x2d, 0x70, 0x72, 0x6f, 0x74, 92 | 0x6f, 0x2f, 0x67, 0x6f, 0x6c, 0x61, 0x6e, 0x67, 0x2f, 0x74, 0x65, 0x73, 0x74, 0x69, 0x6e, 0x67, 93 | 0x70, 0x62, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, 94 | } 95 | 96 | var ( 97 | file_proto_testing_testing_proto_rawDescOnce sync.Once 98 | file_proto_testing_testing_proto_rawDescData = file_proto_testing_testing_proto_rawDesc 99 | ) 100 | 101 | func file_proto_testing_testing_proto_rawDescGZIP() []byte { 102 | file_proto_testing_testing_proto_rawDescOnce.Do(func() { 103 | file_proto_testing_testing_proto_rawDescData = protoimpl.X.CompressGZIP(file_proto_testing_testing_proto_rawDescData) 104 | }) 105 | return file_proto_testing_testing_proto_rawDescData 106 | } 107 | 108 | var file_proto_testing_testing_proto_msgTypes = make([]protoimpl.MessageInfo, 1) 109 | var file_proto_testing_testing_proto_goTypes = []any{ 110 | (*TestPayload)(nil), // 0: testingpb.TestPayload 111 | } 112 | var file_proto_testing_testing_proto_depIdxs = []int32{ 113 | 0, // [0:0] is the sub-list for method output_type 114 | 0, // [0:0] is the sub-list for method input_type 115 | 0, // [0:0] is the sub-list for extension type_name 116 | 0, // [0:0] is the sub-list for extension extendee 117 | 0, // [0:0] is the sub-list for field type_name 118 | } 119 | 120 | func init() { file_proto_testing_testing_proto_init() } 121 | func file_proto_testing_testing_proto_init() { 122 | if File_proto_testing_testing_proto != nil { 123 | return 124 | } 125 | if !protoimpl.UnsafeEnabled { 126 | file_proto_testing_testing_proto_msgTypes[0].Exporter = func(v any, i int) any { 127 | switch v := v.(*TestPayload); i { 128 | case 0: 129 | return &v.state 130 | case 1: 131 | return &v.sizeCache 132 | case 2: 133 | return &v.unknownFields 134 | default: 135 | return nil 136 | } 137 | } 138 | } 139 | type x struct{} 140 | out := protoimpl.TypeBuilder{ 141 | File: protoimpl.DescBuilder{ 142 | GoPackagePath: reflect.TypeOf(x{}).PkgPath(), 143 | RawDescriptor: file_proto_testing_testing_proto_rawDesc, 144 | NumEnums: 0, 145 | NumMessages: 1, 146 | NumExtensions: 0, 147 | NumServices: 0, 148 | }, 149 | GoTypes: file_proto_testing_testing_proto_goTypes, 150 | DependencyIndexes: file_proto_testing_testing_proto_depIdxs, 151 | MessageInfos: file_proto_testing_testing_proto_msgTypes, 152 | }.Build() 153 | File_proto_testing_testing_proto = out.File 154 | file_proto_testing_testing_proto_rawDesc = nil 155 | file_proto_testing_testing_proto_goTypes = nil 156 | file_proto_testing_testing_proto_depIdxs = nil 157 | } 158 | -------------------------------------------------------------------------------- /golang/utils.go: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2018 IoTeX 2 | // This is an alpha (internal) release and is not suitable for production. This source code is provided 'as is' and no 3 | // warranties are given as to title or non-infringement, merchantability or fitness for purpose and, to the extent 4 | // permitted by law, all liability for your use of the code is disclaimed. This source code is governed by Apache 5 | // License 2.0 that can be found in the LICENSE file. 6 | 7 | package golang 8 | 9 | import ( 10 | "errors" 11 | 12 | "google.golang.org/protobuf/proto" 13 | 14 | "github.com/iotexproject/iotex-proto/golang/iotexrpc" 15 | "github.com/iotexproject/iotex-proto/golang/iotextypes" 16 | "github.com/iotexproject/iotex-proto/golang/testingpb" 17 | ) 18 | 19 | // GetTypeFromRPCMsg retrieves the proto message type 20 | func GetTypeFromRPCMsg(msg proto.Message) (iotexrpc.MessageType, error) { 21 | switch msg.(type) { 22 | case *iotextypes.Block: 23 | return iotexrpc.MessageType_BLOCK, nil 24 | case *iotexrpc.BlockSync: 25 | return iotexrpc.MessageType_BLOCK_REQUEST, nil 26 | case *iotextypes.Action: 27 | return iotexrpc.MessageType_ACTION, nil 28 | case *iotextypes.Actions: 29 | return iotexrpc.MessageType_ACTIONS, nil 30 | case *iotextypes.ActionHash: 31 | return iotexrpc.MessageType_ACTION_HASH, nil 32 | case *iotexrpc.ActionSync: 33 | return iotexrpc.MessageType_ACTION_REQUEST, nil 34 | case *iotextypes.ConsensusMessage: 35 | return iotexrpc.MessageType_CONSENSUS, nil 36 | case *iotextypes.NodeInfoRequest: 37 | return iotexrpc.MessageType_NODE_INFO_REQUEST, nil 38 | case *iotextypes.NodeInfo: 39 | return iotexrpc.MessageType_NODE_INFO, nil 40 | case *testingpb.TestPayload: 41 | return iotexrpc.MessageType_TEST, nil 42 | default: 43 | return iotexrpc.MessageType_UNKNOWN, errors.New("unknown RPC message type") 44 | } 45 | } 46 | 47 | // TypifyRPCMsg unmarshal a proto message based on the given MessageType 48 | func TypifyRPCMsg(t iotexrpc.MessageType, msg []byte) (proto.Message, error) { 49 | var m proto.Message 50 | switch t { 51 | case iotexrpc.MessageType_BLOCK: 52 | m = &iotextypes.Block{} 53 | case iotexrpc.MessageType_CONSENSUS: 54 | m = &iotextypes.ConsensusMessage{} 55 | case iotexrpc.MessageType_BLOCK_REQUEST: 56 | m = &iotexrpc.BlockSync{} 57 | case iotexrpc.MessageType_ACTION: 58 | m = &iotextypes.Action{} 59 | case iotexrpc.MessageType_ACTIONS: 60 | m = &iotextypes.Actions{} 61 | case iotexrpc.MessageType_ACTION_HASH: 62 | m = &iotextypes.ActionHash{} 63 | case iotexrpc.MessageType_ACTION_REQUEST: 64 | m = &iotexrpc.ActionSync{} 65 | case iotexrpc.MessageType_NODE_INFO_REQUEST: 66 | m = &iotextypes.NodeInfoRequest{} 67 | case iotexrpc.MessageType_NODE_INFO: 68 | m = &iotextypes.NodeInfo{} 69 | case iotexrpc.MessageType_TEST: 70 | m = &testingpb.TestPayload{} 71 | default: 72 | return nil, errors.New("unknown RPC message type") 73 | } 74 | 75 | err := proto.Unmarshal(msg, m) 76 | if err != nil { 77 | return nil, err 78 | } 79 | return m, nil 80 | } 81 | -------------------------------------------------------------------------------- /misc/scripts/mockgen.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | mkdir -p ./golang/iotexapi/mock_iotexapi 4 | mockgen -destination=./golang/iotexapi/mock_iotexapi/mock_iotexapi.go \ 5 | github.com/iotexproject/iotex-proto/golang/iotexapi \ 6 | APIServiceServer,APIServiceClient 7 | -------------------------------------------------------------------------------- /proto/api/api.proto: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2019 IoTeX 2 | // This is an alpha (internal) release and is not suitable for production. This source code is provided 'as is' and no 3 | // warranties are given as to title or non-infringement, merchantability or fitness for purpose and, to the extent 4 | // permitted by law, all liability for your use of the code is disclaimed. This source code is governed by Apache 5 | // License 2.0 that can be found in the LICENSE file. 6 | 7 | // To compile the proto, run: 8 | // protoc -I. -I ./../types --go_out=plugins=grpc:$GOPATH/src *.proto 9 | syntax = "proto3"; 10 | package iotexapi; 11 | option go_package = "github.com/iotexproject/iotex-proto/golang/iotexapi"; 12 | option java_multiple_files = true; 13 | option java_package = "com.github.iotexproject.grpc.api"; 14 | 15 | import "proto/types/action.proto"; 16 | import "proto/types/blockchain.proto"; 17 | import "proto/types/node.proto"; 18 | import "proto/types/election.proto"; 19 | import "proto/types/transaction_log.proto"; 20 | import "google/protobuf/timestamp.proto"; 21 | 22 | service APIService { 23 | // get the address detail of an address 24 | rpc GetAccount(GetAccountRequest) returns (GetAccountResponse) {} 25 | 26 | // get action(s) by: 27 | // 1. start index and action count 28 | // 2. action hash 29 | // 3. address with start index and action count 30 | // 4. get unconfirmed actions by address with start index and action count 31 | // 5. block hash with start index and action count 32 | rpc GetActions(GetActionsRequest) returns (GetActionsResponse) {} 33 | 34 | // get block metadata(s) by: 35 | // 1. start index and block count 36 | // 2. block hash 37 | rpc GetBlockMetas(GetBlockMetasRequest) returns (GetBlockMetasResponse) {} 38 | 39 | // get chain metadata 40 | rpc GetChainMeta(GetChainMetaRequest) returns (GetChainMetaResponse) {} 41 | 42 | // get server version 43 | rpc GetServerMeta(GetServerMetaRequest) returns (GetServerMetaResponse) {} 44 | 45 | // sendAction 46 | rpc SendAction(SendActionRequest) returns (SendActionResponse) {} 47 | 48 | // get receipt by action Hash 49 | rpc GetReceiptByAction(GetReceiptByActionRequest) returns (GetReceiptByActionResponse) {} 50 | 51 | // TODO: read contract 52 | rpc ReadContract(ReadContractRequest) returns (ReadContractResponse) {} 53 | 54 | // suggest gas price 55 | rpc SuggestGasPrice(SuggestGasPriceRequest) returns (SuggestGasPriceResponse) {} 56 | 57 | // estimate gas for action, to be deprecated 58 | rpc EstimateGasForAction(EstimateGasForActionRequest) returns (EstimateGasForActionResponse) {} 59 | 60 | // estimate gas for action and transfer not sealed 61 | rpc EstimateActionGasConsumption(EstimateActionGasConsumptionRequest) returns (EstimateActionGasConsumptionResponse) {} 62 | 63 | // read state from blockchain 64 | rpc ReadState(ReadStateRequest) returns (ReadStateResponse) {} 65 | 66 | // get epoch metadata 67 | rpc GetEpochMeta(GetEpochMetaRequest) returns (GetEpochMetaResponse) {} 68 | 69 | // get raw blocks data 70 | rpc GetRawBlocks(GetRawBlocksRequest) returns (GetRawBlocksResponse) {} 71 | 72 | // get logs filtered by contract address and topics 73 | rpc GetLogs(GetLogsRequest) returns (GetLogsResponse) {} 74 | 75 | rpc GetTransactionLogByActionHash(GetTransactionLogByActionHashRequest) returns (GetTransactionLogByActionHashResponse) {} 76 | 77 | rpc GetTransactionLogByBlockHeight(GetTransactionLogByBlockHeightRequest) returns (GetTransactionLogByBlockHeightResponse) {} 78 | 79 | /* 80 | * below are streaming APIs 81 | */ 82 | 83 | // get block info in stream 84 | rpc StreamBlocks(StreamBlocksRequest) returns (stream StreamBlocksResponse) {} 85 | 86 | // get logs filtered by contract address and topics in stream 87 | rpc StreamLogs(StreamLogsRequest) returns (stream StreamLogsResponse) {} 88 | 89 | // get actions from act pool 90 | rpc GetActPoolActions(GetActPoolActionsRequest) returns (GetActPoolActionsResponse) {} 91 | 92 | // Deprecated 93 | rpc GetEvmTransfersByActionHash(GetEvmTransfersByActionHashRequest) returns (GetEvmTransfersByActionHashResponse) {} 94 | 95 | // Deprecated 96 | rpc GetEvmTransfersByBlockHeight(GetEvmTransfersByBlockHeightRequest) returns (GetEvmTransfersByBlockHeightResponse) {} 97 | 98 | // Deprecated 99 | rpc GetElectionBuckets(GetElectionBucketsRequest) returns (GetElectionBucketsResponse) {} 100 | 101 | rpc ReadContractStorage(ReadContractStorageRequest) returns (ReadContractStorageResponse) {} 102 | 103 | rpc TraceTransactionStructLogs(TraceTransactionStructLogsRequest) returns (TraceTransactionStructLogsResponse) {} 104 | } 105 | 106 | // experiment 107 | service TransactionLogService { 108 | rpc GetTransactionLogByActionHash(GetTransactionLogByActionHashRequest) returns (GetTransactionLogByActionHashResponse) {} 109 | 110 | rpc GetTransactionLogByBlockHeight(GetTransactionLogByBlockHeightRequest) returns (GetTransactionLogByBlockHeightResponse) {} 111 | } 112 | 113 | message Bucket { 114 | // hex string 115 | string voter = 1; 116 | string votes = 2; 117 | string weightedVotes = 3; 118 | // human readable duration 119 | string remainingDuration = 4; 120 | } 121 | 122 | message GetAccountRequest { 123 | string address = 1; 124 | } 125 | 126 | message GetAccountResponse { 127 | iotextypes.AccountMeta accountMeta = 1; 128 | iotextypes.BlockIdentifier blockIdentifier = 2; 129 | } 130 | 131 | message GetActionsRequest { 132 | oneof lookup { 133 | GetActionsByIndexRequest byIndex = 1; 134 | GetActionByHashRequest byHash = 2; 135 | GetActionsByAddressRequest byAddr = 3; 136 | GetUnconfirmedActionsByAddressRequest unconfirmedByAddr = 4; 137 | GetActionsByBlockRequest byBlk = 5; 138 | } 139 | } 140 | 141 | message GetActionsByIndexRequest { 142 | uint64 start = 1; 143 | uint64 count = 2; 144 | } 145 | 146 | message GetActionByHashRequest { 147 | string actionHash = 1; 148 | bool checkPending = 2; 149 | } 150 | 151 | message GetActionsByAddressRequest { 152 | string address = 1; 153 | uint64 start = 2; 154 | uint64 count = 3; 155 | } 156 | 157 | message GetUnconfirmedActionsByAddressRequest { 158 | string address = 1; 159 | uint64 start = 2; 160 | uint64 count = 3; 161 | } 162 | 163 | message GetActionsByBlockRequest { 164 | string blkHash = 1; 165 | uint64 start = 2; 166 | uint64 count = 3; 167 | } 168 | 169 | message ActionInfo { 170 | iotextypes.Action action = 1; 171 | string actHash = 2; 172 | string blkHash = 3; 173 | google.protobuf.Timestamp timestamp = 4; 174 | uint64 blkHeight = 5; 175 | string sender = 6; 176 | string gasFee = 7; 177 | uint32 index = 8; 178 | } 179 | 180 | message ReceiptInfo { 181 | iotextypes.Receipt receipt = 1; 182 | string blkHash = 2; 183 | } 184 | 185 | message BlockProducerInfo { 186 | string address = 1; 187 | string votes = 2; 188 | bool active = 3; 189 | uint64 production = 4; 190 | } 191 | 192 | message BlockInfo { 193 | iotextypes.Block block = 1; 194 | repeated iotextypes.Receipt receipts = 2; 195 | iotextypes.TransactionLogs transactionLogs = 3; 196 | } 197 | 198 | message GetActionsResponse { 199 | uint64 total = 2; 200 | repeated ActionInfo actionInfo = 1; 201 | } 202 | 203 | message GetBlockMetasRequest { 204 | oneof lookup { 205 | GetBlockMetasByIndexRequest byIndex = 1; 206 | GetBlockMetaByHashRequest byHash = 2; 207 | } 208 | } 209 | 210 | message GetBlockMetasByIndexRequest { 211 | uint64 start = 1; 212 | uint64 count = 2; 213 | } 214 | 215 | message GetBlockMetaByHashRequest { 216 | string blkHash = 1; 217 | } 218 | 219 | message GetBlockMetasResponse { 220 | uint64 total = 2; 221 | repeated iotextypes.BlockMeta blkMetas = 1; 222 | } 223 | 224 | message GetChainMetaRequest {} 225 | 226 | message GetChainMetaResponse { 227 | iotextypes.ChainMeta chainMeta = 1; 228 | string syncStage = 2; // sync stage 229 | } 230 | 231 | message GetServerMetaRequest {} 232 | 233 | message GetServerMetaResponse { 234 | iotextypes.ServerMeta serverMeta = 1; 235 | } 236 | 237 | message SendActionRequest { 238 | iotextypes.Action action = 1; 239 | } 240 | 241 | message SendSignedActionBytesRequest { 242 | string signedActionBytes = 1; 243 | } 244 | 245 | message SendActionResponse { 246 | string actionHash = 1; 247 | } 248 | 249 | message GetReceiptByActionRequest { 250 | string actionHash = 1; 251 | } 252 | 253 | message GetReceiptByActionResponse { 254 | ReceiptInfo receiptInfo = 1; 255 | } 256 | 257 | message ReadContractRequest { 258 | iotextypes.Execution execution = 1; 259 | string callerAddress = 2; 260 | uint64 gasLimit = 3; 261 | string gasPrice = 4; 262 | } 263 | 264 | message ReadContractResponse { 265 | string data = 1; 266 | iotextypes.Receipt receipt = 2; 267 | } 268 | 269 | message SuggestGasPriceRequest {} 270 | 271 | message SuggestGasPriceResponse { 272 | uint64 gasPrice = 1; 273 | } 274 | 275 | // To be deprecated 276 | message EstimateGasForActionRequest { 277 | iotextypes.Action action = 1; 278 | } 279 | 280 | message EstimateActionGasConsumptionRequest { 281 | oneof action { 282 | iotextypes.Transfer transfer = 1; 283 | iotextypes.Execution execution = 2; 284 | // Native staking 285 | iotextypes.StakeCreate stakeCreate = 40; 286 | iotextypes.StakeReclaim stakeUnstake = 41; 287 | iotextypes.StakeReclaim stakeWithdraw = 42; 288 | iotextypes.StakeAddDeposit stakeAddDeposit = 43; 289 | iotextypes.StakeRestake stakeRestake = 44; 290 | iotextypes.StakeChangeCandidate stakeChangeCandidate = 45; 291 | iotextypes.StakeTransferOwnership stakeTransferOwnership = 46; 292 | iotextypes.CandidateRegister candidateRegister = 47; 293 | iotextypes.CandidateBasicInfo candidateUpdate = 48; 294 | iotextypes.CandidateActivate candidateActivate = 49; 295 | iotextypes.CandidateEndorsement candidateEndorsement = 51; 296 | iotextypes.CandidateTransferOwnership candidateTransferOwnership = 52; 297 | iotextypes.StakeMigrate stakeMigrate = 53; 298 | } 299 | string callerAddress = 100; 300 | string gasPrice = 101; 301 | } 302 | 303 | message EstimateActionGasConsumptionResponse { 304 | uint64 gas = 1; 305 | } 306 | 307 | message EstimateGasForActionResponse { 308 | uint64 gas = 1; 309 | } 310 | 311 | message ReadStateRequest { 312 | bytes protocolID = 1; 313 | bytes methodName = 2; 314 | repeated bytes arguments = 3; 315 | string height = 4; // optional, if not present, read from tip height 316 | } 317 | 318 | message ReadStateResponse { 319 | bytes data = 1; 320 | iotextypes.BlockIdentifier blockIdentifier = 2; 321 | } 322 | 323 | message GetEpochMetaRequest { 324 | uint64 epochNumber = 1; 325 | } 326 | 327 | message GetEpochMetaResponse { 328 | iotextypes.EpochData epochData = 1; 329 | uint64 totalBlocks = 2; 330 | repeated BlockProducerInfo blockProducersInfo = 3; 331 | } 332 | 333 | message GetRawBlocksRequest { 334 | uint64 startHeight = 1; 335 | uint64 count = 2; 336 | bool withReceipts = 3; 337 | bool withTransactionLogs = 4; 338 | } 339 | 340 | message GetRawBlocksResponse { 341 | repeated BlockInfo blocks = 1; 342 | } 343 | 344 | message GetLogsByBlock { 345 | bytes blockHash = 1; 346 | } 347 | 348 | message GetLogsByRange { 349 | uint64 fromBlock = 1; 350 | uint64 toBlock = 2; 351 | uint64 paginationSize = 3; 352 | } 353 | 354 | message Topics { 355 | repeated bytes topic = 1; 356 | } 357 | 358 | message LogsFilter { 359 | repeated string address = 1; 360 | repeated Topics topics = 2; 361 | } 362 | 363 | message GetLogsRequest { 364 | LogsFilter filter = 1; 365 | oneof lookup { 366 | GetLogsByBlock byBlock = 2; 367 | GetLogsByRange byRange = 3; 368 | } 369 | } 370 | 371 | message GetLogsResponse { 372 | repeated iotextypes.Log logs = 1; 373 | } 374 | 375 | message GetTransactionLogByActionHashRequest { 376 | string actionHash = 1; 377 | } 378 | 379 | message GetTransactionLogByActionHashResponse { 380 | iotextypes.TransactionLog transactionLog = 1; 381 | } 382 | 383 | message GetTransactionLogByBlockHeightRequest { 384 | uint64 blockHeight = 1; 385 | } 386 | 387 | message GetTransactionLogByBlockHeightResponse { 388 | iotextypes.TransactionLogs transactionLogs = 1; 389 | iotextypes.BlockIdentifier blockIdentifier = 2; 390 | } 391 | 392 | /* 393 | * below are streaming APIs 394 | */ 395 | message StreamBlocksRequest {} 396 | 397 | message StreamBlocksResponse { 398 | BlockInfo block = 1; 399 | iotextypes.BlockIdentifier blockIdentifier = 2; 400 | } 401 | 402 | message StreamLogsRequest { 403 | LogsFilter filter = 1; 404 | } 405 | 406 | message StreamLogsResponse { 407 | iotextypes.Log log = 1; 408 | } 409 | 410 | message GetActPoolActionsRequest { 411 | repeated string actionHashes = 1; // if this field is absent, get all actions from actpool 412 | } 413 | 414 | message GetActPoolActionsResponse { 415 | repeated iotextypes.Action actions = 1; 416 | } 417 | 418 | /* 419 | * election APIs 420 | */ 421 | message GetElectionBucketsRequest{ 422 | uint64 epochNum = 1; 423 | } 424 | 425 | message GetElectionBucketsResponse{ 426 | repeated iotextypes.ElectionBucket buckets = 1; 427 | } 428 | 429 | // Deprecated 430 | message GetEvmTransfersByActionHashRequest { 431 | string actionHash = 1; 432 | } 433 | 434 | // Deprecated 435 | message GetEvmTransfersByActionHashResponse { 436 | iotextypes.ActionEvmTransfer actionEvmTransfers = 1; 437 | } 438 | 439 | // Deprecated 440 | message GetEvmTransfersByBlockHeightRequest { 441 | uint64 blockHeight = 1; 442 | } 443 | 444 | // Deprecated 445 | message GetEvmTransfersByBlockHeightResponse { 446 | iotextypes.BlockEvmTransfer blockEvmTransfers = 1; 447 | } 448 | 449 | message ReadContractStorageRequest { 450 | string contract = 1; 451 | bytes key = 2; 452 | } 453 | 454 | message ReadContractStorageResponse { 455 | bytes data = 1; 456 | } 457 | 458 | message TraceTransactionStructLogsRequest { 459 | string actionHash = 1; 460 | } 461 | 462 | message TraceTransactionStructLogsResponse { 463 | repeated iotextypes.TransactionStructLog structLogs = 1; 464 | } 465 | -------------------------------------------------------------------------------- /proto/api/read_state.proto: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2020 IoTeX 2 | // This is an alpha (internal) release and is not suitable for production. This source code is provided 'as is' and no 3 | // warranties are given as to title or non-infringement, merchantability or fitness for purpose and, to the extent 4 | // permitted by law, all liability for your use of the code is disclaimed. This source code is governed by Apache 5 | // License 2.0 that can be found in the LICENSE file. 6 | 7 | // To compile the proto, run: 8 | // protoc -I. -I ./../types --go_out=plugins=grpc:$GOPATH/src *.proto 9 | syntax = "proto3"; 10 | package iotexapi; 11 | option go_package = "github.com/iotexproject/iotex-proto/golang/iotexapi"; 12 | option java_multiple_files = true; 13 | option java_package = "com.github.iotexproject.grpc.api"; 14 | 15 | message PaginationParam { 16 | uint32 offset = 1; 17 | uint32 limit = 2; 18 | } 19 | 20 | message ReadStakingDataMethod { 21 | enum Name { 22 | INVALID = 0; 23 | BUCKETS = 1; 24 | BUCKETS_BY_VOTER = 2; 25 | BUCKETS_BY_CANDIDATE = 3; 26 | CANDIDATES = 4; 27 | CANDIDATE_BY_NAME = 5; 28 | BUCKETS_BY_INDEXES = 6; 29 | CANDIDATE_BY_ADDRESS = 7; 30 | TOTAL_STAKING_AMOUNT = 8; 31 | BUCKETS_COUNT = 9; 32 | // 10-19 reserved for native staking 33 | COMPOSITE_BUCKETS = 20; 34 | COMPOSITE_BUCKETS_BY_VOTER = 21; 35 | COMPOSITE_BUCKETS_BY_CANDIDATE = 22; 36 | COMPOSITE_BUCKETS_BY_INDEXES = 23; 37 | COMPOSITE_BUCKETS_COUNT = 24; 38 | COMPOSITE_TOTAL_STAKING_AMOUNT = 25; 39 | CONTRACT_STAKING_BUCKET_TYPES = 26; 40 | } 41 | Name method = 1; 42 | } 43 | 44 | message ReadStakingDataRequest { 45 | message VoteBuckets { 46 | PaginationParam pagination = 1; 47 | } 48 | 49 | message VoteBucketsByVoter { 50 | string voterAddress = 1; 51 | PaginationParam pagination = 2; 52 | } 53 | 54 | message VoteBucketsByCandidate { 55 | string candName = 1; 56 | PaginationParam pagination = 2; 57 | } 58 | 59 | message Candidates { 60 | PaginationParam pagination = 1; 61 | } 62 | 63 | message CandidateByName { 64 | string candName = 1; 65 | } 66 | 67 | message VoteBucketsByIndexes { 68 | repeated uint64 index = 1; 69 | } 70 | 71 | message CandidateByAddress { 72 | string ownerAddr = 1; 73 | string id = 2; 74 | } 75 | 76 | message TotalStakingAmount {} 77 | 78 | message BucketsCount {} 79 | 80 | message ContractStakingBucketTypes { 81 | string contractAddress = 1; 82 | } 83 | 84 | oneof request { 85 | VoteBuckets buckets = 1; 86 | VoteBucketsByVoter bucketsByVoter = 2; 87 | VoteBucketsByCandidate bucketsByCandidate = 3; 88 | Candidates candidates = 4; 89 | CandidateByName candidateByName = 5; 90 | VoteBucketsByIndexes bucketsByIndexes = 6; 91 | CandidateByAddress candidateByAddress = 7; 92 | TotalStakingAmount totalStakingAmount = 8; 93 | BucketsCount bucketsCount = 9; 94 | ContractStakingBucketTypes contractStakingBucketTypes = 10; 95 | } 96 | } 97 | -------------------------------------------------------------------------------- /proto/rpc/rpc.proto: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2018 IoTeX 2 | // This is an alpha (internal) release and is not suitable for production. This source code is provided 'as is' and no 3 | // warranties are given as to title or non-infringement, merchantability or fitness for purpose and, to the extent 4 | // permitted by law, all liability for your use of the code is disclaimed. This source code is governed by Apache 5 | // License 2.0 that can be found in the LICENSE file. 6 | 7 | // To compile the proto, run: 8 | // protoc -I. -I ./../types --go_out=plugins=grpc:$GOPATH/src *.proto 9 | syntax = "proto3"; 10 | package iotexrpc; 11 | option go_package = "github.com/iotexproject/iotex-proto/golang/iotexrpc"; 12 | option java_multiple_files = true; 13 | option java_package = "com.github.iotexproject.grpc.rpc"; 14 | 15 | import "google/protobuf/timestamp.proto"; 16 | 17 | message BlockSync { 18 | uint64 start = 2; 19 | uint64 end = 3; 20 | } 21 | 22 | message ActionSync { 23 | repeated bytes hashes = 1; 24 | } 25 | 26 | enum MessageType { 27 | UNKNOWN = 0; 28 | ACTION = 1; 29 | BLOCK = 2; 30 | CONSENSUS = 3; 31 | BLOCK_REQUEST = 4; 32 | NODE_INFO_REQUEST = 5; 33 | NODE_INFO = 6; 34 | ACTIONS = 7; 35 | ACTION_HASH = 8; 36 | ACTION_REQUEST = 9; 37 | TEST = 10001; 38 | } 39 | 40 | message BroadcastMsg { 41 | uint32 chain_id = 1; 42 | MessageType msg_type = 2; 43 | bytes msg_body = 3; 44 | string peer_id = 4; 45 | google.protobuf.Timestamp timestamp = 5; 46 | } 47 | 48 | message UnicastMsg { 49 | uint32 chain_id = 1; 50 | string addr = 2; 51 | MessageType msg_type = 3; 52 | bytes msg_body = 4; 53 | string peer_id = 5; 54 | google.protobuf.Timestamp timestamp = 6; 55 | } 56 | -------------------------------------------------------------------------------- /proto/testing/testing.proto: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2018 IoTeX 2 | // This is an alpha (internal) release and is not suitable for production. This source code is provided 'as is' and no 3 | // warranties are given as to title or non-infringement, merchantability or fitness for purpose and, to the extent 4 | // permitted by law, all liability for your use of the code is disclaimed. This source code is governed by Apache 5 | // License 2.0 that can be found in the LICENSE file. 6 | 7 | // To compile the proto, run: 8 | // protoc --go_out=plugins=grpc:$GOPATH/src *.proto 9 | syntax = "proto3"; 10 | package testingpb; 11 | option go_package = "github.com/iotexproject/iotex-proto/golang/testingpb"; 12 | option java_multiple_files = true; 13 | option java_package = "com.github.iotexproject.grpc.testing"; 14 | 15 | message TestPayload { 16 | bytes msg_body = 1; 17 | } 18 | -------------------------------------------------------------------------------- /proto/types/action.proto: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2018 IoTeX 2 | // This is an alpha (internal) release and is not suitable for production. This source code is provided 'as is' and no 3 | // warranties are given as to title or non-infringement, merchantability or fitness for purpose and, to the extent 4 | // permitted by law, all liability for your use of the code is disclaimed. This source code is governed by Apache 5 | // License 2.0 that can be found in the LICENSE file. 6 | 7 | // To compile the proto, run: 8 | // protoc --go_out=plugins=grpc:$GOPATH/src *.proto 9 | syntax = "proto3"; 10 | package iotextypes; 11 | option go_package = "github.com/iotexproject/iotex-proto/golang/iotextypes"; 12 | option java_multiple_files = true; 13 | option java_package = "com.github.iotexproject.grpc.types"; 14 | 15 | message Transfer { 16 | // used by state-based model 17 | string amount = 1; 18 | string recipient = 2; 19 | bytes payload = 3; 20 | } 21 | 22 | // Candidates and list of candidates 23 | message Candidate { 24 | string address = 1; 25 | bytes votes = 2; 26 | bytes pubKey = 3; 27 | string rewardAddress = 4; 28 | } 29 | 30 | message CandidateList { 31 | repeated Candidate candidates = 1; 32 | } 33 | 34 | message PutPollResult { 35 | uint64 height = 1; 36 | CandidateList candidates = 2; 37 | } 38 | 39 | message TxContainer { 40 | bytes raw = 1; 41 | } 42 | 43 | message Execution { 44 | string amount = 1; 45 | string contract = 2; 46 | bytes data = 3; 47 | } 48 | 49 | message AccessTuple { 50 | string address = 1; 51 | repeated string storageKeys = 2; 52 | } 53 | 54 | message BlobTxSidecar { 55 | repeated bytes blobs = 1; // Blobs needed by the blob pool 56 | repeated bytes commitments = 2; // Commitments needed by the blob pool 57 | repeated bytes proofs = 3; // Proofs needed by the blob pool 58 | } 59 | 60 | message BlobTxData { 61 | string blobFeeCap = 1; 62 | repeated bytes blobHashes = 2; 63 | BlobTxSidecar blobTxSidecar = 3; 64 | } 65 | 66 | message BlobTxSidecars { 67 | repeated bytes txHash = 1; 68 | repeated BlobTxSidecar sidecars = 2; 69 | } 70 | 71 | // create stake 72 | message StakeCreate { 73 | string candidateName = 1; 74 | string stakedAmount = 2; 75 | uint32 stakedDuration = 3; 76 | bool autoStake = 4; 77 | bytes payload = 5; 78 | } 79 | 80 | // migrate stake 81 | message StakeMigrate { 82 | uint64 bucketIndex = 1; 83 | } 84 | 85 | // unstake or withdraw 86 | message StakeReclaim { 87 | uint64 bucketIndex = 1; 88 | bytes payload = 2; 89 | } 90 | 91 | // add the amount of bucket 92 | message StakeAddDeposit { 93 | uint64 bucketIndex = 1; 94 | string amount = 2; 95 | bytes payload = 3; 96 | } 97 | 98 | // restake the duration and autoStake flag of bucket 99 | message StakeRestake { 100 | uint64 bucketIndex = 1; 101 | uint32 stakedDuration = 2; 102 | bool autoStake = 3; 103 | bytes payload = 4; 104 | } 105 | 106 | // move the bucket to vote for another candidate or transfer the ownership of bucket to another voters 107 | message StakeChangeCandidate { 108 | uint64 bucketIndex = 1; 109 | string candidateName = 2; 110 | bytes payload = 3; 111 | } 112 | 113 | message StakeTransferOwnership { 114 | uint64 bucketIndex = 1; 115 | string voterAddress = 2; 116 | bytes payload = 3; 117 | } 118 | 119 | message CandidateBasicInfo { 120 | string name = 1; 121 | string operatorAddress = 2; 122 | string rewardAddress = 3; 123 | } 124 | 125 | message CandidateRegister { 126 | CandidateBasicInfo candidate = 1; 127 | string stakedAmount = 2; 128 | uint32 stakedDuration = 3; 129 | bool autoStake = 4; 130 | string ownerAddress = 5; // if ownerAddress is absent, owner of candidate is the sender 131 | bytes payload = 6; 132 | } 133 | 134 | message CandidateTransferOwnership { 135 | string newOwnerAddress = 1; 136 | bytes payload = 2; 137 | } 138 | 139 | message CandidateActivate { 140 | uint64 bucketIndex = 1; 141 | } 142 | 143 | message CandidateEndorsement { 144 | uint64 bucketIndex = 1; 145 | bool endorse = 2; // deprecated 146 | uint32 op = 3; 147 | } 148 | 149 | message StartSubChain { 150 | // TODO: chainID chould be assigned by system and returned via a receipt 151 | uint32 chainID = 1; 152 | string securityDeposit = 2; 153 | string operationDeposit = 3; 154 | uint64 startHeight = 4; 155 | uint64 parentHeightOffset = 5; 156 | } 157 | 158 | message StopSubChain { 159 | uint32 chainID = 1; 160 | uint64 stopHeight = 2; 161 | string subChainAddress = 3; 162 | } 163 | 164 | message MerkleRoot { 165 | string name = 1; 166 | bytes value = 2; 167 | } 168 | 169 | message PutBlock { 170 | string subChainAddress = 1; 171 | uint64 height = 2; 172 | repeated MerkleRoot roots = 3; 173 | } 174 | 175 | message CreateDeposit { 176 | uint32 chainID = 1; 177 | string amount = 2; 178 | string recipient = 3; 179 | } 180 | 181 | message SettleDeposit { 182 | string amount = 1; 183 | string recipient = 2; 184 | uint64 index = 3; 185 | } 186 | 187 | // plum main chain APIs 188 | message CreatePlumChain { 189 | } 190 | 191 | message TerminatePlumChain { 192 | string subChainAddress = 1; 193 | } 194 | 195 | message PlumPutBlock { 196 | string subChainAddress = 1; 197 | uint64 height = 2; 198 | map roots = 3; 199 | } 200 | 201 | message PlumCreateDeposit { 202 | string subChainAddress = 1; 203 | string amount = 2; 204 | string recipient = 3; 205 | } 206 | 207 | message PlumStartExit { 208 | string subChainAddress = 1; 209 | bytes previousTransfer = 2; 210 | bytes previousTransferBlockProof = 3; 211 | uint64 previousTransferBlockHeight = 4; 212 | bytes exitTransfer = 5; 213 | bytes exitTransferBlockProof = 6; 214 | uint64 exitTransferBlockHeight = 7; 215 | } 216 | 217 | message PlumChallengeExit { 218 | string subChainAddress = 1; 219 | uint64 coinID = 2; 220 | bytes challengeTransfer = 3; 221 | bytes challengeTransferBlockProof = 4; 222 | uint64 challengeTransferBlockHeight = 5; 223 | } 224 | 225 | message PlumResponseChallengeExit { 226 | string subChainAddress = 1; 227 | uint64 coinID = 2; 228 | bytes challengeTransfer = 3; 229 | bytes responseTransfer = 4; 230 | bytes responseTransferBlockProof = 5; 231 | uint64 previousTransferBlockHeight = 6; 232 | } 233 | 234 | message PlumFinalizeExit { 235 | string subChainAddress = 1; 236 | uint64 coinID = 2; 237 | } 238 | 239 | // plum sub chain APIs 240 | message PlumSettleDeposit { 241 | uint64 coinID = 1; 242 | } 243 | 244 | message PlumTransfer { 245 | uint64 coinID = 1; 246 | bytes denomination = 2; 247 | string owner = 3; 248 | string recipient = 4; 249 | } 250 | 251 | message ActionCore { 252 | uint32 version = 1; 253 | uint64 nonce = 2; 254 | uint64 gasLimit = 3; 255 | string gasPrice = 4; 256 | uint32 chainID = 5; 257 | string gasTipCap = 6; 258 | string gasFeeCap = 7; 259 | BlobTxData blobTxData = 8; 260 | repeated AccessTuple accessList = 9; 261 | uint32 txType = 28; 262 | oneof action { 263 | Transfer transfer = 10; 264 | TxContainer txContainer = 11; 265 | Execution execution = 12; 266 | // FedChain 267 | StartSubChain startSubChain = 13; 268 | StopSubChain stopSubChain = 14; 269 | PutBlock putBlock = 15; 270 | CreateDeposit createDeposit = 16; 271 | SettleDeposit settleDeposit = 17; 272 | 273 | // PlumChain 274 | CreatePlumChain createPlumChain = 18; 275 | TerminatePlumChain terminatePlumChain = 19; 276 | PlumPutBlock plumPutBlock = 20; 277 | PlumCreateDeposit plumCreateDeposit = 21; 278 | PlumStartExit plumStartExit = 22; 279 | PlumChallengeExit plumChallengeExit = 23; 280 | PlumResponseChallengeExit plumResponseChallengeExit = 24; 281 | PlumFinalizeExit plumFinalizeExit = 25; 282 | PlumSettleDeposit plumSettleDeposit = 26; 283 | PlumTransfer plumTransfer = 27; 284 | 285 | // Rewarding protocol actions 286 | DepositToRewardingFund depositToRewardingFund = 30; 287 | ClaimFromRewardingFund claimFromRewardingFund = 31; 288 | GrantReward grantReward = 32; 289 | 290 | // Native staking 291 | StakeCreate stakeCreate = 40; 292 | StakeReclaim stakeUnstake = 41; 293 | StakeReclaim stakeWithdraw = 42; 294 | StakeAddDeposit stakeAddDeposit = 43; 295 | StakeRestake stakeRestake = 44; 296 | StakeChangeCandidate stakeChangeCandidate = 45; 297 | StakeTransferOwnership stakeTransferOwnership = 46; 298 | CandidateRegister candidateRegister = 47; 299 | CandidateBasicInfo candidateUpdate = 48; 300 | CandidateActivate candidateActivate = 49; 301 | CandidateEndorsement candidateEndorsement = 51; 302 | CandidateTransferOwnership candidateTransferOwnership = 52; 303 | StakeMigrate stakeMigrate = 53; 304 | 305 | PutPollResult putPollResult = 50; 306 | } 307 | } 308 | 309 | enum Encoding { 310 | option allow_alias = true; 311 | IOTEX_PROTOBUF = 0; 312 | ETHEREUM_EIP155 = 1; 313 | ETHEREUM_RLP = 1; 314 | ETHEREUM_UNPROTECTED = 2; 315 | TX_CONTAINER = 128; 316 | } 317 | 318 | message Action { 319 | ActionCore core = 1; 320 | bytes senderPubKey = 2; 321 | bytes signature = 3; 322 | Encoding encoding = 4; 323 | } 324 | 325 | // a pack of actions 326 | message Actions { 327 | repeated Action actions = 1; 328 | } 329 | 330 | message ActionHash { 331 | bytes hash = 1; 332 | } 333 | 334 | message Receipt { 335 | uint64 status = 1; 336 | uint64 blkHeight = 2; 337 | bytes actHash = 3; 338 | uint64 gasConsumed = 4; 339 | string contractAddress = 5; 340 | repeated Log logs = 6; 341 | string executionRevertMsg = 7; 342 | uint32 txIndex = 8; 343 | uint64 blobGasUsed = 9; 344 | string blobGasPrice = 10; 345 | string effectiveGasPrice = 11; 346 | } 347 | 348 | message Log { 349 | string contractAddress = 1; 350 | repeated bytes topics = 2; 351 | bytes data = 3; 352 | uint64 blkHeight = 4; 353 | bytes actHash = 5; 354 | uint32 index = 6; 355 | bytes blkHash = 7; 356 | uint32 txIndex = 8; 357 | } 358 | 359 | message Logs { 360 | repeated Log logs = 1; 361 | } 362 | 363 | // Deprecated 364 | message EvmTransfer { 365 | bytes amount = 1; 366 | string from = 2; 367 | string to = 3; 368 | } 369 | 370 | // Deprecated 371 | message EvmTransferList { 372 | repeated EvmTransfer evmTransfers = 1; 373 | } 374 | 375 | // Deprecated 376 | message ActionEvmTransfer { 377 | bytes actionHash = 1; 378 | uint64 numEvmTransfers = 2; 379 | repeated EvmTransfer evmTransfers = 3; 380 | } 381 | 382 | // Deprecated 383 | message BlockEvmTransfer { 384 | uint64 blockHeight = 1; 385 | uint64 numEvmTransfers = 2; 386 | repeated ActionEvmTransfer actionEvmTransfers = 3; 387 | } 388 | 389 | //////////////////////////////////////////////////////////////////////////////////////////////////// 390 | // BELOW ARE DEFINITIONS FOR BLOCK PRODUCER PROTOCOL 391 | //////////////////////////////////////////////////////////////////////////////////////////////////// 392 | 393 | message DepositToRewardingFund { 394 | string amount = 1; 395 | bytes data = 2; 396 | } 397 | 398 | message ClaimFromRewardingFund { 399 | string amount = 1; 400 | bytes data = 2; 401 | // address the claim of rewards for, if empty denoting the sender's address 402 | // more information see iip27: https://iotex.larksuite.com/wiki/EtDewVEz6i5BeCkyj6vudtdHsCh 403 | string address = 3; 404 | } 405 | 406 | enum RewardType { 407 | BlockReward = 0; 408 | EpochReward = 1; 409 | } 410 | 411 | message GrantReward { 412 | RewardType type = 1; 413 | uint64 height = 2; 414 | } 415 | -------------------------------------------------------------------------------- /proto/types/blockchain.proto: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2018 IoTeX 2 | // This is an alpha (internal) release and is not suitable for production. This source code is provided 'as is' and no 3 | // warranties are given as to title or non-infringement, merchantability or fitness for purpose and, to the extent 4 | // permitted by law, all liability for your use of the code is disclaimed. This source code is governed by Apache 5 | // License 2.0 that can be found in the LICENSE file. 6 | 7 | // To compile the proto, run: 8 | // protoc --go_out=plugins=grpc:$GOPATH/src *.proto 9 | syntax = "proto3"; 10 | package iotextypes; 11 | option go_package = "github.com/iotexproject/iotex-proto/golang/iotextypes"; 12 | option java_multiple_files = true; 13 | option java_package = "com.github.iotexproject.grpc.types"; 14 | 15 | import "proto/types/action.proto"; 16 | import "proto/types/endorsement.proto"; 17 | import "google/protobuf/timestamp.proto"; 18 | 19 | // header of a block 20 | message BlockHeader { 21 | BlockHeaderCore core = 1; 22 | bytes producerPubkey = 2; 23 | bytes signature = 3; 24 | } 25 | 26 | message BlockHeaderCore { 27 | uint32 version = 1; 28 | uint64 height = 2; 29 | google.protobuf.Timestamp timestamp = 3; 30 | bytes prevBlockHash = 4; 31 | bytes txRoot = 5; 32 | bytes deltaStateDigest = 6; 33 | bytes receiptRoot = 7; 34 | bytes logsBloom = 8; 35 | uint64 gasUsed = 9; 36 | bytes baseFee = 10; 37 | uint64 blobGasUsed = 11; 38 | uint64 excessBlobGas = 12; 39 | } 40 | 41 | // footer of a block 42 | message BlockFooter { 43 | repeated Endorsement endorsements = 1; 44 | google.protobuf.Timestamp timestamp = 2; 45 | } 46 | 47 | // body of a block 48 | message BlockBody { 49 | repeated Action actions = 1; 50 | } 51 | 52 | // block consists of header followed by transactions 53 | // hash of current block can be computed from header hence not stored 54 | message Block { 55 | BlockHeader header = 1; 56 | BlockBody body = 2; 57 | BlockFooter footer = 3; 58 | } 59 | 60 | // Receipts consists of a collection of recepit 61 | message Receipts { 62 | repeated Receipt receipts = 1; 63 | } 64 | 65 | message EpochData { 66 | uint64 num = 1; 67 | uint64 height = 2; 68 | uint64 gravityChainStartHeight = 3; 69 | } 70 | 71 | // Blockchain Metadata 72 | message ChainMeta { 73 | uint64 height = 1; 74 | int64 numActions = 2; 75 | int64 tps = 3; 76 | EpochData epoch = 4; 77 | float tpsFloat = 5; 78 | uint32 chainID = 6; 79 | } 80 | 81 | // Block Metadata 82 | message BlockMeta { 83 | string hash = 1; 84 | uint64 height = 2; 85 | google.protobuf.Timestamp timestamp = 3; 86 | int64 numActions = 4; 87 | string producerAddress = 5; 88 | string transferAmount = 6; 89 | string txRoot = 7; 90 | string receiptRoot = 8; 91 | string deltaStateDigest = 9; 92 | string logsBloom = 10; 93 | string previousBlockHash = 11; 94 | uint64 gasLimit = 12; 95 | uint64 gasUsed = 13; 96 | } 97 | 98 | // BlockIdentifier Metadata 99 | message BlockIdentifier { 100 | string hash = 1; 101 | uint64 height = 2; 102 | } 103 | 104 | // Account Metadata 105 | message AccountMeta { 106 | string address = 1; 107 | string balance = 2; 108 | uint64 nonce = 3; 109 | uint64 pendingNonce = 4; 110 | uint64 numActions = 5; 111 | bool isContract = 6; 112 | bytes contractByteCode = 7; 113 | } 114 | 115 | message BlockStore { 116 | Block block = 1; 117 | repeated Receipt receipts = 2; 118 | } 119 | 120 | message BlockStores { 121 | repeated BlockStore blockStores = 1; 122 | } 123 | -------------------------------------------------------------------------------- /proto/types/consensus.proto: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2019 IoTeX 2 | // This is an alpha (internal) release and is not suitable for production. This source code is provided 'as is' and no 3 | // warranties are given as to title or non-infringement, merchantability or fitness for purpose and, to the extent 4 | // permitted by law, all liability for your use of the code is disclaimed. This source code is governed by Apache 5 | // License 2.0 that can be found in the LICENSE file. 6 | 7 | // To compile the proto, run: 8 | // protoc --go_out=plugins=grpc:$GOPATH/src *.proto 9 | syntax = "proto3"; 10 | package iotextypes; 11 | option go_package = "github.com/iotexproject/iotex-proto/golang/iotextypes"; 12 | option java_multiple_files = true; 13 | option java_package = "com.github.iotexproject.grpc.types"; 14 | 15 | import "proto/types/blockchain.proto"; 16 | import "proto/types/endorsement.proto"; 17 | 18 | message BlockProposal { 19 | Block block = 1; 20 | repeated Endorsement endorsements = 2; 21 | } 22 | 23 | message ConsensusVote { 24 | enum Topic { 25 | PROPOSAL = 0; 26 | LOCK = 1; 27 | COMMIT = 2; 28 | } 29 | bytes blockHash = 1; 30 | Topic topic = 2; 31 | } 32 | 33 | message ConsensusMessage { 34 | uint64 height = 1; 35 | Endorsement endorsement = 2; 36 | oneof msg { 37 | BlockProposal blockProposal = 100; 38 | ConsensusVote vote = 101; 39 | } 40 | } 41 | -------------------------------------------------------------------------------- /proto/types/election.proto: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2019 IoTeX 2 | // This is an alpha (internal) release and is not suitable for production. This source code is provided 'as is' and no 3 | // warranties are given as to title or non-infringement, merchantability or fitness for purpose and, to the extent 4 | // permitted by law, all liability for your use of the code is disclaimed. This source code is governed by Apache 5 | // License 2.0 that can be found in the LICENSE file. 6 | 7 | // To compile the proto, run: 8 | // protoc --go_out=plugins=grpc:$GOPATH/src *.proto 9 | 10 | syntax = "proto3"; 11 | package iotextypes; 12 | option go_package = "github.com/iotexproject/iotex-proto/golang/iotextypes"; 13 | option java_multiple_files = true; 14 | option java_package = "com.github.iotexproject.grpc.types"; 15 | 16 | import "google/protobuf/duration.proto"; 17 | import "google/protobuf/timestamp.proto"; 18 | 19 | message ElectionBucket { 20 | bytes voter = 1; 21 | bytes candidate = 2; 22 | bytes amount = 3; 23 | google.protobuf.Timestamp startTime = 4; 24 | google.protobuf.Duration duration = 5; 25 | bool decay = 6; 26 | } 27 | -------------------------------------------------------------------------------- /proto/types/endorsement.proto: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2018 IoTeX 2 | // This is an alpha (internal) release and is not suitable for production. This source code is provided 'as is' and no 3 | // warranties are given as to title or non-infringement, merchantability or fitness for purpose and, to the extent 4 | // permitted by law, all liability for your use of the code is disclaimed. This source code is governed by Apache 5 | // License 2.0 that can be found in the LICENSE file. 6 | 7 | // To compile the proto, run: 8 | // protoc --go_out=plugins=grpc:$GOPATH/src *.proto 9 | syntax = "proto3"; 10 | package iotextypes; 11 | option go_package = "github.com/iotexproject/iotex-proto/golang/iotextypes"; 12 | option java_multiple_files = true; 13 | option java_package = "com.github.iotexproject.grpc.types"; 14 | 15 | import "google/protobuf/timestamp.proto"; 16 | 17 | message Endorsement { 18 | google.protobuf.Timestamp timestamp = 1; 19 | bytes endorser = 2; 20 | bytes signature = 3; 21 | } 22 | -------------------------------------------------------------------------------- /proto/types/genesis.proto: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2019 IoTeX 2 | // This is an alpha (internal) release and is not suitable for production. This source code is provided 'as is' and no 3 | // warranties are given as to title or non-infringement, merchantability or fitness for purpose and, to the extent 4 | // permitted by law, all liability for your use of the code is disclaimed. This source code is governed by Apache 5 | // License 2.0 that can be found in the LICENSE file. 6 | 7 | // To compile the proto, run: 8 | // protoc --go_out=plugins=grpc:$GOPATH/src *.proto 9 | syntax = "proto3"; 10 | package iotextypes; 11 | option go_package = "github.com/iotexproject/iotex-proto/golang/iotextypes"; 12 | option java_multiple_files = true; 13 | option java_package = "com.github.iotexproject.grpc.types"; 14 | 15 | message Genesis { 16 | GenesisBlockchain blockchain = 1; 17 | GenesisAccount account = 2; 18 | GenesisPoll poll = 3; 19 | GenesisRewarding rewarding = 4; 20 | } 21 | 22 | message GenesisBlockchain { 23 | int64 timestamp = 1; 24 | uint64 blockGasLimit = 2; 25 | uint64 actionGasLimit = 3; 26 | int64 blockInterval = 4; 27 | uint64 numSubEpochs = 5; 28 | uint64 numDelegates = 6; 29 | uint64 numCandidateDelegates = 7; 30 | bool timeBasedRotation = 8; 31 | } 32 | 33 | message GenesisAccount { 34 | repeated string initBalanceAddrs = 1; 35 | repeated string initBalances = 2; 36 | } 37 | 38 | message GenesisPoll { 39 | bool enableGravityChainVoting = 1; 40 | uint64 gravityChainStartHeight = 2; 41 | string registerContractAddress = 3; 42 | string stakingContractAddress = 4; 43 | string voteThreshold = 5; 44 | string scoreThreshold = 6; 45 | string selfStakingThreshold = 7; 46 | repeated GenesisDelegate delegates = 8; 47 | } 48 | 49 | message GenesisDelegate { 50 | string operatorAddr = 1; 51 | string rewardAddr = 2; 52 | string votes = 3; 53 | } 54 | 55 | message GenesisRewarding { 56 | string initAdminAddr = 1; 57 | string initBalance = 2; 58 | string blockReward = 3; 59 | string epochReward = 4; 60 | uint64 numDelegatesForEpochReward = 5; 61 | string foundationBonus = 6; 62 | uint64 numDelegatesForFoundationBonus = 7; 63 | uint64 foundationBonusLastEpoch = 8; 64 | uint64 productivityThreshold = 9; 65 | } -------------------------------------------------------------------------------- /proto/types/node.proto: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2018 IoTeX 2 | // This is an alpha (internal) release and is not suitable for production. This source code is provided 'as is' and no 3 | // warranties are given as to title or non-infringement, merchantability or fitness for purpose and, to the extent 4 | // permitted by law, all liability for your use of the code is disclaimed. This source code is governed by Apache 5 | // License 2.0 that can be found in the LICENSE file. 6 | 7 | // To compile the proto, run: 8 | // protoc --go_out=plugins=grpc:$GOPATH/src *.proto 9 | syntax = "proto3"; 10 | package iotextypes; 11 | option go_package = "github.com/iotexproject/iotex-proto/golang/iotextypes"; 12 | option java_multiple_files = true; 13 | option java_package = "com.github.iotexproject.grpc.types"; 14 | 15 | import "google/protobuf/timestamp.proto"; 16 | 17 | // Server Metadata 18 | message ServerMeta { 19 | string packageVersion = 1; 20 | string packageCommitID = 2; 21 | string gitStatus = 3; 22 | string goVersion = 4; 23 | string buildTime = 5; 24 | } 25 | 26 | message NodeInfoCore { 27 | string version = 1; 28 | uint64 height = 2; 29 | google.protobuf.Timestamp timestamp = 3; 30 | string address = 4; 31 | } 32 | 33 | message NodeInfo { 34 | NodeInfoCore info = 1; 35 | bytes signature = 2; 36 | } 37 | 38 | message NodeInfoRequest {} 39 | -------------------------------------------------------------------------------- /proto/types/receiptstatus.proto: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2018 IoTeX 2 | // This is an alpha (internal) release and is not suitable for production. This source code is provided 'as is' and no 3 | // warranties are given as to title or non-infringement, merchantability or fitness for purpose and, to the extent 4 | // permitted by law, all liability for your use of the code is disclaimed. This source code is governed by Apache 5 | // License 2.0 that can be found in the LICENSE file. 6 | 7 | // To compile the proto, run: 8 | // protoc --go_out=plugins=grpc:$GOPATH/src *.proto 9 | syntax = "proto3"; 10 | package iotextypes; 11 | option go_package = "github.com/iotexproject/iotex-proto/golang/iotextypes"; 12 | option java_multiple_files = true; 13 | option java_package = "com.github.iotexproject.grpc.types"; 14 | 15 | 16 | // BELOW ARE DEFINITIONS FOR EVM ERROR CLASSIFICATION IN RECEIPT STATUS 17 | enum ReceiptStatus { 18 | Failure = 0; 19 | Success = 1; 20 | 21 | //1xx for EVM ErrorCode 22 | ErrUnknown = 100; 23 | ErrOutOfGas = 101; 24 | ErrCodeStoreOutOfGas = 102; 25 | ErrDepth = 103; 26 | ErrContractAddressCollision = 104; 27 | ErrNoCompatibleInterpreter = 105; 28 | ErrExecutionReverted = 106; 29 | ErrMaxCodeSizeExceeded = 107; 30 | ErrWriteProtection = 108; 31 | ErrInvalidSubroutineEntry = 109; 32 | ErrInsufficientBalance = 110; 33 | ErrInvalidJump = 111; 34 | ErrReturnDataOutOfBounds = 112; 35 | ErrGasUintOverflow = 113; 36 | ErrInvalidRetsub = 114; 37 | ErrReturnStackExceeded = 115; 38 | ErrInvalidCode = 116; 39 | 40 | //2xx for Staking ErrorCode 41 | ErrLoadAccount = 200; 42 | ErrNotEnoughBalance = 201; 43 | ErrInvalidBucketIndex = 202; 44 | ErrUnauthorizedOperator = 203; 45 | ErrInvalidBucketType = 204; 46 | ErrCandidateNotExist = 205; 47 | ErrReduceDurationBeforeMaturity = 206; 48 | ErrUnstakeBeforeMaturity = 207; 49 | ErrWithdrawBeforeUnstake = 208; 50 | ErrWithdrawBeforeMaturity = 209; 51 | ErrCandidateAlreadyExist = 210; 52 | ErrCandidateConflict = 211; 53 | ErrInvalidBucketAmount = 212; 54 | ErrWriteAccount = 213; 55 | ErrWriteBucket = 214; 56 | ErrWriteCandidate = 215; 57 | } 58 | -------------------------------------------------------------------------------- /proto/types/state_data.proto: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2020 IoTeX 2 | // This is an alpha (internal) release and is not suitable for production. This source code is provided 'as is' and no 3 | // warranties are given as to title or non-infringement, merchantability or fitness for purpose and, to the extent 4 | // permitted by law, all liability for your use of the code is disclaimed. This source code is governed by Apache 5 | // License 2.0 that can be found in the LICENSE file. 6 | 7 | // To compile the proto, run: 8 | // protoc --go_out=plugins=grpc:$GOPATH/src *.proto 9 | syntax = "proto3"; 10 | package iotextypes; 11 | option go_package = "github.com/iotexproject/iotex-proto/golang/iotextypes"; 12 | option java_multiple_files = true; 13 | option java_package = "com.github.iotexproject.grpc.types"; 14 | 15 | import "google/protobuf/timestamp.proto"; 16 | 17 | // ProbationCandidateList (slashing #1) 18 | message ProbationCandidateList { 19 | message Info { 20 | string address = 1; 21 | uint32 count = 2; 22 | } 23 | repeated Info probationList = 1; 24 | uint32 intensityRate = 2; 25 | } 26 | 27 | message VoteBucket { 28 | uint64 index = 1; 29 | string candidateAddress = 2; 30 | string stakedAmount = 3; 31 | uint32 stakedDuration = 4; 32 | google.protobuf.Timestamp createTime = 5; 33 | google.protobuf.Timestamp stakeStartTime = 6; 34 | google.protobuf.Timestamp unstakeStartTime = 7; 35 | bool autoStake = 8; 36 | string owner = 9; 37 | string contractAddress = 10; 38 | uint64 stakedDurationBlockNumber = 11; 39 | uint64 createBlockHeight = 12; 40 | uint64 stakeStartBlockHeight = 13; 41 | uint64 unstakeStartBlockHeight = 14; 42 | uint64 endorsementExpireBlockHeight = 15; 43 | } 44 | 45 | message VoteBucketList { 46 | repeated VoteBucket buckets = 1; 47 | } 48 | 49 | message CandidateV2 { 50 | string ownerAddress = 1; 51 | string operatorAddress = 2; 52 | string rewardAddress = 3; 53 | string name = 4; 54 | string totalWeightedVotes = 5; 55 | uint64 selfStakeBucketIdx = 6; 56 | string selfStakingTokens = 7; 57 | string id = 8; 58 | } 59 | 60 | message CandidateListV2 { 61 | repeated CandidateV2 candidates = 1; 62 | } 63 | 64 | message BucketsCount { 65 | uint64 total = 1; 66 | uint64 active = 2; 67 | } 68 | 69 | message ContractStakingBucketType { 70 | string stakedAmount = 1; 71 | uint32 stakedDuration = 2; 72 | } 73 | 74 | message ContractStakingBucketTypeList { 75 | repeated ContractStakingBucketType bucketTypes = 1; 76 | } 77 | -------------------------------------------------------------------------------- /proto/types/transaction_log.proto: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2020 IoTeX 2 | // This is an alpha (internal) release and is not suitable for production. This source code is provided 'as is' and no 3 | // warranties are given as to title or non-infringement, merchantability or fitness for purpose and, to the extent 4 | // permitted by law, all liability for your use of the code is disclaimed. This source code is governed by Apache 5 | // License 2.0 that can be found in the LICENSE file. 6 | 7 | // To compile the proto, run: 8 | // protoc --go_out=plugins=grpc:$GOPATH/src *.proto 9 | syntax = "proto3"; 10 | package iotextypes; 11 | option go_package = "github.com/iotexproject/iotex-proto/golang/iotextypes"; 12 | option java_multiple_files = true; 13 | option java_package = "com.github.iotexproject.grpc.types"; 14 | 15 | message TransactionLog { 16 | message Transaction { 17 | bytes topic = 1; 18 | string amount = 2; 19 | string sender = 3; 20 | string recipient = 4; 21 | TransactionLogType type = 5; 22 | } 23 | bytes actionHash = 1; 24 | uint64 numTransactions = 2; 25 | repeated Transaction transactions = 3; 26 | } 27 | 28 | message TransactionLogs { 29 | repeated TransactionLog logs = 1; 30 | } 31 | 32 | enum TransactionLogType { 33 | IN_CONTRACT_TRANSFER = 0; 34 | WITHDRAW_BUCKET = 1; 35 | CREATE_BUCKET = 2; 36 | DEPOSIT_TO_BUCKET = 3; 37 | CANDIDATE_SELF_STAKE = 4; 38 | CANDIDATE_REGISTRATION_FEE = 5; 39 | GAS_FEE = 6; 40 | NATIVE_TRANSFER = 7; 41 | DEPOSIT_TO_REWARDING_FUND = 8; 42 | CLAIM_FROM_REWARDING_FUND = 9; 43 | BLOB_FEE = 10; 44 | PRIORITY_FEE = 11; 45 | } 46 | 47 | message TransactionStructLog { 48 | uint64 pc = 1; 49 | uint64 op = 2; 50 | uint64 gas = 3; 51 | uint64 gasCost = 4; 52 | string memory = 5; 53 | int32 memSize = 6; 54 | repeated string stack = 7; 55 | string returnData = 8; 56 | int32 depth = 9; 57 | uint64 refund = 10; 58 | string opName = 11; 59 | string error = 12; 60 | } 61 | --------------------------------------------------------------------------------