solatis/gold

Wallet file not specified (must request wallet RPC through /wallet/<filename> uri-path

karthikeyan234 opened this issue · 0 comments

Initially, there was only one wallet. And everything was working fine. Later I created one more wallet in my bitcoin node.

And when I run this command

iex(1)> Gold.getbalance(:bitcoin)

I am getting the below error

{:ok,
%HTTPoison.Response{
body: "{"result":null,"error":{"code":-19,"message":"Wallet file not specified (must request wallet RPC through /wallet/ uri-path)."},"id":1}\n",
headers: [
{"Content-Type", "application/json"},
{"Date", "Thu, 04 Mar 2021 04:08:53 GMT"},
{"Content-Length", "145"}
],
request: %HTTPoison.Request{
body: "{"params":[],"method":"getbalance","jsonrpc":"2.0","id":1}",
headers: [
Authorization: "Basic [hidden]"
],
method: :post,
options: [timeout: 30000, recv_timeout: 20000],
params: %{},
url: "http://localhost:8332/"
},
request_url: "http://localhost:8332/",
status_code: 500
}}

After searching in google, So to query a specific wallet.

http://127.0.0.1:8332/wallet/<wallet_name>

We have to pass like this.

I tried editing gold.ex file
case HTTPoison.post("http://" <> hostname <> ":" <> to_string(port) <> "/", Poison.encode!(command), headers, options) do

to

case HTTPoison.post("http://" <> hostname <> ":" <> to_string(port) <> "/wallet/secondwallet", Poison.encode!(command), headers, options) do

But this too did not work. Any insight on how to fix this issue will be greatly appreciated. Thanks

{:error,
%{
code: -19,
error: "Wallet file not specified (must request wallet RPC through /wallet/ uri-path).",
status: :internal_server_error
}}