-
Notifications
You must be signed in to change notification settings - Fork 14
/
rpc.http
265 lines (218 loc) · 4.74 KB
/
rpc.http
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
# 使用VScode插件:`REST Client`
@url = https://httprentgpu.dbcwallet.io:9002
@url2 = https://httpinfo.dbcwallet.io
@controller = 5GrwvaEF5zXb26Fz9rcQpDWS57CtERHpNehXCPcNoHGKutQY
@stash = 5GNJqTPyNqANBkUVMN1LPPrxXnFouWXoe2wNSmmEoLctxiZY
@machine_id = d43aab0afce785c28105b79785f377363781892d4c3fdc5f1f2049c16fb26c42
@renter = 5GNJqTPyNqANBkUVMN1LPPrxXnFouWXoe2wNSmmEoLctxiZY
@committee = 5GNJqTPyNqANBkUVMN1LPPrxXnFouWXoe2wNSmmEoLctxiZY
###
# 1.1 查询某个资金账户控制的所有机器
# 参数:[资金账户 (stash account)]
POST {{url2}} HTTP/1.1
content-type: application/json
{
"jsonrpc":"2.0",
"id":1,
"method":"onlineProfile_getStakerInfo",
"params": ["{{stash}}"]
}
###
# 1.2 查询机器某个 Era 获得收益
# 参数:[机器ID,EraIndex]
POST {{url}} HTTP/1.1
content-type: application/json
{
"jsonrpc": "2.0",
"id": 1,
"method": "onlineProfile_getMachineEraReward",
"params": ["{{machine_id}}", 1]
}
###
# 1.3 查询机器某个 Era 解锁收益
# 参数:[机器ID,EraIndex]
POST {{url}} HTTP/1.1
content-type: application/json
{
"jsonrpc": "2.0",
"id": 1,
"method": "onlineProfile_getMachineEraReleasedReward",
"params": ["{{machine_id}}", 1]
}
###
# 1.4 查询资金账户某个 Era 获得收益
# 参数:[资金账户,EraIndex]
POST {{url}} HTTP/1.1
content-type: application/json
{
"jsonrpc": "2.0",
"id": 1,
"method": "onlineProfile_getStashEraReward",
"params": ["{{stash}}", 1]
}
###
# 1.5. 查询资金账户某个 Era 解锁奖励
# 参数:[资金账户,EraIndex]
POST {{url}} HTTP/1.1
content-type: application/json
{
"jsonrpc": "2.0",
"id": 1,
"method": "onlineProfile_getStashEraReward",
"params": ["{{stash}}", 1]
}
###
# 1.6. 查询机器详细信息
# 参数:[机器ID]
POST {{url}} HTTP/1.1
content-type: application/json
{
"jsonrpc":"2.0",
"id":1,
"method":"onlineProfile_getMachineInfo",
"params": ["{{machine_id}}"]
}
###
# 1.7. 查看矿工个数
POST {{url}} HTTP/1.1
content-type: application/json
{
"jsonrpc": "2.0",
"id": 1,
"method": "onlineProfile_getStakerNum",
"params": []
}
###
# 1.8. 查看所有机器列表
POST {{url}} HTTP/1.1
content-type: application/json
{
"jsonrpc": "2.0",
"id": 1,
"method": "onlineProfile_getMachineList",
"params": []
}
###
# 1.9 查看 onlineProfile 模块统计信息
POST {{url2}} HTTP/1.1
content-type: application/json
{
"jsonrpc":"2.0",
"id":1,
"method":"onlineProfile_getOpInfo",
"params": []
}
###
# 1.10 获取账户链上身份
# 参数:[账户]
POST {{url}} HTTP/1.1
content-type: application/json
{
"jsonrpc": "2.0",
"id": 1,
"method": "onlineProfile_getStakerIdentity",
"params": ["{{stash}}"]
}
###
# 1.11 获取矿工统计信息
# 参数:[pageIndex, count]
POST {{url}} HTTP/1.1
content-type: application/json
{
"jsonrpc": "2.0",
"id": 1,
"method": "onlineProfile_getStakerListInfo",
"params": [0, 5]
}
###
# 1.12 按位置获取统计信息
POST {{url}} HTTP/1.1
content-type: application/json
{
"jsonrpc": "2.0",
"id": 1,
"method": "onlineProfile_getPosGpuInfo",
"params": []
}
###
# 2.1 committee_getCommitteeList
POST {{url}} HTTP/1.1
content-type: application/json
{
"jsonrpc": "2.0",
"id": 1,
"method": "committee_getCommitteeList",
"params": []
}
###
# 3.1 获取机器分配的委员会列表
# 参数:[机器ID]
POST {{url}} HTTP/1.1
content-type: application/json
{
"jsonrpc":"2.0",
"id":1,
"method":"onlineCommittee_getMachineCommitteeList",
"params": ["{{machine_id}}"]
}
###
# 3.2 获取委员会对机器的审核时间
POST {{url}} HTTP/1.1
content-type: application/json
{
"jsonrpc": "2.0",
"id": 1,
"method": "onlineCommittee_getCommitteeOps",
"params": ["{{committee}}", "{{machine_id}}"]
}
###
# 3.3 获取委员会所有派单的机器列表
POST {{url}} HTTP/1.1
content-type: application/json
{
"jsonrpc": "2.0",
"id": 1,
"method": "onlineCommittee_getCommitteeMachineList",
"params": ["{{committee}}"]
}
###
# 4.1 查看机器的租用信息
POST {{url}} HTTP/1.1
content-type: application/json
{
"jsonrpc": "2.0",
"id": 1,
"method": "rentMachine_getRentOrder",
"params": [1]
}
###
# 4.2 查看某个账户租用的机器列表
POST {{url}} HTTP/1.1
content-type: application/json
{
"jsonrpc": "2.0",
"id": 1,
"method": "rentMachine_getRentList",
"params": ["{{renter}}"]
}
# 新增API
###
# 返回是否是机器租用人
POST {{url}} HTTP/1.1
content-type: application/json
{
"jsonrpc": "2.0",
"id": 1,
"method": "rentMachine_isMachineRenter",
"params": ["{{machine_id}}", "{{renter}}"]
}
###
# 获取机器对应的租用ID
POST {{url}} HTTP/1.1
content-type: application/json
{
"jsonrpc": "2.0",
"id": 1,
"method": "rentMachine_getMachineRentId",
"params": ["{{machine_id}}"]
}