-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathapi_spec.yml
295 lines (289 loc) · 9.55 KB
/
api_spec.yml
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
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
openapi: 3.0.0
info:
version: 1.0.0
title: ETD Local Admin
description: This is the API Spec for ETD Local Admin. We use this api to manage the connection between Local Web UI and Geth client
servers:
- url: "https://petstore.swagger.io/v1"
paths:
/coinbase:
description: Set or Get Coinbase for current device
get:
description: Get current coinbase
responses:
200:
description: Success Response
content:
application/json:
schema:
type: object
properties:
coinbase:
type: string
example: "0x221770bCF48cDc134a673345088eB762213B71Dc"
post:
description: Set user coinbase
requestBody:
content:
application/json:
schema:
type: object
properties:
coinbase:
type: string
example: "0x221770bCF48cDc134a673345088eB762213B71Dc"
responses:
201:
description: Success Response
content:
application/json:
schema:
type: object
properties:
coinbase:
type: string
example: "0x221770bCF48cDc134a673345088eB762213B71Dc"
time:
type: string
example: "2021-07-09T02:27:11+08:00"
description: Format in Moment JS
500:
description: "Cannot Set Etherbase"
content:
application/json:
schema:
type: object
properties:
error:
type: string
example: "Your coinbase is not in correct format"
time:
type: string
example: "2021-07-09T02:27:11+08:00"
description: Format in Moment JS
/miner/start:
description: Start Mining
post:
description: Start mining process
responses:
201:
description: Success response
500:
description: "Cannot Start mining"
content:
application/json:
schema:
type: object
properties:
error:
type: string
example: "You didn't set your coinbase"
time:
type: string
example: "2021-07-09T02:27:11+08:00"
description: Format in Moment JS
/miner/stop:
description: Stop Mining
post:
description: Stop mining process
responses:
201:
description: Success response
500:
description: "Cannot Stop mining"
content:
application/json:
schema:
type: object
properties:
error:
type: string
example: "You didn't set your coinbase"
time:
type: string
example: "2021-07-09T02:27:11+08:00"
description: Format in Moment JS
/balance:
description: Get the balance for the current device
get:
summary: Get the balance
description: Get the current coinbase's balance
responses:
200:
description: Success response
content:
application/json:
schema:
type: object
properties:
time:
type: string
example: "2021-07-09T02:27:11+08:00"
description: Format in Moment JS
balance:
type: number
example: 60
description: Balance
unit:
type: string
example: etd
description: Unit for the balance
/status/geth:
description: Get status of the current geth server.
get:
description: This will include all the info from geth clients.
For example, peerCount, isMining, blockNumber,
hash rate , local address, Geth Version, and latest block id.
summary: Get Geth info
responses:
200:
description: Success response
content:
application/json:
schema:
type: array
items:
properties:
infoName:
type: string
description: Name of the info
example: Peer Count
infoValue:
type: string
description: Value of the info
example: "10"
500:
description: Unable to fetch geth info
content:
application/json:
schema:
type: object
properties:
error:
type: string
example: We cannot connect to the Geth client. Make sure you start your Geth correctly.
time:
type: string
example: "2021-07-09T02:27:11+08:00"
description: Format in Moment JS
/status/system:
description: Get system status
get:
summary: Get system info
description: Get system info.
Including CPU usage, memory usage, hard drive usage,
system time, docker image version, docker container status,
and auto-update script status.
responses:
200:
description: Success response
content:
application/json:
schema:
type: array
items:
properties:
infoName:
type: string
description: Name of the info
example: CPU Usage
infoValue:
type: string
description: Value of the info
example: "10%"
/logs:
description: Get system logs
get:
summary: Get system logs
description: Get system logs. For example, auto-update log, runner log, and docker logs.
responses:
200:
description: Success response
content:
application/json:
schema:
type: array
items:
properties:
logName:
type: string
description: Log File Name
example: Auto update.log
logValue:
type: string
description: Log File Content
example: "[2021-01-01] Check update"
/peers/add:
description: Add peer
post:
summary: Add peer
description: Add new peer by providing peer url
responses:
201:
description: Success response
500:
description: "Cannot Set Etherbase"
content:
application/json:
schema:
type: object
properties:
error:
type: string
example: "Your coinbase is not in correct format"
time:
type: string
example: "2021-07-09T02:27:11+08:00"
description: Format in Moment JS
/peers:
description: Peers' info
get:
summary: Get connected peers' info
description: Will return all the connected peers
responses:
201:
description: Success response
content:
application/json:
schema:
type: array
items:
properties:
caps:
type: array
items:
type: string
example: "etd/61"
id:
type: string
example: "3f8f61999252251808972871bc810505d5b33f7de761c98810584279dce9ecabb0b7da0836978e6074f48e2b787048739c9dc1f734403c8adafc0716d16f4dcd"
name:
type: string
description: Geth client version
example: Geth/v1.3.5-34b622a2/linux/go1.6
network:
type: object
description: Network infomation for the connnected client
properties:
localAddress:
type: string
example: 192.168.0.105:49356
remoteAddress:
type: string
example: 73.217.192.86:30303
protocols:
type: object
properties:
etd:
type: object
properties:
difficulty:
type: number
description: Hash difficulty
example: 10197633442299193000
head:
type: string
example: "8f2c1a08cfc80eff8e2aa601254d6f094e0e801b2e4f0bf2aefffaead93daa41"
version:
type: number
example: 63