From 5a8fe4478937c3adc3c9a7e0fd2ffcb9cb6a051e Mon Sep 17 00:00:00 2001 From: coffeepots Date: Thu, 22 Mar 2018 17:26:33 +0000 Subject: [PATCH] Initial commit --- README | 46 ++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 46 insertions(+) create mode 100644 README diff --git a/README b/README new file mode 100644 index 0000000..853f16e --- /dev/null +++ b/README @@ -0,0 +1,46 @@ +# 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/) \ No newline at end of file