forked from pokt-network/pocket
-
Notifications
You must be signed in to change notification settings - Fork 0
/
openapi.yaml
208 lines (197 loc) · 5.33 KB
/
openapi.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
openapi: 3.0.3
servers:
- url: "http://localhost:50832"
info:
description: >-
This is the API definition Pocket Network Node RPC interface.
Pocket is a distributed network that relays data requests and responses to and from any blockchain system.
Pocket verifies all relayed data and proportionally rewards the participating nodes with POKT.
version: 1.0.0
title: Pocket Network
termsOfService: "https://pokt.network/terms/"
contact:
email: [email protected]
license:
name: MIT License
url: "https://github.com/pokt-network/pocket/blob/main/LICENSE"
tags:
- name: version
description: Version of the Pocket API
- name: health
description: Liveness of the Pocket API node
- name: client
description: Dispatch and relay services
- name: consensus
description: Consensus related methods
paths:
/v1/health:
get:
tags:
- health
summary: Get the liveness of the Pocket API node
responses:
"200":
description: Healthy
"404":
description: Unhealthy - Unreachable
"500":
description: Unhealthy - Server Error
/v1/version:
get:
tags:
- version
summary: Get the current version of the Pocket Network API
responses:
default:
description: Default response
content:
text/plain:
schema:
type: string
example: 1.0.0
/v1/consensus/state:
get:
tags:
- consensus
summary: Gets the current height, round and step
responses:
default:
description: Default response
content:
application/json:
schema:
$ref: "#/components/schemas/ConsensusState"
example: { "height": 75016, "round": 0, "step": 3 }
/v1/client/broadcast_tx_sync:
post:
tags:
- client
summary: Broadcast raw transaction bytes
requestBody:
description: Raw transaction to be broadcasted
required: true
content:
application/json:
schema:
$ref: "#/components/schemas/RawTXRequest"
responses:
"200":
description: Transaction added to the mempool without errors
"400":
description: Bad request
content:
text/plain:
example: "description of failure"
"500":
description: An error occurred while adding the transaction to the mempool
content:
text/plain:
example: "description of failure"
/v1/p2p/staked_actors_address_book:
get:
tags:
- p2p
summary: Returns the protocol actor address book
parameters:
- in: query
name: height
required: false
schema:
type: integer
format: int64
minimum: 0
description: The height the query will be executed on. By default it uses the current height of the consensus module. This may be the latest height if synched or an earlier height if synching.
- in: query
name: actor_type
required: false
schema:
$ref: "#/components/schemas/ActorTypesEnum"
description: The type of actor the address book will be populated with. By default it returns an address book for all protocol actors supported by the blockchain
responses:
"200":
description: Staked actors response
content:
application/json:
schema:
$ref: "#/components/schemas/P2PStakedActorsResponse"
"400":
description: Bad request
content:
text/plain:
example: "description of failure"
"500":
description: An error occurred while retrieving the staked actors address book
content:
text/plain:
example: "description of failure"
externalDocs:
description: Find out more about Pocket Network
url: "https://pokt.network"
components:
schemas:
RawTXRequest:
type: object
required:
- address
- raw_hex_bytes
properties:
address:
type: string
raw_hex_bytes:
type: string
ConsensusState:
type: object
required:
- height
- round
- step
properties:
height:
type: integer
format: int64
round:
type: integer
format: int64
step:
type: integer
format: int64
Actor:
type: object
required:
- type
- address
- public_key
- service_url
properties:
type:
$ref: "#/components/schemas/ActorTypesEnum"
address:
type: string
public_key:
type: string
service_url:
type: string
P2PStakedActorsResponse:
type: object
required:
- actors
- height
properties:
actors:
type: "array"
items:
$ref: "#/components/schemas/Actor"
height:
type: integer
format: int64
ActorTypesEnum:
type: string
enum:
- validator
- servicer
- fisherman
- application
securitySchemes: {}
links: {}
callbacks: {}
security: []