Nim library for implementing JSON-RPC clients and servers
Go to file
coffeepots 6dc45a9f9d RPC macro now builds compiletime list for automatic server registration 2018-03-22 17:28:34 +00:00
eth-rpc RPC macro now builds compiletime list for automatic server registration 2018-03-22 17:28:34 +00:00
tests First commit 2018-03-02 11:46:59 +00:00
.gitignore Initial commit 2018-03-01 13:17:27 +00:00
LICENSE Initial commit 2018-03-01 13:17:27 +00:00
README Initial commit 2018-03-22 17:26:33 +00:00
eth_rpc.nimble Add Nimble support 2018-03-02 13:01:30 +00:00

README

# Nim-eth-rpc

Nim-eth-rpc is designed to provide remote procedure calls to the Nimbus Ethereum research project.

## Installation

### Requirements
* Nim 17.3 and up

`git clone https://github.com/status-im/nim-eth-rpc`

## Usage

### Server

```nim
import rpcserver, asyncdispatch

when isMainModule:
  var srv = newRpcServer("")
  asyncCheck srv.serve()
  runForever()
```

### Client

```nim
import rpcclient, asyncdispatch, json

proc main {.async.} =
  var client = newRpcClient()
  await client.connect("localhost", Port(8545))
  let response = waitFor client.web3_clientVersion(newJNull())
  echo response.result.pretty

waitFor main()

```

## Contributing
Pull requests are welcome. For major changes, please open an issue first to discuss what you would like to change.

Please make sure to update tests as appropriate.

## License
[MIT](https://choosealicense.com/licenses/mit/)