Changeset View
Changeset View
Standalone View
Standalone View
doc/REST-interface.md
Unauthenticated REST Interface | Unauthenticated REST Interface | ||||
============================== | ============================== | ||||
The REST API can be enabled with the `-rest` option. | The REST API can be enabled with the `-rest` option. | ||||
The interface runs on the same port as the JSON-RPC interface, by default port 8332 for mainnet, port 18332 for testnet, and port 18443 for regtest. | The interface runs on the same port as the JSON-RPC interface, by default port 8332 for mainnet, port 18332 for testnet, and port 18443 for regtest. | ||||
Supported API | Supported API | ||||
------------- | ------------- | ||||
#### Transactions | #### Transactions | ||||
`GET /rest/tx/<TX-HASH>.<bin|hex|json>` | `GET /rest/tx/<TX-HASH>.<bin|hex|json>` | ||||
Given a transaction hash: returns a transaction in binary, hex-encoded binary, or JSON formats. | Given a transaction hash: returns a transaction in binary, hex-encoded binary, or JSON formats. | ||||
For full TX query capability, one must enable the transaction index via "txindex=1" command line / configuration option. | By default, this endpoint will only search the mempool. | ||||
To query for a confirmed transaction, enable the transaction index via "txindex=1" command line / configuration option. | |||||
#### Blocks | #### Blocks | ||||
`GET /rest/block/<BLOCK-HASH>.<bin|hex|json>` | `GET /rest/block/<BLOCK-HASH>.<bin|hex|json>` | ||||
`GET /rest/block/notxdetails/<BLOCK-HASH>.<bin|hex|json>` | `GET /rest/block/notxdetails/<BLOCK-HASH>.<bin|hex|json>` | ||||
Given a block hash: returns a block, in binary, hex-encoded binary or JSON formats. | Given a block hash: returns a block, in binary, hex-encoded binary or JSON formats. | ||||
The HTTP request and response are both handled entirely in-memory, thus making maximum memory usage at least 2.66MB (1 MB max block, plus hex encoding) per request. | The HTTP request and response are both handled entirely in-memory, thus making maximum memory usage at least 2.66MB (1 MB max block, plus hex encoding) per request. | ||||
▲ Show 20 Lines • Show All 75 Lines • Show Last 20 Lines |