This repository has been archived by the owner on Apr 13, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 115
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
84 changed files
with
818 additions
and
31,791 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,251 @@ | ||
openapi: "3.0.0" | ||
|
||
info: | ||
version: "0.1" | ||
title: Scorex Node API example | ||
description: API docs for example Scorex project. | ||
contact: | ||
name: Scorex framework Team | ||
email: kushi@protonmail.com | ||
url: https://github.com/scorexfoundation/scorex | ||
license: | ||
name: CC0 1.0 Universal | ||
url: https://raw.githubusercontent.com/ScorexFoundation/Scorex/master/COPYING | ||
|
||
components: | ||
schemas: | ||
# Objects | ||
ModifierId: | ||
description: Base58-encoded 32 byte modifier id | ||
type: object | ||
required: | ||
- modifierId | ||
properties: | ||
modifierId: | ||
type: string | ||
example: D2bXMwWN8P9nWJ9qqwZJLauAdcZHX9n6s91QQ9vK6Zu4 | ||
|
||
Digest32: | ||
description: Base58-encoded 32 byte digest | ||
type: object | ||
required: | ||
- digest | ||
properties: | ||
digest: | ||
type: string | ||
example: FjX5cPuwMc2ocDLPWzt6jq29BXjvU6d5w5XURDJ6dmoM | ||
Peer: | ||
type: object | ||
required: | ||
- address | ||
properties: | ||
address: | ||
type: string | ||
example: 127.0.0.1:5673 | ||
name: | ||
type: string | ||
example: mynode | ||
nonce: | ||
type: integer | ||
# int32 | ||
format: int64 | ||
example: 123456 | ||
lastSeen: | ||
type: integer | ||
# int32 | ||
format: int64 | ||
example: 123456 | ||
|
||
|
||
paths: | ||
|
||
/nodeView/openSurface: | ||
get: | ||
summary: Get history open surface | ||
operationId: getOpenSurface | ||
tags: | ||
- nodeView | ||
responses: | ||
200: | ||
description: Array of modifier ids | ||
content: | ||
application/json: | ||
schema: | ||
type: array | ||
example: ["D2bXMwWN8P9nWJ9qqwZJLauAdcZHX9n6s91QQ9vK6Zu4"] | ||
items: | ||
type: string | ||
example: D2bXMwWN8P9nWJ9qqwZJLauAdcZHX9n6s91QQ9vK6Zu4 | ||
|
||
/nodeView/persistentModifier/{modifierId}: | ||
get: | ||
summary: Get history open surface | ||
operationId: getPersistentModifierById | ||
tags: | ||
- nodeView | ||
parameters: | ||
- in: path | ||
name: modifierId | ||
required: true | ||
description: ID of a requested modifier | ||
schema: | ||
type: string | ||
responses: | ||
200: | ||
description: Node view modifier | ||
content: | ||
application/json: | ||
schema: | ||
type: object | ||
required: | ||
- id | ||
|
||
/nodeView/pool: | ||
get: | ||
summary: Get memory pool | ||
operationId: getPool | ||
tags: | ||
- nodeView | ||
responses: | ||
200: | ||
description: Memory pool | ||
content: | ||
application/json: | ||
schema: | ||
type: object | ||
required: | ||
- size | ||
- transactions | ||
|
||
/peers/all: | ||
get: | ||
summary: Get all known peers | ||
operationId: getAllPeers | ||
tags: | ||
- peers | ||
responses: | ||
200: | ||
description: Array of peer objects | ||
content: | ||
application/json: | ||
schema: | ||
type: array | ||
items: | ||
$ref: '#/components/schemas/Peer' | ||
|
||
/peers/connected: | ||
get: | ||
summary: Get current connected peers | ||
operationId: getConnectedPeers | ||
tags: | ||
- peers | ||
responses: | ||
200: | ||
description: Array of peer objects | ||
content: | ||
application/json: | ||
schema: | ||
type: array | ||
items: | ||
$ref: '#/components/schemas/Peer' | ||
|
||
/peers/connect: | ||
post: | ||
summary: Add address to peers list | ||
operationId: connectToPeer | ||
tags: | ||
- peers | ||
requestBody: | ||
required: true | ||
content: | ||
application/json: | ||
schema: | ||
type: string | ||
example: 127.0.0.1:5673 | ||
responses: | ||
200: | ||
description: Attempt to connect to the peer | ||
default: | ||
description: Error | ||
content: | ||
application/json: | ||
schema: | ||
type: string | ||
enum: | ||
- invalid.peer.address | ||
- invalid.json | ||
|
||
/peers/blacklisted: | ||
get: | ||
summary: Get blacklisted peers | ||
operationId: getBlacklistedPeers | ||
tags: | ||
- peers | ||
responses: | ||
200: | ||
description: Array of peer objects | ||
content: | ||
application/json: | ||
schema: | ||
type: array | ||
items: | ||
$ref: '#/components/schemas/Peer' | ||
|
||
/utils/seed: | ||
get: | ||
summary: Get random seed with 32 bytes size | ||
operationId: getRandomSeed | ||
tags: | ||
- utils | ||
responses: | ||
200: | ||
description: Base58-encoded 32 byte seed | ||
content: | ||
text/plain: | ||
schema: | ||
type: string | ||
example: 7yaASMijGEGTbttYHg1MrXnWB8EbzjJnFLSWvmNoHrXV | ||
|
||
/utils/seed/{length}: | ||
get: | ||
summary: Generate random seed of specified length in bytes | ||
operationId: getRandomSeedWithLength | ||
tags: | ||
- utils | ||
parameters: | ||
- in: path | ||
name: length | ||
required: true | ||
description: seed length in bytes | ||
schema: | ||
type: string | ||
responses: | ||
200: | ||
description: Base58-encoded N byte seed | ||
content: | ||
text/plain: | ||
schema: | ||
type: string | ||
example: 7yaASMijGEGTbttYHg1MrXnWB8EbzjJnFLSWvmNoHrXV | ||
|
||
/utils/hash/blake2b: | ||
post: | ||
summary: Return Blake2b hash of specified message | ||
operationId: hashBlake2b | ||
tags: | ||
- utils | ||
requestBody: | ||
required: true | ||
content: | ||
text/plain: | ||
schema: | ||
type: string | ||
example: 7yaASMijGEGTbttYHg1MrXnWB8EbzjJnFLSWvmNoHrXV | ||
responses: | ||
200: | ||
description: Base58-encoded 32 byte hash | ||
content: | ||
text/plain: | ||
schema: | ||
type: string | ||
example: 6QLZkR1RdHvF7gUw7oms1XdQM6kc9kxpmyHRADN5x7uQ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.