-1

I'm new in RPC. I developed a board which use many coin to exchange . But my board is based on other website api to get the BTC address for users. And i want it to be independent. So i was searching and i found this that i can set up bitcoin daemon on the server and configure it using RPC (RPCuser, RPCpassword, RPCport ... etc) And then use javascript to connect my board to the bitcoin daemon to get every user his BTC wallet address. My problem is i'm new in RPC javascript development. So could you please give me a simple code of javascript using RPC to connect to Bitcoin daemon and get a new wallet address, balance, send and receive money, History ... etc.? I already installed Bitcoin daemon on my server and i ran it. I only left with the javascript code. This is my bitcoin.conf file information:

rpcuser=username
rpcpassword=mypassword 
rpcallowip=127.0.0.1
rpcallowip=xxx.xxx.xxx.xxx
rpcallowip=xxx.xxx.xxx.xxx
rpcport=8332
server=1
daemon=1
listen=1
txindex=1
  • Take a look at the JSONRPC wiki under NodeJS en.bitcoin.it/wiki/API_reference_(JSON-RPC)#Node.js. Javascript is a client side language and things would not end well if you are using javascript to communicate with your node as your credentials would be viewable by anyone. – m1xolyd1an Mar 31 '18 at 15:46
  • So what's the best way to do this? My goal is to protect user from hacking and protect the server information from users also . In other words i don't want the user to get the information of server instead of he can run everything in his browser . means if the server got hacked . the hackers will get nothing because all the information is in client side – Ys3 Mar 31 '18 at 15:58
  • I mean which one is best to use RPC with php or javascript? I want to protect both . the server from users and the users from server if server got hacked – Ys3 Mar 31 '18 at 16:03

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.