Skip to content

Commit

Permalink
reordered methods and examples
Browse files Browse the repository at this point in the history
  • Loading branch information
jpzk committed Dec 16, 2019
1 parent d1d958b commit 94a51c4
Showing 1 changed file with 21 additions and 13 deletions.
34 changes: 21 additions & 13 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,27 @@ Simply add the following dependency to your project.
libraryDependencies += "io.tokenanalyst" %% "blockchain-rpc" % "2.5.0",
```

Jump to [examples](https://github.com/tokenanalyst/blockchain-rpc/tree/ethereum#example-fetch-bitcoin-block) for usage.

## Supported Bitcoin methods

| Bitcoind RPC methods | description | bitcoin-rpc method |
|---|---|---|
| getblockhash | Gets the block hash at a specific height | getBlockHash(height: Long) |
| getbestblockhash | Gets the block tip hash | getBestBlockHash() |
| getblock | Gets the block with transaction ids | getBlockByHash(hash: String) |
| getblockhash, getblock | Gets the block with transaction ids | getBlockByHeight(height: Long) |
| getrawtransaction | Gets raw transaction data | getTransaction(hash: String) |
| batch of getrawtransaction | Gets raw transaction data | getTransactions(hashes: Seq[String]) |
| estimatesmartfee | Estimates fee for include in block n | estimateSmartFee(height: Long) |
| usage of ZeroMQ | Gets next block hash subscription | getNextBlockHash() |

## Supported Ethereum methods

| Ethereum RPC methods | description | ethereum-rpc method |
|---|---|---|
| | | |

## Example: Fetch Bitcoin Block

This is a simple example of how the RPCClient is generally used. We're using Cats Resources here which automatically deallocate any opened resources after use.
Expand Down Expand Up @@ -86,16 +107,3 @@ object CatchupFromZero extends IOApp {
| BLOCKCHAIN_RPC_PASSWORD | RPC password | Optional String |
| BLOCKCHAIN_RPC_PORT | RPC port when not default | Optional Int |
| BLOCKCHAIN_RPC_ZEROMQ_PORT | ZeroMQ port when not default | Optional Int |

## Supported Bitcoin methods

| Bitcoind RPC methods | description | bitcoin-rpc method |
|---|---|---|
| getblockhash | Gets the block hash at a specific height | getBlockHash(height: Long) |
| getbestblockhash | Gets the block tip hash | getBestBlockHash() |
| getblock | Gets the block with transaction ids | getBlockByHash(hash: String) |
| getblockhash, getblock | Gets the block with transaction ids | getBlockByHeight(height: Long) |
| getrawtransaction | Gets raw transaction data | getTransaction(hash: String) |
| batch of getrawtransaction | Gets raw transaction data | getTransactions(hashes: Seq[String]) |
| estimatesmartfee | Estimates fee for include in block n | estimateSmartFee(height: Long) |
| usage of ZeroMQ | Gets next block hash subscription | getNextBlockHash() |

0 comments on commit 94a51c4

Please sign in to comment.