Use `curl` in shell examples
MODIFY
docs/api_specs/includes/informational_api_specs.md
docs/api_specs/includes/informational_api_specs.md
@@ -6,7 +6,7 @@ API specification of the Watcher's Informational Service
## Account - Get Balance
```shell
-http POST /account.get_balance address=b3256026863eb6ae5b06fa396ab09069784ea8ea
+curl http://localhost:4000/account.get_balance -d '{"address": "b3256026863eb6ae5b06fa396ab09069784ea8ea"}'
```
```elixir
@@ -42,9 +42,9 @@ Returns the balance of each currency for the given account address
`POST /account.get_balance`
-### JSON Body
+### Request Body
-Key | Type | Description
+Attribute | Type | Description
--------- | ------- | -----------
address | Hex encoded string | Address of the funds owner
@@ -53,7 +53,7 @@ address | Hex encoded string | Address of the funds owner
## Account - Get Utxos
```shell
-http POST /account.get_utxos address=b3256026863eb6ae5b06fa396ab09069784ea8ea
+curl http://localhost:4000/account.get_utxos -d '{"address": "b3256026863eb6ae5b06fa396ab09069784ea8ea", "limit": 10}'
```
```elixir
@@ -89,9 +89,9 @@ Gets all utxos belonging to the given address
`POST /account.get_utxos`
-### JSON Body
+### Request Body
-Key | Type | Description
+Attribute | Type | Description
--------- | ------- | -----------
address | Hex encoded string | Address of the account
limit | Integer | Maximum number of utxos to return (optional)
@@ -101,7 +101,7 @@ limit | Integer | Maximum number of utxos to return (optional)
## Account - Get Transactions
```shell
-http POST /account.get_transactions address=b3256026863eb6ae5b06fa396ab09069784ea8ea
+curl http://localhost:4000/account.get_transactions -d '{"address": "b3256026863eb6ae5b06fa396ab09069784ea8ea"}'
```
```elixir
@@ -142,9 +142,9 @@ Gets a list of transactions.
`POST /account.get_transactions`
-### JSON Body
+### Request Body
-Key | Type | Description
+Attribute | Type | Description
--------- | ------- | -----------
address | Hex encoded string | Address of the account
limit | Integer | Maximum number of transactions to return (optional)
@@ -154,7 +154,8 @@ limit | Integer | Maximum number of transactions to return (optional)
## Transaction - Get All
```shell
-http POST /transaction.all block=100```
+curl http://localhost:4000/transaction.all -d '{"block": "100", "limit": 50}'
+```
```elixir
// TODO
@@ -207,9 +208,9 @@ Gets a transaction with the given id
`POST /transaction.get`
-### JSON Body
+### Request Body
-Key | Type | Description
+Attribute | Type | Description
--------- | ------- | -----------
block | Integer | Block number to filter by (optional)
address | Hex encoded string | Address to filter by (optional)
@@ -220,7 +221,7 @@ limit | Integer | Maximum number of transactions to return (optional)
## Transaction - Get
```shell
-http POST /transaction.get id=bdf562c24ace032176e27621073df58ce1c6f65de3b5932343b70ba03c72132d
+curl http://localhost:4000/transaction.get -d '{"id": "bdf562c24ace032176e27621073df58ce1c6f65de3b5932343b70ba03c72132d"}'
```
```elixir
@@ -284,9 +285,9 @@ Gets a transaction with the given id
`POST /transaction.get`
-### JSON Body
+### Request Body
-Key | Type | Description
+Attribute | Type | Description
--------- | ------- | -----------
id | Hex encoded string | Hash of the Plasma transaction
@@ -295,7 +296,7 @@ id | Hex encoded string | Hash of the Plasma transaction
## Block - Get all
```shell
-http POST /block.all limit=100
+curl http://localhost:4000/block.all -d '{"limit": 100}'
```
```elixir
@@ -335,9 +336,9 @@ Gets a block with the given id
`POST /block.all`
-### JSON Body
+### Request Body
-Key | Type | Description
+Attribute | Type | Description
--------- | ------- | -----------
limit | Integer | Maximum number of transactions to return (optional)
@@ -347,7 +348,7 @@ limit | Integer | Maximum number of transactions to return (optional)
## Block - Get
```shell
-http POST /block.get id=bdf562c24ace032176e27621073df58ce1c6f65de3b5932343b70ba03c72132d
+curl http://localhost:4000/block.get -d '{"id": "bdf562c24ace032176e27621073df58ce1c6f65de3b5932343b70ba03c72132d"}'
```
```elixir
@@ -379,9 +380,9 @@ Gets a block with the given id
`POST /block.get`
-### JSON Body
+### Request Body
-Key | Type | Description
+Attribute | Type | Description
--------- | ------- | -----------
id | Hex encoded string | Hash of the Plasma block

MODIFY
docs/api_specs/includes/operator_api_specs.md
docs/api_specs/includes/operator_api_specs.md
## Submit transaction
```shell
-http POST /transaction.submit transaction=f8d083015ba98080808080940000...
+curl http://localhost:4000/transaction.submit -d '{"transaction": "b325602686..."}'
```
```elixir
@@ -28,15 +28,15 @@ http POST /transaction.submit transaction=f8d083015ba98080808080940000...
}
```
-This endpoint submits signed transaction to the child chain
+This endpoint submits a signed transaction to the child chain.
### HTTP Request
`POST /transaction.submit`
-### JSON Body
+### Request Body
-Key | Value | Description
+Attribute | Type | Description
--------- | ------- | -----------
transaction | Hex encoded string | Signed transaction RLP-encoded to bytes and HEX-encoded to string
@@ -46,7 +46,7 @@ transaction | Hex encoded string | Signed transaction RLP-encoded to bytes and H
## Get Block by id
```shell
-http POST /block.get hash=2733e50f526ec2fa19a22b31e8ed50f23cd1fdf94c9154ed3a7609a2f1ff981f
+curl http://localhost:4000/block.get -d '{"hash": "2733e50f526ec2fa19a22b31e8ed50f23cd1fdf94c9154ed3a7609a2f1ff981f}'
```
```elixir
@@ -73,14 +73,14 @@ http POST /block.get hash=2733e50f526ec2fa19a22b31e8ed50f23cd1fdf94c9154ed3a7609
}
```
-This endpoint retrieves a specific block from child chain which hash was published on root chain
+This endpoint retrieves a specific block from child chain by its hash which was published on root chain
### HTTP Request
`POST /block.get`
-### JSON Body
+### Request Body
-Key | Value | Description
+Attribute | Type | Description
--------- | ------- | -----------
hash | Hex encoded string | HEX-encoded hash of the block

MODIFY
docs/api_specs/includes/watcher_api_specs.md
docs/api_specs/includes/watcher_api_specs.md
@@ -5,7 +5,7 @@ API specification of the Watcher's security-critical Service
## Account - Get Utxos
```shell
-http POST /account.get_utxos address=b3256026863eb6ae5b06fa396ab09069784ea8ea
+curl http://localhost:4000/account.get_utxos -d '{"address": "b3256026863eb6ae5b06fa396ab09069784ea8ea", "limit": 10}'
```
```elixir
@@ -43,9 +43,9 @@ Gets all utxos belonging to the given address.
`POST /account.get_utxos`
-### JSON Body
+### Request Body
-Key | Type | Description
+Attribute | Type | Description
--------- | ------- | -----------
address | Hex encoded string | Address of the account
limit | Integer | Maximum number of utxos to return (optional)
@@ -55,7 +55,7 @@ limit | Integer | Maximum number of utxos to return (optional)
## Utxo - Get Challenge Data
```shell
-http POST /utxo.get_challenge_data utxo_pos=10001001
+curl http://localhost:4000/utxo.get_challenge_data -d '{"utxo_pos": "10001001"}'
```
```elixir
@@ -88,9 +88,9 @@ Gets challenge data for a given utxo exit
`POST /utxo.get_challenge_data`
-### JSON Body
+### Request Body
-Key | Type | Description
+Attribute | Type | Description
--------- | ------- | -----------
utxo_pos | Integer | Utxo position (encoded as single integer, the way contract represents them)
@@ -99,7 +99,7 @@ utxo_pos | Integer | Utxo position (encoded as single integer, the way contract
## Utxo - Get Exit Data
```shell
-http POST /utxo.get_exit_data utxo_pos=10001001
+curl http://localhost:4000/utxo.get_exit_data -d '{"utxo_pos": "10001001"}'
```
```elixir
@@ -131,9 +131,9 @@ Gets exit data for a given utxo
`POST /utxo.get_exit_data`
-### JSON Body
+### Request Body
-Key | Type | Description
+Attribute | Type | Description
--------- | ------- | -----------
utxo_pos | Integer | Utxo position (encoded as single integer, the way contract represents them)
@@ -142,7 +142,7 @@ utxo_pos | Integer | Utxo position (encoded as single integer, the way contract
## Transaction - Submit
```shell
-http POST /transaction.submit transaction=f8d083015ba98080808080940000...
+curl http://localhost:4000/transaction.submit -d '{"transaction": "f8d083015ba98080808080940000..."}'
```
```elixir
@@ -174,9 +174,9 @@ Watcher passes signed transaction to the child chain only if it's secure (better
`POST /transaction.submit`
-### JSON Body
+### Request Body
-Key | Type | Description
+Attribute | Type | Description
--------- | ------- | -----------
transaction | Hex encoded string | Signed transaction RLP-encoded to bytes and HEX-encoded to string
@@ -186,7 +186,7 @@ transaction | Hex encoded string | Signed transaction RLP-encoded to bytes and H
## Status
```shell
-http POST /status
+curl -X POST http://localhost:4000/status
```
```elixir
@@ -231,7 +231,7 @@ Gets plasma network and Watcher status
`POST /status`
-### JSON Body
+### Request Body
No parameters are required.
@@ -333,7 +333,7 @@ An non-canonical in-flight exit has been started. It should be challenged.
<aside class="warning"> Not Implemented Yet.</aside>
Event details:
-Key | Type | Description
+Attribute | Type | Description
--------- | ------- | -----------
inflight_blocknum | integer | Block number of the in-flight transaction
inflight_tx_index | integer | Index of the in-flight transaction
@@ -359,7 +359,7 @@ A canonical in-flight exit has been challenged. The challenge should be responde
<aside class="warning"> Not Implemented Yet.</aside>
Event details:
-Key | Type | Description
+Attribute | Type | Description
--------- | ------- | -----------
inflight_blocknum | integer | Block number of the in-flight transaction
inflight_tx_index | integer | Index of the in-flight transaction
@@ -382,7 +382,7 @@ An in-flight exit has been started and can be piggybacked
<aside class="warning"> Not Implemented Yet.</aside>
Event details:
-Key | Type | Description
+Attribute | Type | Description
--------- | ------- | -----------
inflight_blocknum | integer | Block number of the in-flight transaction
inflight_tx_index | integer | Index of the in-flight transaction
@@ -410,7 +410,7 @@ An invalid piggyback is in process. Should be challenged.
<aside class="warning"> Not Implemented Yet.</aside>
Event details:
-Key | Type | Description
+Attribute | Type | Description
--------- | ------- | -----------
type | string | Indicates whether the invalid piggyback is on an "input" or "output"
inflight_blocknum | integer | Block number of the in-flight transaction

MODIFY
docs/api_specs/includes/watcher_websocket_specs.md
docs/api_specs/includes/watcher_websocket_specs.md
@@ -53,7 +53,7 @@ The address_spent event informing about that particular address spent funds.
Both event types have the same structure.
-Key | Type | Description
+Attribute | Type | Description
--------- | ------- | -----------
child_blknum | Integer |
child_txindex | Integer |
@@ -89,7 +89,7 @@ Informs that a new block has been added to the chain.
Both event types have the same structure.
-Key | Type | Description
+Attribute | Type | Description
--------- | ------- | -----------
blknum | Integer |
block_hash | HEX-encoded string |

Use `curl` in shell examples