├── .github ├── dependabot.yml └── workflows │ └── ci.yml ├── .gitignore ├── LICENSE ├── Makefile ├── README.md ├── buf.gen.yaml ├── buf.lock ├── buf.yaml ├── examples.md ├── post └── v1 │ └── service.proto ├── release ├── go │ ├── go.mod │ ├── go.sum │ ├── post │ │ └── v1 │ │ │ ├── service.pb.go │ │ │ ├── service.pb.gw.go │ │ │ └── service_grpc.pb.go │ └── spacemesh │ │ ├── openapi.pb.go │ │ ├── v1 │ │ ├── activation.pb.go │ │ ├── activation.pb.gw.go │ │ ├── activation_grpc.pb.go │ │ ├── activation_types.pb.go │ │ ├── admin.pb.go │ │ ├── admin.pb.gw.go │ │ ├── admin_grpc.pb.go │ │ ├── admin_types.pb.go │ │ ├── admin_types_helper.go │ │ ├── debug.pb.go │ │ ├── debug.pb.gw.go │ │ ├── debug_grpc.pb.go │ │ ├── debug_types.pb.go │ │ ├── global_state.pb.go │ │ ├── global_state.pb.gw.go │ │ ├── global_state_grpc.pb.go │ │ ├── global_state_types.pb.go │ │ ├── mesh.pb.go │ │ ├── mesh.pb.gw.go │ │ ├── mesh_grpc.pb.go │ │ ├── mesh_types.pb.go │ │ ├── node.pb.go │ │ ├── node.pb.gw.go │ │ ├── node_grpc.pb.go │ │ ├── node_types.pb.go │ │ ├── post.pb.go │ │ ├── post.pb.gw.go │ │ ├── post_grpc.pb.go │ │ ├── post_types.pb.go │ │ ├── smesher.pb.go │ │ ├── smesher.pb.gw.go │ │ ├── smesher_grpc.pb.go │ │ ├── smesher_types.pb.go │ │ ├── tx.pb.go │ │ ├── tx.pb.gw.go │ │ ├── tx_grpc.pb.go │ │ ├── tx_types.pb.go │ │ └── types.pb.go │ │ ├── v2alpha1 │ │ ├── account.pb.go │ │ ├── account.pb.gw.go │ │ ├── account_grpc.pb.go │ │ ├── activation.pb.go │ │ ├── activation.pb.gw.go │ │ ├── activation_grpc.pb.go │ │ ├── block.pb.go │ │ ├── layer.pb.go │ │ ├── layer.pb.gw.go │ │ ├── layer_grpc.pb.go │ │ ├── malfeasance.pb.go │ │ ├── malfeasance.pb.gw.go │ │ ├── malfeasance_grpc.pb.go │ │ ├── network.pb.go │ │ ├── network.pb.gw.go │ │ ├── network_grpc.pb.go │ │ ├── node.pb.go │ │ ├── node.pb.gw.go │ │ ├── node_grpc.pb.go │ │ ├── reward.pb.go │ │ ├── reward.pb.gw.go │ │ ├── reward_grpc.pb.go │ │ ├── tx.pb.go │ │ ├── tx.pb.gw.go │ │ ├── tx_grpc.pb.go │ │ └── v2alpha1.pb.go │ │ └── v2beta1 │ │ ├── account.pb.go │ │ ├── account.pb.gw.go │ │ ├── account_grpc.pb.go │ │ ├── activation.pb.go │ │ ├── activation.pb.gw.go │ │ ├── activation_grpc.pb.go │ │ ├── block.pb.go │ │ ├── layer.pb.go │ │ ├── layer.pb.gw.go │ │ ├── layer_grpc.pb.go │ │ ├── malfeasance.pb.go │ │ ├── malfeasance.pb.gw.go │ │ ├── malfeasance_grpc.pb.go │ │ ├── network.pb.go │ │ ├── network.pb.gw.go │ │ ├── network_grpc.pb.go │ │ ├── node.pb.go │ │ ├── node.pb.gw.go │ │ ├── node_grpc.pb.go │ │ ├── reward.pb.go │ │ ├── reward.pb.gw.go │ │ ├── reward_grpc.pb.go │ │ ├── tx.pb.go │ │ ├── tx.pb.gw.go │ │ ├── tx_grpc.pb.go │ │ └── v2beta1.pb.go └── openapi │ └── swagger │ ├── index.html │ ├── package-lock.json │ ├── package.json │ ├── src │ ├── api.swagger.json │ ├── api_v2beta1.swagger.json │ └── index.js │ └── webpack.config.js └── spacemesh ├── v1 ├── activation.proto ├── activation_types.proto ├── admin.proto ├── admin_types.proto ├── debug.proto ├── debug_types.proto ├── global_state.proto ├── global_state_types.proto ├── mesh.proto ├── mesh_types.proto ├── node.proto ├── node_types.proto ├── post.proto ├── post_types.proto ├── smesher.proto ├── smesher_types.proto ├── tx.proto ├── tx_types.proto └── types.proto ├── v2alpha1 ├── account.proto ├── activation.proto ├── block.proto ├── layer.proto ├── malfeasance.proto ├── network.proto ├── node.proto ├── reward.proto ├── tx.proto └── v2alpha1.proto └── v2beta1 ├── account.proto ├── activation.proto ├── block.proto ├── layer.proto ├── malfeasance.proto ├── network.proto ├── node.proto ├── reward.proto ├── tx.proto └── v2beta1.proto /.github/dependabot.yml: -------------------------------------------------------------------------------- 1 | version: 2 2 | updates: 3 | - package-ecosystem: "gomod" 4 | directory: "/release/go" 5 | schedule: 6 | interval: "daily" 7 | - package-ecosystem: npm 8 | directory: "/release/openapi/swagger" 9 | schedule: 10 | interval: daily 11 | - package-ecosystem: "github-actions" 12 | directory: "/" 13 | schedule: 14 | interval: "daily" 15 | -------------------------------------------------------------------------------- /.github/workflows/ci.yml: -------------------------------------------------------------------------------- 1 | name: CI 2 | 3 | # Controls when the action will run. Triggers the workflow on push or pull request 4 | # events but only for the master branch 5 | on: 6 | pull_request: 7 | push: 8 | branches: [master] 9 | 10 | jobs: 11 | build: 12 | runs-on: ubuntu-24.04 13 | steps: 14 | - name: checkout 15 | uses: actions/checkout@v4 16 | - name: set up go 17 | uses: actions/setup-go@v5 18 | with: 19 | check-latest: true 20 | go-version-file: "release/go/go.mod" 21 | - name: lint and check build 22 | run: | 23 | # Runs the buf linter 24 | make lint 25 | 26 | # Checks for breaking changes against master 27 | make breaking 28 | 29 | # Create an actual build, then diff it to make sure build is up to date 30 | make check 31 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | .idea 2 | bin/ 3 | release/openapi/swagger/node_modules 4 | release/openapi/swagger/dist -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2020 Spacemesh 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /Makefile: -------------------------------------------------------------------------------- 1 | PROJECT := api 2 | 3 | # This controls the remote HTTPS git location to compare against for breaking changes in CI. 4 | # 5 | # Most CI providers only clone the branch under test and to a certain depth, so when 6 | # running buf check breaking in CI, it is generally preferable to compare against 7 | # the remote repository directly. 8 | # 9 | # Basic authentication is available, see https://buf.build/docs/inputs#https for more details. 10 | HTTPS_GIT := https://github.com/spacemeshos/api.git 11 | 12 | # This controls the remote SSH git location to compare against for breaking changes in CI. 13 | # 14 | # CI providers will typically have an SSH key installed as part of your setup for both 15 | # public and private repositories. Buf knows how to look for an SSH key at ~/.ssh/id_rsa 16 | # and a known hosts file at ~/.ssh/known_hosts or /etc/ssh/known_hosts without any further 17 | # configuration. We demo this with CircleCI. 18 | # 19 | # See https://buf.build/docs/inputs#ssh for more details. 20 | SSH_GIT := ssh://git@github.com/spacemeshos/api.git 21 | 22 | # This controls the version of buf to install and use. 23 | BUF_VERSION := 1.53.0 24 | 25 | GRPC_JSON_PROXY_VERSION := v2.26.3 26 | PROTOC_GO_VERSION := v1.36.6 27 | PROTOC_GEN_GO_VERSION := v1.5.1 28 | GO_SWAGGER_VERSION := v0.31.0 29 | 30 | # Everything below this line is meant to be static, i.e. only adjust the above variables. ### 31 | 32 | ifeq ($(OS),Windows_NT) 33 | UNAME_OS := windows 34 | ifeq ($(PROCESSOR_ARCHITECTURE),AMD64) 35 | UNAME_ARCH := x86_64 36 | endif 37 | ifeq ($(PROCESSOR_ARCHITECTURE),ARM64) 38 | UNAME_ARCH := aarch64 39 | endif 40 | PROTOC_BUILD := win64 41 | 42 | BIN_DIR := $(abspath .)/bin 43 | export PATH := $(BIN_DIR);$(PATH) 44 | else 45 | UNAME_OS := $(shell uname -s) 46 | UNAME_ARCH := $(shell uname -m) 47 | PROTOC_BUILD := $(shell echo ${UNAME_OS}-${UNAME_ARCH} | tr '[:upper:]' '[:lower:]' | sed 's/darwin/osx/' | sed 's/arm64/aarch_64/' | sed 's/aarch64/aarch_64/') 48 | 49 | BIN_DIR := $(abspath .)/bin 50 | export PATH := $(BIN_DIR):$(PATH) 51 | endif 52 | 53 | # `go install` will put binaries in $(GOBIN), avoiding 54 | # messing up with global environment. 55 | export GOBIN := $(BIN_DIR) 56 | 57 | BUF := $(BIN_DIR)/buf_$(BUF_VERSION) 58 | $(BUF): protoc-plugins deps 59 | @mkdir -p $(BIN_DIR) 60 | @rm -f $(BIN_DIR)/buf_* 61 | @curl -sSL "https://github.com/bufbuild/buf/releases/download/v$(BUF_VERSION)/buf-$(UNAME_OS)-$(UNAME_ARCH)" -o $@ 62 | @chmod +x $@ 63 | @ln -sf $@ $(BIN_DIR)/buf 64 | 65 | # Download protoc plugins 66 | protoc-plugins: 67 | @go install github.com/grpc-ecosystem/grpc-gateway/v2/protoc-gen-grpc-gateway@$(GRPC_JSON_PROXY_VERSION) 68 | @go install github.com/grpc-ecosystem/grpc-gateway/v2/protoc-gen-openapiv2@$(GRPC_JSON_PROXY_VERSION) 69 | @go install google.golang.org/protobuf/cmd/protoc-gen-go@$(PROTOC_GO_VERSION) 70 | @go install google.golang.org/grpc/cmd/protoc-gen-go-grpc@$(PROTOC_GEN_GO_VERSION) 71 | .PHONY: protoc-plugins 72 | 73 | # Download go deps 74 | .PHONY: deps 75 | deps: 76 | @go install github.com/go-swagger/go-swagger/cmd/swagger@$(GO_SWAGGER_VERSION) 77 | 78 | # local is what we run when testing locally. 79 | # This does breaking change detection against our local git repository. 80 | 81 | .PHONY: local 82 | local: $(BUF) 83 | buf breaking --against '.git#branch=master' 84 | 85 | # Linter only. This does not do breaking change detection. 86 | 87 | .PHONY: lint 88 | lint: $(BUF) 89 | buf lint 90 | 91 | # https is what we run when testing in most CI providers. 92 | # This does breaking change detection against our remote HTTPS git repository. 93 | 94 | .PHONY: breaking 95 | breaking: $(BUF) 96 | buf breaking --against "$(HTTPS_GIT)#branch=master" 97 | 98 | # Run all builds 99 | .PHONY: build 100 | build: $(BUF) 101 | buf generate 102 | 103 | sed -i'.bak' 's/"version": "version not set"/"version": "v2alpha1"/' release/openapi/swagger/src/api.swagger.json && rm -f release/openapi/swagger/src/api.swagger.json.bak 104 | swagger flatten --with-flatten=remove-unused release/openapi/swagger/src/api.swagger.json -o release/openapi/swagger/src/api.swagger.json 105 | 106 | sed -i'.bak' 's/"version": "version not set"/"version": "v2beta1"/' release/openapi/swagger/src/api_v2beta1.swagger.json && rm -f release/openapi/swagger/src/api_v2beta1.swagger.json.bak 107 | swagger flatten --with-flatten=remove-unused release/openapi/swagger/src/api_v2beta1.swagger.json -o release/openapi/swagger/src/api_v2beta1.swagger.json 108 | 109 | # Make sure build is up to date 110 | .PHONY: check 111 | check: $(BUF) 112 | @git diff --quiet || (echo "\033[0;31mWorking directory not clean!\033[0m" && git --no-pager diff && exit 1) 113 | @make build 114 | @git diff --name-only --diff-filter=AM --exit-code . || { echo "\nPlease rerun 'make build' and commit changes.\n"; exit 1; } 115 | -------------------------------------------------------------------------------- /buf.gen.yaml: -------------------------------------------------------------------------------- 1 | version: v1 2 | managed: 3 | enabled: true 4 | go_package_prefix: 5 | default: github.com/spacemeshos/api/release/go 6 | except: 7 | - buf.build/googleapis/googleapis 8 | - buf.build/grpc-ecosystem/grpc-gateway 9 | plugins: 10 | - name: go 11 | out: release/go 12 | opt: 13 | - paths=source_relative 14 | - name: go-grpc 15 | out: release/go 16 | opt: 17 | - paths=source_relative 18 | - require_unimplemented_servers=false 19 | - name: grpc-gateway 20 | out: release/go 21 | opt: 22 | - paths=source_relative 23 | - generate_unbound_methods=true 24 | - name: openapiv2 25 | out: release/openapi/swagger/src 26 | strategy: all 27 | opt: 28 | - generate_unbound_methods=true 29 | - allow_merge 30 | - visibility_restriction_selectors=V2 31 | - merge_file_name=api 32 | - use_go_templates=true 33 | - name: openapiv2 34 | out: release/openapi/swagger/src 35 | strategy: all 36 | opt: 37 | - generate_unbound_methods=true 38 | - allow_merge 39 | - visibility_restriction_selectors=v2beta1 40 | - merge_file_name=api_v2beta1 41 | - use_go_templates=true 42 | -------------------------------------------------------------------------------- /buf.lock: -------------------------------------------------------------------------------- 1 | # Generated by buf. DO NOT EDIT. 2 | version: v1 3 | deps: 4 | - remote: buf.build 5 | owner: googleapis 6 | repository: googleapis 7 | commit: f0e53af8f2fc4556b94f482688b57223 8 | digest: shake256:de26a277fc28b8b411ecf58729d78d32fcf15090ffd998a4469225b17889bfb51442eaab04bb7a8d88d203ecdf0a9febd4ffd52c18ed1c2229160c7bd353ca95 9 | - remote: buf.build 10 | owner: grpc-ecosystem 11 | repository: grpc-gateway 12 | commit: f04e50c23f5f40f786d0e8fa3fe3d713 13 | digest: shake256:67b115260e12cb2d6c5d5ce8dbbf3a095c86f0e52b84f9dbd16dec9433b218f8694bc9aadb1d45eb6fd52f5a7029977d460e2d58afb3208ab6c680e7b21c80e4 14 | -------------------------------------------------------------------------------- /buf.yaml: -------------------------------------------------------------------------------- 1 | version: v1 2 | deps: 3 | - buf.build/googleapis/googleapis 4 | - buf.build/grpc-ecosystem/grpc-gateway 5 | lint: 6 | use: 7 | - BASIC 8 | - FILE_LOWER_SNAKE_CASE 9 | - RPC_REQUEST_RESPONSE_UNIQUE 10 | - PACKAGE_NO_IMPORT_CYCLE 11 | - PACKAGE_VERSION_SUFFIX 12 | - PROTOVALIDATE 13 | - SERVICE_SUFFIX 14 | ignore: 15 | - google 16 | rpc_allow_google_protobuf_empty_requests: true 17 | rpc_allow_google_protobuf_empty_responses: true 18 | allow_comment_ignores: true 19 | breaking: 20 | use: 21 | - WIRE_JSON 22 | ignore: 23 | - ./spacemesh/v2alpha1 24 | -------------------------------------------------------------------------------- /examples.md: -------------------------------------------------------------------------------- 1 | # Usage Examples 2 | Examples below assume you are running a locan full node with the default provided reference config file. 3 | 4 | ## Working with Binary Data 5 | Binary data submitted via grpcurl to the api must be a base64 string encoded in the following way: `base64(hex.decode(hex_string))`. 6 | So for example for address represted as a hex string of `0x8C99365feE31f1cEDB056A35D7f561584679ea3c`, the base64 encoding is `jJk2X+4x8c7bBWo11/VhWEZ56jw='` 7 | 8 | ## Account Balance 9 | Returns the current and project balance of an account identified by an address. 10 | 11 | ```bash 12 | grpcurl -d '{"filter" : {"accountId":{"address":"jJk2X+4x8c7bBWo11/VhWEZ56jw="}, "account_data_flags":4}}' -plaintext localhost:9092 spacemesh.v1.GlobalStateService.AccountDataQuery 13 | { 14 | "totalResults": 1, 15 | "accountItem": [ 16 | { 17 | "accountWrapper": { 18 | "accountId": { 19 | "address": "jJk2X+4x8c7bBWo11/VhWEZ56jw=" 20 | }, 21 | "stateCurrent": { 22 | "balance": { 23 | "value": "152276432652715" 24 | } 25 | }, 26 | "stateProjected": { 27 | "balance": { 28 | "value": "152276432652715" 29 | } 30 | } 31 | } 32 | } 33 | ] 34 | } 35 | ``` 36 | 37 | 38 | ## Account Rewards 39 | Returns the smeshing rewards of a rewards account identified by its address. 40 | 41 | ```bash 42 | grpcurl -d '{"filter" : {"accountId":{"address":"jJk2X+4x8c7bBWo11/VhWEZ56jw="}, "account_data_flags":4}}' -plaintext localhost:9092 spacemesh.v1.GlobalStateService.AccountDataQuery 43 | { 44 | 45 | } 46 | ``` 47 | 48 | 49 | -------------------------------------------------------------------------------- /post/v1/service.proto: -------------------------------------------------------------------------------- 1 | syntax = "proto3"; 2 | 3 | import "google/api/visibility.proto"; 4 | 5 | package post.v1; 6 | 7 | message OperatorStatusRequest {} 8 | 9 | message OperatorStatusResponse { 10 | enum Status { 11 | UNUSED = 0; 12 | IDLE = 1; 13 | PROVING = 2; 14 | } 15 | Status status = 1; 16 | } 17 | 18 | service OperatorService { 19 | option (google.api.api_visibility).restriction = "V1"; 20 | 21 | rpc Status(OperatorStatusRequest) returns (OperatorStatusResponse); 22 | } 23 | -------------------------------------------------------------------------------- /release/go/go.mod: -------------------------------------------------------------------------------- 1 | module github.com/spacemeshos/api/release/go 2 | 3 | go 1.24.1 4 | 5 | require ( 6 | github.com/grpc-ecosystem/grpc-gateway/v2 v2.26.3 7 | google.golang.org/genproto/googleapis/api v0.0.0-20250313205543-e70fdf4c4cb4 8 | google.golang.org/genproto/googleapis/rpc v0.0.0-20250313205543-e70fdf4c4cb4 9 | google.golang.org/grpc v1.72.1 10 | google.golang.org/protobuf v1.36.6 11 | ) 12 | 13 | require ( 14 | golang.org/x/net v0.38.0 // indirect 15 | golang.org/x/sys v0.31.0 // indirect 16 | golang.org/x/text v0.23.0 // indirect 17 | ) 18 | -------------------------------------------------------------------------------- /release/go/go.sum: -------------------------------------------------------------------------------- 1 | github.com/go-logr/logr v1.4.2 h1:6pFjapn8bFcIbiKo3XT4j/BhANplGihG6tvd+8rYgrY= 2 | github.com/go-logr/logr v1.4.2/go.mod h1:9T104GzyrTigFIr8wt5mBrctHMim0Nb2HLGrmQ40KvY= 3 | github.com/go-logr/stdr v1.2.2 h1:hSWxHoqTgW2S2qGc0LTAI563KZ5YKYRhT3MFKZMbjag= 4 | github.com/go-logr/stdr v1.2.2/go.mod h1:mMo/vtBO5dYbehREoey6XUKy/eSumjCCveDpRre4VKE= 5 | github.com/golang/protobuf v1.5.4 h1:i7eJL8qZTpSEXOPTxNKhASYpMn+8e5Q6AdndVa1dWek= 6 | github.com/golang/protobuf v1.5.4/go.mod h1:lnTiLA8Wa4RWRcIUkrtSVa5nRhsEGBg48fD6rSs7xps= 7 | github.com/google/go-cmp v0.7.0 h1:wk8382ETsv4JYUZwIsn6YpYiWiBsYLSJiTsyBybVuN8= 8 | github.com/google/go-cmp v0.7.0/go.mod h1:pXiqmnSA92OHEEa9HXL2W4E7lf9JzCmGVUdgjX3N/iU= 9 | github.com/google/uuid v1.6.0 h1:NIvaJDMOsjHA8n1jAhLSgzrAzy1Hgr+hNrb57e+94F0= 10 | github.com/google/uuid v1.6.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= 11 | github.com/grpc-ecosystem/grpc-gateway/v2 v2.26.3 h1:5ZPtiqj0JL5oKWmcsq4VMaAW5ukBEgSGXEN89zeH1Jo= 12 | github.com/grpc-ecosystem/grpc-gateway/v2 v2.26.3/go.mod h1:ndYquD05frm2vACXE1nsccT4oJzjhw2arTS2cpUD1PI= 13 | go.opentelemetry.io/auto/sdk v1.1.0 h1:cH53jehLUN6UFLY71z+NDOiNJqDdPRaXzTel0sJySYA= 14 | go.opentelemetry.io/auto/sdk v1.1.0/go.mod h1:3wSPjt5PWp2RhlCcmmOial7AvC4DQqZb7a7wCow3W8A= 15 | go.opentelemetry.io/otel v1.34.0 h1:zRLXxLCgL1WyKsPVrgbSdMN4c0FMkDAskSTQP+0hdUY= 16 | go.opentelemetry.io/otel v1.34.0/go.mod h1:OWFPOQ+h4G8xpyjgqo4SxJYdDQ/qmRH+wivy7zzx9oI= 17 | go.opentelemetry.io/otel/metric v1.34.0 h1:+eTR3U0MyfWjRDhmFMxe2SsW64QrZ84AOhvqS7Y+PoQ= 18 | go.opentelemetry.io/otel/metric v1.34.0/go.mod h1:CEDrp0fy2D0MvkXE+dPV7cMi8tWZwX3dmaIhwPOaqHE= 19 | go.opentelemetry.io/otel/sdk v1.34.0 h1:95zS4k/2GOy069d321O8jWgYsW3MzVV+KuSPKp7Wr1A= 20 | go.opentelemetry.io/otel/sdk v1.34.0/go.mod h1:0e/pNiaMAqaykJGKbi+tSjWfNNHMTxoC9qANsCzbyxU= 21 | go.opentelemetry.io/otel/sdk/metric v1.34.0 h1:5CeK9ujjbFVL5c1PhLuStg1wxA7vQv7ce1EK0Gyvahk= 22 | go.opentelemetry.io/otel/sdk/metric v1.34.0/go.mod h1:jQ/r8Ze28zRKoNRdkjCZxfs6YvBTG1+YIqyFVFYec5w= 23 | go.opentelemetry.io/otel/trace v1.34.0 h1:+ouXS2V8Rd4hp4580a8q23bg0azF2nI8cqLYnC8mh/k= 24 | go.opentelemetry.io/otel/trace v1.34.0/go.mod h1:Svm7lSjQD7kG7KJ/MUHPVXSDGz2OX4h0M2jHBhmSfRE= 25 | golang.org/x/net v0.38.0 h1:vRMAPTMaeGqVhG5QyLJHqNDwecKTomGeqbnfZyKlBI8= 26 | golang.org/x/net v0.38.0/go.mod h1:ivrbrMbzFq5J41QOQh0siUuly180yBYtLp+CKbEaFx8= 27 | golang.org/x/sys v0.31.0 h1:ioabZlmFYtWhL+TRYpcnNlLwhyxaM9kWTDEmfnprqik= 28 | golang.org/x/sys v0.31.0/go.mod h1:BJP2sWEmIv4KK5OTEluFJCKSidICx8ciO85XgH3Ak8k= 29 | golang.org/x/text v0.23.0 h1:D71I7dUrlY+VX0gQShAThNGHFxZ13dGLBHQLVl1mJlY= 30 | golang.org/x/text v0.23.0/go.mod h1:/BLNzu4aZCJ1+kcD0DNRotWKage4q2rGVAg4o22unh4= 31 | google.golang.org/genproto/googleapis/api v0.0.0-20250313205543-e70fdf4c4cb4 h1:IFnXJq3UPB3oBREOodn1v1aGQeZYQclEmvWRMN0PSsY= 32 | google.golang.org/genproto/googleapis/api v0.0.0-20250313205543-e70fdf4c4cb4/go.mod h1:c8q6Z6OCqnfVIqUFJkCzKcrj8eCvUrz+K4KRzSTuANg= 33 | google.golang.org/genproto/googleapis/rpc v0.0.0-20250313205543-e70fdf4c4cb4 h1:iK2jbkWL86DXjEx0qiHcRE9dE4/Ahua5k6V8OWFb//c= 34 | google.golang.org/genproto/googleapis/rpc v0.0.0-20250313205543-e70fdf4c4cb4/go.mod h1:LuRYeWDFV6WOn90g357N17oMCaxpgCnbi/44qJvDn2I= 35 | google.golang.org/grpc v1.72.1 h1:HR03wO6eyZ7lknl75XlxABNVLLFc2PAb6mHlYh756mA= 36 | google.golang.org/grpc v1.72.1/go.mod h1:wH5Aktxcg25y1I3w7H69nHfXdOG3UiadoBtjh3izSDM= 37 | google.golang.org/protobuf v1.36.6 h1:z1NpPI8ku2WgiWnf+t9wTPsn6eP1L7ksHUlkfLvd9xY= 38 | google.golang.org/protobuf v1.36.6/go.mod h1:jduwjTPXsFjZGTmRluh+L6NjiWu7pchiJ2/5YcXBHnY= 39 | -------------------------------------------------------------------------------- /release/go/post/v1/service_grpc.pb.go: -------------------------------------------------------------------------------- 1 | // Code generated by protoc-gen-go-grpc. DO NOT EDIT. 2 | // versions: 3 | // - protoc-gen-go-grpc v1.5.1 4 | // - protoc (unknown) 5 | // source: post/v1/service.proto 6 | 7 | package postv1 8 | 9 | import ( 10 | context "context" 11 | grpc "google.golang.org/grpc" 12 | codes "google.golang.org/grpc/codes" 13 | status "google.golang.org/grpc/status" 14 | ) 15 | 16 | // This is a compile-time assertion to ensure that this generated file 17 | // is compatible with the grpc package it is being compiled against. 18 | // Requires gRPC-Go v1.64.0 or later. 19 | const _ = grpc.SupportPackageIsVersion9 20 | 21 | const ( 22 | OperatorService_Status_FullMethodName = "/post.v1.OperatorService/Status" 23 | ) 24 | 25 | // OperatorServiceClient is the client API for OperatorService service. 26 | // 27 | // For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream. 28 | type OperatorServiceClient interface { 29 | Status(ctx context.Context, in *OperatorStatusRequest, opts ...grpc.CallOption) (*OperatorStatusResponse, error) 30 | } 31 | 32 | type operatorServiceClient struct { 33 | cc grpc.ClientConnInterface 34 | } 35 | 36 | func NewOperatorServiceClient(cc grpc.ClientConnInterface) OperatorServiceClient { 37 | return &operatorServiceClient{cc} 38 | } 39 | 40 | func (c *operatorServiceClient) Status(ctx context.Context, in *OperatorStatusRequest, opts ...grpc.CallOption) (*OperatorStatusResponse, error) { 41 | cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) 42 | out := new(OperatorStatusResponse) 43 | err := c.cc.Invoke(ctx, OperatorService_Status_FullMethodName, in, out, cOpts...) 44 | if err != nil { 45 | return nil, err 46 | } 47 | return out, nil 48 | } 49 | 50 | // OperatorServiceServer is the server API for OperatorService service. 51 | // All implementations should embed UnimplementedOperatorServiceServer 52 | // for forward compatibility. 53 | type OperatorServiceServer interface { 54 | Status(context.Context, *OperatorStatusRequest) (*OperatorStatusResponse, error) 55 | } 56 | 57 | // UnimplementedOperatorServiceServer should be embedded to have 58 | // forward compatible implementations. 59 | // 60 | // NOTE: this should be embedded by value instead of pointer to avoid a nil 61 | // pointer dereference when methods are called. 62 | type UnimplementedOperatorServiceServer struct{} 63 | 64 | func (UnimplementedOperatorServiceServer) Status(context.Context, *OperatorStatusRequest) (*OperatorStatusResponse, error) { 65 | return nil, status.Errorf(codes.Unimplemented, "method Status not implemented") 66 | } 67 | func (UnimplementedOperatorServiceServer) testEmbeddedByValue() {} 68 | 69 | // UnsafeOperatorServiceServer may be embedded to opt out of forward compatibility for this service. 70 | // Use of this interface is not recommended, as added methods to OperatorServiceServer will 71 | // result in compilation errors. 72 | type UnsafeOperatorServiceServer interface { 73 | mustEmbedUnimplementedOperatorServiceServer() 74 | } 75 | 76 | func RegisterOperatorServiceServer(s grpc.ServiceRegistrar, srv OperatorServiceServer) { 77 | // If the following call pancis, it indicates UnimplementedOperatorServiceServer was 78 | // embedded by pointer and is nil. This will cause panics if an 79 | // unimplemented method is ever invoked, so we test this at initialization 80 | // time to prevent it from happening at runtime later due to I/O. 81 | if t, ok := srv.(interface{ testEmbeddedByValue() }); ok { 82 | t.testEmbeddedByValue() 83 | } 84 | s.RegisterService(&OperatorService_ServiceDesc, srv) 85 | } 86 | 87 | func _OperatorService_Status_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { 88 | in := new(OperatorStatusRequest) 89 | if err := dec(in); err != nil { 90 | return nil, err 91 | } 92 | if interceptor == nil { 93 | return srv.(OperatorServiceServer).Status(ctx, in) 94 | } 95 | info := &grpc.UnaryServerInfo{ 96 | Server: srv, 97 | FullMethod: OperatorService_Status_FullMethodName, 98 | } 99 | handler := func(ctx context.Context, req interface{}) (interface{}, error) { 100 | return srv.(OperatorServiceServer).Status(ctx, req.(*OperatorStatusRequest)) 101 | } 102 | return interceptor(ctx, in, info, handler) 103 | } 104 | 105 | // OperatorService_ServiceDesc is the grpc.ServiceDesc for OperatorService service. 106 | // It's only intended for direct use with grpc.RegisterService, 107 | // and not to be introspected or modified (even as a copy) 108 | var OperatorService_ServiceDesc = grpc.ServiceDesc{ 109 | ServiceName: "post.v1.OperatorService", 110 | HandlerType: (*OperatorServiceServer)(nil), 111 | Methods: []grpc.MethodDesc{ 112 | { 113 | MethodName: "Status", 114 | Handler: _OperatorService_Status_Handler, 115 | }, 116 | }, 117 | Streams: []grpc.StreamDesc{}, 118 | Metadata: "post/v1/service.proto", 119 | } 120 | -------------------------------------------------------------------------------- /release/go/spacemesh/openapi.pb.go: -------------------------------------------------------------------------------- 1 | // Code generated by protoc-gen-go. DO NOT EDIT. 2 | // versions: 3 | // protoc-gen-go v1.33.0 4 | // protoc (unknown) 5 | // source: spacemesh/openapi.proto 6 | 7 | package spacemeshv2 8 | 9 | import ( 10 | _ "github.com/grpc-ecosystem/grpc-gateway/v2/protoc-gen-openapiv2/options" 11 | protoreflect "google.golang.org/protobuf/reflect/protoreflect" 12 | protoimpl "google.golang.org/protobuf/runtime/protoimpl" 13 | reflect "reflect" 14 | ) 15 | 16 | const ( 17 | // Verify that this generated code is sufficiently up-to-date. 18 | _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) 19 | // Verify that runtime/protoimpl is sufficiently up-to-date. 20 | _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) 21 | ) 22 | 23 | var File_spacemesh_openapi_proto protoreflect.FileDescriptor 24 | 25 | var file_spacemesh_openapi_proto_rawDesc = []byte{ 26 | 0x0a, 0x17, 0x73, 0x70, 0x61, 0x63, 0x65, 0x6d, 0x65, 0x73, 0x68, 0x2f, 0x6f, 0x70, 0x65, 0x6e, 27 | 0x61, 0x70, 0x69, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x0c, 0x73, 0x70, 0x61, 0x63, 0x65, 28 | 0x6d, 0x65, 0x73, 0x68, 0x2e, 0x76, 0x32, 0x1a, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x63, 0x2d, 29 | 0x67, 0x65, 0x6e, 0x2d, 0x6f, 0x70, 0x65, 0x6e, 0x61, 0x70, 0x69, 0x76, 0x32, 0x2f, 0x6f, 0x70, 30 | 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x2f, 0x61, 0x6e, 0x6e, 0x6f, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 31 | 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x42, 0xff, 0x02, 0x92, 0x41, 0xcd, 0x01, 0x12, 0x84, 32 | 0x01, 0x0a, 0x0d, 0x53, 0x70, 0x61, 0x63, 0x65, 0x6d, 0x65, 0x73, 0x68, 0x20, 0x41, 0x50, 0x49, 33 | 0x22, 0x22, 0x0a, 0x09, 0x53, 0x70, 0x61, 0x63, 0x65, 0x6d, 0x65, 0x73, 0x68, 0x12, 0x15, 0x68, 34 | 0x74, 0x74, 0x70, 0x73, 0x3a, 0x2f, 0x2f, 0x73, 0x70, 0x61, 0x63, 0x65, 0x6d, 0x65, 0x73, 0x68, 35 | 0x2e, 0x69, 0x6f, 0x2f, 0x2a, 0x4f, 0x0a, 0x0b, 0x4d, 0x49, 0x54, 0x20, 0x4c, 0x69, 0x63, 0x65, 36 | 0x6e, 0x73, 0x65, 0x12, 0x40, 0x68, 0x74, 0x74, 0x70, 0x73, 0x3a, 0x2f, 0x2f, 0x67, 0x69, 0x74, 37 | 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x73, 0x70, 0x61, 0x63, 0x65, 0x6d, 0x65, 0x73, 38 | 0x68, 0x6f, 0x73, 0x2f, 0x67, 0x6f, 0x2d, 0x73, 0x70, 0x61, 0x63, 0x65, 0x6d, 0x65, 0x73, 0x68, 39 | 0x2f, 0x62, 0x6c, 0x6f, 0x62, 0x2f, 0x64, 0x65, 0x76, 0x65, 0x6c, 0x6f, 0x70, 0x2f, 0x4c, 0x49, 40 | 0x43, 0x45, 0x4e, 0x53, 0x45, 0x1a, 0x1d, 0x74, 0x65, 0x73, 0x74, 0x6e, 0x65, 0x74, 0x2d, 0x61, 41 | 0x70, 0x69, 0x2e, 0x73, 0x70, 0x61, 0x63, 0x65, 0x6d, 0x65, 0x73, 0x68, 0x2e, 0x6e, 0x65, 0x74, 42 | 0x77, 0x6f, 0x72, 0x6b, 0x2a, 0x01, 0x02, 0x32, 0x10, 0x61, 0x70, 0x70, 0x6c, 0x69, 0x63, 0x61, 43 | 0x74, 0x69, 0x6f, 0x6e, 0x2f, 0x6a, 0x73, 0x6f, 0x6e, 0x3a, 0x10, 0x61, 0x70, 0x70, 0x6c, 0x69, 44 | 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2f, 0x6a, 0x73, 0x6f, 0x6e, 0x0a, 0x10, 0x63, 0x6f, 0x6d, 45 | 0x2e, 0x73, 0x70, 0x61, 0x63, 0x65, 0x6d, 0x65, 0x73, 0x68, 0x2e, 0x76, 0x32, 0x42, 0x0c, 0x4f, 46 | 0x70, 0x65, 0x6e, 0x61, 0x70, 0x69, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x3b, 0x67, 47 | 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x73, 0x70, 0x61, 0x63, 0x65, 0x6d, 48 | 0x65, 0x73, 0x68, 0x6f, 0x73, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x72, 0x65, 0x6c, 0x65, 0x61, 0x73, 49 | 0x65, 0x2f, 0x67, 0x6f, 0x2f, 0x73, 0x70, 0x61, 0x63, 0x65, 0x6d, 0x65, 0x73, 0x68, 0x3b, 0x73, 50 | 0x70, 0x61, 0x63, 0x65, 0x6d, 0x65, 0x73, 0x68, 0x76, 0x32, 0xa2, 0x02, 0x03, 0x53, 0x58, 0x58, 51 | 0xaa, 0x02, 0x0c, 0x53, 0x70, 0x61, 0x63, 0x65, 0x6d, 0x65, 0x73, 0x68, 0x2e, 0x56, 0x32, 0xca, 52 | 0x02, 0x0c, 0x53, 0x70, 0x61, 0x63, 0x65, 0x6d, 0x65, 0x73, 0x68, 0x5c, 0x56, 0x32, 0xe2, 0x02, 53 | 0x18, 0x53, 0x70, 0x61, 0x63, 0x65, 0x6d, 0x65, 0x73, 0x68, 0x5c, 0x56, 0x32, 0x5c, 0x47, 0x50, 54 | 0x42, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0xea, 0x02, 0x0d, 0x53, 0x70, 0x61, 0x63, 55 | 0x65, 0x6d, 0x65, 0x73, 0x68, 0x3a, 0x3a, 0x56, 0x32, 56 | } 57 | 58 | var file_spacemesh_openapi_proto_goTypes = []interface{}{} 59 | var file_spacemesh_openapi_proto_depIdxs = []int32{ 60 | 0, // [0:0] is the sub-list for method output_type 61 | 0, // [0:0] is the sub-list for method input_type 62 | 0, // [0:0] is the sub-list for extension type_name 63 | 0, // [0:0] is the sub-list for extension extendee 64 | 0, // [0:0] is the sub-list for field type_name 65 | } 66 | 67 | func init() { file_spacemesh_openapi_proto_init() } 68 | func file_spacemesh_openapi_proto_init() { 69 | if File_spacemesh_openapi_proto != nil { 70 | return 71 | } 72 | type x struct{} 73 | out := protoimpl.TypeBuilder{ 74 | File: protoimpl.DescBuilder{ 75 | GoPackagePath: reflect.TypeOf(x{}).PkgPath(), 76 | RawDescriptor: file_spacemesh_openapi_proto_rawDesc, 77 | NumEnums: 0, 78 | NumMessages: 0, 79 | NumExtensions: 0, 80 | NumServices: 0, 81 | }, 82 | GoTypes: file_spacemesh_openapi_proto_goTypes, 83 | DependencyIndexes: file_spacemesh_openapi_proto_depIdxs, 84 | }.Build() 85 | File_spacemesh_openapi_proto = out.File 86 | file_spacemesh_openapi_proto_rawDesc = nil 87 | file_spacemesh_openapi_proto_goTypes = nil 88 | file_spacemesh_openapi_proto_depIdxs = nil 89 | } 90 | -------------------------------------------------------------------------------- /release/go/spacemesh/v1/activation.pb.go: -------------------------------------------------------------------------------- 1 | // Code generated by protoc-gen-go. DO NOT EDIT. 2 | // versions: 3 | // protoc-gen-go v1.36.6 4 | // protoc (unknown) 5 | // source: spacemesh/v1/activation.proto 6 | 7 | package spacemeshv1 8 | 9 | import ( 10 | _ "google.golang.org/genproto/googleapis/api/visibility" 11 | protoreflect "google.golang.org/protobuf/reflect/protoreflect" 12 | protoimpl "google.golang.org/protobuf/runtime/protoimpl" 13 | emptypb "google.golang.org/protobuf/types/known/emptypb" 14 | reflect "reflect" 15 | unsafe "unsafe" 16 | ) 17 | 18 | const ( 19 | // Verify that this generated code is sufficiently up-to-date. 20 | _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) 21 | // Verify that runtime/protoimpl is sufficiently up-to-date. 22 | _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) 23 | ) 24 | 25 | var File_spacemesh_v1_activation_proto protoreflect.FileDescriptor 26 | 27 | const file_spacemesh_v1_activation_proto_rawDesc = "" + 28 | "\n" + 29 | "\x1dspacemesh/v1/activation.proto\x12\fspacemesh.v1\x1a\x1bgoogle/protobuf/empty.proto\x1a#spacemesh/v1/activation_types.proto\x1a\x1bgoogle/api/visibility.proto2\x9d\x01\n" + 30 | "\x11ActivationService\x12:\n" + 31 | "\x03Get\x12\x18.spacemesh.v1.GetRequest\x1a\x19.spacemesh.v1.GetResponse\x12@\n" + 32 | "\aHighest\x12\x16.google.protobuf.Empty\x1a\x1d.spacemesh.v1.HighestResponse\x1a\n" + 33 | "\xfa\xd2\xe4\x93\x02\x04\x12\x02V1B\xb4\x01\n" + 34 | "\x10com.spacemesh.v1B\x0fActivationProtoP\x01Z>github.com/spacemeshos/api/release/go/spacemesh/v1;spacemeshv1\xa2\x02\x03SXX\xaa\x02\fSpacemesh.V1\xca\x02\fSpacemesh\\V1\xe2\x02\x18Spacemesh\\V1\\GPBMetadata\xea\x02\rSpacemesh::V1b\x06proto3" 35 | 36 | var file_spacemesh_v1_activation_proto_goTypes = []any{ 37 | (*GetRequest)(nil), // 0: spacemesh.v1.GetRequest 38 | (*emptypb.Empty)(nil), // 1: google.protobuf.Empty 39 | (*GetResponse)(nil), // 2: spacemesh.v1.GetResponse 40 | (*HighestResponse)(nil), // 3: spacemesh.v1.HighestResponse 41 | } 42 | var file_spacemesh_v1_activation_proto_depIdxs = []int32{ 43 | 0, // 0: spacemesh.v1.ActivationService.Get:input_type -> spacemesh.v1.GetRequest 44 | 1, // 1: spacemesh.v1.ActivationService.Highest:input_type -> google.protobuf.Empty 45 | 2, // 2: spacemesh.v1.ActivationService.Get:output_type -> spacemesh.v1.GetResponse 46 | 3, // 3: spacemesh.v1.ActivationService.Highest:output_type -> spacemesh.v1.HighestResponse 47 | 2, // [2:4] is the sub-list for method output_type 48 | 0, // [0:2] is the sub-list for method input_type 49 | 0, // [0:0] is the sub-list for extension type_name 50 | 0, // [0:0] is the sub-list for extension extendee 51 | 0, // [0:0] is the sub-list for field type_name 52 | } 53 | 54 | func init() { file_spacemesh_v1_activation_proto_init() } 55 | func file_spacemesh_v1_activation_proto_init() { 56 | if File_spacemesh_v1_activation_proto != nil { 57 | return 58 | } 59 | file_spacemesh_v1_activation_types_proto_init() 60 | type x struct{} 61 | out := protoimpl.TypeBuilder{ 62 | File: protoimpl.DescBuilder{ 63 | GoPackagePath: reflect.TypeOf(x{}).PkgPath(), 64 | RawDescriptor: unsafe.Slice(unsafe.StringData(file_spacemesh_v1_activation_proto_rawDesc), len(file_spacemesh_v1_activation_proto_rawDesc)), 65 | NumEnums: 0, 66 | NumMessages: 0, 67 | NumExtensions: 0, 68 | NumServices: 1, 69 | }, 70 | GoTypes: file_spacemesh_v1_activation_proto_goTypes, 71 | DependencyIndexes: file_spacemesh_v1_activation_proto_depIdxs, 72 | }.Build() 73 | File_spacemesh_v1_activation_proto = out.File 74 | file_spacemesh_v1_activation_proto_goTypes = nil 75 | file_spacemesh_v1_activation_proto_depIdxs = nil 76 | } 77 | -------------------------------------------------------------------------------- /release/go/spacemesh/v1/activation_grpc.pb.go: -------------------------------------------------------------------------------- 1 | // Code generated by protoc-gen-go-grpc. DO NOT EDIT. 2 | // versions: 3 | // - protoc-gen-go-grpc v1.5.1 4 | // - protoc (unknown) 5 | // source: spacemesh/v1/activation.proto 6 | 7 | package spacemeshv1 8 | 9 | import ( 10 | context "context" 11 | grpc "google.golang.org/grpc" 12 | codes "google.golang.org/grpc/codes" 13 | status "google.golang.org/grpc/status" 14 | emptypb "google.golang.org/protobuf/types/known/emptypb" 15 | ) 16 | 17 | // This is a compile-time assertion to ensure that this generated file 18 | // is compatible with the grpc package it is being compiled against. 19 | // Requires gRPC-Go v1.64.0 or later. 20 | const _ = grpc.SupportPackageIsVersion9 21 | 22 | const ( 23 | ActivationService_Get_FullMethodName = "/spacemesh.v1.ActivationService/Get" 24 | ActivationService_Highest_FullMethodName = "/spacemesh.v1.ActivationService/Highest" 25 | ) 26 | 27 | // ActivationServiceClient is the client API for ActivationService service. 28 | // 29 | // For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream. 30 | // 31 | // Exposes services to query activation transactions 32 | type ActivationServiceClient interface { 33 | // Get a single activation transaction 34 | Get(ctx context.Context, in *GetRequest, opts ...grpc.CallOption) (*GetResponse, error) 35 | // Highest returns the atx id with the highest tick count. 36 | Highest(ctx context.Context, in *emptypb.Empty, opts ...grpc.CallOption) (*HighestResponse, error) 37 | } 38 | 39 | type activationServiceClient struct { 40 | cc grpc.ClientConnInterface 41 | } 42 | 43 | func NewActivationServiceClient(cc grpc.ClientConnInterface) ActivationServiceClient { 44 | return &activationServiceClient{cc} 45 | } 46 | 47 | func (c *activationServiceClient) Get(ctx context.Context, in *GetRequest, opts ...grpc.CallOption) (*GetResponse, error) { 48 | cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) 49 | out := new(GetResponse) 50 | err := c.cc.Invoke(ctx, ActivationService_Get_FullMethodName, in, out, cOpts...) 51 | if err != nil { 52 | return nil, err 53 | } 54 | return out, nil 55 | } 56 | 57 | func (c *activationServiceClient) Highest(ctx context.Context, in *emptypb.Empty, opts ...grpc.CallOption) (*HighestResponse, error) { 58 | cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) 59 | out := new(HighestResponse) 60 | err := c.cc.Invoke(ctx, ActivationService_Highest_FullMethodName, in, out, cOpts...) 61 | if err != nil { 62 | return nil, err 63 | } 64 | return out, nil 65 | } 66 | 67 | // ActivationServiceServer is the server API for ActivationService service. 68 | // All implementations should embed UnimplementedActivationServiceServer 69 | // for forward compatibility. 70 | // 71 | // Exposes services to query activation transactions 72 | type ActivationServiceServer interface { 73 | // Get a single activation transaction 74 | Get(context.Context, *GetRequest) (*GetResponse, error) 75 | // Highest returns the atx id with the highest tick count. 76 | Highest(context.Context, *emptypb.Empty) (*HighestResponse, error) 77 | } 78 | 79 | // UnimplementedActivationServiceServer should be embedded to have 80 | // forward compatible implementations. 81 | // 82 | // NOTE: this should be embedded by value instead of pointer to avoid a nil 83 | // pointer dereference when methods are called. 84 | type UnimplementedActivationServiceServer struct{} 85 | 86 | func (UnimplementedActivationServiceServer) Get(context.Context, *GetRequest) (*GetResponse, error) { 87 | return nil, status.Errorf(codes.Unimplemented, "method Get not implemented") 88 | } 89 | func (UnimplementedActivationServiceServer) Highest(context.Context, *emptypb.Empty) (*HighestResponse, error) { 90 | return nil, status.Errorf(codes.Unimplemented, "method Highest not implemented") 91 | } 92 | func (UnimplementedActivationServiceServer) testEmbeddedByValue() {} 93 | 94 | // UnsafeActivationServiceServer may be embedded to opt out of forward compatibility for this service. 95 | // Use of this interface is not recommended, as added methods to ActivationServiceServer will 96 | // result in compilation errors. 97 | type UnsafeActivationServiceServer interface { 98 | mustEmbedUnimplementedActivationServiceServer() 99 | } 100 | 101 | func RegisterActivationServiceServer(s grpc.ServiceRegistrar, srv ActivationServiceServer) { 102 | // If the following call pancis, it indicates UnimplementedActivationServiceServer was 103 | // embedded by pointer and is nil. This will cause panics if an 104 | // unimplemented method is ever invoked, so we test this at initialization 105 | // time to prevent it from happening at runtime later due to I/O. 106 | if t, ok := srv.(interface{ testEmbeddedByValue() }); ok { 107 | t.testEmbeddedByValue() 108 | } 109 | s.RegisterService(&ActivationService_ServiceDesc, srv) 110 | } 111 | 112 | func _ActivationService_Get_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { 113 | in := new(GetRequest) 114 | if err := dec(in); err != nil { 115 | return nil, err 116 | } 117 | if interceptor == nil { 118 | return srv.(ActivationServiceServer).Get(ctx, in) 119 | } 120 | info := &grpc.UnaryServerInfo{ 121 | Server: srv, 122 | FullMethod: ActivationService_Get_FullMethodName, 123 | } 124 | handler := func(ctx context.Context, req interface{}) (interface{}, error) { 125 | return srv.(ActivationServiceServer).Get(ctx, req.(*GetRequest)) 126 | } 127 | return interceptor(ctx, in, info, handler) 128 | } 129 | 130 | func _ActivationService_Highest_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { 131 | in := new(emptypb.Empty) 132 | if err := dec(in); err != nil { 133 | return nil, err 134 | } 135 | if interceptor == nil { 136 | return srv.(ActivationServiceServer).Highest(ctx, in) 137 | } 138 | info := &grpc.UnaryServerInfo{ 139 | Server: srv, 140 | FullMethod: ActivationService_Highest_FullMethodName, 141 | } 142 | handler := func(ctx context.Context, req interface{}) (interface{}, error) { 143 | return srv.(ActivationServiceServer).Highest(ctx, req.(*emptypb.Empty)) 144 | } 145 | return interceptor(ctx, in, info, handler) 146 | } 147 | 148 | // ActivationService_ServiceDesc is the grpc.ServiceDesc for ActivationService service. 149 | // It's only intended for direct use with grpc.RegisterService, 150 | // and not to be introspected or modified (even as a copy) 151 | var ActivationService_ServiceDesc = grpc.ServiceDesc{ 152 | ServiceName: "spacemesh.v1.ActivationService", 153 | HandlerType: (*ActivationServiceServer)(nil), 154 | Methods: []grpc.MethodDesc{ 155 | { 156 | MethodName: "Get", 157 | Handler: _ActivationService_Get_Handler, 158 | }, 159 | { 160 | MethodName: "Highest", 161 | Handler: _ActivationService_Highest_Handler, 162 | }, 163 | }, 164 | Streams: []grpc.StreamDesc{}, 165 | Metadata: "spacemesh/v1/activation.proto", 166 | } 167 | -------------------------------------------------------------------------------- /release/go/spacemesh/v1/admin.pb.go: -------------------------------------------------------------------------------- 1 | // Code generated by protoc-gen-go. DO NOT EDIT. 2 | // versions: 3 | // protoc-gen-go v1.36.6 4 | // protoc (unknown) 5 | // source: spacemesh/v1/admin.proto 6 | 7 | package spacemeshv1 8 | 9 | import ( 10 | _ "google.golang.org/genproto/googleapis/api/visibility" 11 | protoreflect "google.golang.org/protobuf/reflect/protoreflect" 12 | protoimpl "google.golang.org/protobuf/runtime/protoimpl" 13 | emptypb "google.golang.org/protobuf/types/known/emptypb" 14 | reflect "reflect" 15 | unsafe "unsafe" 16 | ) 17 | 18 | const ( 19 | // Verify that this generated code is sufficiently up-to-date. 20 | _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) 21 | // Verify that runtime/protoimpl is sufficiently up-to-date. 22 | _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) 23 | ) 24 | 25 | var File_spacemesh_v1_admin_proto protoreflect.FileDescriptor 26 | 27 | const file_spacemesh_v1_admin_proto_rawDesc = "" + 28 | "\n" + 29 | "\x18spacemesh/v1/admin.proto\x12\fspacemesh.v1\x1a\x1bgoogle/protobuf/empty.proto\x1a\x1espacemesh/v1/admin_types.proto\x1a\x1bgoogle/api/visibility.proto2\xcd\x02\n" + 30 | "\fAdminService\x12c\n" + 31 | "\x10CheckpointStream\x12%.spacemesh.v1.CheckpointStreamRequest\x1a&.spacemesh.v1.CheckpointStreamResponse0\x01\x12?\n" + 32 | "\aRecover\x12\x1c.spacemesh.v1.RecoverRequest\x1a\x16.google.protobuf.Empty\x12G\n" + 33 | "\fEventsStream\x12 .spacemesh.v1.EventStreamRequest\x1a\x13.spacemesh.v1.Event0\x01\x12B\n" + 34 | "\x0ePeerInfoStream\x12\x16.google.protobuf.Empty\x1a\x16.spacemesh.v1.PeerInfo0\x01\x1a\n" + 35 | "\xfa\xd2\xe4\x93\x02\x04\x12\x02V1B\xaf\x01\n" + 36 | "\x10com.spacemesh.v1B\n" + 37 | "AdminProtoP\x01Z>github.com/spacemeshos/api/release/go/spacemesh/v1;spacemeshv1\xa2\x02\x03SXX\xaa\x02\fSpacemesh.V1\xca\x02\fSpacemesh\\V1\xe2\x02\x18Spacemesh\\V1\\GPBMetadata\xea\x02\rSpacemesh::V1b\x06proto3" 38 | 39 | var file_spacemesh_v1_admin_proto_goTypes = []any{ 40 | (*CheckpointStreamRequest)(nil), // 0: spacemesh.v1.CheckpointStreamRequest 41 | (*RecoverRequest)(nil), // 1: spacemesh.v1.RecoverRequest 42 | (*EventStreamRequest)(nil), // 2: spacemesh.v1.EventStreamRequest 43 | (*emptypb.Empty)(nil), // 3: google.protobuf.Empty 44 | (*CheckpointStreamResponse)(nil), // 4: spacemesh.v1.CheckpointStreamResponse 45 | (*Event)(nil), // 5: spacemesh.v1.Event 46 | (*PeerInfo)(nil), // 6: spacemesh.v1.PeerInfo 47 | } 48 | var file_spacemesh_v1_admin_proto_depIdxs = []int32{ 49 | 0, // 0: spacemesh.v1.AdminService.CheckpointStream:input_type -> spacemesh.v1.CheckpointStreamRequest 50 | 1, // 1: spacemesh.v1.AdminService.Recover:input_type -> spacemesh.v1.RecoverRequest 51 | 2, // 2: spacemesh.v1.AdminService.EventsStream:input_type -> spacemesh.v1.EventStreamRequest 52 | 3, // 3: spacemesh.v1.AdminService.PeerInfoStream:input_type -> google.protobuf.Empty 53 | 4, // 4: spacemesh.v1.AdminService.CheckpointStream:output_type -> spacemesh.v1.CheckpointStreamResponse 54 | 3, // 5: spacemesh.v1.AdminService.Recover:output_type -> google.protobuf.Empty 55 | 5, // 6: spacemesh.v1.AdminService.EventsStream:output_type -> spacemesh.v1.Event 56 | 6, // 7: spacemesh.v1.AdminService.PeerInfoStream:output_type -> spacemesh.v1.PeerInfo 57 | 4, // [4:8] is the sub-list for method output_type 58 | 0, // [0:4] is the sub-list for method input_type 59 | 0, // [0:0] is the sub-list for extension type_name 60 | 0, // [0:0] is the sub-list for extension extendee 61 | 0, // [0:0] is the sub-list for field type_name 62 | } 63 | 64 | func init() { file_spacemesh_v1_admin_proto_init() } 65 | func file_spacemesh_v1_admin_proto_init() { 66 | if File_spacemesh_v1_admin_proto != nil { 67 | return 68 | } 69 | file_spacemesh_v1_admin_types_proto_init() 70 | type x struct{} 71 | out := protoimpl.TypeBuilder{ 72 | File: protoimpl.DescBuilder{ 73 | GoPackagePath: reflect.TypeOf(x{}).PkgPath(), 74 | RawDescriptor: unsafe.Slice(unsafe.StringData(file_spacemesh_v1_admin_proto_rawDesc), len(file_spacemesh_v1_admin_proto_rawDesc)), 75 | NumEnums: 0, 76 | NumMessages: 0, 77 | NumExtensions: 0, 78 | NumServices: 1, 79 | }, 80 | GoTypes: file_spacemesh_v1_admin_proto_goTypes, 81 | DependencyIndexes: file_spacemesh_v1_admin_proto_depIdxs, 82 | }.Build() 83 | File_spacemesh_v1_admin_proto = out.File 84 | file_spacemesh_v1_admin_proto_goTypes = nil 85 | file_spacemesh_v1_admin_proto_depIdxs = nil 86 | } 87 | -------------------------------------------------------------------------------- /release/go/spacemesh/v1/admin_types_helper.go: -------------------------------------------------------------------------------- 1 | package spacemeshv1 2 | 3 | // without this export oneof is extremely ugly to use 4 | type IsEventDetails = isEvent_Details 5 | -------------------------------------------------------------------------------- /release/go/spacemesh/v1/debug.pb.go: -------------------------------------------------------------------------------- 1 | // Code generated by protoc-gen-go. DO NOT EDIT. 2 | // versions: 3 | // protoc-gen-go v1.36.6 4 | // protoc (unknown) 5 | // source: spacemesh/v1/debug.proto 6 | 7 | package spacemeshv1 8 | 9 | import ( 10 | _ "google.golang.org/genproto/googleapis/api/annotations" 11 | _ "google.golang.org/genproto/googleapis/api/visibility" 12 | protoreflect "google.golang.org/protobuf/reflect/protoreflect" 13 | protoimpl "google.golang.org/protobuf/runtime/protoimpl" 14 | emptypb "google.golang.org/protobuf/types/known/emptypb" 15 | reflect "reflect" 16 | unsafe "unsafe" 17 | ) 18 | 19 | const ( 20 | // Verify that this generated code is sufficiently up-to-date. 21 | _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) 22 | // Verify that runtime/protoimpl is sufficiently up-to-date. 23 | _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) 24 | ) 25 | 26 | var File_spacemesh_v1_debug_proto protoreflect.FileDescriptor 27 | 28 | const file_spacemesh_v1_debug_proto_rawDesc = "" + 29 | "\n" + 30 | "\x18spacemesh/v1/debug.proto\x12\fspacemesh.v1\x1a\x1cgoogle/api/annotations.proto\x1a\x1bgoogle/protobuf/empty.proto\x1a\x1espacemesh/v1/debug_types.proto\x1a\x1bgoogle/api/visibility.proto2\xb0\x03\n" + 31 | "\fDebugService\x12H\n" + 32 | "\vNetworkInfo\x12\x16.google.protobuf.Empty\x1a!.spacemesh.v1.NetworkInfoResponse\x12h\n" + 33 | "\bAccounts\x12\x1d.spacemesh.v1.AccountsRequest\x1a\x1e.spacemesh.v1.AccountsResponse\"\x1d\x82\xd3\xe4\x93\x02\x17:\x01*\"\x12/v1/debug/accounts\x12L\n" + 34 | "\tActiveSet\x12\x1e.spacemesh.v1.ActiveSetRequest\x1a\x1f.spacemesh.v1.ActiveSetResponse\x12C\n" + 35 | "\x0fProposalsStream\x12\x16.google.protobuf.Empty\x1a\x16.spacemesh.v1.Proposal0\x01\x12M\n" + 36 | "\x0eChangeLogLevel\x12#.spacemesh.v1.ChangeLogLevelRequest\x1a\x16.google.protobuf.Empty\x1a\n" + 37 | "\xfa\xd2\xe4\x93\x02\x04\x12\x02V1B\xaf\x01\n" + 38 | "\x10com.spacemesh.v1B\n" + 39 | "DebugProtoP\x01Z>github.com/spacemeshos/api/release/go/spacemesh/v1;spacemeshv1\xa2\x02\x03SXX\xaa\x02\fSpacemesh.V1\xca\x02\fSpacemesh\\V1\xe2\x02\x18Spacemesh\\V1\\GPBMetadata\xea\x02\rSpacemesh::V1b\x06proto3" 40 | 41 | var file_spacemesh_v1_debug_proto_goTypes = []any{ 42 | (*emptypb.Empty)(nil), // 0: google.protobuf.Empty 43 | (*AccountsRequest)(nil), // 1: spacemesh.v1.AccountsRequest 44 | (*ActiveSetRequest)(nil), // 2: spacemesh.v1.ActiveSetRequest 45 | (*ChangeLogLevelRequest)(nil), // 3: spacemesh.v1.ChangeLogLevelRequest 46 | (*NetworkInfoResponse)(nil), // 4: spacemesh.v1.NetworkInfoResponse 47 | (*AccountsResponse)(nil), // 5: spacemesh.v1.AccountsResponse 48 | (*ActiveSetResponse)(nil), // 6: spacemesh.v1.ActiveSetResponse 49 | (*Proposal)(nil), // 7: spacemesh.v1.Proposal 50 | } 51 | var file_spacemesh_v1_debug_proto_depIdxs = []int32{ 52 | 0, // 0: spacemesh.v1.DebugService.NetworkInfo:input_type -> google.protobuf.Empty 53 | 1, // 1: spacemesh.v1.DebugService.Accounts:input_type -> spacemesh.v1.AccountsRequest 54 | 2, // 2: spacemesh.v1.DebugService.ActiveSet:input_type -> spacemesh.v1.ActiveSetRequest 55 | 0, // 3: spacemesh.v1.DebugService.ProposalsStream:input_type -> google.protobuf.Empty 56 | 3, // 4: spacemesh.v1.DebugService.ChangeLogLevel:input_type -> spacemesh.v1.ChangeLogLevelRequest 57 | 4, // 5: spacemesh.v1.DebugService.NetworkInfo:output_type -> spacemesh.v1.NetworkInfoResponse 58 | 5, // 6: spacemesh.v1.DebugService.Accounts:output_type -> spacemesh.v1.AccountsResponse 59 | 6, // 7: spacemesh.v1.DebugService.ActiveSet:output_type -> spacemesh.v1.ActiveSetResponse 60 | 7, // 8: spacemesh.v1.DebugService.ProposalsStream:output_type -> spacemesh.v1.Proposal 61 | 0, // 9: spacemesh.v1.DebugService.ChangeLogLevel:output_type -> google.protobuf.Empty 62 | 5, // [5:10] is the sub-list for method output_type 63 | 0, // [0:5] is the sub-list for method input_type 64 | 0, // [0:0] is the sub-list for extension type_name 65 | 0, // [0:0] is the sub-list for extension extendee 66 | 0, // [0:0] is the sub-list for field type_name 67 | } 68 | 69 | func init() { file_spacemesh_v1_debug_proto_init() } 70 | func file_spacemesh_v1_debug_proto_init() { 71 | if File_spacemesh_v1_debug_proto != nil { 72 | return 73 | } 74 | file_spacemesh_v1_debug_types_proto_init() 75 | type x struct{} 76 | out := protoimpl.TypeBuilder{ 77 | File: protoimpl.DescBuilder{ 78 | GoPackagePath: reflect.TypeOf(x{}).PkgPath(), 79 | RawDescriptor: unsafe.Slice(unsafe.StringData(file_spacemesh_v1_debug_proto_rawDesc), len(file_spacemesh_v1_debug_proto_rawDesc)), 80 | NumEnums: 0, 81 | NumMessages: 0, 82 | NumExtensions: 0, 83 | NumServices: 1, 84 | }, 85 | GoTypes: file_spacemesh_v1_debug_proto_goTypes, 86 | DependencyIndexes: file_spacemesh_v1_debug_proto_depIdxs, 87 | }.Build() 88 | File_spacemesh_v1_debug_proto = out.File 89 | file_spacemesh_v1_debug_proto_goTypes = nil 90 | file_spacemesh_v1_debug_proto_depIdxs = nil 91 | } 92 | -------------------------------------------------------------------------------- /release/go/spacemesh/v1/global_state.pb.go: -------------------------------------------------------------------------------- 1 | // Code generated by protoc-gen-go. DO NOT EDIT. 2 | // versions: 3 | // protoc-gen-go v1.36.6 4 | // protoc (unknown) 5 | // source: spacemesh/v1/global_state.proto 6 | 7 | package spacemeshv1 8 | 9 | import ( 10 | _ "google.golang.org/genproto/googleapis/api/annotations" 11 | _ "google.golang.org/genproto/googleapis/api/visibility" 12 | protoreflect "google.golang.org/protobuf/reflect/protoreflect" 13 | protoimpl "google.golang.org/protobuf/runtime/protoimpl" 14 | reflect "reflect" 15 | unsafe "unsafe" 16 | ) 17 | 18 | const ( 19 | // Verify that this generated code is sufficiently up-to-date. 20 | _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) 21 | // Verify that runtime/protoimpl is sufficiently up-to-date. 22 | _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) 23 | ) 24 | 25 | var File_spacemesh_v1_global_state_proto protoreflect.FileDescriptor 26 | 27 | const file_spacemesh_v1_global_state_proto_rawDesc = "" + 28 | "\n" + 29 | "\x1fspacemesh/v1/global_state.proto\x12\fspacemesh.v1\x1a\x1cgoogle/api/annotations.proto\x1a%spacemesh/v1/global_state_types.proto\x1a\x1bgoogle/api/visibility.proto2\xfa\x04\n" + 30 | "\x12GlobalStateService\x12\x8a\x01\n" + 31 | "\x0fGlobalStateHash\x12$.spacemesh.v1.GlobalStateHashRequest\x1a%.spacemesh.v1.GlobalStateHashResponse\"*\x82\xd3\xe4\x93\x02$:\x01*\"\x1f/v1/globalstate/globalstatehash\x12j\n" + 32 | "\aAccount\x12\x1c.spacemesh.v1.AccountRequest\x1a\x1d.spacemesh.v1.AccountResponse\"\"\x82\xd3\xe4\x93\x02\x1c:\x01*\"\x17/v1/globalstate/account\x12\x8e\x01\n" + 33 | "\x10AccountDataQuery\x12%.spacemesh.v1.AccountDataQueryRequest\x1a&.spacemesh.v1.AccountDataQueryResponse\"+\x82\xd3\xe4\x93\x02%:\x01*\" /v1/globalstate/accountdataquery\x12f\n" + 34 | "\x11AccountDataStream\x12&.spacemesh.v1.AccountDataStreamRequest\x1a'.spacemesh.v1.AccountDataStreamResponse0\x01\x12f\n" + 35 | "\x11GlobalStateStream\x12&.spacemesh.v1.GlobalStateStreamRequest\x1a'.spacemesh.v1.GlobalStateStreamResponse0\x01\x1a\n" + 36 | "\xfa\xd2\xe4\x93\x02\x04\x12\x02V1B\xb5\x01\n" + 37 | "\x10com.spacemesh.v1B\x10GlobalStateProtoP\x01Z>github.com/spacemeshos/api/release/go/spacemesh/v1;spacemeshv1\xa2\x02\x03SXX\xaa\x02\fSpacemesh.V1\xca\x02\fSpacemesh\\V1\xe2\x02\x18Spacemesh\\V1\\GPBMetadata\xea\x02\rSpacemesh::V1b\x06proto3" 38 | 39 | var file_spacemesh_v1_global_state_proto_goTypes = []any{ 40 | (*GlobalStateHashRequest)(nil), // 0: spacemesh.v1.GlobalStateHashRequest 41 | (*AccountRequest)(nil), // 1: spacemesh.v1.AccountRequest 42 | (*AccountDataQueryRequest)(nil), // 2: spacemesh.v1.AccountDataQueryRequest 43 | (*AccountDataStreamRequest)(nil), // 3: spacemesh.v1.AccountDataStreamRequest 44 | (*GlobalStateStreamRequest)(nil), // 4: spacemesh.v1.GlobalStateStreamRequest 45 | (*GlobalStateHashResponse)(nil), // 5: spacemesh.v1.GlobalStateHashResponse 46 | (*AccountResponse)(nil), // 6: spacemesh.v1.AccountResponse 47 | (*AccountDataQueryResponse)(nil), // 7: spacemesh.v1.AccountDataQueryResponse 48 | (*AccountDataStreamResponse)(nil), // 8: spacemesh.v1.AccountDataStreamResponse 49 | (*GlobalStateStreamResponse)(nil), // 9: spacemesh.v1.GlobalStateStreamResponse 50 | } 51 | var file_spacemesh_v1_global_state_proto_depIdxs = []int32{ 52 | 0, // 0: spacemesh.v1.GlobalStateService.GlobalStateHash:input_type -> spacemesh.v1.GlobalStateHashRequest 53 | 1, // 1: spacemesh.v1.GlobalStateService.Account:input_type -> spacemesh.v1.AccountRequest 54 | 2, // 2: spacemesh.v1.GlobalStateService.AccountDataQuery:input_type -> spacemesh.v1.AccountDataQueryRequest 55 | 3, // 3: spacemesh.v1.GlobalStateService.AccountDataStream:input_type -> spacemesh.v1.AccountDataStreamRequest 56 | 4, // 4: spacemesh.v1.GlobalStateService.GlobalStateStream:input_type -> spacemesh.v1.GlobalStateStreamRequest 57 | 5, // 5: spacemesh.v1.GlobalStateService.GlobalStateHash:output_type -> spacemesh.v1.GlobalStateHashResponse 58 | 6, // 6: spacemesh.v1.GlobalStateService.Account:output_type -> spacemesh.v1.AccountResponse 59 | 7, // 7: spacemesh.v1.GlobalStateService.AccountDataQuery:output_type -> spacemesh.v1.AccountDataQueryResponse 60 | 8, // 8: spacemesh.v1.GlobalStateService.AccountDataStream:output_type -> spacemesh.v1.AccountDataStreamResponse 61 | 9, // 9: spacemesh.v1.GlobalStateService.GlobalStateStream:output_type -> spacemesh.v1.GlobalStateStreamResponse 62 | 5, // [5:10] is the sub-list for method output_type 63 | 0, // [0:5] is the sub-list for method input_type 64 | 0, // [0:0] is the sub-list for extension type_name 65 | 0, // [0:0] is the sub-list for extension extendee 66 | 0, // [0:0] is the sub-list for field type_name 67 | } 68 | 69 | func init() { file_spacemesh_v1_global_state_proto_init() } 70 | func file_spacemesh_v1_global_state_proto_init() { 71 | if File_spacemesh_v1_global_state_proto != nil { 72 | return 73 | } 74 | file_spacemesh_v1_global_state_types_proto_init() 75 | type x struct{} 76 | out := protoimpl.TypeBuilder{ 77 | File: protoimpl.DescBuilder{ 78 | GoPackagePath: reflect.TypeOf(x{}).PkgPath(), 79 | RawDescriptor: unsafe.Slice(unsafe.StringData(file_spacemesh_v1_global_state_proto_rawDesc), len(file_spacemesh_v1_global_state_proto_rawDesc)), 80 | NumEnums: 0, 81 | NumMessages: 0, 82 | NumExtensions: 0, 83 | NumServices: 1, 84 | }, 85 | GoTypes: file_spacemesh_v1_global_state_proto_goTypes, 86 | DependencyIndexes: file_spacemesh_v1_global_state_proto_depIdxs, 87 | }.Build() 88 | File_spacemesh_v1_global_state_proto = out.File 89 | file_spacemesh_v1_global_state_proto_goTypes = nil 90 | file_spacemesh_v1_global_state_proto_depIdxs = nil 91 | } 92 | -------------------------------------------------------------------------------- /release/go/spacemesh/v1/node.pb.go: -------------------------------------------------------------------------------- 1 | // Code generated by protoc-gen-go. DO NOT EDIT. 2 | // versions: 3 | // protoc-gen-go v1.36.6 4 | // protoc (unknown) 5 | // source: spacemesh/v1/node.proto 6 | 7 | package spacemeshv1 8 | 9 | import ( 10 | _ "google.golang.org/genproto/googleapis/api/annotations" 11 | _ "google.golang.org/genproto/googleapis/api/visibility" 12 | protoreflect "google.golang.org/protobuf/reflect/protoreflect" 13 | protoimpl "google.golang.org/protobuf/runtime/protoimpl" 14 | emptypb "google.golang.org/protobuf/types/known/emptypb" 15 | reflect "reflect" 16 | unsafe "unsafe" 17 | ) 18 | 19 | const ( 20 | // Verify that this generated code is sufficiently up-to-date. 21 | _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) 22 | // Verify that runtime/protoimpl is sufficiently up-to-date. 23 | _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) 24 | ) 25 | 26 | var File_spacemesh_v1_node_proto protoreflect.FileDescriptor 27 | 28 | const file_spacemesh_v1_node_proto_rawDesc = "" + 29 | "\n" + 30 | "\x17spacemesh/v1/node.proto\x12\fspacemesh.v1\x1a\x1cgoogle/api/annotations.proto\x1a\x1bgoogle/protobuf/empty.proto\x1a\x1dspacemesh/v1/node_types.proto\x1a\x1bgoogle/api/visibility.proto2\xf8\x04\n" + 31 | "\vNodeService\x12W\n" + 32 | "\x04Echo\x12\x19.spacemesh.v1.EchoRequest\x1a\x1a.spacemesh.v1.EchoResponse\"\x18\x82\xd3\xe4\x93\x02\x12:\x01*\"\r/v1/node/echo\x12Z\n" + 33 | "\aVersion\x12\x16.google.protobuf.Empty\x1a\x1d.spacemesh.v1.VersionResponse\"\x18\x82\xd3\xe4\x93\x02\x12\"\x10/v1/node/version\x12T\n" + 34 | "\x05Build\x12\x16.google.protobuf.Empty\x1a\x1b.spacemesh.v1.BuildResponse\"\x16\x82\xd3\xe4\x93\x02\x10\"\x0e/v1/node/build\x12_\n" + 35 | "\x06Status\x12\x1b.spacemesh.v1.StatusRequest\x1a\x1c.spacemesh.v1.StatusResponse\"\x1a\x82\xd3\xe4\x93\x02\x14:\x01*\"\x0f/v1/node/status\x12B\n" + 36 | "\bNodeInfo\x12\x16.google.protobuf.Empty\x1a\x1e.spacemesh.v1.NodeInfoResponse\x12W\n" + 37 | "\fStatusStream\x12!.spacemesh.v1.StatusStreamRequest\x1a\".spacemesh.v1.StatusStreamResponse0\x01\x12T\n" + 38 | "\vErrorStream\x12 .spacemesh.v1.ErrorStreamRequest\x1a!.spacemesh.v1.ErrorStreamResponse0\x01\x1a\n" + 39 | "\xfa\xd2\xe4\x93\x02\x04\x12\x02V1B\xae\x01\n" + 40 | "\x10com.spacemesh.v1B\tNodeProtoP\x01Z>github.com/spacemeshos/api/release/go/spacemesh/v1;spacemeshv1\xa2\x02\x03SXX\xaa\x02\fSpacemesh.V1\xca\x02\fSpacemesh\\V1\xe2\x02\x18Spacemesh\\V1\\GPBMetadata\xea\x02\rSpacemesh::V1b\x06proto3" 41 | 42 | var file_spacemesh_v1_node_proto_goTypes = []any{ 43 | (*EchoRequest)(nil), // 0: spacemesh.v1.EchoRequest 44 | (*emptypb.Empty)(nil), // 1: google.protobuf.Empty 45 | (*StatusRequest)(nil), // 2: spacemesh.v1.StatusRequest 46 | (*StatusStreamRequest)(nil), // 3: spacemesh.v1.StatusStreamRequest 47 | (*ErrorStreamRequest)(nil), // 4: spacemesh.v1.ErrorStreamRequest 48 | (*EchoResponse)(nil), // 5: spacemesh.v1.EchoResponse 49 | (*VersionResponse)(nil), // 6: spacemesh.v1.VersionResponse 50 | (*BuildResponse)(nil), // 7: spacemesh.v1.BuildResponse 51 | (*StatusResponse)(nil), // 8: spacemesh.v1.StatusResponse 52 | (*NodeInfoResponse)(nil), // 9: spacemesh.v1.NodeInfoResponse 53 | (*StatusStreamResponse)(nil), // 10: spacemesh.v1.StatusStreamResponse 54 | (*ErrorStreamResponse)(nil), // 11: spacemesh.v1.ErrorStreamResponse 55 | } 56 | var file_spacemesh_v1_node_proto_depIdxs = []int32{ 57 | 0, // 0: spacemesh.v1.NodeService.Echo:input_type -> spacemesh.v1.EchoRequest 58 | 1, // 1: spacemesh.v1.NodeService.Version:input_type -> google.protobuf.Empty 59 | 1, // 2: spacemesh.v1.NodeService.Build:input_type -> google.protobuf.Empty 60 | 2, // 3: spacemesh.v1.NodeService.Status:input_type -> spacemesh.v1.StatusRequest 61 | 1, // 4: spacemesh.v1.NodeService.NodeInfo:input_type -> google.protobuf.Empty 62 | 3, // 5: spacemesh.v1.NodeService.StatusStream:input_type -> spacemesh.v1.StatusStreamRequest 63 | 4, // 6: spacemesh.v1.NodeService.ErrorStream:input_type -> spacemesh.v1.ErrorStreamRequest 64 | 5, // 7: spacemesh.v1.NodeService.Echo:output_type -> spacemesh.v1.EchoResponse 65 | 6, // 8: spacemesh.v1.NodeService.Version:output_type -> spacemesh.v1.VersionResponse 66 | 7, // 9: spacemesh.v1.NodeService.Build:output_type -> spacemesh.v1.BuildResponse 67 | 8, // 10: spacemesh.v1.NodeService.Status:output_type -> spacemesh.v1.StatusResponse 68 | 9, // 11: spacemesh.v1.NodeService.NodeInfo:output_type -> spacemesh.v1.NodeInfoResponse 69 | 10, // 12: spacemesh.v1.NodeService.StatusStream:output_type -> spacemesh.v1.StatusStreamResponse 70 | 11, // 13: spacemesh.v1.NodeService.ErrorStream:output_type -> spacemesh.v1.ErrorStreamResponse 71 | 7, // [7:14] is the sub-list for method output_type 72 | 0, // [0:7] is the sub-list for method input_type 73 | 0, // [0:0] is the sub-list for extension type_name 74 | 0, // [0:0] is the sub-list for extension extendee 75 | 0, // [0:0] is the sub-list for field type_name 76 | } 77 | 78 | func init() { file_spacemesh_v1_node_proto_init() } 79 | func file_spacemesh_v1_node_proto_init() { 80 | if File_spacemesh_v1_node_proto != nil { 81 | return 82 | } 83 | file_spacemesh_v1_node_types_proto_init() 84 | type x struct{} 85 | out := protoimpl.TypeBuilder{ 86 | File: protoimpl.DescBuilder{ 87 | GoPackagePath: reflect.TypeOf(x{}).PkgPath(), 88 | RawDescriptor: unsafe.Slice(unsafe.StringData(file_spacemesh_v1_node_proto_rawDesc), len(file_spacemesh_v1_node_proto_rawDesc)), 89 | NumEnums: 0, 90 | NumMessages: 0, 91 | NumExtensions: 0, 92 | NumServices: 1, 93 | }, 94 | GoTypes: file_spacemesh_v1_node_proto_goTypes, 95 | DependencyIndexes: file_spacemesh_v1_node_proto_depIdxs, 96 | }.Build() 97 | File_spacemesh_v1_node_proto = out.File 98 | file_spacemesh_v1_node_proto_goTypes = nil 99 | file_spacemesh_v1_node_proto_depIdxs = nil 100 | } 101 | -------------------------------------------------------------------------------- /release/go/spacemesh/v1/post.pb.go: -------------------------------------------------------------------------------- 1 | // Code generated by protoc-gen-go. DO NOT EDIT. 2 | // versions: 3 | // protoc-gen-go v1.36.6 4 | // protoc (unknown) 5 | // source: spacemesh/v1/post.proto 6 | 7 | package spacemeshv1 8 | 9 | import ( 10 | _ "google.golang.org/genproto/googleapis/api/visibility" 11 | protoreflect "google.golang.org/protobuf/reflect/protoreflect" 12 | protoimpl "google.golang.org/protobuf/runtime/protoimpl" 13 | reflect "reflect" 14 | unsafe "unsafe" 15 | ) 16 | 17 | const ( 18 | // Verify that this generated code is sufficiently up-to-date. 19 | _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) 20 | // Verify that runtime/protoimpl is sufficiently up-to-date. 21 | _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) 22 | ) 23 | 24 | var File_spacemesh_v1_post_proto protoreflect.FileDescriptor 25 | 26 | const file_spacemesh_v1_post_proto_rawDesc = "" + 27 | "\n" + 28 | "\x17spacemesh/v1/post.proto\x12\fspacemesh.v1\x1a\x1dspacemesh/v1/post_types.proto\x1a\x1bgoogle/api/visibility.proto2c\n" + 29 | "\vPostService\x12H\n" + 30 | "\bRegister\x12\x1d.spacemesh.v1.ServiceResponse\x1a\x19.spacemesh.v1.NodeRequest(\x010\x01\x1a\n" + 31 | "\xfa\xd2\xe4\x93\x02\x04\x12\x02V12n\n" + 32 | "\x0fPostInfoService\x12O\n" + 33 | "\n" + 34 | "PostStates\x12\x1f.spacemesh.v1.PostStatesRequest\x1a .spacemesh.v1.PostStatesResponse\x1a\n" + 35 | "\xfa\xd2\xe4\x93\x02\x04\x12\x02V1B\xae\x01\n" + 36 | "\x10com.spacemesh.v1B\tPostProtoP\x01Z>github.com/spacemeshos/api/release/go/spacemesh/v1;spacemeshv1\xa2\x02\x03SXX\xaa\x02\fSpacemesh.V1\xca\x02\fSpacemesh\\V1\xe2\x02\x18Spacemesh\\V1\\GPBMetadata\xea\x02\rSpacemesh::V1b\x06proto3" 37 | 38 | var file_spacemesh_v1_post_proto_goTypes = []any{ 39 | (*ServiceResponse)(nil), // 0: spacemesh.v1.ServiceResponse 40 | (*PostStatesRequest)(nil), // 1: spacemesh.v1.PostStatesRequest 41 | (*NodeRequest)(nil), // 2: spacemesh.v1.NodeRequest 42 | (*PostStatesResponse)(nil), // 3: spacemesh.v1.PostStatesResponse 43 | } 44 | var file_spacemesh_v1_post_proto_depIdxs = []int32{ 45 | 0, // 0: spacemesh.v1.PostService.Register:input_type -> spacemesh.v1.ServiceResponse 46 | 1, // 1: spacemesh.v1.PostInfoService.PostStates:input_type -> spacemesh.v1.PostStatesRequest 47 | 2, // 2: spacemesh.v1.PostService.Register:output_type -> spacemesh.v1.NodeRequest 48 | 3, // 3: spacemesh.v1.PostInfoService.PostStates:output_type -> spacemesh.v1.PostStatesResponse 49 | 2, // [2:4] is the sub-list for method output_type 50 | 0, // [0:2] is the sub-list for method input_type 51 | 0, // [0:0] is the sub-list for extension type_name 52 | 0, // [0:0] is the sub-list for extension extendee 53 | 0, // [0:0] is the sub-list for field type_name 54 | } 55 | 56 | func init() { file_spacemesh_v1_post_proto_init() } 57 | func file_spacemesh_v1_post_proto_init() { 58 | if File_spacemesh_v1_post_proto != nil { 59 | return 60 | } 61 | file_spacemesh_v1_post_types_proto_init() 62 | type x struct{} 63 | out := protoimpl.TypeBuilder{ 64 | File: protoimpl.DescBuilder{ 65 | GoPackagePath: reflect.TypeOf(x{}).PkgPath(), 66 | RawDescriptor: unsafe.Slice(unsafe.StringData(file_spacemesh_v1_post_proto_rawDesc), len(file_spacemesh_v1_post_proto_rawDesc)), 67 | NumEnums: 0, 68 | NumMessages: 0, 69 | NumExtensions: 0, 70 | NumServices: 2, 71 | }, 72 | GoTypes: file_spacemesh_v1_post_proto_goTypes, 73 | DependencyIndexes: file_spacemesh_v1_post_proto_depIdxs, 74 | }.Build() 75 | File_spacemesh_v1_post_proto = out.File 76 | file_spacemesh_v1_post_proto_goTypes = nil 77 | file_spacemesh_v1_post_proto_depIdxs = nil 78 | } 79 | -------------------------------------------------------------------------------- /release/go/spacemesh/v1/tx.pb.go: -------------------------------------------------------------------------------- 1 | // Code generated by protoc-gen-go. DO NOT EDIT. 2 | // versions: 3 | // protoc-gen-go v1.36.6 4 | // protoc (unknown) 5 | // source: spacemesh/v1/tx.proto 6 | 7 | package spacemeshv1 8 | 9 | import ( 10 | _ "google.golang.org/genproto/googleapis/api/annotations" 11 | _ "google.golang.org/genproto/googleapis/api/visibility" 12 | protoreflect "google.golang.org/protobuf/reflect/protoreflect" 13 | protoimpl "google.golang.org/protobuf/runtime/protoimpl" 14 | reflect "reflect" 15 | unsafe "unsafe" 16 | ) 17 | 18 | const ( 19 | // Verify that this generated code is sufficiently up-to-date. 20 | _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) 21 | // Verify that runtime/protoimpl is sufficiently up-to-date. 22 | _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) 23 | ) 24 | 25 | var File_spacemesh_v1_tx_proto protoreflect.FileDescriptor 26 | 27 | const file_spacemesh_v1_tx_proto_rawDesc = "" + 28 | "\n" + 29 | "\x15spacemesh/v1/tx.proto\x12\fspacemesh.v1\x1a\x1cgoogle/api/annotations.proto\x1a\x1bspacemesh/v1/tx_types.proto\x1a\x1bgoogle/api/visibility.proto2\xb2\x05\n" + 30 | "\x12TransactionService\x12\x92\x01\n" + 31 | "\x11SubmitTransaction\x12&.spacemesh.v1.SubmitTransactionRequest\x1a'.spacemesh.v1.SubmitTransactionResponse\",\x82\xd3\xe4\x93\x02&:\x01*\"!/v1/transaction/submittransaction\x12\x8e\x01\n" + 32 | "\x10ParseTransaction\x12%.spacemesh.v1.ParseTransactionRequest\x1a&.spacemesh.v1.ParseTransactionResponse\"+\x82\xd3\xe4\x93\x02%:\x01*\" /v1/transaction/parsetransaction\x12\x92\x01\n" + 33 | "\x11TransactionsState\x12&.spacemesh.v1.TransactionsStateRequest\x1a'.spacemesh.v1.TransactionsStateResponse\",\x82\xd3\xe4\x93\x02&:\x01*\"!/v1/transaction/transactionsstate\x12x\n" + 34 | "\x17TransactionsStateStream\x12,.spacemesh.v1.TransactionsStateStreamRequest\x1a-.spacemesh.v1.TransactionsStateStreamResponse0\x01\x12[\n" + 35 | "\rStreamResults\x12'.spacemesh.v1.TransactionResultsRequest\x1a\x1f.spacemesh.v1.TransactionResult0\x01\x1a\n" + 36 | "\xfa\xd2\xe4\x93\x02\x04\x12\x02V1B\xac\x01\n" + 37 | "\x10com.spacemesh.v1B\aTxProtoP\x01Z>github.com/spacemeshos/api/release/go/spacemesh/v1;spacemeshv1\xa2\x02\x03SXX\xaa\x02\fSpacemesh.V1\xca\x02\fSpacemesh\\V1\xe2\x02\x18Spacemesh\\V1\\GPBMetadata\xea\x02\rSpacemesh::V1b\x06proto3" 38 | 39 | var file_spacemesh_v1_tx_proto_goTypes = []any{ 40 | (*SubmitTransactionRequest)(nil), // 0: spacemesh.v1.SubmitTransactionRequest 41 | (*ParseTransactionRequest)(nil), // 1: spacemesh.v1.ParseTransactionRequest 42 | (*TransactionsStateRequest)(nil), // 2: spacemesh.v1.TransactionsStateRequest 43 | (*TransactionsStateStreamRequest)(nil), // 3: spacemesh.v1.TransactionsStateStreamRequest 44 | (*TransactionResultsRequest)(nil), // 4: spacemesh.v1.TransactionResultsRequest 45 | (*SubmitTransactionResponse)(nil), // 5: spacemesh.v1.SubmitTransactionResponse 46 | (*ParseTransactionResponse)(nil), // 6: spacemesh.v1.ParseTransactionResponse 47 | (*TransactionsStateResponse)(nil), // 7: spacemesh.v1.TransactionsStateResponse 48 | (*TransactionsStateStreamResponse)(nil), // 8: spacemesh.v1.TransactionsStateStreamResponse 49 | (*TransactionResult)(nil), // 9: spacemesh.v1.TransactionResult 50 | } 51 | var file_spacemesh_v1_tx_proto_depIdxs = []int32{ 52 | 0, // 0: spacemesh.v1.TransactionService.SubmitTransaction:input_type -> spacemesh.v1.SubmitTransactionRequest 53 | 1, // 1: spacemesh.v1.TransactionService.ParseTransaction:input_type -> spacemesh.v1.ParseTransactionRequest 54 | 2, // 2: spacemesh.v1.TransactionService.TransactionsState:input_type -> spacemesh.v1.TransactionsStateRequest 55 | 3, // 3: spacemesh.v1.TransactionService.TransactionsStateStream:input_type -> spacemesh.v1.TransactionsStateStreamRequest 56 | 4, // 4: spacemesh.v1.TransactionService.StreamResults:input_type -> spacemesh.v1.TransactionResultsRequest 57 | 5, // 5: spacemesh.v1.TransactionService.SubmitTransaction:output_type -> spacemesh.v1.SubmitTransactionResponse 58 | 6, // 6: spacemesh.v1.TransactionService.ParseTransaction:output_type -> spacemesh.v1.ParseTransactionResponse 59 | 7, // 7: spacemesh.v1.TransactionService.TransactionsState:output_type -> spacemesh.v1.TransactionsStateResponse 60 | 8, // 8: spacemesh.v1.TransactionService.TransactionsStateStream:output_type -> spacemesh.v1.TransactionsStateStreamResponse 61 | 9, // 9: spacemesh.v1.TransactionService.StreamResults:output_type -> spacemesh.v1.TransactionResult 62 | 5, // [5:10] is the sub-list for method output_type 63 | 0, // [0:5] is the sub-list for method input_type 64 | 0, // [0:0] is the sub-list for extension type_name 65 | 0, // [0:0] is the sub-list for extension extendee 66 | 0, // [0:0] is the sub-list for field type_name 67 | } 68 | 69 | func init() { file_spacemesh_v1_tx_proto_init() } 70 | func file_spacemesh_v1_tx_proto_init() { 71 | if File_spacemesh_v1_tx_proto != nil { 72 | return 73 | } 74 | file_spacemesh_v1_tx_types_proto_init() 75 | type x struct{} 76 | out := protoimpl.TypeBuilder{ 77 | File: protoimpl.DescBuilder{ 78 | GoPackagePath: reflect.TypeOf(x{}).PkgPath(), 79 | RawDescriptor: unsafe.Slice(unsafe.StringData(file_spacemesh_v1_tx_proto_rawDesc), len(file_spacemesh_v1_tx_proto_rawDesc)), 80 | NumEnums: 0, 81 | NumMessages: 0, 82 | NumExtensions: 0, 83 | NumServices: 1, 84 | }, 85 | GoTypes: file_spacemesh_v1_tx_proto_goTypes, 86 | DependencyIndexes: file_spacemesh_v1_tx_proto_depIdxs, 87 | }.Build() 88 | File_spacemesh_v1_tx_proto = out.File 89 | file_spacemesh_v1_tx_proto_goTypes = nil 90 | file_spacemesh_v1_tx_proto_depIdxs = nil 91 | } 92 | -------------------------------------------------------------------------------- /release/go/spacemesh/v2alpha1/account_grpc.pb.go: -------------------------------------------------------------------------------- 1 | // Code generated by protoc-gen-go-grpc. DO NOT EDIT. 2 | // versions: 3 | // - protoc-gen-go-grpc v1.5.1 4 | // - protoc (unknown) 5 | // source: spacemesh/v2alpha1/account.proto 6 | 7 | package spacemeshv2alpha1 8 | 9 | import ( 10 | context "context" 11 | grpc "google.golang.org/grpc" 12 | codes "google.golang.org/grpc/codes" 13 | status "google.golang.org/grpc/status" 14 | ) 15 | 16 | // This is a compile-time assertion to ensure that this generated file 17 | // is compatible with the grpc package it is being compiled against. 18 | // Requires gRPC-Go v1.64.0 or later. 19 | const _ = grpc.SupportPackageIsVersion9 20 | 21 | const ( 22 | AccountService_List_FullMethodName = "/spacemesh.v2alpha1.AccountService/List" 23 | ) 24 | 25 | // AccountServiceClient is the client API for AccountService service. 26 | // 27 | // For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream. 28 | type AccountServiceClient interface { 29 | // List of accounts 30 | // 31 | // List is a method that takes an "{{.RequestType.Name}}" body and returns an "{{.ResponseType.Name}}". 32 | // This method is used to retrieve a list of accounts based on the provided request parameters. 33 | List(ctx context.Context, in *AccountRequest, opts ...grpc.CallOption) (*AccountList, error) 34 | } 35 | 36 | type accountServiceClient struct { 37 | cc grpc.ClientConnInterface 38 | } 39 | 40 | func NewAccountServiceClient(cc grpc.ClientConnInterface) AccountServiceClient { 41 | return &accountServiceClient{cc} 42 | } 43 | 44 | func (c *accountServiceClient) List(ctx context.Context, in *AccountRequest, opts ...grpc.CallOption) (*AccountList, error) { 45 | cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) 46 | out := new(AccountList) 47 | err := c.cc.Invoke(ctx, AccountService_List_FullMethodName, in, out, cOpts...) 48 | if err != nil { 49 | return nil, err 50 | } 51 | return out, nil 52 | } 53 | 54 | // AccountServiceServer is the server API for AccountService service. 55 | // All implementations should embed UnimplementedAccountServiceServer 56 | // for forward compatibility. 57 | type AccountServiceServer interface { 58 | // List of accounts 59 | // 60 | // List is a method that takes an "{{.RequestType.Name}}" body and returns an "{{.ResponseType.Name}}". 61 | // This method is used to retrieve a list of accounts based on the provided request parameters. 62 | List(context.Context, *AccountRequest) (*AccountList, error) 63 | } 64 | 65 | // UnimplementedAccountServiceServer should be embedded to have 66 | // forward compatible implementations. 67 | // 68 | // NOTE: this should be embedded by value instead of pointer to avoid a nil 69 | // pointer dereference when methods are called. 70 | type UnimplementedAccountServiceServer struct{} 71 | 72 | func (UnimplementedAccountServiceServer) List(context.Context, *AccountRequest) (*AccountList, error) { 73 | return nil, status.Errorf(codes.Unimplemented, "method List not implemented") 74 | } 75 | func (UnimplementedAccountServiceServer) testEmbeddedByValue() {} 76 | 77 | // UnsafeAccountServiceServer may be embedded to opt out of forward compatibility for this service. 78 | // Use of this interface is not recommended, as added methods to AccountServiceServer will 79 | // result in compilation errors. 80 | type UnsafeAccountServiceServer interface { 81 | mustEmbedUnimplementedAccountServiceServer() 82 | } 83 | 84 | func RegisterAccountServiceServer(s grpc.ServiceRegistrar, srv AccountServiceServer) { 85 | // If the following call pancis, it indicates UnimplementedAccountServiceServer was 86 | // embedded by pointer and is nil. This will cause panics if an 87 | // unimplemented method is ever invoked, so we test this at initialization 88 | // time to prevent it from happening at runtime later due to I/O. 89 | if t, ok := srv.(interface{ testEmbeddedByValue() }); ok { 90 | t.testEmbeddedByValue() 91 | } 92 | s.RegisterService(&AccountService_ServiceDesc, srv) 93 | } 94 | 95 | func _AccountService_List_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { 96 | in := new(AccountRequest) 97 | if err := dec(in); err != nil { 98 | return nil, err 99 | } 100 | if interceptor == nil { 101 | return srv.(AccountServiceServer).List(ctx, in) 102 | } 103 | info := &grpc.UnaryServerInfo{ 104 | Server: srv, 105 | FullMethod: AccountService_List_FullMethodName, 106 | } 107 | handler := func(ctx context.Context, req interface{}) (interface{}, error) { 108 | return srv.(AccountServiceServer).List(ctx, req.(*AccountRequest)) 109 | } 110 | return interceptor(ctx, in, info, handler) 111 | } 112 | 113 | // AccountService_ServiceDesc is the grpc.ServiceDesc for AccountService service. 114 | // It's only intended for direct use with grpc.RegisterService, 115 | // and not to be introspected or modified (even as a copy) 116 | var AccountService_ServiceDesc = grpc.ServiceDesc{ 117 | ServiceName: "spacemesh.v2alpha1.AccountService", 118 | HandlerType: (*AccountServiceServer)(nil), 119 | Methods: []grpc.MethodDesc{ 120 | { 121 | MethodName: "List", 122 | Handler: _AccountService_List_Handler, 123 | }, 124 | }, 125 | Streams: []grpc.StreamDesc{}, 126 | Metadata: "spacemesh/v2alpha1/account.proto", 127 | } 128 | -------------------------------------------------------------------------------- /release/go/spacemesh/v2alpha1/block.pb.go: -------------------------------------------------------------------------------- 1 | // Code generated by protoc-gen-go. DO NOT EDIT. 2 | // versions: 3 | // protoc-gen-go v1.36.6 4 | // protoc (unknown) 5 | // source: spacemesh/v2alpha1/block.proto 6 | 7 | package spacemeshv2alpha1 8 | 9 | import ( 10 | protoreflect "google.golang.org/protobuf/reflect/protoreflect" 11 | protoimpl "google.golang.org/protobuf/runtime/protoimpl" 12 | reflect "reflect" 13 | sync "sync" 14 | unsafe "unsafe" 15 | ) 16 | 17 | const ( 18 | // Verify that this generated code is sufficiently up-to-date. 19 | _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) 20 | // Verify that runtime/protoimpl is sufficiently up-to-date. 21 | _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) 22 | ) 23 | 24 | type Block struct { 25 | state protoimpl.MessageState `protogen:"open.v1"` 26 | Id []byte `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"` // block hash 27 | unknownFields protoimpl.UnknownFields 28 | sizeCache protoimpl.SizeCache 29 | } 30 | 31 | func (x *Block) Reset() { 32 | *x = Block{} 33 | mi := &file_spacemesh_v2alpha1_block_proto_msgTypes[0] 34 | ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) 35 | ms.StoreMessageInfo(mi) 36 | } 37 | 38 | func (x *Block) String() string { 39 | return protoimpl.X.MessageStringOf(x) 40 | } 41 | 42 | func (*Block) ProtoMessage() {} 43 | 44 | func (x *Block) ProtoReflect() protoreflect.Message { 45 | mi := &file_spacemesh_v2alpha1_block_proto_msgTypes[0] 46 | if x != nil { 47 | ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) 48 | if ms.LoadMessageInfo() == nil { 49 | ms.StoreMessageInfo(mi) 50 | } 51 | return ms 52 | } 53 | return mi.MessageOf(x) 54 | } 55 | 56 | // Deprecated: Use Block.ProtoReflect.Descriptor instead. 57 | func (*Block) Descriptor() ([]byte, []int) { 58 | return file_spacemesh_v2alpha1_block_proto_rawDescGZIP(), []int{0} 59 | } 60 | 61 | func (x *Block) GetId() []byte { 62 | if x != nil { 63 | return x.Id 64 | } 65 | return nil 66 | } 67 | 68 | var File_spacemesh_v2alpha1_block_proto protoreflect.FileDescriptor 69 | 70 | const file_spacemesh_v2alpha1_block_proto_rawDesc = "" + 71 | "\n" + 72 | "\x1espacemesh/v2alpha1/block.proto\x12\x12spacemesh.v2alpha1\"\x17\n" + 73 | "\x05Block\x12\x0e\n" + 74 | "\x02id\x18\x01 \x01(\fR\x02idB\xd9\x01\n" + 75 | "\x16com.spacemesh.v2alpha1B\n" + 76 | "BlockProtoP\x01ZJgithub.com/spacemeshos/api/release/go/spacemesh/v2alpha1;spacemeshv2alpha1\xa2\x02\x03SXX\xaa\x02\x12Spacemesh.V2alpha1\xca\x02\x12Spacemesh\\V2alpha1\xe2\x02\x1eSpacemesh\\V2alpha1\\GPBMetadata\xea\x02\x13Spacemesh::V2alpha1b\x06proto3" 77 | 78 | var ( 79 | file_spacemesh_v2alpha1_block_proto_rawDescOnce sync.Once 80 | file_spacemesh_v2alpha1_block_proto_rawDescData []byte 81 | ) 82 | 83 | func file_spacemesh_v2alpha1_block_proto_rawDescGZIP() []byte { 84 | file_spacemesh_v2alpha1_block_proto_rawDescOnce.Do(func() { 85 | file_spacemesh_v2alpha1_block_proto_rawDescData = protoimpl.X.CompressGZIP(unsafe.Slice(unsafe.StringData(file_spacemesh_v2alpha1_block_proto_rawDesc), len(file_spacemesh_v2alpha1_block_proto_rawDesc))) 86 | }) 87 | return file_spacemesh_v2alpha1_block_proto_rawDescData 88 | } 89 | 90 | var file_spacemesh_v2alpha1_block_proto_msgTypes = make([]protoimpl.MessageInfo, 1) 91 | var file_spacemesh_v2alpha1_block_proto_goTypes = []any{ 92 | (*Block)(nil), // 0: spacemesh.v2alpha1.Block 93 | } 94 | var file_spacemesh_v2alpha1_block_proto_depIdxs = []int32{ 95 | 0, // [0:0] is the sub-list for method output_type 96 | 0, // [0:0] is the sub-list for method input_type 97 | 0, // [0:0] is the sub-list for extension type_name 98 | 0, // [0:0] is the sub-list for extension extendee 99 | 0, // [0:0] is the sub-list for field type_name 100 | } 101 | 102 | func init() { file_spacemesh_v2alpha1_block_proto_init() } 103 | func file_spacemesh_v2alpha1_block_proto_init() { 104 | if File_spacemesh_v2alpha1_block_proto != nil { 105 | return 106 | } 107 | type x struct{} 108 | out := protoimpl.TypeBuilder{ 109 | File: protoimpl.DescBuilder{ 110 | GoPackagePath: reflect.TypeOf(x{}).PkgPath(), 111 | RawDescriptor: unsafe.Slice(unsafe.StringData(file_spacemesh_v2alpha1_block_proto_rawDesc), len(file_spacemesh_v2alpha1_block_proto_rawDesc)), 112 | NumEnums: 0, 113 | NumMessages: 1, 114 | NumExtensions: 0, 115 | NumServices: 0, 116 | }, 117 | GoTypes: file_spacemesh_v2alpha1_block_proto_goTypes, 118 | DependencyIndexes: file_spacemesh_v2alpha1_block_proto_depIdxs, 119 | MessageInfos: file_spacemesh_v2alpha1_block_proto_msgTypes, 120 | }.Build() 121 | File_spacemesh_v2alpha1_block_proto = out.File 122 | file_spacemesh_v2alpha1_block_proto_goTypes = nil 123 | file_spacemesh_v2alpha1_block_proto_depIdxs = nil 124 | } 125 | -------------------------------------------------------------------------------- /release/go/spacemesh/v2alpha1/network_grpc.pb.go: -------------------------------------------------------------------------------- 1 | // Code generated by protoc-gen-go-grpc. DO NOT EDIT. 2 | // versions: 3 | // - protoc-gen-go-grpc v1.5.1 4 | // - protoc (unknown) 5 | // source: spacemesh/v2alpha1/network.proto 6 | 7 | package spacemeshv2alpha1 8 | 9 | import ( 10 | context "context" 11 | grpc "google.golang.org/grpc" 12 | codes "google.golang.org/grpc/codes" 13 | status "google.golang.org/grpc/status" 14 | ) 15 | 16 | // This is a compile-time assertion to ensure that this generated file 17 | // is compatible with the grpc package it is being compiled against. 18 | // Requires gRPC-Go v1.64.0 or later. 19 | const _ = grpc.SupportPackageIsVersion9 20 | 21 | const ( 22 | NetworkService_Info_FullMethodName = "/spacemesh.v2alpha1.NetworkService/Info" 23 | ) 24 | 25 | // NetworkServiceClient is the client API for NetworkService service. 26 | // 27 | // For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream. 28 | type NetworkServiceClient interface { 29 | // Network information 30 | // 31 | // Info is a method that returns an "{{.ResponseType.Name}}". 32 | // This method is used to retrieve network information. 33 | Info(ctx context.Context, in *NetworkInfoRequest, opts ...grpc.CallOption) (*NetworkInfoResponse, error) 34 | } 35 | 36 | type networkServiceClient struct { 37 | cc grpc.ClientConnInterface 38 | } 39 | 40 | func NewNetworkServiceClient(cc grpc.ClientConnInterface) NetworkServiceClient { 41 | return &networkServiceClient{cc} 42 | } 43 | 44 | func (c *networkServiceClient) Info(ctx context.Context, in *NetworkInfoRequest, opts ...grpc.CallOption) (*NetworkInfoResponse, error) { 45 | cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) 46 | out := new(NetworkInfoResponse) 47 | err := c.cc.Invoke(ctx, NetworkService_Info_FullMethodName, in, out, cOpts...) 48 | if err != nil { 49 | return nil, err 50 | } 51 | return out, nil 52 | } 53 | 54 | // NetworkServiceServer is the server API for NetworkService service. 55 | // All implementations should embed UnimplementedNetworkServiceServer 56 | // for forward compatibility. 57 | type NetworkServiceServer interface { 58 | // Network information 59 | // 60 | // Info is a method that returns an "{{.ResponseType.Name}}". 61 | // This method is used to retrieve network information. 62 | Info(context.Context, *NetworkInfoRequest) (*NetworkInfoResponse, error) 63 | } 64 | 65 | // UnimplementedNetworkServiceServer should be embedded to have 66 | // forward compatible implementations. 67 | // 68 | // NOTE: this should be embedded by value instead of pointer to avoid a nil 69 | // pointer dereference when methods are called. 70 | type UnimplementedNetworkServiceServer struct{} 71 | 72 | func (UnimplementedNetworkServiceServer) Info(context.Context, *NetworkInfoRequest) (*NetworkInfoResponse, error) { 73 | return nil, status.Errorf(codes.Unimplemented, "method Info not implemented") 74 | } 75 | func (UnimplementedNetworkServiceServer) testEmbeddedByValue() {} 76 | 77 | // UnsafeNetworkServiceServer may be embedded to opt out of forward compatibility for this service. 78 | // Use of this interface is not recommended, as added methods to NetworkServiceServer will 79 | // result in compilation errors. 80 | type UnsafeNetworkServiceServer interface { 81 | mustEmbedUnimplementedNetworkServiceServer() 82 | } 83 | 84 | func RegisterNetworkServiceServer(s grpc.ServiceRegistrar, srv NetworkServiceServer) { 85 | // If the following call pancis, it indicates UnimplementedNetworkServiceServer was 86 | // embedded by pointer and is nil. This will cause panics if an 87 | // unimplemented method is ever invoked, so we test this at initialization 88 | // time to prevent it from happening at runtime later due to I/O. 89 | if t, ok := srv.(interface{ testEmbeddedByValue() }); ok { 90 | t.testEmbeddedByValue() 91 | } 92 | s.RegisterService(&NetworkService_ServiceDesc, srv) 93 | } 94 | 95 | func _NetworkService_Info_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { 96 | in := new(NetworkInfoRequest) 97 | if err := dec(in); err != nil { 98 | return nil, err 99 | } 100 | if interceptor == nil { 101 | return srv.(NetworkServiceServer).Info(ctx, in) 102 | } 103 | info := &grpc.UnaryServerInfo{ 104 | Server: srv, 105 | FullMethod: NetworkService_Info_FullMethodName, 106 | } 107 | handler := func(ctx context.Context, req interface{}) (interface{}, error) { 108 | return srv.(NetworkServiceServer).Info(ctx, req.(*NetworkInfoRequest)) 109 | } 110 | return interceptor(ctx, in, info, handler) 111 | } 112 | 113 | // NetworkService_ServiceDesc is the grpc.ServiceDesc for NetworkService service. 114 | // It's only intended for direct use with grpc.RegisterService, 115 | // and not to be introspected or modified (even as a copy) 116 | var NetworkService_ServiceDesc = grpc.ServiceDesc{ 117 | ServiceName: "spacemesh.v2alpha1.NetworkService", 118 | HandlerType: (*NetworkServiceServer)(nil), 119 | Methods: []grpc.MethodDesc{ 120 | { 121 | MethodName: "Info", 122 | Handler: _NetworkService_Info_Handler, 123 | }, 124 | }, 125 | Streams: []grpc.StreamDesc{}, 126 | Metadata: "spacemesh/v2alpha1/network.proto", 127 | } 128 | -------------------------------------------------------------------------------- /release/go/spacemesh/v2alpha1/node.pb.gw.go: -------------------------------------------------------------------------------- 1 | // Code generated by protoc-gen-grpc-gateway. DO NOT EDIT. 2 | // source: spacemesh/v2alpha1/node.proto 3 | 4 | /* 5 | Package spacemeshv2alpha1 is a reverse proxy. 6 | 7 | It translates gRPC into RESTful JSON APIs. 8 | */ 9 | package spacemeshv2alpha1 10 | 11 | import ( 12 | "context" 13 | "errors" 14 | "io" 15 | "net/http" 16 | 17 | "github.com/grpc-ecosystem/grpc-gateway/v2/runtime" 18 | "github.com/grpc-ecosystem/grpc-gateway/v2/utilities" 19 | "google.golang.org/grpc" 20 | "google.golang.org/grpc/codes" 21 | "google.golang.org/grpc/grpclog" 22 | "google.golang.org/grpc/metadata" 23 | "google.golang.org/grpc/status" 24 | "google.golang.org/protobuf/proto" 25 | ) 26 | 27 | // Suppress "imported and not used" errors 28 | var ( 29 | _ codes.Code 30 | _ io.Reader 31 | _ status.Status 32 | _ = errors.New 33 | _ = runtime.String 34 | _ = utilities.NewDoubleArray 35 | _ = metadata.Join 36 | ) 37 | 38 | func request_NodeService_Status_0(ctx context.Context, marshaler runtime.Marshaler, client NodeServiceClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { 39 | var ( 40 | protoReq NodeStatusRequest 41 | metadata runtime.ServerMetadata 42 | ) 43 | if err := marshaler.NewDecoder(req.Body).Decode(&protoReq); err != nil && !errors.Is(err, io.EOF) { 44 | return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) 45 | } 46 | msg, err := client.Status(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) 47 | return msg, metadata, err 48 | } 49 | 50 | func local_request_NodeService_Status_0(ctx context.Context, marshaler runtime.Marshaler, server NodeServiceServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { 51 | var ( 52 | protoReq NodeStatusRequest 53 | metadata runtime.ServerMetadata 54 | ) 55 | if err := marshaler.NewDecoder(req.Body).Decode(&protoReq); err != nil && !errors.Is(err, io.EOF) { 56 | return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) 57 | } 58 | msg, err := server.Status(ctx, &protoReq) 59 | return msg, metadata, err 60 | } 61 | 62 | // RegisterNodeServiceHandlerServer registers the http handlers for service NodeService to "mux". 63 | // UnaryRPC :call NodeServiceServer directly. 64 | // StreamingRPC :currently unsupported pending https://github.com/grpc/grpc-go/issues/906. 65 | // Note that using this registration option will cause many gRPC library features to stop working. Consider using RegisterNodeServiceHandlerFromEndpoint instead. 66 | // GRPC interceptors will not work for this type of registration. To use interceptors, you must use the "runtime.WithMiddlewares" option in the "runtime.NewServeMux" call. 67 | func RegisterNodeServiceHandlerServer(ctx context.Context, mux *runtime.ServeMux, server NodeServiceServer) error { 68 | mux.Handle(http.MethodPost, pattern_NodeService_Status_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { 69 | ctx, cancel := context.WithCancel(req.Context()) 70 | defer cancel() 71 | var stream runtime.ServerTransportStream 72 | ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) 73 | inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) 74 | annotatedContext, err := runtime.AnnotateIncomingContext(ctx, mux, req, "/spacemesh.v2alpha1.NodeService/Status", runtime.WithHTTPPathPattern("/spacemesh.v2alpha1.NodeService/Status")) 75 | if err != nil { 76 | runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) 77 | return 78 | } 79 | resp, md, err := local_request_NodeService_Status_0(annotatedContext, inboundMarshaler, server, req, pathParams) 80 | md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) 81 | annotatedContext = runtime.NewServerMetadataContext(annotatedContext, md) 82 | if err != nil { 83 | runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err) 84 | return 85 | } 86 | forward_NodeService_Status_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) 87 | }) 88 | 89 | return nil 90 | } 91 | 92 | // RegisterNodeServiceHandlerFromEndpoint is same as RegisterNodeServiceHandler but 93 | // automatically dials to "endpoint" and closes the connection when "ctx" gets done. 94 | func RegisterNodeServiceHandlerFromEndpoint(ctx context.Context, mux *runtime.ServeMux, endpoint string, opts []grpc.DialOption) (err error) { 95 | conn, err := grpc.NewClient(endpoint, opts...) 96 | if err != nil { 97 | return err 98 | } 99 | defer func() { 100 | if err != nil { 101 | if cerr := conn.Close(); cerr != nil { 102 | grpclog.Errorf("Failed to close conn to %s: %v", endpoint, cerr) 103 | } 104 | return 105 | } 106 | go func() { 107 | <-ctx.Done() 108 | if cerr := conn.Close(); cerr != nil { 109 | grpclog.Errorf("Failed to close conn to %s: %v", endpoint, cerr) 110 | } 111 | }() 112 | }() 113 | return RegisterNodeServiceHandler(ctx, mux, conn) 114 | } 115 | 116 | // RegisterNodeServiceHandler registers the http handlers for service NodeService to "mux". 117 | // The handlers forward requests to the grpc endpoint over "conn". 118 | func RegisterNodeServiceHandler(ctx context.Context, mux *runtime.ServeMux, conn *grpc.ClientConn) error { 119 | return RegisterNodeServiceHandlerClient(ctx, mux, NewNodeServiceClient(conn)) 120 | } 121 | 122 | // RegisterNodeServiceHandlerClient registers the http handlers for service NodeService 123 | // to "mux". The handlers forward requests to the grpc endpoint over the given implementation of "NodeServiceClient". 124 | // Note: the gRPC framework executes interceptors within the gRPC handler. If the passed in "NodeServiceClient" 125 | // doesn't go through the normal gRPC flow (creating a gRPC client etc.) then it will be up to the passed in 126 | // "NodeServiceClient" to call the correct interceptors. This client ignores the HTTP middlewares. 127 | func RegisterNodeServiceHandlerClient(ctx context.Context, mux *runtime.ServeMux, client NodeServiceClient) error { 128 | mux.Handle(http.MethodPost, pattern_NodeService_Status_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { 129 | ctx, cancel := context.WithCancel(req.Context()) 130 | defer cancel() 131 | inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) 132 | annotatedContext, err := runtime.AnnotateContext(ctx, mux, req, "/spacemesh.v2alpha1.NodeService/Status", runtime.WithHTTPPathPattern("/spacemesh.v2alpha1.NodeService/Status")) 133 | if err != nil { 134 | runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) 135 | return 136 | } 137 | resp, md, err := request_NodeService_Status_0(annotatedContext, inboundMarshaler, client, req, pathParams) 138 | annotatedContext = runtime.NewServerMetadataContext(annotatedContext, md) 139 | if err != nil { 140 | runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err) 141 | return 142 | } 143 | forward_NodeService_Status_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) 144 | }) 145 | return nil 146 | } 147 | 148 | var ( 149 | pattern_NodeService_Status_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1}, []string{"spacemesh.v2alpha1.NodeService", "Status"}, "")) 150 | ) 151 | 152 | var ( 153 | forward_NodeService_Status_0 = runtime.ForwardResponseMessage 154 | ) 155 | -------------------------------------------------------------------------------- /release/go/spacemesh/v2alpha1/node_grpc.pb.go: -------------------------------------------------------------------------------- 1 | // Code generated by protoc-gen-go-grpc. DO NOT EDIT. 2 | // versions: 3 | // - protoc-gen-go-grpc v1.5.1 4 | // - protoc (unknown) 5 | // source: spacemesh/v2alpha1/node.proto 6 | 7 | package spacemeshv2alpha1 8 | 9 | import ( 10 | context "context" 11 | grpc "google.golang.org/grpc" 12 | codes "google.golang.org/grpc/codes" 13 | status "google.golang.org/grpc/status" 14 | ) 15 | 16 | // This is a compile-time assertion to ensure that this generated file 17 | // is compatible with the grpc package it is being compiled against. 18 | // Requires gRPC-Go v1.64.0 or later. 19 | const _ = grpc.SupportPackageIsVersion9 20 | 21 | const ( 22 | NodeService_Status_FullMethodName = "/spacemesh.v2alpha1.NodeService/Status" 23 | ) 24 | 25 | // NodeServiceClient is the client API for NodeService service. 26 | // 27 | // For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream. 28 | type NodeServiceClient interface { 29 | // Node status 30 | // 31 | // Status is a method that returns an "{{.ResponseType.Name}}". 32 | // This method is used to retrieve node status information. 33 | Status(ctx context.Context, in *NodeStatusRequest, opts ...grpc.CallOption) (*NodeStatusResponse, error) 34 | } 35 | 36 | type nodeServiceClient struct { 37 | cc grpc.ClientConnInterface 38 | } 39 | 40 | func NewNodeServiceClient(cc grpc.ClientConnInterface) NodeServiceClient { 41 | return &nodeServiceClient{cc} 42 | } 43 | 44 | func (c *nodeServiceClient) Status(ctx context.Context, in *NodeStatusRequest, opts ...grpc.CallOption) (*NodeStatusResponse, error) { 45 | cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) 46 | out := new(NodeStatusResponse) 47 | err := c.cc.Invoke(ctx, NodeService_Status_FullMethodName, in, out, cOpts...) 48 | if err != nil { 49 | return nil, err 50 | } 51 | return out, nil 52 | } 53 | 54 | // NodeServiceServer is the server API for NodeService service. 55 | // All implementations should embed UnimplementedNodeServiceServer 56 | // for forward compatibility. 57 | type NodeServiceServer interface { 58 | // Node status 59 | // 60 | // Status is a method that returns an "{{.ResponseType.Name}}". 61 | // This method is used to retrieve node status information. 62 | Status(context.Context, *NodeStatusRequest) (*NodeStatusResponse, error) 63 | } 64 | 65 | // UnimplementedNodeServiceServer should be embedded to have 66 | // forward compatible implementations. 67 | // 68 | // NOTE: this should be embedded by value instead of pointer to avoid a nil 69 | // pointer dereference when methods are called. 70 | type UnimplementedNodeServiceServer struct{} 71 | 72 | func (UnimplementedNodeServiceServer) Status(context.Context, *NodeStatusRequest) (*NodeStatusResponse, error) { 73 | return nil, status.Errorf(codes.Unimplemented, "method Status not implemented") 74 | } 75 | func (UnimplementedNodeServiceServer) testEmbeddedByValue() {} 76 | 77 | // UnsafeNodeServiceServer may be embedded to opt out of forward compatibility for this service. 78 | // Use of this interface is not recommended, as added methods to NodeServiceServer will 79 | // result in compilation errors. 80 | type UnsafeNodeServiceServer interface { 81 | mustEmbedUnimplementedNodeServiceServer() 82 | } 83 | 84 | func RegisterNodeServiceServer(s grpc.ServiceRegistrar, srv NodeServiceServer) { 85 | // If the following call pancis, it indicates UnimplementedNodeServiceServer was 86 | // embedded by pointer and is nil. This will cause panics if an 87 | // unimplemented method is ever invoked, so we test this at initialization 88 | // time to prevent it from happening at runtime later due to I/O. 89 | if t, ok := srv.(interface{ testEmbeddedByValue() }); ok { 90 | t.testEmbeddedByValue() 91 | } 92 | s.RegisterService(&NodeService_ServiceDesc, srv) 93 | } 94 | 95 | func _NodeService_Status_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { 96 | in := new(NodeStatusRequest) 97 | if err := dec(in); err != nil { 98 | return nil, err 99 | } 100 | if interceptor == nil { 101 | return srv.(NodeServiceServer).Status(ctx, in) 102 | } 103 | info := &grpc.UnaryServerInfo{ 104 | Server: srv, 105 | FullMethod: NodeService_Status_FullMethodName, 106 | } 107 | handler := func(ctx context.Context, req interface{}) (interface{}, error) { 108 | return srv.(NodeServiceServer).Status(ctx, req.(*NodeStatusRequest)) 109 | } 110 | return interceptor(ctx, in, info, handler) 111 | } 112 | 113 | // NodeService_ServiceDesc is the grpc.ServiceDesc for NodeService service. 114 | // It's only intended for direct use with grpc.RegisterService, 115 | // and not to be introspected or modified (even as a copy) 116 | var NodeService_ServiceDesc = grpc.ServiceDesc{ 117 | ServiceName: "spacemesh.v2alpha1.NodeService", 118 | HandlerType: (*NodeServiceServer)(nil), 119 | Methods: []grpc.MethodDesc{ 120 | { 121 | MethodName: "Status", 122 | Handler: _NodeService_Status_Handler, 123 | }, 124 | }, 125 | Streams: []grpc.StreamDesc{}, 126 | Metadata: "spacemesh/v2alpha1/node.proto", 127 | } 128 | -------------------------------------------------------------------------------- /release/go/spacemesh/v2alpha1/v2alpha1.pb.go: -------------------------------------------------------------------------------- 1 | // Code generated by protoc-gen-go. DO NOT EDIT. 2 | // versions: 3 | // protoc-gen-go v1.36.6 4 | // protoc (unknown) 5 | // source: spacemesh/v2alpha1/v2alpha1.proto 6 | 7 | package spacemeshv2alpha1 8 | 9 | import ( 10 | _ "github.com/grpc-ecosystem/grpc-gateway/v2/protoc-gen-openapiv2/options" 11 | protoreflect "google.golang.org/protobuf/reflect/protoreflect" 12 | protoimpl "google.golang.org/protobuf/runtime/protoimpl" 13 | reflect "reflect" 14 | sync "sync" 15 | unsafe "unsafe" 16 | ) 17 | 18 | const ( 19 | // Verify that this generated code is sufficiently up-to-date. 20 | _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) 21 | // Verify that runtime/protoimpl is sufficiently up-to-date. 22 | _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) 23 | ) 24 | 25 | type SortOrder int32 26 | 27 | const ( 28 | SortOrder_ASC SortOrder = 0 29 | SortOrder_DESC SortOrder = 1 30 | ) 31 | 32 | // Enum value maps for SortOrder. 33 | var ( 34 | SortOrder_name = map[int32]string{ 35 | 0: "ASC", 36 | 1: "DESC", 37 | } 38 | SortOrder_value = map[string]int32{ 39 | "ASC": 0, 40 | "DESC": 1, 41 | } 42 | ) 43 | 44 | func (x SortOrder) Enum() *SortOrder { 45 | p := new(SortOrder) 46 | *p = x 47 | return p 48 | } 49 | 50 | func (x SortOrder) String() string { 51 | return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x)) 52 | } 53 | 54 | func (SortOrder) Descriptor() protoreflect.EnumDescriptor { 55 | return file_spacemesh_v2alpha1_v2alpha1_proto_enumTypes[0].Descriptor() 56 | } 57 | 58 | func (SortOrder) Type() protoreflect.EnumType { 59 | return &file_spacemesh_v2alpha1_v2alpha1_proto_enumTypes[0] 60 | } 61 | 62 | func (x SortOrder) Number() protoreflect.EnumNumber { 63 | return protoreflect.EnumNumber(x) 64 | } 65 | 66 | // Deprecated: Use SortOrder.Descriptor instead. 67 | func (SortOrder) EnumDescriptor() ([]byte, []int) { 68 | return file_spacemesh_v2alpha1_v2alpha1_proto_rawDescGZIP(), []int{0} 69 | } 70 | 71 | var File_spacemesh_v2alpha1_v2alpha1_proto protoreflect.FileDescriptor 72 | 73 | const file_spacemesh_v2alpha1_v2alpha1_proto_rawDesc = "" + 74 | "\n" + 75 | "!spacemesh/v2alpha1/v2alpha1.proto\x12\x12spacemesh.v2alpha1\x1a.protoc-gen-openapiv2/options/annotations.proto*\x1e\n" + 76 | "\tSortOrder\x12\a\n" + 77 | "\x03ASC\x10\x00\x12\b\n" + 78 | "\x04DESC\x10\x01B\x89\x04\x92A\xa9\x02\x12\xe0\x01\n" + 79 | "\rSpacemesh API\"\"\n" + 80 | "\tSpacemesh\x12\x15https://spacemesh.io/*O\n" + 81 | "\vMIT License\x12@https://github.com/spacemeshos/go-spacemesh/blob/develop/LICENSE:Z\n" + 82 | "\x06x-logo\x12P*N\n" + 83 | "\x1b\n" + 84 | "\aaltText\x12\x10\x1a\x0eSpacemesh Logo\n" + 85 | "/\n" + 86 | "\x03url\x12(\x1a&https://docs.spacemesh.io/img/logo.png\x1a\x1dtestnet-api.spacemesh.network*\x01\x022\x10application/json:\x10application/json\n" + 87 | "\x16com.spacemesh.v2alpha1B\rV2alpha1ProtoP\x01ZJgithub.com/spacemeshos/api/release/go/spacemesh/v2alpha1;spacemeshv2alpha1\xa2\x02\x03SXX\xaa\x02\x12Spacemesh.V2alpha1\xca\x02\x12Spacemesh\\V2alpha1\xe2\x02\x1eSpacemesh\\V2alpha1\\GPBMetadata\xea\x02\x13Spacemesh::V2alpha1b\x06proto3" 88 | 89 | var ( 90 | file_spacemesh_v2alpha1_v2alpha1_proto_rawDescOnce sync.Once 91 | file_spacemesh_v2alpha1_v2alpha1_proto_rawDescData []byte 92 | ) 93 | 94 | func file_spacemesh_v2alpha1_v2alpha1_proto_rawDescGZIP() []byte { 95 | file_spacemesh_v2alpha1_v2alpha1_proto_rawDescOnce.Do(func() { 96 | file_spacemesh_v2alpha1_v2alpha1_proto_rawDescData = protoimpl.X.CompressGZIP(unsafe.Slice(unsafe.StringData(file_spacemesh_v2alpha1_v2alpha1_proto_rawDesc), len(file_spacemesh_v2alpha1_v2alpha1_proto_rawDesc))) 97 | }) 98 | return file_spacemesh_v2alpha1_v2alpha1_proto_rawDescData 99 | } 100 | 101 | var file_spacemesh_v2alpha1_v2alpha1_proto_enumTypes = make([]protoimpl.EnumInfo, 1) 102 | var file_spacemesh_v2alpha1_v2alpha1_proto_goTypes = []any{ 103 | (SortOrder)(0), // 0: spacemesh.v2alpha1.SortOrder 104 | } 105 | var file_spacemesh_v2alpha1_v2alpha1_proto_depIdxs = []int32{ 106 | 0, // [0:0] is the sub-list for method output_type 107 | 0, // [0:0] is the sub-list for method input_type 108 | 0, // [0:0] is the sub-list for extension type_name 109 | 0, // [0:0] is the sub-list for extension extendee 110 | 0, // [0:0] is the sub-list for field type_name 111 | } 112 | 113 | func init() { file_spacemesh_v2alpha1_v2alpha1_proto_init() } 114 | func file_spacemesh_v2alpha1_v2alpha1_proto_init() { 115 | if File_spacemesh_v2alpha1_v2alpha1_proto != nil { 116 | return 117 | } 118 | type x struct{} 119 | out := protoimpl.TypeBuilder{ 120 | File: protoimpl.DescBuilder{ 121 | GoPackagePath: reflect.TypeOf(x{}).PkgPath(), 122 | RawDescriptor: unsafe.Slice(unsafe.StringData(file_spacemesh_v2alpha1_v2alpha1_proto_rawDesc), len(file_spacemesh_v2alpha1_v2alpha1_proto_rawDesc)), 123 | NumEnums: 1, 124 | NumMessages: 0, 125 | NumExtensions: 0, 126 | NumServices: 0, 127 | }, 128 | GoTypes: file_spacemesh_v2alpha1_v2alpha1_proto_goTypes, 129 | DependencyIndexes: file_spacemesh_v2alpha1_v2alpha1_proto_depIdxs, 130 | EnumInfos: file_spacemesh_v2alpha1_v2alpha1_proto_enumTypes, 131 | }.Build() 132 | File_spacemesh_v2alpha1_v2alpha1_proto = out.File 133 | file_spacemesh_v2alpha1_v2alpha1_proto_goTypes = nil 134 | file_spacemesh_v2alpha1_v2alpha1_proto_depIdxs = nil 135 | } 136 | -------------------------------------------------------------------------------- /release/go/spacemesh/v2beta1/account_grpc.pb.go: -------------------------------------------------------------------------------- 1 | // Code generated by protoc-gen-go-grpc. DO NOT EDIT. 2 | // versions: 3 | // - protoc-gen-go-grpc v1.5.1 4 | // - protoc (unknown) 5 | // source: spacemesh/v2beta1/account.proto 6 | 7 | package spacemeshv2beta1 8 | 9 | import ( 10 | context "context" 11 | grpc "google.golang.org/grpc" 12 | codes "google.golang.org/grpc/codes" 13 | status "google.golang.org/grpc/status" 14 | ) 15 | 16 | // This is a compile-time assertion to ensure that this generated file 17 | // is compatible with the grpc package it is being compiled against. 18 | // Requires gRPC-Go v1.64.0 or later. 19 | const _ = grpc.SupportPackageIsVersion9 20 | 21 | const ( 22 | AccountService_List_FullMethodName = "/spacemesh.v2beta1.AccountService/List" 23 | ) 24 | 25 | // AccountServiceClient is the client API for AccountService service. 26 | // 27 | // For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream. 28 | type AccountServiceClient interface { 29 | // List of accounts 30 | // 31 | // List is a method that takes an "{{.RequestType.Name}}" body and returns an "{{.ResponseType.Name}}". 32 | // This method is used to retrieve a list of accounts based on the provided request parameters. 33 | List(ctx context.Context, in *AccountRequest, opts ...grpc.CallOption) (*AccountList, error) 34 | } 35 | 36 | type accountServiceClient struct { 37 | cc grpc.ClientConnInterface 38 | } 39 | 40 | func NewAccountServiceClient(cc grpc.ClientConnInterface) AccountServiceClient { 41 | return &accountServiceClient{cc} 42 | } 43 | 44 | func (c *accountServiceClient) List(ctx context.Context, in *AccountRequest, opts ...grpc.CallOption) (*AccountList, error) { 45 | cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) 46 | out := new(AccountList) 47 | err := c.cc.Invoke(ctx, AccountService_List_FullMethodName, in, out, cOpts...) 48 | if err != nil { 49 | return nil, err 50 | } 51 | return out, nil 52 | } 53 | 54 | // AccountServiceServer is the server API for AccountService service. 55 | // All implementations should embed UnimplementedAccountServiceServer 56 | // for forward compatibility. 57 | type AccountServiceServer interface { 58 | // List of accounts 59 | // 60 | // List is a method that takes an "{{.RequestType.Name}}" body and returns an "{{.ResponseType.Name}}". 61 | // This method is used to retrieve a list of accounts based on the provided request parameters. 62 | List(context.Context, *AccountRequest) (*AccountList, error) 63 | } 64 | 65 | // UnimplementedAccountServiceServer should be embedded to have 66 | // forward compatible implementations. 67 | // 68 | // NOTE: this should be embedded by value instead of pointer to avoid a nil 69 | // pointer dereference when methods are called. 70 | type UnimplementedAccountServiceServer struct{} 71 | 72 | func (UnimplementedAccountServiceServer) List(context.Context, *AccountRequest) (*AccountList, error) { 73 | return nil, status.Errorf(codes.Unimplemented, "method List not implemented") 74 | } 75 | func (UnimplementedAccountServiceServer) testEmbeddedByValue() {} 76 | 77 | // UnsafeAccountServiceServer may be embedded to opt out of forward compatibility for this service. 78 | // Use of this interface is not recommended, as added methods to AccountServiceServer will 79 | // result in compilation errors. 80 | type UnsafeAccountServiceServer interface { 81 | mustEmbedUnimplementedAccountServiceServer() 82 | } 83 | 84 | func RegisterAccountServiceServer(s grpc.ServiceRegistrar, srv AccountServiceServer) { 85 | // If the following call pancis, it indicates UnimplementedAccountServiceServer was 86 | // embedded by pointer and is nil. This will cause panics if an 87 | // unimplemented method is ever invoked, so we test this at initialization 88 | // time to prevent it from happening at runtime later due to I/O. 89 | if t, ok := srv.(interface{ testEmbeddedByValue() }); ok { 90 | t.testEmbeddedByValue() 91 | } 92 | s.RegisterService(&AccountService_ServiceDesc, srv) 93 | } 94 | 95 | func _AccountService_List_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { 96 | in := new(AccountRequest) 97 | if err := dec(in); err != nil { 98 | return nil, err 99 | } 100 | if interceptor == nil { 101 | return srv.(AccountServiceServer).List(ctx, in) 102 | } 103 | info := &grpc.UnaryServerInfo{ 104 | Server: srv, 105 | FullMethod: AccountService_List_FullMethodName, 106 | } 107 | handler := func(ctx context.Context, req interface{}) (interface{}, error) { 108 | return srv.(AccountServiceServer).List(ctx, req.(*AccountRequest)) 109 | } 110 | return interceptor(ctx, in, info, handler) 111 | } 112 | 113 | // AccountService_ServiceDesc is the grpc.ServiceDesc for AccountService service. 114 | // It's only intended for direct use with grpc.RegisterService, 115 | // and not to be introspected or modified (even as a copy) 116 | var AccountService_ServiceDesc = grpc.ServiceDesc{ 117 | ServiceName: "spacemesh.v2beta1.AccountService", 118 | HandlerType: (*AccountServiceServer)(nil), 119 | Methods: []grpc.MethodDesc{ 120 | { 121 | MethodName: "List", 122 | Handler: _AccountService_List_Handler, 123 | }, 124 | }, 125 | Streams: []grpc.StreamDesc{}, 126 | Metadata: "spacemesh/v2beta1/account.proto", 127 | } 128 | -------------------------------------------------------------------------------- /release/go/spacemesh/v2beta1/block.pb.go: -------------------------------------------------------------------------------- 1 | // Code generated by protoc-gen-go. DO NOT EDIT. 2 | // versions: 3 | // protoc-gen-go v1.36.6 4 | // protoc (unknown) 5 | // source: spacemesh/v2beta1/block.proto 6 | 7 | package spacemeshv2beta1 8 | 9 | import ( 10 | protoreflect "google.golang.org/protobuf/reflect/protoreflect" 11 | protoimpl "google.golang.org/protobuf/runtime/protoimpl" 12 | reflect "reflect" 13 | sync "sync" 14 | unsafe "unsafe" 15 | ) 16 | 17 | const ( 18 | // Verify that this generated code is sufficiently up-to-date. 19 | _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) 20 | // Verify that runtime/protoimpl is sufficiently up-to-date. 21 | _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) 22 | ) 23 | 24 | type Block struct { 25 | state protoimpl.MessageState `protogen:"open.v1"` 26 | Id []byte `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"` // block hash 27 | unknownFields protoimpl.UnknownFields 28 | sizeCache protoimpl.SizeCache 29 | } 30 | 31 | func (x *Block) Reset() { 32 | *x = Block{} 33 | mi := &file_spacemesh_v2beta1_block_proto_msgTypes[0] 34 | ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) 35 | ms.StoreMessageInfo(mi) 36 | } 37 | 38 | func (x *Block) String() string { 39 | return protoimpl.X.MessageStringOf(x) 40 | } 41 | 42 | func (*Block) ProtoMessage() {} 43 | 44 | func (x *Block) ProtoReflect() protoreflect.Message { 45 | mi := &file_spacemesh_v2beta1_block_proto_msgTypes[0] 46 | if x != nil { 47 | ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) 48 | if ms.LoadMessageInfo() == nil { 49 | ms.StoreMessageInfo(mi) 50 | } 51 | return ms 52 | } 53 | return mi.MessageOf(x) 54 | } 55 | 56 | // Deprecated: Use Block.ProtoReflect.Descriptor instead. 57 | func (*Block) Descriptor() ([]byte, []int) { 58 | return file_spacemesh_v2beta1_block_proto_rawDescGZIP(), []int{0} 59 | } 60 | 61 | func (x *Block) GetId() []byte { 62 | if x != nil { 63 | return x.Id 64 | } 65 | return nil 66 | } 67 | 68 | var File_spacemesh_v2beta1_block_proto protoreflect.FileDescriptor 69 | 70 | const file_spacemesh_v2beta1_block_proto_rawDesc = "" + 71 | "\n" + 72 | "\x1dspacemesh/v2beta1/block.proto\x12\x11spacemesh.v2beta1\"\x17\n" + 73 | "\x05Block\x12\x0e\n" + 74 | "\x02id\x18\x01 \x01(\fR\x02idB\xd2\x01\n" + 75 | "\x15com.spacemesh.v2beta1B\n" + 76 | "BlockProtoP\x01ZHgithub.com/spacemeshos/api/release/go/spacemesh/v2beta1;spacemeshv2beta1\xa2\x02\x03SXX\xaa\x02\x11Spacemesh.V2beta1\xca\x02\x11Spacemesh\\V2beta1\xe2\x02\x1dSpacemesh\\V2beta1\\GPBMetadata\xea\x02\x12Spacemesh::V2beta1b\x06proto3" 77 | 78 | var ( 79 | file_spacemesh_v2beta1_block_proto_rawDescOnce sync.Once 80 | file_spacemesh_v2beta1_block_proto_rawDescData []byte 81 | ) 82 | 83 | func file_spacemesh_v2beta1_block_proto_rawDescGZIP() []byte { 84 | file_spacemesh_v2beta1_block_proto_rawDescOnce.Do(func() { 85 | file_spacemesh_v2beta1_block_proto_rawDescData = protoimpl.X.CompressGZIP(unsafe.Slice(unsafe.StringData(file_spacemesh_v2beta1_block_proto_rawDesc), len(file_spacemesh_v2beta1_block_proto_rawDesc))) 86 | }) 87 | return file_spacemesh_v2beta1_block_proto_rawDescData 88 | } 89 | 90 | var file_spacemesh_v2beta1_block_proto_msgTypes = make([]protoimpl.MessageInfo, 1) 91 | var file_spacemesh_v2beta1_block_proto_goTypes = []any{ 92 | (*Block)(nil), // 0: spacemesh.v2beta1.Block 93 | } 94 | var file_spacemesh_v2beta1_block_proto_depIdxs = []int32{ 95 | 0, // [0:0] is the sub-list for method output_type 96 | 0, // [0:0] is the sub-list for method input_type 97 | 0, // [0:0] is the sub-list for extension type_name 98 | 0, // [0:0] is the sub-list for extension extendee 99 | 0, // [0:0] is the sub-list for field type_name 100 | } 101 | 102 | func init() { file_spacemesh_v2beta1_block_proto_init() } 103 | func file_spacemesh_v2beta1_block_proto_init() { 104 | if File_spacemesh_v2beta1_block_proto != nil { 105 | return 106 | } 107 | type x struct{} 108 | out := protoimpl.TypeBuilder{ 109 | File: protoimpl.DescBuilder{ 110 | GoPackagePath: reflect.TypeOf(x{}).PkgPath(), 111 | RawDescriptor: unsafe.Slice(unsafe.StringData(file_spacemesh_v2beta1_block_proto_rawDesc), len(file_spacemesh_v2beta1_block_proto_rawDesc)), 112 | NumEnums: 0, 113 | NumMessages: 1, 114 | NumExtensions: 0, 115 | NumServices: 0, 116 | }, 117 | GoTypes: file_spacemesh_v2beta1_block_proto_goTypes, 118 | DependencyIndexes: file_spacemesh_v2beta1_block_proto_depIdxs, 119 | MessageInfos: file_spacemesh_v2beta1_block_proto_msgTypes, 120 | }.Build() 121 | File_spacemesh_v2beta1_block_proto = out.File 122 | file_spacemesh_v2beta1_block_proto_goTypes = nil 123 | file_spacemesh_v2beta1_block_proto_depIdxs = nil 124 | } 125 | -------------------------------------------------------------------------------- /release/go/spacemesh/v2beta1/network.pb.gw.go: -------------------------------------------------------------------------------- 1 | // Code generated by protoc-gen-grpc-gateway. DO NOT EDIT. 2 | // source: spacemesh/v2beta1/network.proto 3 | 4 | /* 5 | Package spacemeshv2beta1 is a reverse proxy. 6 | 7 | It translates gRPC into RESTful JSON APIs. 8 | */ 9 | package spacemeshv2beta1 10 | 11 | import ( 12 | "context" 13 | "errors" 14 | "io" 15 | "net/http" 16 | 17 | "github.com/grpc-ecosystem/grpc-gateway/v2/runtime" 18 | "github.com/grpc-ecosystem/grpc-gateway/v2/utilities" 19 | "google.golang.org/grpc" 20 | "google.golang.org/grpc/codes" 21 | "google.golang.org/grpc/grpclog" 22 | "google.golang.org/grpc/metadata" 23 | "google.golang.org/grpc/status" 24 | "google.golang.org/protobuf/proto" 25 | ) 26 | 27 | // Suppress "imported and not used" errors 28 | var ( 29 | _ codes.Code 30 | _ io.Reader 31 | _ status.Status 32 | _ = errors.New 33 | _ = runtime.String 34 | _ = utilities.NewDoubleArray 35 | _ = metadata.Join 36 | ) 37 | 38 | func request_NetworkService_Info_0(ctx context.Context, marshaler runtime.Marshaler, client NetworkServiceClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { 39 | var ( 40 | protoReq NetworkInfoRequest 41 | metadata runtime.ServerMetadata 42 | ) 43 | io.Copy(io.Discard, req.Body) 44 | msg, err := client.Info(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) 45 | return msg, metadata, err 46 | } 47 | 48 | func local_request_NetworkService_Info_0(ctx context.Context, marshaler runtime.Marshaler, server NetworkServiceServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { 49 | var ( 50 | protoReq NetworkInfoRequest 51 | metadata runtime.ServerMetadata 52 | ) 53 | msg, err := server.Info(ctx, &protoReq) 54 | return msg, metadata, err 55 | } 56 | 57 | // RegisterNetworkServiceHandlerServer registers the http handlers for service NetworkService to "mux". 58 | // UnaryRPC :call NetworkServiceServer directly. 59 | // StreamingRPC :currently unsupported pending https://github.com/grpc/grpc-go/issues/906. 60 | // Note that using this registration option will cause many gRPC library features to stop working. Consider using RegisterNetworkServiceHandlerFromEndpoint instead. 61 | // GRPC interceptors will not work for this type of registration. To use interceptors, you must use the "runtime.WithMiddlewares" option in the "runtime.NewServeMux" call. 62 | func RegisterNetworkServiceHandlerServer(ctx context.Context, mux *runtime.ServeMux, server NetworkServiceServer) error { 63 | mux.Handle(http.MethodGet, pattern_NetworkService_Info_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { 64 | ctx, cancel := context.WithCancel(req.Context()) 65 | defer cancel() 66 | var stream runtime.ServerTransportStream 67 | ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) 68 | inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) 69 | annotatedContext, err := runtime.AnnotateIncomingContext(ctx, mux, req, "/spacemesh.v2beta1.NetworkService/Info", runtime.WithHTTPPathPattern("/spacemesh.v2beta1.NetworkService/Info")) 70 | if err != nil { 71 | runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) 72 | return 73 | } 74 | resp, md, err := local_request_NetworkService_Info_0(annotatedContext, inboundMarshaler, server, req, pathParams) 75 | md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) 76 | annotatedContext = runtime.NewServerMetadataContext(annotatedContext, md) 77 | if err != nil { 78 | runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err) 79 | return 80 | } 81 | forward_NetworkService_Info_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) 82 | }) 83 | 84 | return nil 85 | } 86 | 87 | // RegisterNetworkServiceHandlerFromEndpoint is same as RegisterNetworkServiceHandler but 88 | // automatically dials to "endpoint" and closes the connection when "ctx" gets done. 89 | func RegisterNetworkServiceHandlerFromEndpoint(ctx context.Context, mux *runtime.ServeMux, endpoint string, opts []grpc.DialOption) (err error) { 90 | conn, err := grpc.NewClient(endpoint, opts...) 91 | if err != nil { 92 | return err 93 | } 94 | defer func() { 95 | if err != nil { 96 | if cerr := conn.Close(); cerr != nil { 97 | grpclog.Errorf("Failed to close conn to %s: %v", endpoint, cerr) 98 | } 99 | return 100 | } 101 | go func() { 102 | <-ctx.Done() 103 | if cerr := conn.Close(); cerr != nil { 104 | grpclog.Errorf("Failed to close conn to %s: %v", endpoint, cerr) 105 | } 106 | }() 107 | }() 108 | return RegisterNetworkServiceHandler(ctx, mux, conn) 109 | } 110 | 111 | // RegisterNetworkServiceHandler registers the http handlers for service NetworkService to "mux". 112 | // The handlers forward requests to the grpc endpoint over "conn". 113 | func RegisterNetworkServiceHandler(ctx context.Context, mux *runtime.ServeMux, conn *grpc.ClientConn) error { 114 | return RegisterNetworkServiceHandlerClient(ctx, mux, NewNetworkServiceClient(conn)) 115 | } 116 | 117 | // RegisterNetworkServiceHandlerClient registers the http handlers for service NetworkService 118 | // to "mux". The handlers forward requests to the grpc endpoint over the given implementation of "NetworkServiceClient". 119 | // Note: the gRPC framework executes interceptors within the gRPC handler. If the passed in "NetworkServiceClient" 120 | // doesn't go through the normal gRPC flow (creating a gRPC client etc.) then it will be up to the passed in 121 | // "NetworkServiceClient" to call the correct interceptors. This client ignores the HTTP middlewares. 122 | func RegisterNetworkServiceHandlerClient(ctx context.Context, mux *runtime.ServeMux, client NetworkServiceClient) error { 123 | mux.Handle(http.MethodGet, pattern_NetworkService_Info_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { 124 | ctx, cancel := context.WithCancel(req.Context()) 125 | defer cancel() 126 | inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) 127 | annotatedContext, err := runtime.AnnotateContext(ctx, mux, req, "/spacemesh.v2beta1.NetworkService/Info", runtime.WithHTTPPathPattern("/spacemesh.v2beta1.NetworkService/Info")) 128 | if err != nil { 129 | runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) 130 | return 131 | } 132 | resp, md, err := request_NetworkService_Info_0(annotatedContext, inboundMarshaler, client, req, pathParams) 133 | annotatedContext = runtime.NewServerMetadataContext(annotatedContext, md) 134 | if err != nil { 135 | runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err) 136 | return 137 | } 138 | forward_NetworkService_Info_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) 139 | }) 140 | return nil 141 | } 142 | 143 | var ( 144 | pattern_NetworkService_Info_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1}, []string{"spacemesh.v2beta1.NetworkService", "Info"}, "")) 145 | ) 146 | 147 | var ( 148 | forward_NetworkService_Info_0 = runtime.ForwardResponseMessage 149 | ) 150 | -------------------------------------------------------------------------------- /release/go/spacemesh/v2beta1/network_grpc.pb.go: -------------------------------------------------------------------------------- 1 | // Code generated by protoc-gen-go-grpc. DO NOT EDIT. 2 | // versions: 3 | // - protoc-gen-go-grpc v1.5.1 4 | // - protoc (unknown) 5 | // source: spacemesh/v2beta1/network.proto 6 | 7 | package spacemeshv2beta1 8 | 9 | import ( 10 | context "context" 11 | grpc "google.golang.org/grpc" 12 | codes "google.golang.org/grpc/codes" 13 | status "google.golang.org/grpc/status" 14 | ) 15 | 16 | // This is a compile-time assertion to ensure that this generated file 17 | // is compatible with the grpc package it is being compiled against. 18 | // Requires gRPC-Go v1.64.0 or later. 19 | const _ = grpc.SupportPackageIsVersion9 20 | 21 | const ( 22 | NetworkService_Info_FullMethodName = "/spacemesh.v2beta1.NetworkService/Info" 23 | ) 24 | 25 | // NetworkServiceClient is the client API for NetworkService service. 26 | // 27 | // For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream. 28 | type NetworkServiceClient interface { 29 | // Network information 30 | // 31 | // Info is a method that returns an "{{.ResponseType.Name}}". 32 | // This method is used to retrieve network information. 33 | Info(ctx context.Context, in *NetworkInfoRequest, opts ...grpc.CallOption) (*NetworkInfoResponse, error) 34 | } 35 | 36 | type networkServiceClient struct { 37 | cc grpc.ClientConnInterface 38 | } 39 | 40 | func NewNetworkServiceClient(cc grpc.ClientConnInterface) NetworkServiceClient { 41 | return &networkServiceClient{cc} 42 | } 43 | 44 | func (c *networkServiceClient) Info(ctx context.Context, in *NetworkInfoRequest, opts ...grpc.CallOption) (*NetworkInfoResponse, error) { 45 | cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) 46 | out := new(NetworkInfoResponse) 47 | err := c.cc.Invoke(ctx, NetworkService_Info_FullMethodName, in, out, cOpts...) 48 | if err != nil { 49 | return nil, err 50 | } 51 | return out, nil 52 | } 53 | 54 | // NetworkServiceServer is the server API for NetworkService service. 55 | // All implementations should embed UnimplementedNetworkServiceServer 56 | // for forward compatibility. 57 | type NetworkServiceServer interface { 58 | // Network information 59 | // 60 | // Info is a method that returns an "{{.ResponseType.Name}}". 61 | // This method is used to retrieve network information. 62 | Info(context.Context, *NetworkInfoRequest) (*NetworkInfoResponse, error) 63 | } 64 | 65 | // UnimplementedNetworkServiceServer should be embedded to have 66 | // forward compatible implementations. 67 | // 68 | // NOTE: this should be embedded by value instead of pointer to avoid a nil 69 | // pointer dereference when methods are called. 70 | type UnimplementedNetworkServiceServer struct{} 71 | 72 | func (UnimplementedNetworkServiceServer) Info(context.Context, *NetworkInfoRequest) (*NetworkInfoResponse, error) { 73 | return nil, status.Errorf(codes.Unimplemented, "method Info not implemented") 74 | } 75 | func (UnimplementedNetworkServiceServer) testEmbeddedByValue() {} 76 | 77 | // UnsafeNetworkServiceServer may be embedded to opt out of forward compatibility for this service. 78 | // Use of this interface is not recommended, as added methods to NetworkServiceServer will 79 | // result in compilation errors. 80 | type UnsafeNetworkServiceServer interface { 81 | mustEmbedUnimplementedNetworkServiceServer() 82 | } 83 | 84 | func RegisterNetworkServiceServer(s grpc.ServiceRegistrar, srv NetworkServiceServer) { 85 | // If the following call pancis, it indicates UnimplementedNetworkServiceServer was 86 | // embedded by pointer and is nil. This will cause panics if an 87 | // unimplemented method is ever invoked, so we test this at initialization 88 | // time to prevent it from happening at runtime later due to I/O. 89 | if t, ok := srv.(interface{ testEmbeddedByValue() }); ok { 90 | t.testEmbeddedByValue() 91 | } 92 | s.RegisterService(&NetworkService_ServiceDesc, srv) 93 | } 94 | 95 | func _NetworkService_Info_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { 96 | in := new(NetworkInfoRequest) 97 | if err := dec(in); err != nil { 98 | return nil, err 99 | } 100 | if interceptor == nil { 101 | return srv.(NetworkServiceServer).Info(ctx, in) 102 | } 103 | info := &grpc.UnaryServerInfo{ 104 | Server: srv, 105 | FullMethod: NetworkService_Info_FullMethodName, 106 | } 107 | handler := func(ctx context.Context, req interface{}) (interface{}, error) { 108 | return srv.(NetworkServiceServer).Info(ctx, req.(*NetworkInfoRequest)) 109 | } 110 | return interceptor(ctx, in, info, handler) 111 | } 112 | 113 | // NetworkService_ServiceDesc is the grpc.ServiceDesc for NetworkService service. 114 | // It's only intended for direct use with grpc.RegisterService, 115 | // and not to be introspected or modified (even as a copy) 116 | var NetworkService_ServiceDesc = grpc.ServiceDesc{ 117 | ServiceName: "spacemesh.v2beta1.NetworkService", 118 | HandlerType: (*NetworkServiceServer)(nil), 119 | Methods: []grpc.MethodDesc{ 120 | { 121 | MethodName: "Info", 122 | Handler: _NetworkService_Info_Handler, 123 | }, 124 | }, 125 | Streams: []grpc.StreamDesc{}, 126 | Metadata: "spacemesh/v2beta1/network.proto", 127 | } 128 | -------------------------------------------------------------------------------- /release/go/spacemesh/v2beta1/node.pb.gw.go: -------------------------------------------------------------------------------- 1 | // Code generated by protoc-gen-grpc-gateway. DO NOT EDIT. 2 | // source: spacemesh/v2beta1/node.proto 3 | 4 | /* 5 | Package spacemeshv2beta1 is a reverse proxy. 6 | 7 | It translates gRPC into RESTful JSON APIs. 8 | */ 9 | package spacemeshv2beta1 10 | 11 | import ( 12 | "context" 13 | "errors" 14 | "io" 15 | "net/http" 16 | 17 | "github.com/grpc-ecosystem/grpc-gateway/v2/runtime" 18 | "github.com/grpc-ecosystem/grpc-gateway/v2/utilities" 19 | "google.golang.org/grpc" 20 | "google.golang.org/grpc/codes" 21 | "google.golang.org/grpc/grpclog" 22 | "google.golang.org/grpc/metadata" 23 | "google.golang.org/grpc/status" 24 | "google.golang.org/protobuf/proto" 25 | ) 26 | 27 | // Suppress "imported and not used" errors 28 | var ( 29 | _ codes.Code 30 | _ io.Reader 31 | _ status.Status 32 | _ = errors.New 33 | _ = runtime.String 34 | _ = utilities.NewDoubleArray 35 | _ = metadata.Join 36 | ) 37 | 38 | func request_NodeService_Status_0(ctx context.Context, marshaler runtime.Marshaler, client NodeServiceClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { 39 | var ( 40 | protoReq NodeStatusRequest 41 | metadata runtime.ServerMetadata 42 | ) 43 | io.Copy(io.Discard, req.Body) 44 | msg, err := client.Status(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) 45 | return msg, metadata, err 46 | } 47 | 48 | func local_request_NodeService_Status_0(ctx context.Context, marshaler runtime.Marshaler, server NodeServiceServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { 49 | var ( 50 | protoReq NodeStatusRequest 51 | metadata runtime.ServerMetadata 52 | ) 53 | msg, err := server.Status(ctx, &protoReq) 54 | return msg, metadata, err 55 | } 56 | 57 | // RegisterNodeServiceHandlerServer registers the http handlers for service NodeService to "mux". 58 | // UnaryRPC :call NodeServiceServer directly. 59 | // StreamingRPC :currently unsupported pending https://github.com/grpc/grpc-go/issues/906. 60 | // Note that using this registration option will cause many gRPC library features to stop working. Consider using RegisterNodeServiceHandlerFromEndpoint instead. 61 | // GRPC interceptors will not work for this type of registration. To use interceptors, you must use the "runtime.WithMiddlewares" option in the "runtime.NewServeMux" call. 62 | func RegisterNodeServiceHandlerServer(ctx context.Context, mux *runtime.ServeMux, server NodeServiceServer) error { 63 | mux.Handle(http.MethodGet, pattern_NodeService_Status_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { 64 | ctx, cancel := context.WithCancel(req.Context()) 65 | defer cancel() 66 | var stream runtime.ServerTransportStream 67 | ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) 68 | inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) 69 | annotatedContext, err := runtime.AnnotateIncomingContext(ctx, mux, req, "/spacemesh.v2beta1.NodeService/Status", runtime.WithHTTPPathPattern("/spacemesh.v2beta1.NodeService/Status")) 70 | if err != nil { 71 | runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) 72 | return 73 | } 74 | resp, md, err := local_request_NodeService_Status_0(annotatedContext, inboundMarshaler, server, req, pathParams) 75 | md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) 76 | annotatedContext = runtime.NewServerMetadataContext(annotatedContext, md) 77 | if err != nil { 78 | runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err) 79 | return 80 | } 81 | forward_NodeService_Status_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) 82 | }) 83 | 84 | return nil 85 | } 86 | 87 | // RegisterNodeServiceHandlerFromEndpoint is same as RegisterNodeServiceHandler but 88 | // automatically dials to "endpoint" and closes the connection when "ctx" gets done. 89 | func RegisterNodeServiceHandlerFromEndpoint(ctx context.Context, mux *runtime.ServeMux, endpoint string, opts []grpc.DialOption) (err error) { 90 | conn, err := grpc.NewClient(endpoint, opts...) 91 | if err != nil { 92 | return err 93 | } 94 | defer func() { 95 | if err != nil { 96 | if cerr := conn.Close(); cerr != nil { 97 | grpclog.Errorf("Failed to close conn to %s: %v", endpoint, cerr) 98 | } 99 | return 100 | } 101 | go func() { 102 | <-ctx.Done() 103 | if cerr := conn.Close(); cerr != nil { 104 | grpclog.Errorf("Failed to close conn to %s: %v", endpoint, cerr) 105 | } 106 | }() 107 | }() 108 | return RegisterNodeServiceHandler(ctx, mux, conn) 109 | } 110 | 111 | // RegisterNodeServiceHandler registers the http handlers for service NodeService to "mux". 112 | // The handlers forward requests to the grpc endpoint over "conn". 113 | func RegisterNodeServiceHandler(ctx context.Context, mux *runtime.ServeMux, conn *grpc.ClientConn) error { 114 | return RegisterNodeServiceHandlerClient(ctx, mux, NewNodeServiceClient(conn)) 115 | } 116 | 117 | // RegisterNodeServiceHandlerClient registers the http handlers for service NodeService 118 | // to "mux". The handlers forward requests to the grpc endpoint over the given implementation of "NodeServiceClient". 119 | // Note: the gRPC framework executes interceptors within the gRPC handler. If the passed in "NodeServiceClient" 120 | // doesn't go through the normal gRPC flow (creating a gRPC client etc.) then it will be up to the passed in 121 | // "NodeServiceClient" to call the correct interceptors. This client ignores the HTTP middlewares. 122 | func RegisterNodeServiceHandlerClient(ctx context.Context, mux *runtime.ServeMux, client NodeServiceClient) error { 123 | mux.Handle(http.MethodGet, pattern_NodeService_Status_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { 124 | ctx, cancel := context.WithCancel(req.Context()) 125 | defer cancel() 126 | inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) 127 | annotatedContext, err := runtime.AnnotateContext(ctx, mux, req, "/spacemesh.v2beta1.NodeService/Status", runtime.WithHTTPPathPattern("/spacemesh.v2beta1.NodeService/Status")) 128 | if err != nil { 129 | runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) 130 | return 131 | } 132 | resp, md, err := request_NodeService_Status_0(annotatedContext, inboundMarshaler, client, req, pathParams) 133 | annotatedContext = runtime.NewServerMetadataContext(annotatedContext, md) 134 | if err != nil { 135 | runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err) 136 | return 137 | } 138 | forward_NodeService_Status_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) 139 | }) 140 | return nil 141 | } 142 | 143 | var ( 144 | pattern_NodeService_Status_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1}, []string{"spacemesh.v2beta1.NodeService", "Status"}, "")) 145 | ) 146 | 147 | var ( 148 | forward_NodeService_Status_0 = runtime.ForwardResponseMessage 149 | ) 150 | -------------------------------------------------------------------------------- /release/go/spacemesh/v2beta1/node_grpc.pb.go: -------------------------------------------------------------------------------- 1 | // Code generated by protoc-gen-go-grpc. DO NOT EDIT. 2 | // versions: 3 | // - protoc-gen-go-grpc v1.5.1 4 | // - protoc (unknown) 5 | // source: spacemesh/v2beta1/node.proto 6 | 7 | package spacemeshv2beta1 8 | 9 | import ( 10 | context "context" 11 | grpc "google.golang.org/grpc" 12 | codes "google.golang.org/grpc/codes" 13 | status "google.golang.org/grpc/status" 14 | ) 15 | 16 | // This is a compile-time assertion to ensure that this generated file 17 | // is compatible with the grpc package it is being compiled against. 18 | // Requires gRPC-Go v1.64.0 or later. 19 | const _ = grpc.SupportPackageIsVersion9 20 | 21 | const ( 22 | NodeService_Status_FullMethodName = "/spacemesh.v2beta1.NodeService/Status" 23 | ) 24 | 25 | // NodeServiceClient is the client API for NodeService service. 26 | // 27 | // For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream. 28 | type NodeServiceClient interface { 29 | // Node status 30 | // 31 | // Status is a method that returns an "{{.ResponseType.Name}}". 32 | // This method is used to retrieve node status information. 33 | Status(ctx context.Context, in *NodeStatusRequest, opts ...grpc.CallOption) (*NodeStatusResponse, error) 34 | } 35 | 36 | type nodeServiceClient struct { 37 | cc grpc.ClientConnInterface 38 | } 39 | 40 | func NewNodeServiceClient(cc grpc.ClientConnInterface) NodeServiceClient { 41 | return &nodeServiceClient{cc} 42 | } 43 | 44 | func (c *nodeServiceClient) Status(ctx context.Context, in *NodeStatusRequest, opts ...grpc.CallOption) (*NodeStatusResponse, error) { 45 | cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) 46 | out := new(NodeStatusResponse) 47 | err := c.cc.Invoke(ctx, NodeService_Status_FullMethodName, in, out, cOpts...) 48 | if err != nil { 49 | return nil, err 50 | } 51 | return out, nil 52 | } 53 | 54 | // NodeServiceServer is the server API for NodeService service. 55 | // All implementations should embed UnimplementedNodeServiceServer 56 | // for forward compatibility. 57 | type NodeServiceServer interface { 58 | // Node status 59 | // 60 | // Status is a method that returns an "{{.ResponseType.Name}}". 61 | // This method is used to retrieve node status information. 62 | Status(context.Context, *NodeStatusRequest) (*NodeStatusResponse, error) 63 | } 64 | 65 | // UnimplementedNodeServiceServer should be embedded to have 66 | // forward compatible implementations. 67 | // 68 | // NOTE: this should be embedded by value instead of pointer to avoid a nil 69 | // pointer dereference when methods are called. 70 | type UnimplementedNodeServiceServer struct{} 71 | 72 | func (UnimplementedNodeServiceServer) Status(context.Context, *NodeStatusRequest) (*NodeStatusResponse, error) { 73 | return nil, status.Errorf(codes.Unimplemented, "method Status not implemented") 74 | } 75 | func (UnimplementedNodeServiceServer) testEmbeddedByValue() {} 76 | 77 | // UnsafeNodeServiceServer may be embedded to opt out of forward compatibility for this service. 78 | // Use of this interface is not recommended, as added methods to NodeServiceServer will 79 | // result in compilation errors. 80 | type UnsafeNodeServiceServer interface { 81 | mustEmbedUnimplementedNodeServiceServer() 82 | } 83 | 84 | func RegisterNodeServiceServer(s grpc.ServiceRegistrar, srv NodeServiceServer) { 85 | // If the following call pancis, it indicates UnimplementedNodeServiceServer was 86 | // embedded by pointer and is nil. This will cause panics if an 87 | // unimplemented method is ever invoked, so we test this at initialization 88 | // time to prevent it from happening at runtime later due to I/O. 89 | if t, ok := srv.(interface{ testEmbeddedByValue() }); ok { 90 | t.testEmbeddedByValue() 91 | } 92 | s.RegisterService(&NodeService_ServiceDesc, srv) 93 | } 94 | 95 | func _NodeService_Status_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { 96 | in := new(NodeStatusRequest) 97 | if err := dec(in); err != nil { 98 | return nil, err 99 | } 100 | if interceptor == nil { 101 | return srv.(NodeServiceServer).Status(ctx, in) 102 | } 103 | info := &grpc.UnaryServerInfo{ 104 | Server: srv, 105 | FullMethod: NodeService_Status_FullMethodName, 106 | } 107 | handler := func(ctx context.Context, req interface{}) (interface{}, error) { 108 | return srv.(NodeServiceServer).Status(ctx, req.(*NodeStatusRequest)) 109 | } 110 | return interceptor(ctx, in, info, handler) 111 | } 112 | 113 | // NodeService_ServiceDesc is the grpc.ServiceDesc for NodeService service. 114 | // It's only intended for direct use with grpc.RegisterService, 115 | // and not to be introspected or modified (even as a copy) 116 | var NodeService_ServiceDesc = grpc.ServiceDesc{ 117 | ServiceName: "spacemesh.v2beta1.NodeService", 118 | HandlerType: (*NodeServiceServer)(nil), 119 | Methods: []grpc.MethodDesc{ 120 | { 121 | MethodName: "Status", 122 | Handler: _NodeService_Status_Handler, 123 | }, 124 | }, 125 | Streams: []grpc.StreamDesc{}, 126 | Metadata: "spacemesh/v2beta1/node.proto", 127 | } 128 | -------------------------------------------------------------------------------- /release/go/spacemesh/v2beta1/v2beta1.pb.go: -------------------------------------------------------------------------------- 1 | // Code generated by protoc-gen-go. DO NOT EDIT. 2 | // versions: 3 | // protoc-gen-go v1.36.6 4 | // protoc (unknown) 5 | // source: spacemesh/v2beta1/v2beta1.proto 6 | 7 | package spacemeshv2beta1 8 | 9 | import ( 10 | protoreflect "google.golang.org/protobuf/reflect/protoreflect" 11 | protoimpl "google.golang.org/protobuf/runtime/protoimpl" 12 | reflect "reflect" 13 | sync "sync" 14 | unsafe "unsafe" 15 | ) 16 | 17 | const ( 18 | // Verify that this generated code is sufficiently up-to-date. 19 | _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) 20 | // Verify that runtime/protoimpl is sufficiently up-to-date. 21 | _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) 22 | ) 23 | 24 | type SortOrder int32 25 | 26 | const ( 27 | SortOrder_ASC SortOrder = 0 28 | SortOrder_DESC SortOrder = 1 29 | ) 30 | 31 | // Enum value maps for SortOrder. 32 | var ( 33 | SortOrder_name = map[int32]string{ 34 | 0: "ASC", 35 | 1: "DESC", 36 | } 37 | SortOrder_value = map[string]int32{ 38 | "ASC": 0, 39 | "DESC": 1, 40 | } 41 | ) 42 | 43 | func (x SortOrder) Enum() *SortOrder { 44 | p := new(SortOrder) 45 | *p = x 46 | return p 47 | } 48 | 49 | func (x SortOrder) String() string { 50 | return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x)) 51 | } 52 | 53 | func (SortOrder) Descriptor() protoreflect.EnumDescriptor { 54 | return file_spacemesh_v2beta1_v2beta1_proto_enumTypes[0].Descriptor() 55 | } 56 | 57 | func (SortOrder) Type() protoreflect.EnumType { 58 | return &file_spacemesh_v2beta1_v2beta1_proto_enumTypes[0] 59 | } 60 | 61 | func (x SortOrder) Number() protoreflect.EnumNumber { 62 | return protoreflect.EnumNumber(x) 63 | } 64 | 65 | // Deprecated: Use SortOrder.Descriptor instead. 66 | func (SortOrder) EnumDescriptor() ([]byte, []int) { 67 | return file_spacemesh_v2beta1_v2beta1_proto_rawDescGZIP(), []int{0} 68 | } 69 | 70 | var File_spacemesh_v2beta1_v2beta1_proto protoreflect.FileDescriptor 71 | 72 | const file_spacemesh_v2beta1_v2beta1_proto_rawDesc = "" + 73 | "\n" + 74 | "\x1fspacemesh/v2beta1/v2beta1.proto\x12\x11spacemesh.v2beta1*\x1e\n" + 75 | "\tSortOrder\x12\a\n" + 76 | "\x03ASC\x10\x00\x12\b\n" + 77 | "\x04DESC\x10\x01B\xd4\x01\n" + 78 | "\x15com.spacemesh.v2beta1B\fV2beta1ProtoP\x01ZHgithub.com/spacemeshos/api/release/go/spacemesh/v2beta1;spacemeshv2beta1\xa2\x02\x03SXX\xaa\x02\x11Spacemesh.V2beta1\xca\x02\x11Spacemesh\\V2beta1\xe2\x02\x1dSpacemesh\\V2beta1\\GPBMetadata\xea\x02\x12Spacemesh::V2beta1b\x06proto3" 79 | 80 | var ( 81 | file_spacemesh_v2beta1_v2beta1_proto_rawDescOnce sync.Once 82 | file_spacemesh_v2beta1_v2beta1_proto_rawDescData []byte 83 | ) 84 | 85 | func file_spacemesh_v2beta1_v2beta1_proto_rawDescGZIP() []byte { 86 | file_spacemesh_v2beta1_v2beta1_proto_rawDescOnce.Do(func() { 87 | file_spacemesh_v2beta1_v2beta1_proto_rawDescData = protoimpl.X.CompressGZIP(unsafe.Slice(unsafe.StringData(file_spacemesh_v2beta1_v2beta1_proto_rawDesc), len(file_spacemesh_v2beta1_v2beta1_proto_rawDesc))) 88 | }) 89 | return file_spacemesh_v2beta1_v2beta1_proto_rawDescData 90 | } 91 | 92 | var file_spacemesh_v2beta1_v2beta1_proto_enumTypes = make([]protoimpl.EnumInfo, 1) 93 | var file_spacemesh_v2beta1_v2beta1_proto_goTypes = []any{ 94 | (SortOrder)(0), // 0: spacemesh.v2beta1.SortOrder 95 | } 96 | var file_spacemesh_v2beta1_v2beta1_proto_depIdxs = []int32{ 97 | 0, // [0:0] is the sub-list for method output_type 98 | 0, // [0:0] is the sub-list for method input_type 99 | 0, // [0:0] is the sub-list for extension type_name 100 | 0, // [0:0] is the sub-list for extension extendee 101 | 0, // [0:0] is the sub-list for field type_name 102 | } 103 | 104 | func init() { file_spacemesh_v2beta1_v2beta1_proto_init() } 105 | func file_spacemesh_v2beta1_v2beta1_proto_init() { 106 | if File_spacemesh_v2beta1_v2beta1_proto != nil { 107 | return 108 | } 109 | type x struct{} 110 | out := protoimpl.TypeBuilder{ 111 | File: protoimpl.DescBuilder{ 112 | GoPackagePath: reflect.TypeOf(x{}).PkgPath(), 113 | RawDescriptor: unsafe.Slice(unsafe.StringData(file_spacemesh_v2beta1_v2beta1_proto_rawDesc), len(file_spacemesh_v2beta1_v2beta1_proto_rawDesc)), 114 | NumEnums: 1, 115 | NumMessages: 0, 116 | NumExtensions: 0, 117 | NumServices: 0, 118 | }, 119 | GoTypes: file_spacemesh_v2beta1_v2beta1_proto_goTypes, 120 | DependencyIndexes: file_spacemesh_v2beta1_v2beta1_proto_depIdxs, 121 | EnumInfos: file_spacemesh_v2beta1_v2beta1_proto_enumTypes, 122 | }.Build() 123 | File_spacemesh_v2beta1_v2beta1_proto = out.File 124 | file_spacemesh_v2beta1_v2beta1_proto_goTypes = nil 125 | file_spacemesh_v2beta1_v2beta1_proto_depIdxs = nil 126 | } 127 | -------------------------------------------------------------------------------- /release/openapi/swagger/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | Spacemesh Public API Documentation 6 | 7 | 8 |
9 | 10 | -------------------------------------------------------------------------------- /release/openapi/swagger/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "swagger", 3 | "version": "1.0.0", 4 | "description": "Swagger-UI for spacemesh public API", 5 | "main": "index.js", 6 | "scripts": { 7 | "test": "echo \"Error: no test specified\" && exit 1", 8 | "build": "webpack" 9 | }, 10 | "author": "", 11 | "license": "ISC", 12 | "devDependencies": { 13 | "css-loader": "^7.1.2", 14 | "html-webpack-plugin": "^5.6.3", 15 | "json-loader": "^0.5.7", 16 | "style-loader": "^4.0.0", 17 | "webpack": "^5.99.9", 18 | "webpack-cli": "^6.0.1", 19 | "yaml-loader": "^0.8.1" 20 | }, 21 | "dependencies": { 22 | "buffer": "^6.0.3", 23 | "stream": "^0.0.3", 24 | "swagger-ui": "^5.22.0" 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /release/openapi/swagger/src/index.js: -------------------------------------------------------------------------------- 1 | const SwaggerUI = require('swagger-ui'); 2 | require('swagger-ui/dist/swagger-ui.css'); 3 | const spec = require('./api.swagger.json'); 4 | SwaggerUI({ 5 | spec, 6 | dom_id: '#swagger', 7 | }); -------------------------------------------------------------------------------- /release/openapi/swagger/webpack.config.js: -------------------------------------------------------------------------------- 1 | const path = require('path'); 2 | const HtmlWebpackPlugin = require('html-webpack-plugin'); 3 | const webpack = require('webpack'); 4 | const outputPath = path.resolve(__dirname, 'dist'); 5 | module.exports = { 6 | mode: 'development', 7 | entry: { 8 | // tell webpack where our code is 9 | app: './src/index.js', 10 | }, 11 | module: { 12 | rules: [{ 13 | test: /\.yaml$/, 14 | use: [ 15 | { loader: 'json-loader' }, 16 | { loader: 'yaml-loader' } 17 | ] 18 | }, 19 | { 20 | test: /\.css$/, 21 | use: [ 22 | { loader: 'style-loader' }, 23 | { loader: 'css-loader' }, 24 | ] 25 | }] 26 | }, 27 | plugins: [ 28 | // tell webpack to use our template we created 29 | new HtmlWebpackPlugin({ 30 | template: 'index.html' 31 | }), 32 | new webpack.ProvidePlugin({ 33 | Buffer: ['buffer', 'Buffer'], 34 | }) 35 | ], 36 | // tell webpack where to output the build code to - './dist' 37 | output: { 38 | filename: '[name].bundle.js', 39 | path: outputPath, 40 | } 41 | }; -------------------------------------------------------------------------------- /spacemesh/v1/activation.proto: -------------------------------------------------------------------------------- 1 | syntax = "proto3"; 2 | 3 | import "google/protobuf/empty.proto"; 4 | import "spacemesh/v1/activation_types.proto"; 5 | import "google/api/visibility.proto"; 6 | 7 | package spacemesh.v1; 8 | 9 | // Exposes services to query activation transactions 10 | service ActivationService { 11 | option (google.api.api_visibility).restriction = "V1"; 12 | // Get a single activation transaction 13 | rpc Get(GetRequest) returns (GetResponse); 14 | 15 | // Highest returns the atx id with the highest tick count. 16 | rpc Highest(google.protobuf.Empty) returns (HighestResponse); 17 | } 18 | -------------------------------------------------------------------------------- /spacemesh/v1/activation_types.proto: -------------------------------------------------------------------------------- 1 | syntax = "proto3"; 2 | 3 | import "spacemesh/v1/types.proto"; 4 | 5 | package spacemesh.v1; 6 | 7 | message GetRequest { 8 | bytes id = 1; 9 | } 10 | 11 | message GetResponse { 12 | Activation atx = 1; 13 | MalfeasanceProof malfeasance_proof = 2; 14 | } 15 | 16 | message HighestResponse { 17 | Activation atx = 1; 18 | } -------------------------------------------------------------------------------- /spacemesh/v1/admin.proto: -------------------------------------------------------------------------------- 1 | syntax = "proto3"; 2 | 3 | import "google/protobuf/empty.proto"; 4 | import "spacemesh/v1/admin_types.proto"; 5 | import "google/api/visibility.proto"; 6 | 7 | package spacemesh.v1; 8 | 9 | // AdminService offers the set of administrative RPCs. 10 | service AdminService { 11 | option (google.api.api_visibility).restriction = "V1"; 12 | 13 | // Returns the checkpoint data. 14 | rpc CheckpointStream(CheckpointStreamRequest) returns (stream CheckpointStreamResponse); 15 | 16 | // Recovers from the provided checkpoint data. 17 | rpc Recover(RecoverRequest) returns (google.protobuf.Empty); 18 | 19 | // Events that are relevant for node operator 20 | rpc EventsStream(EventStreamRequest) returns (stream Event); 21 | 22 | // PeerInfo returns info for all connected peers. 23 | rpc PeerInfoStream(google.protobuf.Empty) returns (stream PeerInfo); 24 | 25 | } 26 | -------------------------------------------------------------------------------- /spacemesh/v1/admin_types.proto: -------------------------------------------------------------------------------- 1 | syntax = "proto3"; 2 | 3 | import "google/protobuf/timestamp.proto"; 4 | import "google/protobuf/duration.proto"; 5 | import "spacemesh/v1/types.proto"; 6 | 7 | package spacemesh.v1; 8 | 9 | message CheckpointStreamRequest { 10 | uint32 snapshot_layer = 1; 11 | uint32 num_atxs = 2; 12 | } 13 | 14 | message CheckpointStreamResponse { 15 | bytes data = 1; 16 | } 17 | 18 | message RecoverRequest { 19 | string uri = 1; 20 | uint32 restore_layer = 2; 21 | } 22 | 23 | message Event { 24 | // time when event occured. 25 | google.protobuf.Timestamp timestamp = 1; 26 | // the reason of the failure may be complex to pinpoint. 27 | // for the first version we want to highlight that failure occured and defer user to logs. 28 | bool failure = 2; 29 | string help = 3; 30 | oneof details { 31 | EventBeacon beacon = 4; 32 | EventInitStart init_start = 5; 33 | EventInitComplete init_complete = 6; 34 | EventPostStart post_start = 7; 35 | EventPostComplete post_complete = 8; 36 | EventPoetWaitRound poet_wait_round = 9; 37 | EventPoetWaitProof poet_wait_proof = 10; 38 | EventAtxPubished atx_published = 11; 39 | EventEligibilities eligibilities = 12; 40 | EventProposal proposal = 13; 41 | EventInitFailed init_failed = 14; 42 | EventMalfeasance malfeasance = 15; 43 | EventPostServiceStarted post_service_started = 16; 44 | EventPostServiceStopped post_service_stopped = 17; 45 | EventWaitingForPoETRegistrationWindow waiting_for_poet_registration_window = 18; 46 | EventProofDownloadedFromPoet proof_downloaded_from_poet = 19; 47 | EventRegisteredInPoet registered_in_poet = 20; 48 | EventBestProofSelected best_proof_selected = 21; 49 | EventWaitingForPoETRoundEnd waiting_for_poet_round_end = 22; 50 | } 51 | } 52 | 53 | message EventBeacon { 54 | uint32 epoch = 1; 55 | bytes beacon = 2; 56 | } 57 | 58 | message EventInitStart { 59 | bytes smesher = 1; 60 | bytes commitment = 2; 61 | } 62 | 63 | message EventInitFailed { 64 | bytes smesher = 1; 65 | bytes commitment = 2; 66 | string error = 3; 67 | } 68 | 69 | message EventInitComplete { 70 | bytes smesher = 1; 71 | } 72 | 73 | message EventPostServiceStarted {} 74 | 75 | message EventPostServiceStopped {} 76 | 77 | message EventPostStart { 78 | bytes challenge = 1; 79 | bytes smesher = 2; 80 | } 81 | 82 | message EventPostComplete { 83 | bytes challenge = 1; 84 | bytes smesher = 2; 85 | } 86 | 87 | // Deprecated. Will be removed soon. Use WaitingForPoETRegistrationWindow instead. 88 | message EventPoetWaitRound { 89 | option deprecated = true; 90 | uint32 current = 1; 91 | uint32 publish = 2; 92 | google.protobuf.Duration wait = 3; 93 | google.protobuf.Timestamp until = 4; 94 | bytes smesher = 5; 95 | } 96 | 97 | message EventWaitingForPoETRegistrationWindow { 98 | uint32 current = 1; 99 | uint32 publish = 2; 100 | google.protobuf.Timestamp round_end = 3; 101 | bytes smesher = 4; 102 | } 103 | 104 | // Deprecated. Will be removed soon. Use EventWaitingForPoETRoundEnd instead. 105 | message EventPoetWaitProof { 106 | option deprecated = true; 107 | uint32 publish = 1; 108 | uint32 target = 2; 109 | google.protobuf.Duration wait = 3; 110 | google.protobuf.Timestamp until = 4; 111 | bytes smesher = 5; 112 | } 113 | 114 | message EventWaitingForPoETRoundEnd { 115 | uint32 publish = 1; 116 | uint32 target = 2; 117 | google.protobuf.Timestamp round_end = 3; 118 | bytes smesher = 4; 119 | } 120 | 121 | message EventAtxPubished { 122 | uint32 current = 1; 123 | uint32 target = 2; 124 | bytes id = 3; 125 | google.protobuf.Duration wait = 4; 126 | google.protobuf.Timestamp until = 5; 127 | bytes smesher = 6; 128 | } 129 | 130 | message EventEligibilities { 131 | uint32 epoch = 1; 132 | bytes beacon = 2; 133 | bytes atx = 3; 134 | uint32 active_set_size = 4; 135 | repeated ProposalEligibility eligibilities = 5; 136 | bytes smesher = 6; 137 | } 138 | 139 | message ProposalEligibility { 140 | uint32 layer = 1; 141 | uint32 count = 2; 142 | } 143 | 144 | // Published proposal. Rewards will be received, once proposal is included into the block. 145 | message EventProposal { 146 | uint32 layer = 1; 147 | bytes proposal = 2; 148 | bytes smesher = 3; 149 | } 150 | 151 | message EventMalfeasance { 152 | MalfeasanceProof proof = 1; 153 | } 154 | 155 | message EventStreamRequest {} 156 | 157 | message EventRegisteredInPoet { 158 | string url = 1; 159 | bytes smesher = 2; 160 | string round_id = 3; 161 | } 162 | 163 | // ticks is proof leaves / tickSize 164 | message EventProofDownloadedFromPoet { 165 | string url = 1; 166 | string round_id = 2; 167 | uint64 ticks = 3; 168 | } 169 | 170 | message EventBestProofSelected { 171 | string url = 1; 172 | string round_id = 2; 173 | uint64 ticks = 3; 174 | bytes smesher = 4; 175 | } 176 | 177 | message ConnectionInfo { 178 | string address = 1; 179 | google.protobuf.Duration uptime = 2; 180 | bool outbound = 3; 181 | // buf:lint:ignore ENUM_VALUE_UPPER_SNAKE_CASE 182 | enum Kind { 183 | Unknown = 0; 184 | Inbound = 1; 185 | Outbound = 2; 186 | HPInbound = 3; 187 | HPOutbound = 4; 188 | RelayInbound = 5; 189 | RelayOutbound = 6; 190 | } 191 | Kind kind = 4; 192 | } 193 | 194 | message PeerRequestStats { 195 | uint64 success_count = 1; 196 | uint64 failure_count = 2; 197 | optional google.protobuf.Duration latency = 3; 198 | } 199 | 200 | message PeerInfo { 201 | string id = 1; 202 | repeated ConnectionInfo connections = 2; 203 | repeated string tags = 4; 204 | optional PeerRequestStats client_stats = 5; 205 | optional PeerRequestStats server_stats = 6; 206 | uint64 bytes_sent = 7; 207 | uint64 bytes_received = 8; 208 | repeated uint64 send_rate = 9; 209 | repeated uint64 recv_rate = 10; 210 | } 211 | -------------------------------------------------------------------------------- /spacemesh/v1/debug.proto: -------------------------------------------------------------------------------- 1 | syntax = "proto3"; 2 | 3 | import "google/api/annotations.proto"; 4 | import "google/protobuf/empty.proto"; 5 | import "spacemesh/v1/debug_types.proto"; 6 | import "google/api/visibility.proto"; 7 | 8 | package spacemesh.v1; 9 | 10 | // DebugService exposes methods used for mostly debugging and tests 11 | // NOTE: The endpoints in this service are experimental and subject to change without notice. 12 | // They should not be used in production. 13 | service DebugService { 14 | option (google.api.api_visibility).restriction = "V1"; 15 | 16 | // NetworkInfo returns p2p network information. Mostly required for integration with deployment 17 | // and testing tooling. 18 | rpc NetworkInfo(google.protobuf.Empty) returns (NetworkInfoResponse); 19 | 20 | // Accounts returns data for all the accounts currently in the node's current global state. 21 | // This includes each account's address, nonce and balance but excludes projection of account state. 22 | rpc Accounts (AccountsRequest) returns (AccountsResponse) { 23 | option (google.api.http) = { 24 | post: "/v1/debug/accounts" 25 | body: "*" 26 | }; 27 | } 28 | 29 | // ActiveSet returns the active set used by hare in a given epoch. 30 | rpc ActiveSet(ActiveSetRequest) returns (ActiveSetResponse); 31 | 32 | // ProposalsStream streams all proposals that are confirmed by hare. 33 | rpc ProposalsStream(google.protobuf.Empty) returns (stream Proposal); 34 | 35 | rpc ChangeLogLevel(ChangeLogLevelRequest) returns (google.protobuf.Empty); 36 | } 37 | -------------------------------------------------------------------------------- /spacemesh/v1/debug_types.proto: -------------------------------------------------------------------------------- 1 | syntax = "proto3"; 2 | 3 | import "spacemesh/v1/global_state_types.proto"; 4 | import "spacemesh/v1/types.proto"; 5 | 6 | package spacemesh.v1; 7 | 8 | message AccountsRequest { 9 | uint32 layer = 1; 10 | } 11 | 12 | message AccountsResponse { 13 | repeated Account account_wrapper = 1; 14 | } 15 | 16 | message DataStats { 17 | uint64 bytes_sent = 1; 18 | uint64 bytes_received = 2; 19 | repeated uint64 send_rate = 3; 20 | repeated uint64 recv_rate = 4; 21 | }; 22 | 23 | message NetworkInfoResponse { 24 | string id = 1; 25 | repeated string listen_addresses = 2; 26 | repeated string known_addresses = 3; 27 | // buf:lint:ignore ENUM_VALUE_UPPER_SNAKE_CASE 28 | enum NATType { 29 | NATTypeUnknown = 0; 30 | Cone = 1; 31 | Symmetric = 2; 32 | } 33 | NATType nat_type_udp = 4; 34 | NATType nat_type_tcp = 5; 35 | // buf:lint:ignore ENUM_VALUE_UPPER_SNAKE_CASE 36 | enum Reachability { 37 | ReachabilityUnknown = 0; 38 | Public = 1; 39 | Private = 2; 40 | }; 41 | Reachability reachability = 6; 42 | bool dht_server_enabled = 7; 43 | map stats = 8; 44 | } 45 | 46 | message EpochData { 47 | bytes beacon = 1; 48 | } 49 | 50 | message Eligibility { 51 | uint32 j = 1; 52 | bytes signature = 2; 53 | } 54 | 55 | message ActiveSetRequest { 56 | uint32 epoch = 1; 57 | } 58 | 59 | message ActiveSetResponse { 60 | repeated ActivationId ids = 1; 61 | } 62 | 63 | message Proposal { 64 | bytes id = 1; 65 | EpochNumber epoch = 2; 66 | LayerNumber layer = 3; 67 | SmesherId smesher = 4; 68 | oneof epoch_data { 69 | bytes reference = 5; 70 | EpochData data = 6; 71 | } 72 | bytes ballot = 7; 73 | repeated Eligibility eligibilities = 8; 74 | // buf:lint:ignore ENUM_VALUE_UPPER_SNAKE_CASE 75 | enum Status { 76 | Created = 0; 77 | Included = 1; 78 | } 79 | Status status = 9; 80 | } 81 | 82 | message ChangeLogLevelRequest { 83 | string module = 1; // '*' will match all registered modules 84 | string level = 2; 85 | } 86 | -------------------------------------------------------------------------------- /spacemesh/v1/global_state.proto: -------------------------------------------------------------------------------- 1 | syntax = "proto3"; 2 | 3 | import "google/api/annotations.proto"; 4 | import "spacemesh/v1/global_state_types.proto"; 5 | import "google/api/visibility.proto"; 6 | 7 | package spacemesh.v1; 8 | 9 | // Readonly global state data - current and historical. 10 | // Global state data is data which is not explicitly stored in the mesh. 11 | // Global state is modified only by the state transition function. 12 | service GlobalStateService { 13 | option (google.api.api_visibility).restriction = "V1"; 14 | 15 | // Latest computed global state - layer and its root hash 16 | rpc GlobalStateHash(GlobalStateHashRequest) returns (GlobalStateHashResponse) { 17 | option (google.api.http) = { 18 | post: "/v1/globalstate/globalstatehash" 19 | body: "*" 20 | }; 21 | } 22 | 23 | // Account info in the current global state. 24 | rpc Account(AccountRequest) returns (AccountResponse) { 25 | option (google.api.http) = { 26 | post: "/v1/globalstate/account" 27 | body: "*" 28 | }; 29 | } 30 | 31 | // Query for account related data such as rewards, tx receipts and account info 32 | // 33 | // Note: it might be too expensive to add a param for layer to get these results from 34 | // as it may require indexing all global state changes per account by layer. 35 | // If it is possible to index by layer then we should add param start_layer to 36 | // AccountDataParams. Currently it will return data from genesis. 37 | rpc AccountDataQuery(AccountDataQueryRequest) returns (AccountDataQueryResponse) { 38 | option (google.api.http) = { 39 | post: "/v1/globalstate/accountdataquery" 40 | body: "*" 41 | }; 42 | } 43 | 44 | ////////// Streams 45 | 46 | // Get a stream of account related changes such as account balance change, 47 | // tx receipts and rewards 48 | rpc AccountDataStream(AccountDataStreamRequest) returns (stream AccountDataStreamResponse); 49 | 50 | // New global state computed for a layer by the STF 51 | rpc GlobalStateStream(GlobalStateStreamRequest) returns (stream GlobalStateStreamResponse); 52 | } 53 | -------------------------------------------------------------------------------- /spacemesh/v1/global_state_types.proto: -------------------------------------------------------------------------------- 1 | syntax = "proto3"; 2 | 3 | import "spacemesh/v1/types.proto"; 4 | 5 | package spacemesh.v1; 6 | 7 | message AccountState { 8 | uint64 counter = 1; // aka nonce 9 | Amount balance = 2; // known account balance 10 | } 11 | 12 | message Account { 13 | AccountId account_id = 1; // account public address 14 | AccountState state_current = 2; // current state 15 | AccountState state_projected = 3; // projected state (includes pending txs) 16 | } 17 | 18 | // All data items that touch an account (see below note, under the associated 19 | // message) 20 | enum AccountDataFlag { 21 | ACCOUNT_DATA_FLAG_UNSPECIFIED = 0; 22 | ACCOUNT_DATA_FLAG_TRANSACTION_RECEIPT = 1; // tx receipt for a tx to or from an account 23 | ACCOUNT_DATA_FLAG_REWARD = 2; // reward awarded to an account 24 | ACCOUNT_DATA_FLAG_ACCOUNT = 4; // account data changes (counter or balance) 25 | } 26 | 27 | message AccountRequest { 28 | AccountId account_id = 1; 29 | } 30 | 31 | message AccountResponse { 32 | Account account_wrapper = 1; 33 | } 34 | 35 | message AccountDataFilter { 36 | AccountId account_id = 1; 37 | uint32 account_data_flags = 2; // bit field of AccountDataFlag 38 | } 39 | 40 | message AccountDataStreamRequest { 41 | AccountDataFilter filter = 1; 42 | } 43 | 44 | message AccountDataStreamResponse { 45 | AccountData datum = 1; 46 | } 47 | 48 | message AccountDataQueryRequest { 49 | AccountDataFilter filter = 1; 50 | uint32 max_results = 2; // max numbers of results client would like to get 51 | uint32 offset = 3; // return results from offset 52 | } 53 | 54 | message TransactionReceipt { 55 | TransactionId id = 1; // the source transaction 56 | enum TransactionResult { // the results of STF transaction processing 57 | TRANSACTION_RESULT_UNSPECIFIED = 0; 58 | TRANSACTION_RESULT_EXECUTED = 1; // executed w/o error by the STF 59 | TRANSACTION_RESULT_BAD_COUNTER = 2; // unexpected transaction counter 60 | TRANSACTION_RESULT_RUNTIME_EXCEPTION = 3; // app code exception 61 | TRANSACTION_RESULT_INSUFFICIENT_GAS = 4; // out of gas 62 | TRANSACTION_RESULT_INSUFFICIENT_FUNDS = 5; // failed due to sender's insufficient funds 63 | } 64 | TransactionResult result = 2; // tx processing result 65 | uint64 gas_used = 3; // gas units used by the transaction 66 | Amount fee = 4; // transaction fee charged for the transaction (in smidge, gas_price * gas_used) 67 | LayerNumber layer = 5; // the layer in which the STF processed this transaction 68 | uint32 index = 6; // the index of the tx in the ordered list of txs to be executed by stf in the layer. 69 | bytes svm_data = 7; // svm binary data. Decode with svm-codec 70 | } 71 | 72 | // All data items that touch an account: receipts for transactions from, or to 73 | // this account, as well as those that modify its state (e.g., token transfers). 74 | // Rewards here includes fees paid. Account contains counter and balance updates. 75 | // Note that this mixes concerns: transactions and rewards are _causes_ of a 76 | // change to account state; nonce and balance updates are _results_. 77 | message AccountData { 78 | oneof datum { 79 | Reward reward = 1; 80 | TransactionReceipt receipt = 2; 81 | Account account_wrapper = 3; 82 | } 83 | } 84 | 85 | message AccountDataQueryResponse { 86 | uint32 total_results = 1; 87 | repeated AccountData account_item = 2; 88 | } 89 | 90 | enum GlobalStateDataFlag { 91 | GLOBAL_STATE_DATA_FLAG_UNSPECIFIED = 0; 92 | GLOBAL_STATE_DATA_FLAG_TRANSACTION_RECEIPT = 1; // tx receipt generated 93 | GLOBAL_STATE_DATA_FLAG_REWARD = 2; // reward awarded to an account (includes fees paid) 94 | GLOBAL_STATE_DATA_FLAG_ACCOUNT = 4; // account data changes (counter or balance) 95 | GLOBAL_STATE_DATA_FLAG_GLOBAL_STATE_HASH = 8; // hash of global state (i.e., state root) 96 | } 97 | 98 | message GlobalStateHash { 99 | bytes root_hash = 1; 100 | LayerNumber layer = 2; 101 | } 102 | 103 | // For now this is empty but in future we might want to allow this to take a 104 | // layer number. 105 | message GlobalStateHashRequest {} 106 | 107 | message GlobalStateHashResponse { 108 | GlobalStateHash response = 1; 109 | } 110 | 111 | message GlobalStateStreamRequest { 112 | uint32 global_state_data_flags = 1; // bit field of GlobalStateDataFlag 113 | } 114 | 115 | message GlobalStateData { 116 | oneof datum { 117 | Reward reward = 1; 118 | TransactionReceipt receipt = 2; 119 | Account account_wrapper = 3; 120 | GlobalStateHash global_state = 4; 121 | } 122 | } 123 | 124 | message GlobalStateStreamResponse { 125 | GlobalStateData datum = 1; 126 | } 127 | -------------------------------------------------------------------------------- /spacemesh/v1/mesh.proto: -------------------------------------------------------------------------------- 1 | syntax = "proto3"; 2 | 3 | import "google/api/annotations.proto"; 4 | import "spacemesh/v1/mesh_types.proto"; 5 | import "google/api/visibility.proto"; 6 | 7 | package spacemesh.v1; 8 | 9 | // Readonly API for basic mesh info 10 | service MeshService { 11 | option (google.api.api_visibility).restriction = "V1"; 12 | 13 | // Network genesis time as unix epoch time 14 | rpc GenesisTime(GenesisTimeRequest) returns (GenesisTimeResponse) { 15 | option (google.api.http) = { 16 | post: "/v1/mesh/genesistime" 17 | body: "*" 18 | }; 19 | } 20 | 21 | // Current layer number 22 | rpc CurrentLayer(CurrentLayerRequest) returns (CurrentLayerResponse) { 23 | option (google.api.http) = { 24 | post: "/v1/mesh/currentlayer" 25 | body: "*" 26 | }; 27 | } 28 | 29 | // Current epoch number 30 | rpc CurrentEpoch(CurrentEpochRequest) returns (CurrentEpochResponse) { 31 | option (google.api.http) = { 32 | post: "/v1/mesh/currentepoch" 33 | body: "*" 34 | }; 35 | } 36 | 37 | // Genesis ID 38 | rpc GenesisID(GenesisIDRequest) returns (GenesisIDResponse) { 39 | option (google.api.http) = { 40 | post: "/v1/mesh/genesisid" 41 | body: "*" 42 | }; 43 | } 44 | 45 | // Number of layers per epoch (a network parameter) 46 | rpc EpochNumLayers(EpochNumLayersRequest) returns (EpochNumLayersResponse) { 47 | option (google.api.http) = { 48 | post: "/v1/mesh/epochnumlayers" 49 | body: "*" 50 | }; 51 | } 52 | 53 | // Layer duration (a network parameter) 54 | rpc LayerDuration(LayerDurationRequest) returns (LayerDurationResponse) { 55 | option (google.api.http) = { 56 | post: "/v1/mesh/layerduration" 57 | body: "*" 58 | }; 59 | } 60 | 61 | // Number of transactions per second (a network parameter) 62 | rpc MaxTransactionsPerSecond(MaxTransactionsPerSecondRequest) returns (MaxTransactionsPerSecondResponse) { 63 | option (google.api.http) = { 64 | post: "/v1/mesh/maxtransactionspersecond" 65 | body: "*" 66 | }; 67 | } 68 | 69 | ////////// Queries 70 | // Queries return paginated, historical data. 71 | 72 | // Get account data query 73 | rpc AccountMeshDataQuery(AccountMeshDataQueryRequest) returns (AccountMeshDataQueryResponse) { 74 | option (google.api.http) = { 75 | post: "/v1/mesh/accountmeshdataquery" 76 | body: "*" 77 | }; 78 | } 79 | 80 | // Layers data query 81 | rpc LayersQuery(LayersQueryRequest) returns (LayersQueryResponse) { 82 | option (google.api.http) = { 83 | post: "/v1/mesh/layersquery" 84 | body: "*" 85 | }; 86 | } 87 | 88 | ////////// Streams 89 | // Streams return live, new data as it becomes available to the node and not 90 | // historical data. 91 | 92 | // A stream of transactions and activations from an account. 93 | // Includes simple coin transactions with the account as the destination. 94 | rpc AccountMeshDataStream(AccountMeshDataStreamRequest) returns (stream AccountMeshDataStreamResponse); 95 | 96 | // Layer with blocks, transactions and activations 97 | // Sent each time layer data changes. Designed for heavy-duty clients. 98 | rpc LayerStream(LayerStreamRequest) returns (stream LayerStreamResponse); 99 | 100 | // Epoch activation transactions. 101 | rpc EpochStream(EpochStreamRequest) returns (stream EpochStreamResponse); 102 | 103 | rpc MalfeasanceQuery(MalfeasanceRequest) returns (MalfeasanceResponse); 104 | rpc MalfeasanceStream(MalfeasanceStreamRequest) returns (stream MalfeasanceStreamResponse); 105 | } 106 | -------------------------------------------------------------------------------- /spacemesh/v1/mesh_types.proto: -------------------------------------------------------------------------------- 1 | syntax = "proto3"; 2 | 3 | import "spacemesh/v1/types.proto"; 4 | 5 | package spacemesh.v1; 6 | 7 | message GenesisTimeRequest {} 8 | 9 | message GenesisTimeResponse { 10 | SimpleInt unixtime = 1; 11 | } 12 | 13 | message CurrentLayerRequest {} 14 | 15 | message CurrentLayerResponse { 16 | LayerNumber layernum = 1; 17 | } 18 | 19 | message CurrentEpochRequest {} 20 | 21 | message CurrentEpochResponse { 22 | EpochNumber epochnum = 1; 23 | } 24 | 25 | message GenesisIDRequest {} 26 | 27 | message GenesisIDResponse { 28 | bytes genesis_id = 1; 29 | } 30 | 31 | message EpochNumLayersRequest {} 32 | 33 | message EpochNumLayersResponse { 34 | LayerNumber numlayers = 1; 35 | } 36 | 37 | message LayerDurationRequest {} 38 | 39 | message LayerDurationResponse { 40 | // layer duration, in seconds 41 | SimpleInt duration = 1; 42 | } 43 | 44 | message MaxTransactionsPerSecondRequest {} 45 | 46 | message MaxTransactionsPerSecondResponse { 47 | SimpleInt max_txs_per_second = 1; 48 | } 49 | 50 | enum AccountMeshDataFlag { 51 | ACCOUNT_MESH_DATA_FLAG_UNSPECIFIED = 0; 52 | ACCOUNT_MESH_DATA_FLAG_TRANSACTIONS = 1; 53 | ACCOUNT_MESH_DATA_FLAG_ACTIVATIONS = 2; 54 | } 55 | 56 | message AccountMeshDataFilter { 57 | AccountId account_id = 1; 58 | uint32 account_mesh_data_flags = 2; // A bit field of AccountMeshDataFlags 59 | } 60 | 61 | message AccountMeshData { 62 | oneof datum { 63 | MeshTransaction mesh_transaction = 1; 64 | Activation activation = 2; 65 | } 66 | } 67 | 68 | message AccountMeshDataStreamRequest { 69 | AccountMeshDataFilter filter = 1; 70 | } 71 | 72 | message AccountMeshDataStreamResponse { 73 | AccountMeshData datum = 1; 74 | } 75 | 76 | message AccountMeshDataQueryRequest { 77 | AccountMeshDataFilter filter = 1; 78 | LayerNumber min_layer = 2; // return data only from this layer or later 79 | uint32 max_results = 3; // max number of results to return 80 | uint32 offset = 4; // query offset 81 | } 82 | 83 | message AccountMeshDataQueryResponse { 84 | repeated AccountMeshData data = 1; 85 | uint32 total_results = 2; // total number of availble results 86 | } 87 | 88 | message LayersQueryRequest { 89 | LayerNumber start_layer = 1; 90 | LayerNumber end_layer = 2; 91 | } 92 | 93 | message LayersQueryResponse { 94 | repeated Layer layer = 1; 95 | } 96 | 97 | message LayerStreamRequest {} 98 | 99 | message LayerStreamResponse { 100 | Layer layer = 1; 101 | } 102 | 103 | message EpochStreamRequest { 104 | uint32 epoch = 1; 105 | } 106 | 107 | message EpochStreamResponse { 108 | ActivationId id = 1; 109 | } 110 | 111 | message MalfeasanceRequest { 112 | string smesher_hex = 1; 113 | bool include_proof = 2; 114 | } 115 | 116 | message MalfeasanceResponse { 117 | MalfeasanceProof proof = 1; 118 | } 119 | 120 | message MalfeasanceStreamRequest { 121 | bool include_proof = 1; 122 | } 123 | 124 | message MalfeasanceStreamResponse { 125 | MalfeasanceProof proof = 1; 126 | } 127 | -------------------------------------------------------------------------------- /spacemesh/v1/node.proto: -------------------------------------------------------------------------------- 1 | syntax = "proto3"; 2 | 3 | import "google/api/annotations.proto"; 4 | import "google/protobuf/empty.proto"; 5 | import "spacemesh/v1/node_types.proto"; 6 | import "google/api/visibility.proto"; 7 | 8 | package spacemesh.v1; 9 | 10 | // Readonly basic node data 11 | service NodeService { 12 | option (google.api.api_visibility).restriction = "V1"; 13 | 14 | // A simple test endpoint 15 | rpc Echo(EchoRequest) returns (EchoResponse) { 16 | option (google.api.http) = { 17 | post: "/v1/node/echo" 18 | body: "*" 19 | }; 20 | } 21 | 22 | // Returns the version of the node software as a semver string 23 | rpc Version(google.protobuf.Empty) returns (VersionResponse) { 24 | option (google.api.http) = { 25 | post: "/v1/node/version" 26 | }; 27 | } 28 | 29 | // Returns the github commit hash used to build the node 30 | rpc Build(google.protobuf.Empty) returns (BuildResponse) { 31 | option (google.api.http) = { 32 | post: "/v1/node/build" 33 | }; 34 | } 35 | 36 | // Current node status (net and sync) 37 | rpc Status(StatusRequest) returns (StatusResponse) { 38 | option (google.api.http) = { 39 | post: "/v1/node/status" 40 | body: "*" 41 | }; 42 | } 43 | 44 | // NodeInfo is a node configuration info. 45 | rpc NodeInfo(google.protobuf.Empty) returns (NodeInfoResponse); 46 | 47 | ////////// Node streaming data 48 | 49 | // Node status events (sync and net) 50 | rpc StatusStream(StatusStreamRequest) returns (stream StatusStreamResponse); 51 | 52 | // Node error events 53 | rpc ErrorStream(ErrorStreamRequest) returns (stream ErrorStreamResponse); 54 | } 55 | -------------------------------------------------------------------------------- /spacemesh/v1/node_types.proto: -------------------------------------------------------------------------------- 1 | syntax = "proto3"; 2 | 3 | import "spacemesh/v1/types.proto"; 4 | 5 | package spacemesh.v1; 6 | 7 | message EchoRequest { 8 | SimpleString msg = 1; 9 | } 10 | 11 | message EchoResponse { 12 | SimpleString msg = 1; 13 | } 14 | 15 | message VersionResponse { 16 | SimpleString version_string = 1; 17 | } 18 | 19 | message BuildResponse { 20 | SimpleString build_string = 1; 21 | } 22 | 23 | // current node status 24 | message NodeStatus { 25 | uint64 connected_peers = 1; // number of connected neighbors 26 | bool is_synced = 2; // true when meshed is synced 27 | LayerNumber synced_layer = 3; // the last layer node has synced 28 | LayerNumber top_layer = 4; // top layer is the tip 29 | LayerNumber verified_layer = 5; // the last layer node has verified 30 | } 31 | 32 | message StatusRequest {} 33 | 34 | message StatusResponse { 35 | NodeStatus status = 1; 36 | } 37 | 38 | message StatusStreamRequest {} 39 | 40 | message StatusStreamResponse { 41 | NodeStatus status = 1; 42 | } 43 | 44 | enum LogLevel { 45 | LOG_LEVEL_UNSPECIFIED = 0; 46 | LOG_LEVEL_DEBUG = 1; 47 | LOG_LEVEL_INFO = 2; 48 | LOG_LEVEL_WARN = 3; 49 | LOG_LEVEL_ERROR = 4; 50 | LOG_LEVEL_DPANIC = 5; 51 | LOG_LEVEL_PANIC = 6; 52 | LOG_LEVEL_FATAL = 7; 53 | } 54 | 55 | message NodeError { 56 | LogLevel level = 1; 57 | string module = 2; 58 | string msg = 3; 59 | string stack_trace = 4; 60 | } 61 | 62 | message ErrorStreamRequest {} 63 | 64 | message ErrorStreamResponse { 65 | NodeError error = 1; 66 | } 67 | 68 | message NodeInfoResponse { 69 | string hrp = 1; 70 | uint32 first_genesis = 2; 71 | uint32 effective_genesis = 3; 72 | uint32 epoch_size = 4; 73 | } 74 | -------------------------------------------------------------------------------- /spacemesh/v1/post.proto: -------------------------------------------------------------------------------- 1 | syntax = "proto3"; 2 | 3 | import "spacemesh/v1/post_types.proto"; 4 | import "google/api/visibility.proto"; 5 | 6 | package spacemesh.v1; 7 | 8 | // PostService is used by dedicated PoST nodes to interact with the spacemesh 9 | // node. 10 | service PostService { 11 | option (google.api.api_visibility).restriction = "V1"; 12 | 13 | // Register is a bi-directional stream that allows a dedicated PoST node to connect to the spacemesh node. 14 | // The node will send NodeRequests to PoST and the service will respond with ServiceResponses. 15 | rpc Register(stream ServiceResponse) returns (stream NodeRequest); 16 | } 17 | 18 | // PostInfoService can be used to query information about the states of PoST services. 19 | service PostInfoService { 20 | option (google.api.api_visibility).restriction = "V1"; 21 | 22 | // PostStates returns information about the state of the PoST for all known IDs. 23 | rpc PostStates(PostStatesRequest) returns (PostStatesResponse); 24 | } 25 | -------------------------------------------------------------------------------- /spacemesh/v1/post_types.proto: -------------------------------------------------------------------------------- 1 | syntax = "proto3"; 2 | 3 | package spacemesh.v1; 4 | 5 | /* 6 | * 7 | * PostService types 8 | * 9 | */ 10 | 11 | // NodeRequest is a request sent from the node to the post service. 12 | message NodeRequest { 13 | oneof kind { 14 | MetadataRequest metadata = 1; 15 | GenProofRequest gen_proof = 2; 16 | // InitRequest init = 3; 17 | // ResizeRequest resize = 4; 18 | } 19 | } 20 | 21 | // ServiceResponse is a response sent from the post service to the node. 22 | message ServiceResponse { 23 | oneof kind { 24 | MetadataResponse metadata = 1; 25 | GenProofResponse gen_proof = 2; 26 | // InitResponse init = 3; 27 | // ResizeResponse resize = 4; 28 | } 29 | } 30 | 31 | message GenProofRequest { bytes challenge = 1; } 32 | 33 | message Proof { 34 | uint32 nonce = 1; 35 | bytes indices = 2; 36 | uint64 pow = 3; 37 | } 38 | 39 | message Metadata { 40 | bytes node_id = 1; 41 | bytes commitment_atx_id = 2; 42 | optional uint64 nonce = 3; 43 | 44 | uint32 num_units = 4; 45 | uint64 labels_per_unit = 5; 46 | } 47 | 48 | message ProofMetadata { 49 | bytes challenge = 1; 50 | Metadata meta = 2; 51 | } 52 | 53 | enum GenProofStatus { 54 | GEN_PROOF_STATUS_UNSPECIFIED = 0; 55 | GEN_PROOF_STATUS_OK = 1; 56 | GEN_PROOF_STATUS_ERROR = 2; 57 | } 58 | 59 | message GenProofResponse { 60 | GenProofStatus status = 1; 61 | Proof proof = 2; 62 | ProofMetadata metadata = 3; 63 | } 64 | 65 | message MetadataRequest {} 66 | 67 | message MetadataResponse { 68 | Metadata meta = 1; 69 | } 70 | 71 | /* 72 | * 73 | * PostInfoService types 74 | * 75 | */ 76 | 77 | message PostStatesRequest {} 78 | 79 | message PostState { 80 | enum State { 81 | UNUSED = 0; // not used 82 | IDLE = 1; // post-service is not needed 83 | PROVING = 2; // ID is proving, post-service is needed 84 | } 85 | 86 | bytes id = 1; // public key of the identity (aka Node ID) 87 | State state = 2; 88 | string name = 3; 89 | } 90 | 91 | message PostStatesResponse { 92 | repeated PostState states = 1; 93 | } 94 | -------------------------------------------------------------------------------- /spacemesh/v1/smesher.proto: -------------------------------------------------------------------------------- 1 | syntax = "proto3"; 2 | 3 | import "google/api/annotations.proto"; 4 | import "google/protobuf/empty.proto"; 5 | import "spacemesh/v1/smesher_types.proto"; 6 | import "google/api/visibility.proto"; 7 | 8 | package spacemesh.v1; 9 | 10 | service SmesherService { 11 | option (google.api.api_visibility).restriction = "V1"; 12 | 13 | // Returns true iff node is currently smeshing 14 | rpc IsSmeshing (google.protobuf.Empty) returns (IsSmeshingResponse) { 15 | option (google.api.http) = { 16 | post: "/v1/smesher/issmeshing" 17 | }; 18 | } 19 | 20 | // Starts smeshing, after completing the post setup. 21 | // Changing of the post setup options (e.g., number of units), after initial setup, is supported. 22 | // Returns success if request is accepted by node , failure if it fails 23 | rpc StartSmeshing (StartSmeshingRequest) returns (StartSmeshingResponse) { 24 | option (google.api.http) = { 25 | post: "/v1/smesher/startsmeshing" 26 | body: "*" 27 | }; 28 | } 29 | 30 | // Stops smeshing, or the preceding post setup session, and optionally attempt to 31 | // delete the post setup data files(s). 32 | // Returns success if request is accepted by node, failure if it fails 33 | rpc StopSmeshing (StopSmeshingRequest) returns (StopSmeshingResponse) { 34 | option (google.api.http) = { 35 | post: "/v1/smesher/stopsmeshing" 36 | body: "*" 37 | }; 38 | } 39 | 40 | // Get the Smesher IDs managed by the node 41 | rpc SmesherIDs (google.protobuf.Empty) returns (SmesherIDsResponse) { 42 | option (google.api.http) = { 43 | post: "/v1/smesher/smesherids" 44 | }; 45 | } 46 | 47 | // Get the current coinbase 48 | rpc Coinbase (google.protobuf.Empty) returns (CoinbaseResponse) { 49 | option (google.api.http) = { 50 | post: "/v1/smesher/coinbase" 51 | }; 52 | } 53 | 54 | // Set the coinbase 55 | // Returns success if request succeeds, failure if it fails 56 | rpc SetCoinbase (SetCoinbaseRequest) returns (SetCoinbaseResponse) { 57 | option (google.api.http) = { 58 | post: "/v1/smesher/setcoinbase" 59 | body: "*" 60 | }; 61 | } 62 | 63 | // Returns the Post setup status 64 | rpc PostSetupStatus (google.protobuf.Empty) returns (PostSetupStatusResponse) { 65 | option (google.api.http) = { 66 | post: "/v1/smesher/postsetupstatus" 67 | }; 68 | } 69 | 70 | // Returns a stream of updates for the Post setup status 71 | rpc PostSetupStatusStream (google.protobuf.Empty) returns (stream PostSetupStatusStreamResponse); 72 | 73 | // Returns a list of available Post setup providers 74 | rpc PostSetupProviders (PostSetupProvidersRequest) returns (PostSetupProvidersResponse) { 75 | option (google.api.http) = { 76 | post: "/v1/smesher/postsetupproviders" 77 | body: "*" 78 | }; 79 | } 80 | 81 | // Returns the Post protocol config 82 | rpc PostConfig (google.protobuf.Empty) returns (PostConfigResponse) { 83 | option (google.api.http) = { 84 | post: "/v1/smesher/postconfig" 85 | body: "*" 86 | }; 87 | } 88 | } 89 | -------------------------------------------------------------------------------- /spacemesh/v1/smesher_types.proto: -------------------------------------------------------------------------------- 1 | syntax = "proto3"; 2 | 3 | import "spacemesh/v1/types.proto"; 4 | import "google/rpc/status.proto"; 5 | 6 | package spacemesh.v1; 7 | 8 | message IsSmeshingResponse { 9 | bool is_smeshing = 1; 10 | } 11 | 12 | message StartSmeshingRequest { 13 | // Coinbase account for rewards accumulation. 14 | AccountId coinbase = 1; 15 | 16 | // The Post setup options. 17 | PostSetupOpts opts = 2; 18 | } 19 | 20 | message StartSmeshingResponse { 21 | google.rpc.Status status = 1; 22 | } 23 | 24 | // Param passed to methods to indicate a request to delete data files 25 | message StopSmeshingRequest { 26 | bool delete_files = 1; 27 | } 28 | 29 | message StopSmeshingResponse { 30 | google.rpc.Status status = 1; 31 | } 32 | 33 | message SetCoinbaseRequest { 34 | AccountId id = 1; 35 | } 36 | 37 | message SetCoinbaseResponse { 38 | google.rpc.Status status = 1; 39 | } 40 | 41 | message SmesherIDsResponse { 42 | repeated bytes public_keys = 1; 43 | } 44 | 45 | message CoinbaseResponse { 46 | AccountId account_id = 1; 47 | } 48 | 49 | message PostSetupProvidersRequest { 50 | // Whether to run a short benchmarking session for each provider to evaluate its performance 51 | bool benchmark = 1; 52 | } 53 | 54 | message PostSetupProvidersResponse { 55 | repeated PostSetupProvider providers = 1; 56 | } 57 | 58 | message PostSetupStatusResponse { 59 | PostSetupStatus status = 1; 60 | } 61 | 62 | message PostSetupStatusStreamResponse { 63 | PostSetupStatus status = 1; 64 | } 65 | 66 | message PostConfigResponse { 67 | uint32 bits_per_label = 1; 68 | uint64 labels_per_unit = 2; 69 | uint32 min_num_units = 3; 70 | uint32 max_num_units = 4; 71 | uint32 k1 = 5; 72 | uint32 k2 = 6; 73 | } 74 | 75 | message PostSetupProvider { 76 | uint32 id = 1; // unique id for the provider 77 | string model = 2; // e.g. Nvidia GTX 2700 78 | enum DeviceType { 79 | DEVICE_CLASS_CPU = 0; // useful for testing on systems without a cuda or vulkan GPU 80 | DEVICE_CLASS_GPU = 1; 81 | } 82 | DeviceType device_type = 3; // device type of the provider 83 | uint64 performance = 4; // Estimated performance in hashes per second 84 | } 85 | 86 | // Post setup options, used to define the setup requirements. 87 | message PostSetupOpts { 88 | string data_dir = 1; // User provided path to create the setup data files at 89 | uint32 num_units = 2; // Number of Post data units to generate 90 | uint64 max_file_size = 3; // Max size in bytes of a single file within the data files 91 | optional uint32 provider_id = 4; // A `PostSetupProvider` id 92 | bool throttle = 5; // Throttle down setup phase computations while user is interactive on system 93 | } 94 | 95 | message PostSetupStatus { 96 | enum State { 97 | STATE_UNSPECIFIED = 0; // Lane's favorite impossible value 98 | STATE_NOT_STARTED = 1; // Setup not started 99 | STATE_PREPARED = 2; // Setup prepared 100 | STATE_IN_PROGRESS = 3; // Setup in progress 101 | STATE_PAUSED = 4; // Setup paused 102 | STATE_COMPLETE = 5; // Setup is complete 103 | STATE_ERROR = 6; // Setup last session ended with an error 104 | } 105 | State state = 1; 106 | uint64 num_labels_written = 2; // Number of labels (hashes) written to the data files 107 | PostSetupOpts opts = 3; // setup options previously set by the user 108 | } 109 | -------------------------------------------------------------------------------- /spacemesh/v1/tx.proto: -------------------------------------------------------------------------------- 1 | syntax = "proto3"; 2 | 3 | import "google/api/annotations.proto"; 4 | import "spacemesh/v1/tx_types.proto"; 5 | import "google/api/visibility.proto"; 6 | 7 | package spacemesh.v1; 8 | 9 | // Provides clients a way to submit a tx to the network for processing, and to 10 | // check or follow the "journey" of a tx from mempool to block inclusion to 11 | // mesh to STF processing. This service is separate from the Mesh and 12 | // GlobalState services because txs move across both. 13 | service TransactionService { 14 | option (google.api.api_visibility).restriction = "V1"; 15 | 16 | // Submit a new tx to the node for processing. The response 17 | // TransactionState message contains both the txid of the new tx, as well 18 | // as whether or not it was admitted into the mempool. 19 | rpc SubmitTransaction(SubmitTransactionRequest) returns (SubmitTransactionResponse) { 20 | option (google.api.http) = { 21 | post: "/v1/transaction/submittransaction" 22 | body: "*" 23 | }; 24 | } 25 | 26 | // ParseTransaction without submitting it to the mempool. 27 | // It has a limitation that it will work only for an already spawned accounts, 28 | // and for initial spawn transactions. Client is expected to wait until spawn transaction 29 | // executes before it will submit other transactions. 30 | rpc ParseTransaction(ParseTransactionRequest) returns (ParseTransactionResponse) { 31 | option (google.api.http) = { 32 | post: "/v1/transaction/parsetransaction" 33 | body: "*" 34 | }; 35 | } 36 | 37 | // Returns current tx state for one or more txs which indicates if a tx is 38 | // on the mesh, on its way to the mesh or was rejected and will never get 39 | // to the mesh 40 | rpc TransactionsState(TransactionsStateRequest) returns (TransactionsStateResponse) { 41 | option (google.api.http) = { 42 | post: "/v1/transaction/transactionsstate" 43 | body: "*" 44 | }; 45 | } 46 | 47 | ////////// Streams 48 | // Streams return live, new data as it becomes available to the node and 49 | // not historical data. 50 | 51 | // Returns tx state for one or more txs every time the tx state changes for 52 | // one of these txs 53 | rpc TransactionsStateStream(TransactionsStateStreamRequest) returns (stream TransactionsStateStreamResponse); 54 | 55 | // StreamResults streams historical data and watch live events with transaction results. 56 | rpc StreamResults(TransactionResultsRequest) returns (stream TransactionResult); 57 | } 58 | -------------------------------------------------------------------------------- /spacemesh/v1/tx_types.proto: -------------------------------------------------------------------------------- 1 | syntax = "proto3"; 2 | 3 | import "google/rpc/status.proto"; 4 | import "spacemesh/v1/types.proto"; 5 | 6 | package spacemesh.v1; 7 | 8 | message TransactionsIds { 9 | repeated TransactionId transaction_id = 1; 10 | } 11 | 12 | message SubmitTransactionRequest { 13 | bytes transaction = 1; // signed binary transaction 14 | } 15 | 16 | message SubmitTransactionResponse { 17 | google.rpc.Status status = 1; 18 | TransactionState txstate = 2; 19 | } 20 | 21 | message TransactionsStateRequest { 22 | repeated TransactionId transaction_id = 1; 23 | bool include_transactions = 2; // when true response will include matching transactions in addition to state 24 | } 25 | 26 | message TransactionsStateResponse { 27 | repeated TransactionState transactions_state = 1; 28 | repeated Transaction transactions = 2; 29 | } 30 | 31 | message TransactionsStateStreamRequest { 32 | repeated TransactionId transaction_id = 1; 33 | bool include_transactions = 2; // when true response will include matching transactions in addition to state 34 | } 35 | 36 | message TransactionsStateStreamResponse { 37 | TransactionState transaction_state = 1; 38 | Transaction transaction = 2; 39 | } 40 | 41 | // TransactionState is the "journey" of a tx from mempool to block inclusion to 42 | // mesh to STF processing. To know whether or not the tx actually succeeded, 43 | // and its side effects, check the Receipt in the GlobalStateService. 44 | message TransactionState { 45 | TransactionId id = 1; 46 | enum TransactionState { 47 | TRANSACTION_STATE_UNSPECIFIED = 0; // default state 48 | TRANSACTION_STATE_REJECTED = 1; // rejected from mempool due to, e.g., invalid syntax 49 | TRANSACTION_STATE_INSUFFICIENT_FUNDS = 2; // rejected from mempool by funds check 50 | TRANSACTION_STATE_CONFLICTING = 3; // rejected from mempool due to conflicting counter 51 | TRANSACTION_STATE_MEMPOOL = 4; // in mempool but not on the mesh yet 52 | TRANSACTION_STATE_MESH = 5; // submitted to the mesh 53 | TRANSACTION_STATE_PROCESSED = 6; // processed by STF; check Receipt for success or failure 54 | TRANSACTION_STATE_INEFFECTUAL = 7; // removed from mempool and will be forgotten and never executed 55 | } 56 | TransactionState state = 2; 57 | } 58 | 59 | // TransactionResultsRequest request object for results stream. 60 | message TransactionResultsRequest { 61 | // id is filter by transaction id. 62 | bytes id = 1; 63 | // address is a filter by account address, it could be principal or any affected address. 64 | string address = 2; 65 | // start streaming from this layer. if 0 - stream will start from genesis. 66 | uint32 start = 3; 67 | // end streaming at this layer. if 0 - stream till the latest available layer. 68 | uint32 end = 4; 69 | // watch live data. 70 | bool watch = 5; 71 | } 72 | 73 | message TransactionResult { 74 | enum Status { 75 | SUCCESS = 0; 76 | FAILURE = 1; 77 | INVALID = 2; 78 | } 79 | 80 | Transaction tx = 1; 81 | Status status = 2; 82 | string message = 3; 83 | uint64 gas_consumed = 4; 84 | uint64 fee = 5; 85 | bytes block = 6; 86 | uint32 layer = 7; 87 | repeated string touched_addresses = 8; 88 | } 89 | 90 | message ParseTransactionRequest { 91 | bytes transaction = 1; // signed binary transaction 92 | bool verify = 2; // if true signature verification will be executed 93 | } 94 | 95 | message ParseTransactionResponse { 96 | Transaction tx = 1; 97 | } 98 | -------------------------------------------------------------------------------- /spacemesh/v1/types.proto: -------------------------------------------------------------------------------- 1 | syntax = "proto3"; 2 | 3 | package spacemesh.v1; 4 | 5 | message SimpleInt { 6 | uint64 value = 1; 7 | } 8 | 9 | message SimpleString { 10 | string value = 1; 11 | } 12 | 13 | // A non-negative coin amount, in smidge 14 | message Amount { 15 | uint64 value = 1; 16 | } 17 | 18 | message AccountId { 19 | string address = 1; 20 | } 21 | 22 | message TransactionId { 23 | bytes id = 1; 24 | } 25 | 26 | message ActivationId { 27 | bytes id = 1; 28 | } 29 | 30 | message SmesherId { 31 | bytes id = 1; 32 | } 33 | 34 | // An Activation "transaction" (ATX) 35 | message Activation { 36 | ActivationId id = 1; 37 | LayerNumber layer = 2; // the layer that this activation is part of 38 | SmesherId smesher_id = 3; // id of smesher who created the ATX 39 | AccountId coinbase = 4; // coinbase account id 40 | // previous ATX pointed to 41 | // deprecated to support ATX V2 and merging of ATXs: use previous_atxs instead 42 | // a merged ATX might reference multiple previous ATXs 43 | ActivationId prev_atx = 5 [deprecated = true]; 44 | uint32 num_units = 6; // number of PoST data commitment units 45 | uint64 sequence = 7; 46 | repeated ActivationId previous_atxs = 8; // previous ATXs 47 | } 48 | 49 | // An immutable Spacemesh transaction. 50 | // do not include mutable data such as tx state or result. 51 | message Transaction { 52 | bytes id = 1; 53 | AccountId principal = 2; 54 | AccountId template = 3; 55 | uint32 method = 4; // this is actually limited by uint8, but no type for that. 56 | Nonce nonce = 5; 57 | LayerLimits limits = 6; 58 | uint64 max_gas = 7; 59 | uint64 gas_price = 8; 60 | uint64 max_spend = 9; 61 | bytes raw = 10; 62 | } 63 | 64 | message LayerLimits { 65 | uint32 min = 1; 66 | uint32 max = 2; 67 | } 68 | 69 | message Nonce { 70 | uint64 counter = 1; 71 | uint32 bitfield = 2; // this is actually limited by uint8, but no type for that. 72 | } 73 | 74 | 75 | // Transaction that was added to the mesh. 76 | message MeshTransaction { 77 | Transaction transaction = 1; 78 | LayerNumber layer_id = 2; 79 | } 80 | 81 | message Reward { 82 | LayerNumber layer = 1; // layer award was paid in 83 | Amount total = 2; // total reward paid (sum of tx fee and layer reward) 84 | Amount layer_reward = 3; // tx_fee = total - layer_reward 85 | LayerNumber layer_computed = 4; // layer number of the layer when reward was computed 86 | AccountId coinbase = 5; // account awarded this reward 87 | SmesherId smesher = 6; // id of smesher who earned this reward 88 | } 89 | 90 | message Block { 91 | bytes id = 1; // block hash 92 | repeated Transaction transactions = 2; // block transactions 93 | ActivationId activation_id = 3; // the smesher's activation that this block refers to 94 | SmesherId smesher_id = 4; // the id of the smesher who submitted this block 95 | } 96 | 97 | message Layer { 98 | LayerNumber number = 1; // layer number - not hash - layer content may change 99 | enum LayerStatus { 100 | LAYER_STATUS_UNSPECIFIED = 0; // not yet approved or confirmed 101 | LAYER_STATUS_APPROVED = 1; // approved by hare 102 | LAYER_STATUS_CONFIRMED = 2; // confirmed by tortoise 103 | LAYER_STATUS_APPLIED = 3; // applied in state 104 | } 105 | LayerStatus status = 2; 106 | bytes hash = 3; // computer layer hash - do we need this? 107 | repeated Block blocks = 4; // layer's blocks 108 | repeated Activation activations = 5; // list of layer's activations 109 | bytes root_state_hash = 6; // when available - the root state hash of global state in this layer 110 | } 111 | 112 | message LayerNumber { 113 | uint32 number = 1; 114 | } 115 | 116 | message EpochNumber { 117 | uint32 number = 1; 118 | } 119 | 120 | message MalfeasanceProof { 121 | SmesherId smesher_id = 1; 122 | LayerNumber layer = 2; 123 | enum MalfeasanceType { 124 | MALFEASANCE_UNSPECIFIED = 0; 125 | MALFEASANCE_ATX = 1; 126 | MALFEASANCE_BALLOT = 2; 127 | MALFEASANCE_HARE = 3; 128 | MALFEASANCE_POST_INDEX = 4; 129 | MALFEASANCE_INCORRECT_PREV_ATX = 5; 130 | } 131 | MalfeasanceType kind = 3; 132 | string debug_info = 4; 133 | bytes proof = 5; 134 | } 135 | -------------------------------------------------------------------------------- /spacemesh/v2alpha1/account.proto: -------------------------------------------------------------------------------- 1 | syntax = "proto3"; 2 | 3 | import "google/api/visibility.proto"; 4 | 5 | package spacemesh.v2alpha1; 6 | 7 | message Account { 8 | string address = 1; // account public address 9 | AccountState current = 2; // current state 10 | AccountState projected = 3; // projected state (includes pending txs) 11 | string template = 4; // account template address 12 | } 13 | 14 | message AccountState { 15 | uint64 counter = 1; // aka nonce 16 | uint64 balance = 2; // account balance in smidge 17 | uint32 layer = 3; // account balance as of layer X 18 | } 19 | 20 | message AccountRequest { 21 | repeated string addresses = 1; // list of account addresses 22 | uint64 offset = 2; // adjusts the starting point for data 23 | uint64 limit = 3; // specifies max number of items to fetch// bech32 format including HRP 24 | }; 25 | 26 | message AccountList { 27 | repeated Account accounts = 1; // list of accounts 28 | } 29 | 30 | service AccountService { 31 | option (google.api.api_visibility).restriction = "V2"; 32 | 33 | // List of accounts 34 | // 35 | // List is a method that takes an "{{.RequestType.Name}}" body and returns an "{{.ResponseType.Name}}". 36 | // This method is used to retrieve a list of accounts based on the provided request parameters. 37 | rpc List(AccountRequest) returns (AccountList); 38 | } -------------------------------------------------------------------------------- /spacemesh/v2alpha1/activation.proto: -------------------------------------------------------------------------------- 1 | syntax = "proto3"; 2 | 3 | import "google/api/visibility.proto"; 4 | 5 | package spacemesh.v2alpha1; 6 | 7 | message Activation { 8 | bytes id = 1; 9 | bytes smesher_id = 2; 10 | uint32 publish_epoch = 3; 11 | string coinbase = 4; 12 | uint64 weight = 5; 13 | uint64 height = 6; 14 | uint32 num_units = 7; // number of effective PoST data commitment units 15 | } 16 | 17 | message ActivationStreamRequest { 18 | uint32 start_epoch = 1; // Apply `start_epoch/end_epoch` filters together with `coinbase` filter for better performance. 19 | uint32 end_epoch = 2; 20 | repeated bytes id = 3; 21 | repeated bytes smesher_id = 4; 22 | string coinbase = 5; // `coinbase` filter is not supported by database index and will result in sequential scan. 23 | bool watch = 6; 24 | } 25 | 26 | service ActivationStreamService { 27 | option (google.api.api_visibility).restriction = "INTERNAL"; 28 | 29 | rpc Stream(ActivationStreamRequest) returns (stream Activation); 30 | } 31 | 32 | message ActivationRequest { 33 | uint32 start_epoch = 1; // starting epoch for the query 34 | uint32 end_epoch = 2; // ending epoch for the query 35 | repeated bytes id = 3; // list of activation IDs 36 | repeated bytes smesher_id = 4; // list of smesher IDs 37 | string coinbase = 5; // `coinbase` filter is not supported by database index and will result in sequential scan. 38 | uint64 offset = 6; // adjusts the starting point for data 39 | uint64 limit = 7; // specifies max number of items to fetch 40 | } 41 | 42 | message ActivationList { 43 | repeated Activation activations = 1; // list of activations 44 | } 45 | 46 | message ActivationsCountRequest { 47 | optional uint32 epoch = 1; // epoch number 48 | } 49 | 50 | message ActivationsCountResponse { 51 | uint32 count = 1; // number of activations for the specified epoch 52 | } 53 | 54 | message HighestRequest { 55 | } 56 | 57 | message HighestResponse { 58 | Activation activation = 1; 59 | } 60 | 61 | service ActivationService { 62 | option (google.api.api_visibility).restriction = "V2"; 63 | 64 | // List of activations 65 | // 66 | // List is a method that takes an "{{.RequestType.Name}}" body and returns an "{{.ResponseType.Name}}". 67 | // This method is used to retrieve a list of activations based on the provided request parameters. 68 | rpc List(ActivationRequest) returns (ActivationList); 69 | 70 | // Count of activations 71 | // 72 | // ActivationsCount is a method that takes an "{{.RequestType.Name}}" body and returns an "{{.ResponseType.Name}}". 73 | // This method is used to retrieve the count of activations for a specified epoch. 74 | rpc ActivationsCount(ActivationsCountRequest) returns (ActivationsCountResponse); 75 | 76 | // Highest 77 | // 78 | // Highest is a method that takes an "{{.RequestType.Name}}" body and returns an "{{.ResponseType.Name}}". 79 | // This method is used to retrieve the activation with the highest tick count. 80 | rpc Highest(HighestRequest) returns (HighestResponse); 81 | } 82 | -------------------------------------------------------------------------------- /spacemesh/v2alpha1/block.proto: -------------------------------------------------------------------------------- 1 | syntax = "proto3"; 2 | 3 | package spacemesh.v2alpha1; 4 | 5 | message Block { 6 | bytes id = 1; // block hash 7 | } 8 | -------------------------------------------------------------------------------- /spacemesh/v2alpha1/layer.proto: -------------------------------------------------------------------------------- 1 | syntax = "proto3"; 2 | 3 | import "spacemesh/v2alpha1/block.proto"; 4 | import "google/api/visibility.proto"; 5 | import "spacemesh/v2alpha1/v2alpha1.proto"; 6 | 7 | package spacemesh.v2alpha1; 8 | 9 | message Layer { 10 | uint32 number = 1; // layer number - not hash - layer content may change 11 | enum LayerStatus { 12 | LAYER_STATUS_UNSPECIFIED = 0; 13 | LAYER_STATUS_APPLIED = 1; // applied by hare 14 | LAYER_STATUS_VERIFIED = 2; // verified by tortoise 15 | } 16 | LayerStatus status = 2; 17 | string consensus_hash = 3; 18 | bytes state_hash = 4; // fingerprint of the computed state at the layer 19 | bytes cumulative_state_hash = 5; // cumulative fingerprint that uniquely identifies state since genesis 20 | Block block = 6; // layer's block 21 | } 22 | 23 | message LayerRequest { 24 | uint32 start_layer = 1; // starting layer for the query 25 | uint32 end_layer = 2; // ending layer for the query 26 | uint64 offset = 3; // adjusts the starting point for data 27 | uint64 limit = 4; // specifies max number of items to fetch 28 | SortOrder sort_order = 5; // specifies the sort order (default is ASC) 29 | }; 30 | 31 | message LayerList { 32 | repeated Layer layers = 1; // list of layers 33 | } 34 | 35 | service LayerService { 36 | option (google.api.api_visibility).restriction = "V2"; 37 | 38 | // List of layers 39 | // 40 | // List is a method that takes a "{{.RequestType.Name}}" body and returns an "{{.ResponseType.Name}}". 41 | // This method is used to retrieve a list of layers based on the provided request parameters. 42 | rpc List(LayerRequest) returns (LayerList); 43 | } 44 | 45 | message LayerStreamRequest { 46 | uint32 start_layer = 1; 47 | uint32 end_layer = 2; 48 | bool watch = 3; 49 | }; 50 | 51 | service LayerStreamService { 52 | option (google.api.api_visibility).restriction = "INTERNAL"; 53 | 54 | rpc Stream(LayerStreamRequest) returns (stream Layer); 55 | } -------------------------------------------------------------------------------- /spacemesh/v2alpha1/malfeasance.proto: -------------------------------------------------------------------------------- 1 | syntax = "proto3"; 2 | 3 | import "google/api/visibility.proto"; 4 | 5 | package spacemesh.v2alpha1; 6 | 7 | message MalfeasanceProof { 8 | bytes smesher = 1; 9 | 10 | enum MalfeasanceDomain { 11 | DOMAIN_UNSPECIFIED = 0; // for legacy proofs 12 | DOMAIN_ACTIVATION = 1; // ATX related proofs 13 | DOMAIN_BALLOT = 2; // Ballot related proofs 14 | DOMAIN_HARE = 3; // Hare related proofs 15 | } 16 | MalfeasanceDomain domain = 2; 17 | 18 | // type of the malfeasance proof, depends on domain 19 | // 20 | // for legacy proofs the types are 21 | // 1 - Double publish of ATX 22 | // 2 - Multiple ballots for a layer by same smesher 23 | // 3 - Hare Equivocation (currently unused) 24 | // 4 - ATX with invalid PoST proof published 25 | // 5 - ATX referencing an invalid previous ATX published 26 | uint32 type = 3; 27 | 28 | // Properties of the Malfeasance proof, different for every type of proof 29 | map properties = 4; 30 | } 31 | 32 | message MalfeasanceRequest { 33 | repeated bytes smesher_id = 1; // list of smesher ids to fetch (can be empty for all) 34 | uint64 offset = 2; // adjusts the starting point for data 35 | uint64 limit = 3; // specifies max number of items to fetch 36 | } 37 | 38 | message MalfeasanceList { 39 | repeated MalfeasanceProof proofs = 1; // list of malfeasance proofs 40 | } 41 | 42 | service MalfeasanceService { 43 | option (google.api.api_visibility).restriction = "V2"; 44 | 45 | // List of malfeasance proofs 46 | // 47 | // List is a method that takes a "{{.RequestType.Name}}" body and returns an "{{.ResponseType.Name}}". 48 | // This method is used to retrieve a list of malfeasance proofs based on the provided request parameters. 49 | rpc List(MalfeasanceRequest) returns (MalfeasanceList); 50 | } 51 | 52 | message MalfeasanceStreamRequest { 53 | repeated bytes smesher_id = 1; // list of smesher ids to watch 54 | bool watch = 2; 55 | } 56 | 57 | service MalfeasanceStreamService { 58 | option (google.api.api_visibility).restriction = "INTERNAL"; 59 | 60 | rpc Stream(MalfeasanceStreamRequest) returns (stream MalfeasanceProof); 61 | } 62 | -------------------------------------------------------------------------------- /spacemesh/v2alpha1/network.proto: -------------------------------------------------------------------------------- 1 | syntax = "proto3"; 2 | 3 | import "google/protobuf/timestamp.proto"; 4 | import "google/protobuf/duration.proto"; 5 | import "google/api/visibility.proto"; 6 | 7 | package spacemesh.v2alpha1; 8 | 9 | message NetworkInfoResponse { 10 | google.protobuf.Timestamp genesis_time = 1; // genesis time of the network, represented as a timestamp 11 | google.protobuf.Duration layer_duration = 3; // duration of each layer in the network, specified as a duration 12 | bytes genesis_id = 4; 13 | string hrp = 5; 14 | uint32 effective_genesis_layer = 6; // effective genesis layer, i.e., first layer after genesis initialization period 15 | uint32 layers_per_epoch = 7; // number of layers per epoch 16 | uint64 labels_per_unit = 8; // number of labels per unit 17 | } 18 | 19 | message NetworkInfoRequest {} 20 | 21 | service NetworkService { 22 | option (google.api.api_visibility).restriction = "V2"; 23 | 24 | // Network information 25 | // 26 | // Info is a method that returns an "{{.ResponseType.Name}}". 27 | // This method is used to retrieve network information. 28 | rpc Info(NetworkInfoRequest) returns (NetworkInfoResponse); 29 | } -------------------------------------------------------------------------------- /spacemesh/v2alpha1/node.proto: -------------------------------------------------------------------------------- 1 | syntax = "proto3"; 2 | 3 | import "google/api/visibility.proto"; 4 | 5 | package spacemesh.v2alpha1; 6 | 7 | message NodeStatusResponse { 8 | uint64 connected_peers = 1; // number of connected neighbors 9 | enum SyncStatus { 10 | SYNC_STATUS_UNSPECIFIED = 0; 11 | SYNC_STATUS_OFFLINE = 1; 12 | SYNC_STATUS_SYNCING = 2; 13 | SYNC_STATUS_SYNCED = 3; 14 | } 15 | SyncStatus status = 2; // node sync status 16 | uint32 latest_layer = 3; // latest layer node has seen from blocks 17 | uint32 applied_layer = 4; // last layer node has applied to the state 18 | uint32 processed_layer = 5; // last layer whose votes have been processed 19 | uint32 current_layer = 6; // current layer, based on clock time 20 | } 21 | 22 | message NodeStatusRequest {} 23 | 24 | service NodeService { 25 | option (google.api.api_visibility).restriction = "V2"; 26 | 27 | // Node status 28 | // 29 | // Status is a method that returns an "{{.ResponseType.Name}}". 30 | // This method is used to retrieve node status information. 31 | rpc Status(NodeStatusRequest) returns (NodeStatusResponse); 32 | } -------------------------------------------------------------------------------- /spacemesh/v2alpha1/reward.proto: -------------------------------------------------------------------------------- 1 | syntax = "proto3"; 2 | 3 | import "google/api/visibility.proto"; 4 | import "spacemesh/v2alpha1/v2alpha1.proto"; 5 | 6 | package spacemesh.v2alpha1; 7 | 8 | message Reward { 9 | uint32 layer = 1; // layer award was paid in 10 | uint64 total = 2; // total reward paid in smidge (sum of tx fee and layer reward) 11 | uint64 layer_reward = 3; // tx_fee = total - layer_reward 12 | string coinbase = 5; // account awarded this reward 13 | bytes smesher = 6; // id of smesher who earned this reward 14 | } 15 | 16 | message RewardRequest { 17 | uint32 start_layer = 1; // starting layer for the query 18 | uint32 end_layer = 2; // ending layer for the query 19 | oneof filter_by { 20 | string coinbase = 3; // filter by coinbase 21 | bytes smesher = 4; // filter by smesher 22 | } // filter by coinbase or smesher 23 | uint64 offset = 5; // adjusts the starting point for data 24 | uint64 limit = 6; // specifies max number of items to fetch 25 | SortOrder sort_order = 7; // specifies the sort order by layer (default is ASC) 26 | } 27 | 28 | message RewardList { 29 | repeated Reward rewards = 1; // list of rewards 30 | } 31 | 32 | service RewardService { 33 | option (google.api.api_visibility).restriction = "V2"; 34 | 35 | // List of rewards 36 | // 37 | // List is a method that takes a "{{.RequestType.Name}}" body and returns an "{{.ResponseType.Name}}". 38 | // This method is used to retrieve a list of rewards based on the provided request parameters. 39 | rpc List(RewardRequest) returns (RewardList); 40 | } 41 | 42 | message RewardStreamRequest { 43 | uint32 start_layer = 1; 44 | uint32 end_layer = 2; 45 | oneof filter_by { 46 | string coinbase = 3; 47 | bytes smesher = 4; 48 | } 49 | bool watch = 5; 50 | } 51 | 52 | service RewardStreamService { 53 | option (google.api.api_visibility).restriction = "INTERNAL"; 54 | 55 | rpc Stream(RewardStreamRequest) returns (stream Reward); 56 | } -------------------------------------------------------------------------------- /spacemesh/v2alpha1/v2alpha1.proto: -------------------------------------------------------------------------------- 1 | syntax = "proto3"; 2 | 3 | import "protoc-gen-openapiv2/options/annotations.proto"; 4 | 5 | package spacemesh.v2alpha1; 6 | 7 | option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_swagger) = { 8 | info: { 9 | title: "Spacemesh API", 10 | contact: { 11 | name: "Spacemesh", 12 | url: "https://spacemesh.io/", 13 | }, 14 | license: { 15 | name: "MIT License", 16 | url: "https://github.com/spacemeshos/go-spacemesh/blob/develop/LICENSE", 17 | }, 18 | extensions: { 19 | key: "x-logo", 20 | value: { 21 | struct_value: { 22 | fields: { 23 | key: "url", 24 | value: { string_value: "https://docs.spacemesh.io/img/logo.png" } 25 | } 26 | fields: { 27 | key: "altText", 28 | value: { string_value: "Spacemesh Logo" } 29 | } 30 | }, 31 | }, 32 | } 33 | }, 34 | schemes: HTTPS, 35 | consumes: "application/json", 36 | produces: "application/json", 37 | host: "testnet-api.spacemesh.network", 38 | }; 39 | 40 | enum SortOrder { 41 | ASC = 0; 42 | DESC = 1; 43 | } 44 | -------------------------------------------------------------------------------- /spacemesh/v2beta1/account.proto: -------------------------------------------------------------------------------- 1 | syntax = "proto3"; 2 | 3 | import "google/api/annotations.proto"; 4 | import "google/api/visibility.proto"; 5 | 6 | package spacemesh.v2beta1; 7 | 8 | message Account { 9 | string address = 1; // account public address 10 | AccountState current = 2; // current state 11 | AccountState projected = 3; // projected state (includes pending txs) 12 | string template = 4; // account template address 13 | } 14 | 15 | message AccountState { 16 | uint64 counter = 1; // aka nonce 17 | uint64 balance = 2; // account balance in smidge 18 | uint32 layer = 3; // account balance as of layer X 19 | } 20 | 21 | message AccountRequest { 22 | repeated string addresses = 1; // list of account addresses 23 | uint64 offset = 2; // adjusts the starting point for data 24 | uint64 limit = 3; // specifies max number of items to fetch// bech32 format including HRP 25 | }; 26 | 27 | message AccountList { 28 | repeated Account accounts = 1; // list of accounts 29 | } 30 | 31 | service AccountService { 32 | option (google.api.api_visibility).restriction = "v2beta1"; 33 | 34 | // List of accounts 35 | // 36 | // List is a method that takes an "{{.RequestType.Name}}" body and returns an "{{.ResponseType.Name}}". 37 | // This method is used to retrieve a list of accounts based on the provided request parameters. 38 | rpc List(AccountRequest) returns (AccountList) { 39 | option (google.api.http) = { 40 | get: "/spacemesh.v2beta1.AccountService/List" 41 | }; 42 | }; 43 | } 44 | -------------------------------------------------------------------------------- /spacemesh/v2beta1/activation.proto: -------------------------------------------------------------------------------- 1 | syntax = "proto3"; 2 | 3 | import "google/api/annotations.proto"; 4 | import "google/api/visibility.proto"; 5 | 6 | package spacemesh.v2beta1; 7 | 8 | message Activation { 9 | bytes id = 1; 10 | bytes smesher_id = 2; 11 | uint32 publish_epoch = 3; 12 | string coinbase = 4; 13 | uint64 weight = 5; 14 | uint64 height = 6; 15 | uint32 num_units = 7; // number of effective PoST data commitment units 16 | } 17 | 18 | message ActivationStreamRequest { 19 | uint32 start_epoch = 1; // Apply `start_epoch/end_epoch` filters together with `coinbase` filter for better performance. 20 | uint32 end_epoch = 2; 21 | repeated bytes id = 3; 22 | repeated bytes smesher_id = 4; 23 | string coinbase = 5; // `coinbase` filter is not supported by database index and will result in sequential scan. 24 | bool watch = 6; 25 | } 26 | 27 | service ActivationStreamService { 28 | option (google.api.api_visibility).restriction = "INTERNAL"; 29 | 30 | rpc Stream(ActivationStreamRequest) returns (stream Activation); 31 | } 32 | 33 | message ActivationRequest { 34 | uint32 start_epoch = 1; // starting epoch for the query 35 | uint32 end_epoch = 2; // ending epoch for the query 36 | repeated bytes id = 3; // list of activation IDs 37 | repeated bytes smesher_id = 4; // list of smesher IDs 38 | string coinbase = 5; // `coinbase` filter is not supported by database index and will result in sequential scan. 39 | uint64 offset = 6; // adjusts the starting point for data 40 | uint64 limit = 7; // specifies max number of items to fetch 41 | } 42 | 43 | message ActivationList { 44 | repeated Activation activations = 1; // list of activations 45 | } 46 | 47 | message ActivationsCountRequest { 48 | optional uint32 epoch = 1; // epoch number 49 | } 50 | 51 | message ActivationsCountResponse { 52 | uint32 count = 1; // number of activations for the specified epoch 53 | } 54 | 55 | message HighestRequest { 56 | } 57 | 58 | message HighestResponse { 59 | Activation activation = 1; 60 | } 61 | 62 | service ActivationService { 63 | option (google.api.api_visibility).restriction = "v2beta1"; 64 | 65 | // List of activations 66 | // 67 | // List is a method that takes an "{{.RequestType.Name}}" body and returns an "{{.ResponseType.Name}}". 68 | // This method is used to retrieve a list of activations based on the provided request parameters. 69 | rpc List(ActivationRequest) returns (ActivationList) { 70 | option (google.api.http) = { 71 | get: "/spacemesh.v2beta1.ActivationService/List" 72 | }; 73 | }; 74 | 75 | // Count of activations 76 | // 77 | // ActivationsCount is a method that takes an "{{.RequestType.Name}}" body and returns an "{{.ResponseType.Name}}". 78 | // This method is used to retrieve the count of activations for a specified epoch. 79 | rpc ActivationsCount(ActivationsCountRequest) returns (ActivationsCountResponse) { 80 | option (google.api.http) = { 81 | get: "/spacemesh.v2beta1.ActivationService/ActivationsCount" 82 | }; 83 | }; 84 | 85 | // Highest 86 | // 87 | // Highest is a method that takes an "{{.RequestType.Name}}" body and returns an "{{.ResponseType.Name}}". 88 | // This method is used to retrieve the activation with the highest tick count. 89 | rpc Highest(HighestRequest) returns (HighestResponse) { 90 | option (google.api.http) = { 91 | get: "/spacemesh.v2beta1.ActivationService/Highest" 92 | }; 93 | }; 94 | } 95 | -------------------------------------------------------------------------------- /spacemesh/v2beta1/block.proto: -------------------------------------------------------------------------------- 1 | syntax = "proto3"; 2 | 3 | package spacemesh.v2beta1; 4 | 5 | message Block { 6 | bytes id = 1; // block hash 7 | } 8 | -------------------------------------------------------------------------------- /spacemesh/v2beta1/layer.proto: -------------------------------------------------------------------------------- 1 | syntax = "proto3"; 2 | 3 | import "google/api/annotations.proto"; 4 | import "google/api/visibility.proto"; 5 | import "spacemesh/v2beta1/block.proto"; 6 | import "spacemesh/v2beta1/v2beta1.proto"; 7 | 8 | package spacemesh.v2beta1; 9 | 10 | message Layer { 11 | uint32 number = 1; // layer number - not hash - layer content may change 12 | enum LayerStatus { 13 | LAYER_STATUS_UNSPECIFIED = 0; 14 | LAYER_STATUS_APPLIED = 1; // applied by hare 15 | LAYER_STATUS_VERIFIED = 2; // verified by tortoise 16 | } 17 | LayerStatus status = 2; 18 | string consensus_hash = 3; 19 | bytes state_hash = 4; // fingerprint of the computed state at the layer 20 | bytes cumulative_state_hash = 5; // cumulative fingerprint that uniquely identifies state since genesis 21 | Block block = 6; // layer's block 22 | } 23 | 24 | message LayerRequest { 25 | uint32 start_layer = 1; // starting layer for the query 26 | uint32 end_layer = 2; // ending layer for the query 27 | uint64 offset = 3; // adjusts the starting point for data 28 | uint64 limit = 4; // specifies max number of items to fetch 29 | SortOrder sort_order = 5; // specifies the sort order (default is ASC) 30 | }; 31 | 32 | message LayerList { 33 | repeated Layer layers = 1; // list of layers 34 | } 35 | 36 | service LayerService { 37 | option (google.api.api_visibility).restriction = "v2beta1"; 38 | 39 | // List of layers 40 | // 41 | // List is a method that takes a "{{.RequestType.Name}}" body and returns an "{{.ResponseType.Name}}". 42 | // This method is used to retrieve a list of layers based on the provided request parameters. 43 | rpc List(LayerRequest) returns (LayerList) { 44 | option (google.api.http) = { 45 | get: "/spacemesh.v2beta1.LayerService/List" 46 | }; 47 | }; 48 | } 49 | 50 | message LayerStreamRequest { 51 | uint32 start_layer = 1; 52 | uint32 end_layer = 2; 53 | bool watch = 3; 54 | }; 55 | 56 | service LayerStreamService { 57 | option (google.api.api_visibility).restriction = "INTERNAL"; 58 | 59 | rpc Stream(LayerStreamRequest) returns (stream Layer); 60 | } 61 | -------------------------------------------------------------------------------- /spacemesh/v2beta1/malfeasance.proto: -------------------------------------------------------------------------------- 1 | syntax = "proto3"; 2 | 3 | import "google/api/annotations.proto"; 4 | import "google/api/visibility.proto"; 5 | 6 | package spacemesh.v2beta1; 7 | 8 | message MalfeasanceProof { 9 | bytes smesher = 1; 10 | 11 | enum MalfeasanceDomain { 12 | DOMAIN_UNSPECIFIED = 0; // for legacy proofs 13 | DOMAIN_ACTIVATION = 1; // ATX related proofs 14 | DOMAIN_BALLOT = 2; // Ballot related proofs 15 | DOMAIN_HARE = 3; // Hare related proofs 16 | } 17 | MalfeasanceDomain domain = 2; 18 | 19 | // type of the malfeasance proof, depends on domain 20 | // 21 | // for legacy proofs the types are 22 | // 1 - Double publish of ATX 23 | // 2 - Multiple ballots for a layer by same smesher 24 | // 3 - Hare Equivocation (currently unused) 25 | // 4 - ATX with invalid PoST proof published 26 | // 5 - ATX referencing an invalid previous ATX published 27 | uint32 type = 3; 28 | 29 | // Properties of the Malfeasance proof, different for every type of proof 30 | map properties = 4; 31 | } 32 | 33 | message MalfeasanceRequest { 34 | repeated bytes smesher_id = 1; // list of smesher ids to fetch (can be empty for all) 35 | uint64 offset = 2; // adjusts the starting point for data 36 | uint64 limit = 3; // specifies max number of items to fetch 37 | } 38 | 39 | message MalfeasanceList { 40 | repeated MalfeasanceProof proofs = 1; // list of malfeasance proofs 41 | } 42 | 43 | service MalfeasanceService { 44 | option (google.api.api_visibility).restriction = "v2beta1"; 45 | 46 | // List of malfeasance proofs 47 | // 48 | // List is a method that takes a "{{.RequestType.Name}}" body and returns an "{{.ResponseType.Name}}". 49 | // This method is used to retrieve a list of malfeasance proofs based on the provided request parameters. 50 | rpc List(MalfeasanceRequest) returns (MalfeasanceList) { 51 | option (google.api.http) = { 52 | get: "/spacemesh.v2beta1.MalfeasanceService/List" 53 | }; 54 | } 55 | } 56 | 57 | message MalfeasanceStreamRequest { 58 | repeated bytes smesher_id = 1; // list of smesher ids to watch 59 | bool watch = 2; 60 | } 61 | 62 | service MalfeasanceStreamService { 63 | option (google.api.api_visibility).restriction = "INTERNAL"; 64 | 65 | rpc Stream(MalfeasanceStreamRequest) returns (stream MalfeasanceProof); 66 | } 67 | -------------------------------------------------------------------------------- /spacemesh/v2beta1/network.proto: -------------------------------------------------------------------------------- 1 | syntax = "proto3"; 2 | 3 | import "google/api/annotations.proto"; 4 | import "google/api/visibility.proto"; 5 | import "google/protobuf/duration.proto"; 6 | import "google/protobuf/timestamp.proto"; 7 | 8 | package spacemesh.v2beta1; 9 | 10 | message NetworkInfoResponse { 11 | google.protobuf.Timestamp genesis_time = 1; // genesis time of the network, represented as a timestamp 12 | google.protobuf.Duration layer_duration = 3; // duration of each layer in the network, specified as a duration 13 | bytes genesis_id = 4; 14 | string hrp = 5; 15 | uint32 effective_genesis_layer = 6; // effective genesis layer, i.e., first layer after genesis initialization period 16 | uint32 layers_per_epoch = 7; // number of layers per epoch 17 | uint64 labels_per_unit = 8; // number of labels per unit 18 | } 19 | 20 | message NetworkInfoRequest {} 21 | 22 | service NetworkService { 23 | option (google.api.api_visibility).restriction = "v2beta1"; 24 | 25 | // Network information 26 | // 27 | // Info is a method that returns an "{{.ResponseType.Name}}". 28 | // This method is used to retrieve network information. 29 | rpc Info(NetworkInfoRequest) returns (NetworkInfoResponse) { 30 | option (google.api.http) = { 31 | get: "/spacemesh.v2beta1.NetworkService/Info" 32 | }; 33 | } 34 | } 35 | -------------------------------------------------------------------------------- /spacemesh/v2beta1/node.proto: -------------------------------------------------------------------------------- 1 | syntax = "proto3"; 2 | 3 | import "google/api/annotations.proto"; 4 | import "google/api/visibility.proto"; 5 | 6 | package spacemesh.v2beta1; 7 | 8 | message NodeStatusResponse { 9 | uint64 connected_peers = 1; // number of connected neighbors 10 | enum SyncStatus { 11 | SYNC_STATUS_UNSPECIFIED = 0; 12 | SYNC_STATUS_OFFLINE = 1; 13 | SYNC_STATUS_SYNCING = 2; 14 | SYNC_STATUS_SYNCED = 3; 15 | } 16 | SyncStatus status = 2; // node sync status 17 | uint32 latest_layer = 3; // latest layer node has seen from blocks 18 | uint32 applied_layer = 4; // last layer node has applied to the state 19 | uint32 processed_layer = 5; // last layer whose votes have been processed 20 | uint32 current_layer = 6; // current layer, based on clock time 21 | } 22 | 23 | message NodeStatusRequest {} 24 | 25 | service NodeService { 26 | option (google.api.api_visibility).restriction = "v2beta1"; 27 | 28 | // Node status 29 | // 30 | // Status is a method that returns an "{{.ResponseType.Name}}". 31 | // This method is used to retrieve node status information. 32 | rpc Status(NodeStatusRequest) returns (NodeStatusResponse) { 33 | option (google.api.http) = { 34 | get: "/spacemesh.v2beta1.NodeService/Status" 35 | }; 36 | } 37 | } 38 | -------------------------------------------------------------------------------- /spacemesh/v2beta1/reward.proto: -------------------------------------------------------------------------------- 1 | syntax = "proto3"; 2 | 3 | import "google/api/annotations.proto"; 4 | import "google/api/visibility.proto"; 5 | import "spacemesh/v2beta1/v2beta1.proto"; 6 | 7 | package spacemesh.v2beta1; 8 | 9 | message Reward { 10 | uint32 layer = 1; // layer award was paid in 11 | uint64 total = 2; // total reward paid in smidge (sum of tx fee and layer reward) 12 | uint64 layer_reward = 3; // tx_fee = total - layer_reward 13 | string coinbase = 5; // account awarded this reward 14 | bytes smesher = 6; // id of smesher who earned this reward 15 | } 16 | 17 | message RewardRequest { 18 | uint32 start_layer = 1; // starting layer for the query 19 | uint32 end_layer = 2; // ending layer for the query 20 | oneof filter_by { 21 | string coinbase = 3; // filter by coinbase 22 | bytes smesher = 4; // filter by smesher 23 | } // filter by coinbase or smesher 24 | uint64 offset = 5; // adjusts the starting point for data 25 | uint64 limit = 6; // specifies max number of items to fetch 26 | SortOrder sort_order = 7; // specifies the sort order by layer (default is ASC) 27 | } 28 | 29 | message RewardList { 30 | repeated Reward rewards = 1; // list of rewards 31 | } 32 | 33 | service RewardService { 34 | option (google.api.api_visibility).restriction = "v2beta1"; 35 | 36 | // List of rewards 37 | // 38 | // List is a method that takes a "{{.RequestType.Name}}" body and returns an "{{.ResponseType.Name}}". 39 | // This method is used to retrieve a list of rewards based on the provided request parameters. 40 | rpc List(RewardRequest) returns (RewardList) { 41 | option (google.api.http) = { 42 | get: "/spacemesh.v2beta1.RewardService/List" 43 | }; 44 | }; 45 | } 46 | 47 | message RewardStreamRequest { 48 | uint32 start_layer = 1; 49 | uint32 end_layer = 2; 50 | oneof filter_by { 51 | string coinbase = 3; 52 | bytes smesher = 4; 53 | } 54 | bool watch = 5; 55 | } 56 | 57 | service RewardStreamService { 58 | option (google.api.api_visibility).restriction = "INTERNAL"; 59 | 60 | rpc Stream(RewardStreamRequest) returns (stream Reward); 61 | } 62 | -------------------------------------------------------------------------------- /spacemesh/v2beta1/v2beta1.proto: -------------------------------------------------------------------------------- 1 | syntax = "proto3"; 2 | 3 | package spacemesh.v2beta1; 4 | 5 | enum SortOrder { 6 | ASC = 0; 7 | DESC = 1; 8 | } 9 | --------------------------------------------------------------------------------