Skip to content
This repository has been archived by the owner on Apr 6, 2020. It is now read-only.

Commit

Permalink
add better description of getBlockDetails callback parameter. Add ref…
Browse files Browse the repository at this point in the history
…erence to ethereumjs-block.
  • Loading branch information
jwasinger committed Sep 14, 2017
1 parent 4af2bfe commit 13cb5a4
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -53,14 +53,21 @@ Adds a block to the blockchain.
#### `blockchain.getBlock(blockTag, callback)`
Gets a block by its blockTag.
- `blockTag` - the block's hash or number
- `callback` - the callback. It is given two parameters `err` and the found `block` if any.
- `callback` - the callback. It is given two parameters `err` and the found `block` (an instance of https://github.com/ethereumjs/ethereumjs-block) if any.

--------------------------------------------------------

#### `blockchain.getDetails(hash, callback)`
Retrieves meta infromation about the block and passed it to the `callback`
- `hash` - the hash of the block as a `Buffer` or a hex `String`
- `callback` - the callback which is passed an `Object` containing two properties `parent`, the hash of the this block's parents and `children` an `Array` of hashes of children blocks.
- `callback` - the callback which is passed an `Object` containing the following properties:
- * `parent` - the hash of the parent block
- * `td` - the total difficulty of the block
- * `number` - the block number
- * `child` - the block's children
- * `genesis` - boolean (true if genesis block, false if not)
- * `inChain` - TODO
- * `staleChildren` - TODO

--------------------------------------------------------

Expand Down

0 comments on commit 13cb5a4

Please sign in to comment.