├── README.md └── node-http └── hsd.yaml /README.md: -------------------------------------------------------------------------------- 1 | # HSD OPENAPI 2 | 3 | This repository stores an OpenAPI spec file for Handshake nodes. 4 | 5 | The goal of this repository is to store versioned history of supported http API calls on various 6 | HSD implementations. 7 | -------------------------------------------------------------------------------- /node-http/hsd.yaml: -------------------------------------------------------------------------------- 1 | --- 2 | openapi: 3.0.2 3 | info: 4 | title: hsd2 5 | license: 6 | name: MIT License 7 | url: https://opensource.org/licenses/MIT 8 | version: 0.1.0 9 | servers: 10 | - url: http://{domain}:{port} 11 | description: 'Local HSD node ' 12 | variables: 13 | domain: 14 | default: localhost 15 | description: The traditional value if the user has a Handshake node running 16 | locally 17 | port: 18 | default: "13037" 19 | description: The variable for testnet 20 | - url: '{domain}:{port}' 21 | description: Mainnet 22 | variables: 23 | domain: 24 | default: localhost 25 | port: 26 | default: "12037" 27 | description: Port for mainnet Handshake installation 28 | paths: 29 | /reset: 30 | summary: Reset chain to specific height 31 | description: This will reset the chain used by the node to the specified height. 32 | The node will then begin to rsync the chain from that height to the tip. 33 | post: 34 | requestBody: 35 | content: 36 | application/json: 37 | schema: 38 | type: integer 39 | examples: 40 | Reset Chain to Block 100: 41 | value: 42 | height: 100 43 | required: true 44 | responses: 45 | 200: 46 | description: Returned if the reset is successful 47 | content: 48 | application/json: 49 | schema: 50 | type: boolean 51 | examples: 52 | Successful Reset: 53 | value: 54 | success: true 55 | 400: 56 | description: Returned if the height is poorly formatted 57 | content: 58 | application/json: 59 | schema: 60 | $ref: '#/components/schemas/Error' 61 | examples: 62 | Height too high: 63 | value: 64 | error: 65 | message: Height cannot be greater than chain tip. 66 | 500: 67 | description: Block not found 68 | content: 69 | application/json: 70 | schema: 71 | $ref: '#/components/schemas/Error' 72 | examples: 73 | Block not found: 74 | value: 75 | error: 76 | message: Block not found. 77 | components: 78 | schemas: 79 | info: 80 | title: Root Type for info 81 | description: The root of the info type's schema. 82 | type: object 83 | properties: 84 | version: 85 | type: string 86 | network: 87 | type: string 88 | chain: 89 | type: object 90 | properties: 91 | height: 92 | format: int32 93 | type: integer 94 | tip: 95 | type: string 96 | progress: 97 | format: int32 98 | type: integer 99 | pool: 100 | type: object 101 | properties: 102 | host: 103 | type: string 104 | port: 105 | format: int32 106 | type: integer 107 | agent: 108 | type: string 109 | services: 110 | type: string 111 | outbound: 112 | format: int32 113 | type: integer 114 | inbound: 115 | format: int32 116 | type: integer 117 | mempool: 118 | type: object 119 | properties: 120 | tx: 121 | format: int32 122 | type: integer 123 | size: 124 | format: int32 125 | type: integer 126 | time: 127 | type: object 128 | properties: 129 | uptime: 130 | format: int32 131 | type: integer 132 | system: 133 | format: int32 134 | type: integer 135 | adjusted: 136 | format: int32 137 | type: integer 138 | offset: 139 | format: int32 140 | type: integer 141 | memory: 142 | type: object 143 | properties: 144 | total: 145 | format: int32 146 | type: integer 147 | jsHeap: 148 | format: int32 149 | type: integer 150 | jsHeapTotal: 151 | format: int32 152 | type: integer 153 | nativeHeap: 154 | format: int32 155 | type: integer 156 | external: 157 | format: int32 158 | type: integer 159 | example: |- 160 | { 161 | "version": "0.0.0", 162 | "network": "testnet", 163 | "chain": { 164 | "height": 3601, 165 | "tip": "a06c2b7a61ed896f12fbb552311acebad0d4e8392f08cbd16e1ed946813afd01", 166 | "progress": 1 167 | }, 168 | "pool": { 169 | "host": "199.185.131.97", 170 | "port": 13038, 171 | "agent": "/hsd:0.0.0/", 172 | "services": "1", 173 | "outbound": 8, 174 | "inbound": 0 175 | }, 176 | "mempool": { 177 | "tx": 0, 178 | "size": 0 179 | }, 180 | "time": { 181 | "uptime": 5, 182 | "system": 1556137851, 183 | "adjusted": 1556137851, 184 | "offset": 0 185 | }, 186 | "memory": { 187 | "total": 64, 188 | "jsHeap": 20, 189 | "jsHeapTotal": 34, 190 | "nativeHeap": 29, 191 | "external": 17 192 | } 193 | } 194 | Covenant: 195 | title: Root Type for Covenant 196 | description: A Covenant that is stored inside of a Transaction 197 | type: object 198 | properties: 199 | type: 200 | format: int32 201 | description: The numeric type value of the covenant 202 | type: integer 203 | action: 204 | description: The action this covenant takes 205 | type: string 206 | items: 207 | description: An array of the data for this covenant 208 | type: array 209 | items: {} 210 | example: 211 | type: 0 212 | action: NONE 213 | items: [] 214 | UTXO: 215 | title: Root Type for UTXO 216 | description: A representation of an Unspent Transaction Output 217 | type: object 218 | example: |- 219 | { 220 | "version": 0, 221 | "height": 3326, 222 | "value": 1999997520, 223 | "address": "ts1q4w0y9jaemmk78u66sfk4klufkk5qdr9ly5kuvn", 224 | "covenant": { 225 | "type": 0, 226 | "action": "NONE", 227 | "items": [] 228 | }, 229 | "coinbase": false, 230 | "hash": "c3c404c36a0c78b59cbad20d4466f336bd3e9a99d0fcb7a361bceceacff3911f", 231 | "index": 1 232 | } 233 | Transaction: 234 | title: Root Type for Transaction 235 | description: The root of the Transaction type's schema. 236 | required: [] 237 | type: object 238 | properties: 239 | hash: 240 | type: string 241 | witnessHash: 242 | type: string 243 | fee: 244 | format: int32 245 | type: integer 246 | rate: 247 | format: int32 248 | type: integer 249 | mtime: 250 | format: int32 251 | type: integer 252 | height: 253 | format: int32 254 | type: integer 255 | time: 256 | format: int32 257 | type: integer 258 | index: 259 | format: int32 260 | type: integer 261 | version: 262 | format: int32 263 | type: integer 264 | inputs: 265 | type: array 266 | items: {} 267 | outputs: 268 | type: array 269 | items: {} 270 | locktime: 271 | format: int32 272 | type: integer 273 | hex: 274 | type: string 275 | confirmations: 276 | format: int32 277 | type: integer 278 | block: 279 | type: string 280 | example: 281 | hash: a659ea7e126074e0ec41bed48867e388e65bfbc7a1fd6445aaefb0dba457175c 282 | witnessHash: fc4ec969d257f5e921fa020f0d240298caf362c058a1480756c25cabe5276813 283 | fee: 0 284 | rate: 0 285 | mtime: 1556137846 286 | height: 3601 287 | block: a06c2b7a61ed896f12fbb552311acebad0d4e8392f08cbd16e1ed946813afd01 288 | time: 1556136594 289 | index: 0 290 | version: 0 291 | inputs: 292 | - prevout: 293 | hash: "0000000000000000000000000000000000000000000000000000000000000000" 294 | index: 4294967295 295 | witness: 296 | - 6d696e656420627920687364 297 | - 5817336bc6a09544 298 | - "0000000000000000" 299 | sequence: 4037084422 300 | outputs: 301 | - value: 2000000000 302 | address: ts1q6hkprx5zsfzxsed5ekpqjr05vy4su3sdszynaz 303 | covenant: 304 | type: 0 305 | action: NONE 306 | items: [] 307 | locktime: 3601 308 | hex: 00000000010000000000000000000000000000000000000000000000000000000000000000ffffffff0605a1f00100943577000000000014d5ec119a8282446865b4cd82090df4612b0e460d0000110e0000030c6d696e656420627920687364085817336bc6a09544080000000000000000 309 | confirmations: 2 310 | Error: 311 | title: Root Type for Error 312 | description: Non-standard error thrown by the daemon - i.e. 500 313 | type: object 314 | properties: 315 | message: 316 | description: The error message 317 | type: string 318 | type: 319 | description: The specific type of error 320 | type: string 321 | code: 322 | description: The error code 323 | type: integer 324 | example: |- 325 | { 326 | "error": { 327 | "message": "Block not found." 328 | } 329 | } 330 | --------------------------------------------------------------------------------