mirror of
https://github.com/codex-storage/nim-json-rpc.git
synced 2025-02-23 16:38:22 +00:00
1.3 KiB
1.3 KiB
Nim-eth-rpc
Nim-eth-rpc is designed to provide remote procedure calls to the Nimbus Ethereum research project.
Installation
git clone https://github.com/status-im/nim-eth-rpc
Requirements
- Nim 17.3 and up
Usage
Server
import rpcserver, asyncdispatch
when isMainModule:
var srv = newRpcServer("")
asyncCheck srv.serve()
runForever()
Client
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.