Skip to content

Commit

Permalink
Merge pulls #711, #752, #758
Browse files Browse the repository at this point in the history
* Pull #711: Add Basic "How To Run A Full Node" Page
* Pull #752: Revert "Drop good tor privacy score for mycelium"
* Pull #758: Dev Docs: Add Inline Template Plugin And Use It For RPC/REST
  • Loading branch information
harding committed Feb 23, 2015
4 parents c1b8da9 + f61f66d + 7fed5ea + 2c44b59 commit bac9de6
Show file tree
Hide file tree
Showing 110 changed files with 4,188 additions and 1,142 deletions.
302 changes: 245 additions & 57 deletions _includes/helpers/vars.md

Large diffs are not rendered by default.

123 changes: 96 additions & 27 deletions _includes/ref/bitcoin-core/rest/requests/get_block-notxdetails.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,39 +21,108 @@ GET /block/notxdetails/<hash>.<format>

*Parameter #1---the header hash of the block to retrieve*

| Name | Type | Presence | Description
|------------------|--------------|-----------------------------|----------------
| Header Hash | path (hex) | Required<br>(exactly 1) | The hash of the header of the block to get, encoded as hex in RPC byte order
{:.ntpd}
{% itemplate ntpd1 %}
- n: "Header Hash"
t: "path (hex)"
p: "Required<br>(exactly 1)"
d: "The hash of the header of the block to get, encoded as hex in RPC byte order"

{% enditemplate %}

*Parameter #2---the output format*

| Name | Type | Presence | Description
|------------------|--------------|-----------------------------|----------------
| Format | suffix | Required<br>(exactly 1) | Set to `.json` for decoded block contents in JSON, or `.bin` or `hex` for a serialized block in binary or hex
{:.ntpd}
{% itemplate ntpd1 %}
- n: "Format"
t: "suffix"
p: "Required<br>(exactly 1)"
d: "Set to `.json` for decoded block contents in JSON, or `.bin` or `hex` for a serialized block in binary or hex"

{% enditemplate %}

*Response as JSON*

| Name | Type | Presence | Description
|--------------------------|-------------------|-----------------------------|----------------
| Result | object | Required<br>(exactly 1) | An object containing the requested block
| →<br>`hash` | string (hex) | Required<br>(exactly 1) | The hash of this block's block header encoded as hex in RPC byte order. This is the same as the hash provided in parameter #1
| →<br>`confirmations` | number (int) | Required<br>(exactly 1) | The number of confirmations the transactions in this block have, starting at 1 when this block is at the tip of the best block chain. This score will be -1 if the the block is not part of the best block chain
| →<br>`size` | number (int) | Required<br>(exactly 1) | The size of this block in serialized block format, counted in bytes
| →<br>`height` | number (int) | Required<br>(exactly 1) | The height of this block on its block chain
| →<br>`version` | number (int) | Required<br>(exactly 1) | This block's version number. See [block version numbers][section block versions]
| →<br>`merkleroot` | string (hex) | Required<br>(exactly 1) | The merkle root for this block, encoded as hex in RPC byte order
| →<br>`tx` | array | Required<br>(exactly 1) | An array containing all transactions in this block. The transactions appear in the array in the same order they appear in the serialized block
| → →<br>TXID | string (hex) | Required<br>(1 or more) | The TXID of a transaction in this block, encoded as hex in RPC byte order
| →<br>`time` | number (int) | Required<br>(exactly 1) | The value of the *time* field in the block header, indicating approximately when the block was created
| →<br>`nonce` | number (int) | Required<br>(exactly 1) | The nonce which was successful at turning this particular block into one that could be added to the best block chain
| →<br>`bits` | string (hex) | Required<br>(exactly 1) | The value of the *nBits* field in the block header, indicating the target threshold this block's header had to pass
| →<br>`difficulty` | number (real) | Required<br>(exactly 1) | The estimated amount of work done to find this block relative to the estimated amount of work done to find block 0
| →<br>`chainwork` | string (hex) | Required<br>(exactly 1) | The estimated number of block header hashes miners had to check from the genesis block to this block, encoded as big-endian hex
| →<br>`previousblockhash` | string (hex) | Required<br>(exactly 1) | The hash of the header of the previous block, encoded as hex in RPC byte order
| →<br>`nextblockhash` | string (hex) | Optional<br>(0 or 1) | The hash of the next block on the best block chain, if known, encoded as hex in RPC byte order
{:.ntpd}
{% itemplate ntpd1 %}
- n: "Result"
t: "object"
p: "Required<br>(exactly 1)"
d: "An object containing the requested block"

- n: "→<br>`hash`"
t: "string (hex)"
p: "Required<br>(exactly 1)"
d: "The hash of this block's block header encoded as hex in RPC byte order. This is the same as the hash provided in parameter #1"

- n: "→<br>`confirmations`"
t: "number (int)"
p: "Required<br>(exactly 1)"
d: "The number of confirmations the transactions in this block have, starting at 1 when this block is at the tip of the best block chain. This score will be -1 if the the block is not part of the best block chain"

- n: "→<br>`size`"
t: "number (int)"
p: "Required<br>(exactly 1)"
d: "The size of this block in serialized block format, counted in bytes"

- n: "→<br>`height`"
t: "number (int)"
p: "Required<br>(exactly 1)"
d: "The height of this block on its block chain"

- n: "→<br>`version`"
t: "number (int)"
p: "Required<br>(exactly 1)"
d: "This block's version number. See [block version numbers][section block versions]"

- n: "→<br>`merkleroot`"
t: "string (hex)"
p: "Required<br>(exactly 1)"
d: "The merkle root for this block, encoded as hex in RPC byte order"

- n: "→<br>`tx`"
t: "array"
p: "Required<br>(exactly 1)"
d: "An array containing all transactions in this block. The transactions appear in the array in the same order they appear in the serialized block"

- n: "→ →<br>TXID"
t: "string (hex)"
p: "Required<br>(1 or more)"
d: "The TXID of a transaction in this block, encoded as hex in RPC byte order"

- n: "→<br>`time`"
t: "number (int)"
p: "Required<br>(exactly 1)"
d: "The value of the *time* field in the block header, indicating approximately when the block was created"

- n: "→<br>`nonce`"
t: "number (int)"
p: "Required<br>(exactly 1)"
d: "The nonce which was successful at turning this particular block into one that could be added to the best block chain"

- n: "→<br>`bits`"
t: "string (hex)"
p: "Required<br>(exactly 1)"
d: "The value of the *nBits* field in the block header, indicating the target threshold this block's header had to pass"

- n: "→<br>`difficulty`"
t: "number (real)"
p: "Required<br>(exactly 1)"
d: "The estimated amount of work done to find this block relative to the estimated amount of work done to find block 0"

- n: "→<br>`chainwork`"
t: "string (hex)"
p: "Required<br>(exactly 1)"
d: "The estimated number of block header hashes miners had to check from the genesis block to this block, encoded as big-endian hex"

- n: "→<br>`previousblockhash`"
t: "string (hex)"
p: "Required<br>(exactly 1)"
d: "The hash of the header of the previous block, encoded as hex in RPC byte order"

- n: "→<br>`nextblockhash`"
t: "string (hex)"
p: "Optional<br>(0 or 1)"
d: "The hash of the next block on the best block chain, if known, encoded as hex in RPC byte order"

{% enditemplate %}

*Examples from Bitcoin Core 0.10.0*

Expand Down
123 changes: 96 additions & 27 deletions _includes/ref/bitcoin-core/rest/requests/get_block.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,43 +21,112 @@ GET /block/<hash>.<format>

*Parameter #1---the header hash of the block to retrieve*

| Name | Type | Presence | Description
|------------------|--------------|-----------------------------|----------------
| Header Hash | path (hex) | Required<br>(exactly 1) | The hash of the header of the block to get, encoded as hex in RPC byte order
{:.ntpd}
{% itemplate ntpd1 %}
- n: "Header Hash"
t: "path (hex)"
p: "Required<br>(exactly 1)"
d: "The hash of the header of the block to get, encoded as hex in RPC byte order"

{% enditemplate %}

*Parameter #2---the output format*

| Name | Type | Presence | Description
|------------------|--------------|-----------------------------|----------------
| Format | suffix | Required<br>(exactly 1) | Set to `.json` for decoded block contents in JSON, or `.bin` or `hex` for a serialized block in binary or hex
{:.ntpd}
{% itemplate ntpd1 %}
- n: "Format"
t: "suffix"
p: "Required<br>(exactly 1)"
d: "Set to `.json` for decoded block contents in JSON, or `.bin` or `hex` for a serialized block in binary or hex"

{% enditemplate %}

*Response as JSON*

{% assign DEPTH="→ →" %}
{% include helpers/vars.md %}

| Name | Type | Presence | Description
|--------------------------|-------------------|-----------------------------|----------------
| Result | object | Required<br>(exactly 1) | An object containing the requested block
| →<br>`hash` | string (hex) | Required<br>(exactly 1) | The hash of this block's block header encoded as hex in RPC byte order. This is the same as the hash provided in parameter #1
| →<br>`confirmations` | number (int) | Required<br>(exactly 1) | The number of confirmations the transactions in this block have, starting at 1 when this block is at the tip of the best block chain. This score will be -1 if the the block is not part of the best block chain
| →<br>`size` | number (int) | Required<br>(exactly 1) | The size of this block in serialized block format, counted in bytes
| →<br>`height` | number (int) | Required<br>(exactly 1) | The height of this block on its block chain
| →<br>`version` | number (int) | Required<br>(exactly 1) | This block's version number. See [block version numbers][section block versions]
| →<br>`merkleroot` | string (hex) | Required<br>(exactly 1) | The merkle root for this block, encoded as hex in RPC byte order
| →<br>`tx` | array | Required<br>(exactly 1) | An array containing all transactions in this block. The transactions appear in the array in the same order they appear in the serialized block
| → →<br>Transaction | object | Required<br>(1 or more) | An object describing a particular transaction within this block
{% itemplate ntpd1 %}
- n: "Result"
t: "object"
p: "Required<br>(exactly 1)"
d: "An object containing the requested block"

- n: "→<br>`hash`"
t: "string (hex)"
p: "Required<br>(exactly 1)"
d: "The hash of this block's block header encoded as hex in RPC byte order. This is the same as the hash provided in parameter #1"

- n: "→<br>`confirmations`"
t: "number (int)"
p: "Required<br>(exactly 1)"
d: "The number of confirmations the transactions in this block have, starting at 1 when this block is at the tip of the best block chain. This score will be -1 if the the block is not part of the best block chain"

- n: "→<br>`size`"
t: "number (int)"
p: "Required<br>(exactly 1)"
d: "The size of this block in serialized block format, counted in bytes"

- n: "→<br>`height`"
t: "number (int)"
p: "Required<br>(exactly 1)"
d: "The height of this block on its block chain"

- n: "→<br>`version`"
t: "number (int)"
p: "Required<br>(exactly 1)"
d: "This block's version number. See [block version numbers][section block versions]"

- n: "→<br>`merkleroot`"
t: "string (hex)"
p: "Required<br>(exactly 1)"
d: "The merkle root for this block, encoded as hex in RPC byte order"

- n: "→<br>`tx`"
t: "array"
p: "Required<br>(exactly 1)"
d: "An array containing all transactions in this block. The transactions appear in the array in the same order they appear in the serialized block"

- n: "→ →<br>Transaction"
t: "object"
p: "Required<br>(1 or more)"
d: "An object describing a particular transaction within this block"

{{INCLUDE_DECODE_RAW_TRANSACTION}}
| →<br>`time` | number (int) | Required<br>(exactly 1) | The value of the *time* field in the block header, indicating approximately when the block was created
| →<br>`nonce` | number (int) | Required<br>(exactly 1) | The nonce which was successful at turning this particular block into one that could be added to the best block chain
| →<br>`bits` | string (hex) | Required<br>(exactly 1) | The value of the *nBits* field in the block header, indicating the target threshold this block's header had to pass
| →<br>`difficulty` | number (real) | Required<br>(exactly 1) | The estimated amount of work done to find this block relative to the estimated amount of work done to find block 0
| →<br>`chainwork` | string (hex) | Required<br>(exactly 1) | The estimated number of block header hashes miners had to check from the genesis block to this block, encoded as big-endian hex
| →<br>`previousblockhash` | string (hex) | Required<br>(exactly 1) | The hash of the header of the previous block, encoded as hex in RPC byte order
| →<br>`nextblockhash` | string (hex) | Optional<br>(0 or 1) | The hash of the next block on the best block chain, if known, encoded as hex in RPC byte order
{:.ntpd}
- n: "→<br>`time`"
t: "number (int)"
p: "Required<br>(exactly 1)"
d: "The value of the *time* field in the block header, indicating approximately when the block was created"

- n: "→<br>`nonce`"
t: "number (int)"
p: "Required<br>(exactly 1)"
d: "The nonce which was successful at turning this particular block into one that could be added to the best block chain"

- n: "→<br>`bits`"
t: "string (hex)"
p: "Required<br>(exactly 1)"
d: "The value of the *nBits* field in the block header, indicating the target threshold this block's header had to pass"

- n: "→<br>`difficulty`"
t: "number (real)"
p: "Required<br>(exactly 1)"
d: "The estimated amount of work done to find this block relative to the estimated amount of work done to find block 0"

- n: "→<br>`chainwork`"
t: "string (hex)"
p: "Required<br>(exactly 1)"
d: "The estimated number of block header hashes miners had to check from the genesis block to this block, encoded as big-endian hex"

- n: "→<br>`previousblockhash`"
t: "string (hex)"
p: "Required<br>(exactly 1)"
d: "The hash of the header of the previous block, encoded as hex in RPC byte order"

- n: "→<br>`nextblockhash`"
t: "string (hex)"
p: "Optional<br>(0 or 1)"
d: "The hash of the next block on the best block chain, if known, encoded as hex in RPC byte order"

{% enditemplate %}

*Examples from Bitcoin Core 0.10.0*

Expand Down
57 changes: 41 additions & 16 deletions _includes/ref/bitcoin-core/rest/requests/get_tx.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,32 +23,57 @@ GET /tx/<txid>.<format>

*Parameter #1---the TXID of the transaction to retrieve*

| Name | Type | Presence | Description
|------------------|--------------|-----------------------------|----------------
| TXID | path (hex) | Required<br>(exactly 1) | The TXID of the transaction to get, encoded as hex in RPC byte order
{:.ntpd}
{% itemplate ntpd1 %}
- n: "TXID"
t: "path (hex)"
p: "Required<br>(exactly 1)"
d: "The TXID of the transaction to get, encoded as hex in RPC byte order"

{% enditemplate %}

*Parameter #2---the output format*

| Name | Type | Presence | Description
|------------------|--------------|-----------------------------|----------------
| Format | suffix | Required<br>(exactly 1) | Set to `.json` for decoded transaction contents in JSON, or `.bin` or `hex` for a serialized transaction in binary or hex
{:.ntpd}
{% itemplate ntpd1 %}
- n: "Format"
t: "suffix"
p: "Required<br>(exactly 1)"
d: "Set to `.json` for decoded transaction contents in JSON, or `.bin` or `hex` for a serialized transaction in binary or hex"

{% enditemplate %}

*Response as JSON*

{% assign DEPTH="" %}
{% include helpers/vars.md %}

| Name | Type | Presence | Description
|----------------------|-----------------|-----------------------------|----------------
| Result | object | Required<br>(exactly 1) | An object describing the request transaction
{% itemplate ntpd1 %}
- n: "Result"
t: "object"
p: "Required<br>(exactly 1)"
d: "An object describing the request transaction"

{{INCLUDE_DECODE_RAW_TRANSACTION}}
| →<br>`blockhash` | string (hex) | Optional<br>(0 or 1) | If the transaction has been included in a block on the local best block chain, this is the hash of that block encoded as hex in RPC byte order
| →<br>`confirmations` | number (int) | Required<br>(exactly 1) | If the transaction has been included in a block on the local best block chain, this is how many confirmations it has. Otherwise, this is `0`
| →<br>`time` | number (int) | Optional<br>(0 or 1) | If the transaction has been included in a block on the local best block chain, this is the block header time of that block (may be in the future)
| →<br>`blocktime` | number (int) | Optional<br>(0 or 1) | This field is currently identical to the time field described above
{:.ntpd}
- n: "→<br>`blockhash`"
t: "string (hex)"
p: "Optional<br>(0 or 1)"
d: "If the transaction has been included in a block on the local best block chain, this is the hash of that block encoded as hex in RPC byte order"

- n: "→<br>`confirmations`"
t: "number (int)"
p: "Required<br>(exactly 1)"
d: "If the transaction has been included in a block on the local best block chain, this is how many confirmations it has. Otherwise, this is `0`"

- n: "→<br>`time`"
t: "number (int)"
p: "Optional<br>(0 or 1)"
d: "If the transaction has been included in a block on the local best block chain, this is the block header time of that block (may be in the future)"

- n: "→<br>`blocktime`"
t: "number (int)"
p: "Optional<br>(0 or 1)"
d: "This field is currently identical to the time field described above"

{% enditemplate %}

*Examples from Bitcoin Core 0.10.0*

Expand Down
Loading

0 comments on commit bac9de6

Please sign in to comment.