solatis / gold Goto Github PK
View Code? Open in Web Editor NEWElixir interface to Bitcoin RPC API
Elixir interface to Bitcoin RPC API
This project curretly has no licensing status. I would like to use this Elixir RPC interface with my own elixir Bitcoin library, which may end up in production for commercial use. Please let me know if this is acceptable.
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
}}
When bitcoind returns an error response, handle_error does not return the error code, but only the error message.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.