From 4c911f57a5b195b20219e5ad23989ad4bf271bad Mon Sep 17 00:00:00 2001 From: Luke Childs Date: Thu, 12 Dec 2019 13:04:10 +0700 Subject: [PATCH] Add cURL JSON-RPC demo --- README.md | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/README.md b/README.md index 6b5419a..b75b767 100644 --- a/README.md +++ b/README.md @@ -28,6 +28,12 @@ To access JSON-RPC from other services you'll also need to expose port 8332. You docker --name bitcoind run -v $HOME/.bitcoin:/data/.bitcoin -p 8333:8333 -p 127.0.0.1:8332:8332 lukechilds/bitcoind ``` +You could now query JSON-RPC via cURL like so: + +``` +curl --data '{"jsonrpc":"1.0","id":"curltext","method":"getnetworkinfo"}' http://$(cat $HOME/.bitcoin/.cookie)@127.0.0.1:8332 +``` + ### CLI Arguments All CLI arguments are passed directly through to bitcoind.