From 41c7030390645a621b8000d71dba1fe1f24d769c Mon Sep 17 00:00:00 2001 From: c789 Date: Fri, 3 Feb 2017 13:14:16 -0500 Subject: [PATCH] Update wallet-rpc.md Added instructions on how to use a username and password to connect to monero-wallet-rpc --- knowledge-base/developer-guides/wallet-rpc.md | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/knowledge-base/developer-guides/wallet-rpc.md b/knowledge-base/developer-guides/wallet-rpc.md index b36e79e7..9fff6241 100644 --- a/knowledge-base/developer-guides/wallet-rpc.md +++ b/knowledge-base/developer-guides/wallet-rpc.md @@ -24,6 +24,18 @@ All monero-wallet-rpc methods use the same JSON RPC interface. For example: -d '{"jsonrpc":"2.0","id":"0","method":"'$METHOD'","params":'"$PARAMS"'}' \ -H 'Content-Type: application/json' +If the monero-wallet-rpc was executed with the `--rpc-login` argument as `username:password`, then follow this example: + + IP=127.0.0.1 + PORT=18082 + METHOD="make_integrated_address" + PARAMS="{\"payment_id\":\"1234567890123456789012345678900012345678901234567890123456789000\"}" + curl \ + -u username:password --digest \ + -X POST http://$IP:$PORT/json_rpc \ + -d '{"jsonrpc":"2.0","id":"0","method":"'$METHOD'","params":'"$PARAMS"'}' \ + -H 'Content-Type: application/json' + Note: "atomic units" refer to the smallest fraction of 1 XMR according to the monerod implementation. **1 XMR = 1e12 atomic units.** ### Index of JSON RPC Methods: