From 85492971c80d07c899bf977671b4afbd8353e173 Mon Sep 17 00:00:00 2001 From: BigBoss Date: Thu, 4 May 2023 23:18:14 -0400 Subject: [PATCH] rebased, minor improvements for docker compose --- .dockerignore | 1 + Makefile | 2 +- .../{fisherman.json => config.fisherman.json} | 0 .../{servicer.json => config.servicer.json} | 2 +- build/deployments/.env.example | 28 +- build/deployments/docker-compose.yaml | 54 +- rpc/v1/openapi.yaml | 902 +++++++++++++++++- utility/session.go | 9 + 8 files changed, 971 insertions(+), 27 deletions(-) create mode 100644 .dockerignore rename build/config/{fisherman.json => config.fisherman.json} (100%) rename build/config/{servicer.json => config.servicer.json} (98%) diff --git a/.dockerignore b/.dockerignore new file mode 100644 index 000000000..c4c53c804 --- /dev/null +++ b/.dockerignore @@ -0,0 +1 @@ +/var diff --git a/Makefile b/Makefile index 8352b0a0d..0b7e67134 100644 --- a/Makefile +++ b/Makefile @@ -160,7 +160,7 @@ build_and_watch: ## Continous build Pocket's main entrypoint as files change # TODO(olshansky): Need to think of a Pocket related name for `compose_and_watch`, maybe just `pocket_watch`? .PHONY: compose_and_watch compose_and_watch: docker_check db_start monitoring_start ## Run a localnet composed of 4 consensus validators w/ hot reload & debugging - ${docker-compose} up --force-recreate node1.consensus node2.consensus node3.consensus node4.consensus + ${docker-compose} up --force-recreate node1.consensus node2.consensus node3.consensus node4.consensus node5.servicer .PHONY: rebuild_and_compose_and_watch rebuild_and_compose_and_watch: docker_check db_start monitoring_start ## Rebuilds the container from scratch and launches compose_and_watch diff --git a/build/config/fisherman.json b/build/config/config.fisherman.json similarity index 100% rename from build/config/fisherman.json rename to build/config/config.fisherman.json diff --git a/build/config/servicer.json b/build/config/config.servicer.json similarity index 98% rename from build/config/servicer.json rename to build/config/config.servicer.json index 2b6baf9de..28391ef5d 100644 --- a/build/config/servicer.json +++ b/build/config/config.servicer.json @@ -29,7 +29,7 @@ "health_check_period": "30s" }, "p2p": { - "hostname": "node1.servicer", + "hostname": "node5.servicer", "port": 42069, "use_rain_tree": true, "is_empty_connection_type": false, diff --git a/build/deployments/.env.example b/build/deployments/.env.example index b763972e4..9ec7cca30 100644 --- a/build/deployments/.env.example +++ b/build/deployments/.env.example @@ -1,21 +1,25 @@ # docker compose stuff # override with your own values if the default host port mappings in docker-compose do not suit you -# NODE1_PORT_7081=127.0.0.1:7081 +# NODE1_DEBUG_PORT=127.0.0.1:7081 # NODE1_PORT_9081=127.0.0.1:9081 -# NODE1_PORT_42070=127.0.0.1:42070 -# NODE1_PORT_50832=127.0.0.1:50832 -# NODE2_PORT_7081=127.0.0.1:7082 +# NODE1_P2P_PORT=127.0.0.1:42070 +# NODE1_RPC_PORT=127.0.0.1:50832 +# NODE2_DEBUG_PORT=127.0.0.1:7082 # NODE2_PORT_9081=127.0.0.1:9082 -# NODE2_PORT_42070=127.0.0.1:42071 -# NODE2_PORT_50832=127.0.0.1:50833 -# NODE3_PORT_7081=127.0.0.1:7083 +# NODE2_P2P_PORT=127.0.0.1:42071 +# NODE2_RPC_PORT=127.0.0.1:50833 +# NODE3_DEBUG_PORT=127.0.0.1:7083 # NODE3_PORT_9081=127.0.0.1:9083 -# NODE3_PORT_42070=127.0.0.1:42072 -# NODE3_PORT_50832=127.0.0.1:50834 -# NODE4_PORT_7081=127.0.0.1:7084 +# NODE3_P2P_PORT=127.0.0.1:42072 +# NODE3_RPC_PORT=127.0.0.1:50834 +# NODE4_DEBUG_PORT=127.0.0.1:7084 # NODE4_PORT_9081=127.0.0.1:9084 -# NODE4_PORT_42070=127.0.0.1:42073 -# NODE4_PORT_50832=127.0.0.1:50835 +# NODE4_P2P_PORT=127.0.0.1:42073 +# NODE4_RPC_PORT=127.0.0.1:50835 +# NODE5_DEBUG_PORT:-0.0.0.0:7085 +# NODE5_PORT_9081:-0.0.0.0:9085 +# NODE5_P2P_PORT:-0.0.0.0:42074 +# NODE5_RPC_PORT:-0.0.0.0:50836 # GRAFANA_PORT_3000=127.0.0.1:3000 # POSTGRES_PORT_5432=127.0.0.1:5432 # LOKI_PORT_3100=127.0.0.1:3100 diff --git a/build/deployments/docker-compose.yaml b/build/deployments/docker-compose.yaml index 3031db52d..67ab5c17c 100755 --- a/build/deployments/docker-compose.yaml +++ b/build/deployments/docker-compose.yaml @@ -42,10 +42,10 @@ services: - "42069" - "50832" ports: - - "${NODE1_PORT_7081:-0.0.0.0:7081}:7081" + - "${NODE1_DEBUG_PORT:-0.0.0.0:7081}:7081" - "${NODE1_PORT_9081:-0.0.0.0:9081}:9080" - - "${NODE1_PORT_42070:-0.0.0.0:42070}:42069" - - "${NODE1_PORT_50832:-0.0.0.0:50832}:50832" + - "${NODE1_P2P_PORT:-0.0.0.0:42070}:42069" + - "${NODE1_RPC_PORT:-0.0.0.0:50832}:50832" volumes: - ${PWD}:/go/src/github.com/pocket-network # Needed for DLV debugging @@ -74,10 +74,10 @@ services: - "9000" - "50832" ports: - - "${NODE2_PORT_7081:-0.0.0.0:7082}:7081" + - "${NODE2_DEBUG_PORT:-0.0.0.0:7082}:7081" - "${NODE2_PORT_9081:-0.0.0.0:9082}:9080" - - "${NODE2_PORT_42070:-0.0.0.0:42071}:42069" - - "${NODE2_PORT_50832:-0.0.0.0:50833}:50832" + - "${NODE2_P2P_PORT:-0.0.0.0:42071}:42069" + - "${NODE2_RPC_PORT:-0.0.0.0:50833}:50832" volumes: - ${PWD}:/go/src/github.com/pocket-network # Needed for DLV debugging @@ -102,10 +102,10 @@ services: - "9000" - "50832" ports: - - "${NODE3_PORT_7081:-0.0.0.0:7083}:7081" + - "${NODE3_DEBUG_PORT:-0.0.0.0:7083}:7081" - "${NODE3_PORT_9081:-0.0.0.0:9083}:9080" - - "${NODE3_PORT_42070:-0.0.0.0:42072}:42069" - - "${NODE3_PORT_50832:-0.0.0.0:50834}:50832" + - "${NODE3_P2P_PORT:-0.0.0.0:42072}:42069" + - "${NODE3_RPC_PORT:-0.0.0.0:50834}:50832" volumes: - ${PWD}:/go/src/github.com/pocket-network # Needed for DLV debugging @@ -130,10 +130,10 @@ services: - "9000" - "50832" ports: - - "${NODE4_PORT_7081:-0.0.0.0:7084}:7081" + - "${NODE4_DEBUG_PORT:-0.0.0.0:7084}:7081" - "${NODE4_PORT_9081:-0.0.0.0:9084}:9080" - - "${NODE4_PORT_42070:-0.0.0.0:42073}:42069" - - "${NODE4_PORT_50832:-0.0.0.0:50835}:50832" + - "${NODE4_P2P_PORT:-0.0.0.0:42073}:42069" + - "${NODE4_RPC_PORT:-0.0.0.0:50835}:50832" volumes: - ${PWD}:/go/src/github.com/pocket-network # Needed for DLV debugging @@ -143,6 +143,36 @@ services: # environment: # - DEBUG_PORT=7084 + node5.servicer: + logging: *loki-logging + container_name: node5.servicer + image: pocket/servicer:latest + command: "build/scripts/watch.sh build/config/config.servicer.json build/config/genesis.json" + build: + context: ../.. + dockerfile: ./build/Dockerfile.localdev + expose: + - "7085" # dlv debug + - "42069" + - "9080" + - "9000" + - "50832" + ports: + - "${NODE5_DEBUG_PORT:-0.0.0.0:7085}:7085" + - "${NODE5_PORT_9081:-0.0.0.0:9085}:9080" + - "${NODE5_P2P_PORT:-0.0.0.0:42074}:42069" + - "${NODE5_RPC_PORT:-0.0.0.0:50836}:50832" + volumes: + - ${PWD}:/go/src/github.com/pocket-network + # Needed for DLV debugging + security_opt: + - "seccomp:unconfined" + # Uncomment to enable DLV debugging + environment: + - POCKET_RPC_USE_CORS=true + - LIBP2P_DEBUG=info + - DEBUG_PORT=7085 + db: logging: *loki-logging container_name: pocket-db diff --git a/rpc/v1/openapi.yaml b/rpc/v1/openapi.yaml index 12a2e1aff..2098324c0 100644 --- a/rpc/v1/openapi.yaml +++ b/rpc/v1/openapi.yaml @@ -1,6 +1,7 @@ openapi: 3.0.3 servers: - url: "http://localhost:50832" + - url: "http://localhost:50836" info: description: >- This is the API definition Pocket Network Node RPC interface. @@ -333,10 +334,619 @@ paths: schema: $ref: "#/components/schemas/AllChainParamsResponse" "500": - description: An error occurred while retrieving the current node parameters + description: An error occurred while retrieving the current chain parameters content: text/plain: example: "description of failure" + /v1/query/app: + post: + tags: + - query + summary: Returns the data for the specific app address at a given height + requestBody: + description: Request application data at the specified height, height = 0 is used as the latest + content: + application/json: + schema: + $ref: "#/components/schemas/QueryAccountHeight" + example: + address: da034209758b78eaea06dd99c07909ab54c99b45 + height: 0 + required: true + responses: + "200": + description: Returns application data at the specified height + content: + application/json: + schema: + $ref: "#/components/schemas/ProtocolActor" + "400": + description: Bad request + content: + text/plain: + example: "description of failure" + "500": + description: An error occurred while retrieving the application data at the specified height + content: + text/plain: + example: "description of failure" + # TODO: (h5law) Determine a parameter to give the request that differentiates + # the staking status of an app and returns only that type of staked application + # This will be equivalent to the `staking_status` field from the V0 RPC spec + /v1/query/apps: + post: + tags: + - query + summary: Returns the data for the all apps at the specified height + requestBody: + description: Request all application data at the specified height, height = 0 is used as the latest; Max per_page=1000 + content: + application/json: + schema: + $ref: "#/components/schemas/QueryHeightPaginated" + example: + height: 0 + page: 1 + per_page: 50 + required: true + responses: + "200": + description: Returns application data at the specified height + content: + application/json: + schema: + $ref: "#/components/schemas/QueryAppsResponse" + "400": + description: Bad request + content: + text/plain: + example: "description of failure" + "500": + description: An error occurred while retrieving all application data at the specified height + content: + text/plain: + example: "description of failure" + /v1/query/balance: + post: + tags: + - query + summary: Returns the balance of the account at the specified height + requestBody: + description: Request account balance at the specified height, height = 0 is used as the latest + content: + application/json: + schema: + $ref: "#/components/schemas/QueryAccountHeight" + example: + address: da034209758b78eaea06dd99c07909ab54c99b45 + height: 99 + required: true + responses: + "200": + description: Returns account balance at the specified height + content: + application/json: + schema: + $ref: "#/components/schemas/QueryBalanceResponse" + "400": + description: Bad request + content: + text/plain: + example: "description of failure" + "500": + description: An error occurred while retrieving the account balance at the specified height + content: + text/plain: + example: "description of failure" + /v1/query/block: + post: + tags: + - query + summary: Returns the block structure at the specified height + requestBody: + description: Request the block at the specified height, height = 0 is used as the latest + content: + application/json: + schema: + $ref: "#/components/schemas/QueryHeight" + example: + height: 0 + required: true + responses: + "200": + description: Returns block structure at the specified height + content: + application/json: + schema: + $ref: "#/components/schemas/QueryBlockResponse" + "400": + description: Bad request + content: + text/plain: + example: "description of failure" + "500": + description: An error occurred while retrieving the block structure at the specified height + content: + text/plain: + example: "description of failure" + /v1/query/block_txs: + post: + tags: + - query + summary: Returns all the transactions in the block at the specified height + requestBody: + description: Request the transactions in the block at the specified height, height = 0 is used as the latest; Max per_page=1000, can be sorted either asc or desc (default) + content: + application/json: + schema: + $ref: "#/components/schemas/QueryHeightPaginated" + example: + height: 0 + page: 1 + per_page: 1000 + sort: desc + required: true + responses: + "200": + description: Returns all transactions in the block at the specified height + content: + application/json: + schema: + $ref: "#/components/schemas/QueryTxsResponse" + "400": + description: Bad request + content: + text/plain: + example: "description of failure" + "500": + description: An error occurred while retrieving the block transactions at the specified height + content: + text/plain: + example: "description of failure" + /v1/query/fisherman: + post: + tags: + - query + summary: Returns the data for the specific fisherman address at a given height + requestBody: + description: Request fisherman data at the specified height, height = 0 is used as the latest + content: + application/json: + schema: + $ref: "#/components/schemas/QueryAccountHeight" + example: + address: da034209758b78eaea06dd99c07909ab54c99b45 + height: 0 + required: true + responses: + "200": + description: Returns fisherman data at the specified height + content: + application/json: + schema: + $ref: "#/components/schemas/ProtocolActor" + "400": + description: Bad request + content: + text/plain: + example: "description of failure" + "500": + description: An error occurred while retrieving the fisherman data at the specified height + content: + text/plain: + example: "description of failure" + /v1/query/fishermen: + post: + tags: + - query + summary: Returns the data for the all fishermen at the specified height + requestBody: + description: Request all fishermen data at the specified height, height = 0 is used as the latest; Max per_page=1000 + content: + application/json: + schema: + $ref: "#/components/schemas/QueryHeightPaginated" + example: + height: 0 + page: 1 + per_page: 50 + required: true + responses: + "200": + description: Returns all fishermen data at the specified height + content: + application/json: + schema: + $ref: "#/components/schemas/QueryFishermenResponse" + "400": + description: Bad request + content: + text/plain: + example: "description of failure" + "500": + description: An error occurred while retrieving all fishermen data at the specified height + content: + text/plain: + example: "description of failure" + /v1/query/height: + get: + tags: + - query + summary: Returns the current block height + responses: + "200": + description: Returns the current height + content: + application/json: + schema: + $ref: "#/components/schemas/QueryHeight" + "500": + description: An error occurred while retrieving the current height + content: + text/plain: + example: "description of failure" + /v1/query/param: + post: + tags: + - query + requestBody: + description: Request the value of the specified chain parameter at the given height, height = 0 is used as the latest + content: + application/json: + schema: + $ref: "#/components/schemas/QueryParameter" + example: + param: blocks_per_session + height: 2 + required: true + responses: + "200": + description: Returns the value of the parameter at the specified height + content: + application/json: + schema: + $ref: "#/components/schemas/Parameter" + "400": + description: Bad request + content: + text/plain: + example: "description of failure" + "500": + description: An error occurred while retrieving the parameter + content: + text/plain: + example: "description of failure" + /v1/query/servicer: + post: + tags: + - query + summary: Returns the data for the specific servicer address at a given height + requestBody: + description: Request servicer data at the specified height, height = 0 is used as the latest + content: + application/json: + schema: + $ref: "#/components/schemas/QueryAccountHeight" + example: + address: da034209758b78eaea06dd99c07909ab54c99b45 + height: 0 + required: true + responses: + "200": + description: Returns servicer data at the specified height + content: + application/json: + schema: + $ref: "#/components/schemas/ProtocolActor" + "400": + description: Bad request + content: + text/plain: + example: "description of failure" + "500": + description: An error occurred while retrieving the servicer data at the specified height + content: + text/plain: + example: "description of failure" + /v1/query/servicers: + post: + tags: + - query + summary: Returns the data for the all servicers at the specified height + requestBody: + description: Request all servicers data at the specified height, height = 0 is used as the latest; Max per_page=1000 + content: + application/json: + schema: + $ref: "#/components/schemas/QueryHeightPaginated" + example: + height: 0 + page: 1 + per_page: 50 + required: true + responses: + "200": + description: Returns all servicers data at the specified height + content: + application/json: + schema: + $ref: "#/components/schemas/QueryServicersResponse" + "400": + description: Bad request + content: + text/plain: + example: "description of failure" + "500": + description: An error occurred while retrieving all servicers data at the specified height + content: + text/plain: + example: "description of failure" + /v1/query/supply: + post: + tags: + - query + summary: Returns the token supply at the specified height + requestBody: + description: Request the token supply data at the specified height, height = 0 is used as the latest; Max per_page=1000 + content: + application/json: + schema: + $ref: "#/components/schemas/QueryHeight" + example: + height: 0 + required: true + responses: + "200": + description: Returns the token supply data at the specified height + content: + application/json: + schema: + $ref: "#/components/schemas/QuerySupplyResponse" + "400": + description: Bad request + content: + text/plain: + example: "description of failure" + "500": + description: An error occurred while retrieving the token supply data at the specified height + content: + text/plain: + example: "description of failure" + /v1/query/supported_chains: + post: + tags: + - query + summary: Returns the supported chains at the specified height + requestBody: + description: Request the supported chains at the specified height, height = 0 is used as the latest; Max per_page=1000 + content: + application/json: + schema: + $ref: "#/components/schemas/QueryHeight" + example: + height: 0 + required: true + responses: + "200": + description: Returns the supported chains list at the specified height + content: + application/json: + schema: + $ref: "#/components/schemas/QuerySupportedChainsResponse" + "400": + description: Bad request + content: + text/plain: + example: "description of failure" + "500": + description: An error occurred while retrieving the supported chains at the specified height + content: + text/plain: + example: "description of failure" + /v1/query/tx: + post: + tags: + - query + summary: Returns the transaction by its hash + requestBody: + description: Request a transaction from its hash + content: + application/json: + schema: + $ref: "#/components/schemas/QueryHash" + example: + hash: c05a67912d84860ff5db13e29b453c578c3fc0c95333f6a4987b2060f56639b6 + required: true + responses: + "200": + description: Returns the transaction + content: + application/json: + schema: + $ref: "#/components/schemas/IndexedTransaction" + "400": + description: Bad request + content: + text/plain: + example: "description of failure" + "500": + description: An error occurred while retrieving the transaction + content: + text/plain: + example: "description of failure" + /v1/query/unconfirmed_tx: + post: + tags: + - query + summary: Returns the unconfirmed transaction by its hash from mempool + requestBody: + description: Request an unconfirmed transaction currently in the mempool from its hash + content: + application/json: + schema: + $ref: "#/components/schemas/QueryHash" + example: + hash: c05a67912d84860ff5db13e29b453c578c3fc0c95333f6a4987b2060f56639b6 + required: true + responses: + "200": + description: Returns the unconfirmed transaction from the mempool + content: + application/json: + schema: + $ref: "#/components/schemas/IndexedTransaction" + "400": + description: Bad request + content: + text/plain: + example: "description of failure" + "500": + description: An error occurred while retrieving the transaction from the mempool + content: + text/plain: + example: "description of failure" + /v1/query/unconfirmed_txs: + post: + tags: + - query + summary: Returns all unconfirmed transactions handled by the mempool + requestBody: + description: Request the unconfirmed transactions currently in the mempool + content: + application/json: + schema: + $ref: "#/components/schemas/QueryPaginated" + example: + page: 1 + per_page: 1000 + sort: desc + required: true + responses: + "200": + description: Returns all the unconfirmed transactions in the mempool + content: + application/json: + schema: + $ref: "#/components/schemas/QueryTxsResponse" + "400": + description: Bad request + content: + text/plain: + example: "description of failure" + "500": + description: An error occurred while retrieving the transactions in the mempool + content: + text/plain: + example: "description of failure" + /v1/query/upgrade: + post: + tags: + - query + summary: Returns the upgrade information for the specified height + requestBody: + description: Request the upgrade information for the specified height, height = 0 is used as latest + content: + application/json: + schema: + $ref: "#/components/schemas/QueryHeight" + example: + height: 5 + required: true + responses: + "200": + description: Returns the upgrade information for the specified height + content: + application/json: + schema: + $ref: "#/components/schemas/QueryUpgradeResponse" + "400": + description: Bad request + content: + text/plain: + example: "description of failure" + "500": + description: An error occurred while retrieving the update information + content: + text/plain: + example: "description of failure" + /v1/query/validator: + post: + tags: + - query + summary: Returns the data for the specific validator address at a given height + requestBody: + description: Request validator data at the specified height, height = 0 is used as the latest + content: + application/json: + schema: + $ref: "#/components/schemas/QueryAccountHeight" + example: + address: da034209758b78eaea06dd99c07909ab54c99b45 + height: 0 + required: true + responses: + "200": + description: Returns validator data at the specified height + content: + application/json: + schema: + $ref: "#/components/schemas/ProtocolActor" + "400": + description: Bad request + content: + text/plain: + example: "description of failure" + "500": + description: An error occurred while retrieving the validator data at the specified height + content: + text/plain: + example: "description of failure" + /v1/query/validators: + post: + tags: + - query + summary: Returns the data for the all validators at the specified height + requestBody: + description: Request all validators data at the specified height, height = 0 is used as the latest; Max per_page=1000 + content: + application/json: + schema: + $ref: "#/components/schemas/QueryHeightPaginated" + example: + height: 0 + page: 1 + per_page: 50 + required: true + responses: + "200": + description: Returns all validators data at the specified height + content: + application/json: + schema: + $ref: "#/components/schemas/QueryValidatorsResponse" + "400": + description: Bad request + content: + text/plain: + example: "description of failure" + "500": + description: An error occurred while retrieving all validators data at the specified height + content: + text/plain: + example: "description of failure" + /v1/query/nodeRoles: + get: + tags: + - query + summary: Returns the type of utility actor(s) running on the node + responses: + "200": + description: A list of the node's utility actor(s) + content: + application/json: + schema: + type: array + example: ["validator", "servicer"] externalDocs: description: Find out more about Pocket Network @@ -461,6 +1071,58 @@ components: type: string raw_hex_bytes: type: string + RelayRequest: + type: object + required: + - payload + - meta + properties: + payload: + $ref: "#/components/schemas/Payload" + meta: + $ref: "#/components/schemas/RelayRequestMeta" + SessionRequest: + type: object + required: + - app_address + - chain + - geozone + - session_height + properties: + app_address: + type: string + chain: + type: string + geozone: + type: string + session_height: + type: integer + format: int64 + + # Responses + Account: + type: object + required: + - address + - coins + properties: + address: + type: string + coins: + type: array + items: + $ref: "#/components/schemas/Coin" + AllChainParamsResponse: + type: array + items: + $ref: "#/components/schemas/Parameter" + ChallengeResponse: + type: object + required: + - response + properties: + response: + type: string ConsensusState: type: object required: @@ -525,6 +1187,244 @@ components: height: type: integer format: int64 + QueryAccountsResponse: + type: object + required: + - result + - page + - total_pages + properties: + result: + type: array + items: + $ref: "#/components/schemas/Account" + page: + type: integer + format: int64 + total_pages: + type: integer + format: int64 + QueryAccountTxsResponse: + type: object + required: + - txs + - total_txs + - page + - total_pages + properties: + txs: + type: array + items: + $ref: "#/components/schemas/IndexedTransaction" + total_txs: + type: integer + format: int64 + page: + type: integer + format: int64 + total_pages: + type: integer + format: int64 + QueryAppsResponse: + type: object + required: + - apps + - total_apps + - page + - total_pages + properties: + apps: + type: array + items: + $ref: "#/components/schemas/ProtocolActor" + total_apps: + type: integer + format: int64 + page: + type: integer + format: int64 + total_pages: + type: integer + format: int64 + QueryBalanceResponse: + type: object + required: + - balance + properties: + balance: + type: integer + format: int64 + QueryBlockResponse: + type: object + required: + - block + properties: + block: + $ref: "#/components/schemas/Block" + QueryFishermenResponse: + type: object + required: + - fishermen + - total_fishermen + - page + - total_pages + properties: + fishermen: + type: array + items: + $ref: "#/components/schemas/ProtocolActor" + total_fishermen: + type: integer + format: int64 + page: + type: integer + format: int64 + total_pages: + type: integer + format: int64 + QueryServicersResponse: + type: object + required: + - servicers + - total_servicers + - page + - total_pages + properties: + servicers: + type: array + items: + $ref: "#/components/schemas/ProtocolActor" + total_servicers: + type: integer + format: int64 + page: + type: integer + format: int64 + total_pages: + type: integer + format: int64 + QuerySupplyResponse: + type: object + required: + - pools + - total + properties: + pools: + type: array + items: + $ref: "#/components/schemas/Pool" + total: + $ref: "#/components/schemas/Coin" + QuerySupportedChainsResponse: + type: object + required: + - supported_chains + properties: + supported_chains: + type: array + items: + type: string + QueryTxsResponse: + type: object + required: + - transactions + - total_txs + - page + - total_pages + properties: + transactions: + type: array + items: + $ref: "#/components/schemas/IndexedTransaction" + total_txs: + type: integer + format: int64 + page: + type: integer + format: int64 + total_pages: + type: integer + format: int64 + QueryUpgradeResponse: + type: object + required: + - height + - version + properties: + height: + type: integer + format: int64 + version: + type: string + QueryValidatorsResponse: + type: object + required: + - validators + - total_validators + - page + - total_pages + properties: + validators: + type: array + items: + $ref: "#/components/schemas/ProtocolActor" + total_validators: + type: integer + format: int64 + page: + type: integer + format: int64 + total_pages: + type: integer + format: int64 + RelayResponse: + type: object + required: + - payload + - servicer_signature + properties: + payload: + type: string + servicer_signature: + type: string + Session: + type: object + required: + - session_id + - session_number + - session_height + - num_session_blocks + - chain + - geozone + - application + - servicers + - fishermen + properties: + session_id: + type: string + session_number: + type: integer + format: int64 + session_height: + type: integer + format: int64 + num_session_blocks: + type: integer + format: int64 + chain: + type: string + geozone: + type: string + application: + $ref: "#/components/schemas/ProtocolActor" + servicers: + type: array + items: + $ref: "#/components/schemas/ProtocolActor" + fishermen: + type: array + items: + $ref: "#/components/schemas/ProtocolActor" # Types AAT: diff --git a/utility/session.go b/utility/session.go index 65ec4b751..b0ded5d9a 100644 --- a/utility/session.go +++ b/utility/session.go @@ -16,8 +16,17 @@ import ( "github.com/pokt-network/pocket/utility/types" ) +const ( + NodeIsNotServicerErr = "node is not a servicer" +) + // TODO: Implement this func (u *utilityModule) HandleRelay(relay *coreTypes.Relay) (*coreTypes.RelayResponse, error) { + + if u.servicer == nil { + return nil, fmt.Errorf(NodeIsNotServicerErr) + } + return nil, nil }