forked from zpalmtree/karai-docs
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathswagger.json
More file actions
261 lines (261 loc) · 8.39 KB
/
swagger.json
File metadata and controls
261 lines (261 loc) · 8.39 KB
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
{
"openapi": "3.0.1",
"info": {
"title": "go-karai",
"description": "<img src=\"logo.png\" style=\"display: block; margin-left: auto; margin-right: auto; width: 70%;\">\n\n# Intro\n\nThis website documents the API methods available for the `go-karai` program.\n\nThe default base API url is [127.0.0.1:4200/api/v1](http://127.0.0.1:4200/api/v1).\n\nWhen using the docs, be aware that you can click the 'Model' tab to get a description of all available parameters, their types, and an example value.\n\n# Initialization\n\n* Start by launching the `go-karai` program.\n* From a terminal (or via a programming language):\n\n```\n./go-karai -coordinator\n```\n\n* Or if you're on windows:\n\n```\ngo-karai.exe -coordinator\n```\n\n* If you want to see the available configuration options for the `wallet-api`, launch the program with:\n```\n./go-karai -help\n```\n\n# Try it Out\n\nIf you want to test karai out without doing any programming, you can use the 'Try it out' section in swagger.\n\n# API Wrappers\n\nFinally, whilst you may send raw HTTP requests to the API url, you may be interested in an API/RPC wrapper.\n\nThese can be generated for many languages, by using the `Generate Client` option in the top menu.\nBe patient, this can take some time to complete.\n\n# Support\n\nIf you are having issues, please stop by our [discord](http://chat.turtlecoin.lol) and visit the `#dev_karai` channel for assistance.",
"version": "1.0.0"
},
"servers": [
{
"url": "http://zeus.karai.io/api/v1"
},
{
"url": "https://zeus.karai.io/api/v1"
}
],
"tags": [
{
"name": "misc",
"description": "Miscellaneous operations such as status check, peer retrieval, version retrieval"
},
{
"name": "transactions",
"description": "Operations related to transactions"
}
],
"paths": {
"/": {
"get": {
"tags": [
"misc"
],
"summary": "Can be used to verify a coordinator is online",
"responses": {
"200": {
"description": "",
"content": {
"application/json": {
"schema": {
"type": "string",
"example": "Hello go-karai"
}
}
}
}
}
}
},
"/peer": {
"get": {
"tags": [
"misc"
],
"summary": "Get the p2p peer ID of this coordinator",
"responses": {
"200": {
"description": "",
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"p2p_peer_ID": {
"type": "string",
"description": "The p2p peer ID of this coordinator",
"example": "b5c8b20811de384b5018280a4471205cc8300a1250fad93532ea2e2f1518206b"
}
}
}
}
}
}
}
}
},
"/version": {
"get": {
"tags": [
"misc"
],
"summary": "Get the version of the software the coordinator is using",
"responses": {
"200": {
"description": "",
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"karai_version": {
"type": "string",
"description": "The version of the software",
"example": "0.7.1"
}
}
}
}
}
}
}
}
},
"/transactions": {
"get": {
"tags": [
"transactions"
],
"summary": "Retrieve all transactions in the graph",
"responses": {
"200": {
"description": "",
"content": {
"application/json": {
"schema": {
"type": "array",
"items": {
"oneOf": [
{
"$ref": "#/components/schemas/RootTx"
},
{
"$ref": "#/components/schemas/MilestoneTx"
},
{
"$ref": "#/components/schemas/SubgraphTipTx"
},
{
"$ref": "#/components/schemas/StandardTx"
}
]
}
}
}
}
}
}
}
},
"/transaction/send": {
"post": {
"tags": [
"transactions"
],
"summary": "Validate and send a transaction",
"responses": {
"200": {
"description": "This function has not yet been implemented",
"content": {
"application/json": {
"schema": {
"type": "object"
}
}
}
}
}
}
}
},
"components": {
"schemas": {
"RootTx": {
"type": "object",
"properties": {
"tx_type": {
"type": "number",
"example": 0,
"description": "The type of this transaction. 0, for RootTx."
},
"tx_hash": {
"type": "string",
"example": "1ae3529687d8340213f6ffc2c5a4d2747ff35575eb12841e7bfea60660cd69c1",
"description": "The SHA256 hash of the root transaction's contents."
},
"tx_data": {
"type": "string",
"example": "Karai Transaction Channel - Root",
"description": "This is an arbitrary data field."
}
}
},
"MilestoneTx": {
"type": "object",
"properties": {
"tx_type": {
"type": "number",
"example": 1,
"description": "The type of this transaction. 1, for MilestoneTx."
},
"tx_hash": {
"type": "string",
"example": "1ae3529687d8340213f6ffc2c5a4d2747ff35575eb12841e7bfea60660cd69c1",
"description": "The SHA256 hash of the milestone transaction's contents."
},
"tx_prev": {
"type": "string",
"example": "1ae3529687d8340213f6ffc2c5a4d2747ff35575eb12841e7bfea60660cd69c1",
"description": "The SHA256 hash of the previous transaction"
},
"tx_data": {
"type": "array",
"items": {
"type": "object"
}
}
}
},
"SubgraphTipTx": {
"type": "object",
"properties": {
"tx_type": {
"type": "number",
"example": 2,
"description": "The type of this transaction. 2, for SubgraphTipTx."
},
"tx_hash": {
"type": "string",
"example": "1ae3529687d8340213f6ffc2c5a4d2747ff35575eb12841e7bfea60660cd69c1",
"description": "The SHA256 hash of the subgraph tip transaction's contents."
},
"tx_prev": {
"type": "string",
"example": "1ae3529687d8340213f6ffc2c5a4d2747ff35575eb12841e7bfea60660cd69c1",
"description": "The SHA256 hash of the previous transaction"
},
"tx_data": {
"type": "array",
"items": {
"type": "object"
}
}
}
},
"StandardTx": {
"type": "object",
"properties": {
"tx_type": {
"type": "number",
"example": 3,
"description": "The type of this transaction. 3, for StandardTx."
},
"tx_hash": {
"type": "string",
"example": "1ae3529687d8340213f6ffc2c5a4d2747ff35575eb12841e7bfea60660cd69c1",
"description": "The SHA256 hash of the standard transaction's contents."
},
"tx_prev": {
"type": "string",
"example": "1ae3529687d8340213f6ffc2c5a4d2747ff35575eb12841e7bfea60660cd69c1",
"description": "The SHA256 hash of the previous transaction"
},
"tx_data": {
"type": "array",
"items": {
"type": "object"
}
}
}
}
}
}
}