Bitcoin Forum
October 18, 2018, 06:20:25 AM *
News: Make sure you are not using versions of Bitcoin Core other than 0.17.0 [Torrent], 0.16.3, 0.15.2, or 0.14.3. More info.
 
   Home   Help Search Donate Login Register  
Pages: [1]
  Print  
Author Topic: How exactly does RPC calls work?  (Read 558 times)
Abiky
Legendary
*
Offline Offline

Activity: 1162
Merit: 1006


Crypto-Games.net: Multiple coins, multiple games


View Profile
October 21, 2016, 12:41:03 AM
 #1

I'm trying to figure out how to send remote RPC calls from within my PC to a remote BTC full node. All I know is that I can set the RPC port, username and password, but when I try to access it via a web browser (by typing its ip address) and put in the login details, I get an error message.

So how exactly does this work? I just want to be able to control a remote full node from my PC just by specifying the commands like: getpeerinfo and dumpprivkey.

Is there something that I may have missed? Please help, as I'm a little confused with this.  Huh


▄▄▄████████▄▄▄
▄██████████████████▄
▄██████████████████████▄
██████████████████████████
████████████████████████████
██████████████████████████████
██████████████████████████████
██████████████████████████████
██████████████████████████████
██████████████████████████████
████████████████████████████
██████████████████████████
▀██████████████████████▀
▀██████████████████▀
▀▀▀████████▀▀▀
   ███████
██████████
██████████
██████████
██████████
██████████
██████████
██████████
██████████
██████████
██████████
██████████
███████
BTC  ◉PLAY  ◉XMR  ◉DOGE  ◉BCH  ◉STRAT  ◉ETH  ◉GAS  ◉LTC  ◉DASH  ◉PPC
     ▄▄██████████████▄▄
  ▄██████████████████████▄        █████
▄██████████████████████████▄      █████
████ ▄▄▄▄▄ ▄▄▄▄▄▄ ▄▄▄▄▄ ████     ▄██▀
████ █████ ██████ █████ ████    ▄██▀
████ █████ ██████ █████ ████    ██▀
████ █████ ██████ █████ ████    ██
████ ▀▀▀▀▀ ▀▀▀▀▀▀ ▀▀▀▀▀ ████ ▄██████▄
████████████████████████████ ████████
███████▀            ▀███████ ▀██████▀
█████▀                ▀█████
▀██████████████████████████▀
  ▀▀████████████████████▀▀ 
✔️DICE           
✔️BLACKJACK
✔️PLINKO
✔️VIDEO POKER
✔️ROULETTE     
✔️LOTTO
1539843625
Hero Member
*
Offline Offline

Posts: 1539843625

View Profile Personal Message (Offline)

Ignore
1539843625
Reply with quote  #2

1539843625
Report to moderator
1539843625
Hero Member
*
Offline Offline

Posts: 1539843625

View Profile Personal Message (Offline)

Ignore
1539843625
Reply with quote  #2

1539843625
Report to moderator
1539843625
Hero Member
*
Offline Offline

Posts: 1539843625

View Profile Personal Message (Offline)

Ignore
1539843625
Reply with quote  #2

1539843625
Report to moderator
Advertised sites are not endorsed by the Bitcoin Forum. They may be unsafe, untrustworthy, or illegal in your jurisdiction. Advertise here.
1539843625
Hero Member
*
Offline Offline

Posts: 1539843625

View Profile Personal Message (Offline)

Ignore
1539843625
Reply with quote  #2

1539843625
Report to moderator
1539843625
Hero Member
*
Offline Offline

Posts: 1539843625

View Profile Personal Message (Offline)

Ignore
1539843625
Reply with quote  #2

1539843625
Report to moderator
achow101
Staff
Legendary
*
Offline Offline

Activity: 1554
Merit: 1703


3F1Y9yquzvY6RWvKbw2n2zeo9V5mvBhADU


View Profile WWW
October 21, 2016, 12:45:45 AM
 #2

The RPC calls work in the same way other HTTP APIs work where you have to provide data. You must use HTTP post requests. It isn't something you access through the browser.

You can use the bitcoin-cli program which will do everything for you and you use it like you do with the debug console. Or you can get some program that can do HTTP post requests (e.g. curl) and then send a JSON encoded HTTP Post request to call an RPC command. The bitcoind will respond with the output.

OgNasty
Donator
Legendary
*
Offline Offline

Activity: 2702
Merit: 1376


I 💚 Bitcoin


View Profile WWW
October 21, 2016, 02:02:19 AM
 #3

This video shows how easy it is to use the provided tools with python to handle calls locally.  I don't think using dumpprivkey from remote nodes would be considered the best security practice.

https://www.youtube.com/watch?v=3xAO4K7FC6E

franky1
Legendary
*
Offline Offline

Activity: 2198
Merit: 1200



View Profile
October 21, 2016, 03:12:07 AM
 #4

RPC calls are primarily used for your webserver or other applications to get data from YOUR bitcoin client.
if YOUR bitcoin client is not set up to accept the connection from an application, then it wont work

if you just want to get data from "the web". then use the API calls from some bitcoin explorers such as
blockchain.info/api
https://blockexplorer.com/api-ref
http://blockr.io/documentation/api
but this is not for full wallet access of those websites, just the block data stuff

but as someone said.
opening general access to things like dumpprivkey on YOUR client is bad due to hackers then possibly trying to get at your client to grab your keys.

however i have a strange feeling you are subtly asking this question in the OP, not learn how to set up YOUR client to allow a connection, but how to remotely 'hack' into any client to grab a privkey of a client without them having to open it up to full remote access.

thus subtly asking how to create a hacking tool

I DO NOT TRADE OR ACT AS ESCROW ON THIS FORUM EVER.
Please do your own research & respect what is written here as both opinion & information gleaned from experience. many people replying with insults but no on-topic content substance, automatically are 'facepalmed' and yawned at
CrazyCraig
Sr. Member
****
Offline Offline

Activity: 498
Merit: 340


Bye Felisha!


View Profile
October 21, 2016, 03:32:08 AM
 #5

I'm trying to figure out how to send remote RPC calls from within my PC to a remote BTC full node. All I know is that I can set the RPC port, username and password, but when I try to access it via a web browser (by typing its ip address) and put in the login details, I get an error message.

So how exactly does this work? I just want to be able to control a remote full node from my PC just by specifying the commands like: getpeerinfo and dumpprivkey.

Is there something that I may have missed? Please help, as I'm a little confused with this.  Huh

Also make sure your firewall isn't blocking the RPC outbound port.

Abiky
Legendary
*
Offline Offline

Activity: 1162
Merit: 1006


Crypto-Games.net: Multiple coins, multiple games


View Profile
October 22, 2016, 10:43:52 PM
 #6

The RPC calls work in the same way other HTTP APIs work where you have to provide data. You must use HTTP post requests. It isn't something you access through the browser.

You can use the bitcoin-cli program which will do everything for you and you use it like you do with the debug console. Or you can get some program that can do HTTP post requests (e.g. curl) and then send a JSON encoded HTTP Post request to call an RPC command. The bitcoind will respond with the output.

Great! Thanks for the information. I thought that it was something that could be accessed via the web browser by simply adding the necessary details. Just wanted to know more about this since I want to make my own Bitcoin web application.  Smiley


This video shows how easy it is to use the provided tools with python to handle calls locally.  I don't think using dumpprivkey from remote nodes would be considered the best security practice.

https://www.youtube.com/watch?v=3xAO4K7FC6E

Thanks for the video, mate. It will be of great use to me since I'm very familiar with using Python. My purpose would be more of making a web application using JavaScript that would send RPC calls to the Bitcoin daemon in order to make wallet addresses, deposit BTC, and more (it would be more of like an RPG game). But still, the video above would be very useful for me in case I decide to make a local application from within Python.


@everyone  Thanks guys for all your help. All of this material has greatly helped me into clearing most of my doubts regarding making RPC calls remotely in order to make my own apps with them.  Wink


▄▄▄████████▄▄▄
▄██████████████████▄
▄██████████████████████▄
██████████████████████████
████████████████████████████
██████████████████████████████
██████████████████████████████
██████████████████████████████
██████████████████████████████
██████████████████████████████
████████████████████████████
██████████████████████████
▀██████████████████████▀
▀██████████████████▀
▀▀▀████████▀▀▀
   ███████
██████████
██████████
██████████
██████████
██████████
██████████
██████████
██████████
██████████
██████████
██████████
███████
BTC  ◉PLAY  ◉XMR  ◉DOGE  ◉BCH  ◉STRAT  ◉ETH  ◉GAS  ◉LTC  ◉DASH  ◉PPC
     ▄▄██████████████▄▄
  ▄██████████████████████▄        █████
▄██████████████████████████▄      █████
████ ▄▄▄▄▄ ▄▄▄▄▄▄ ▄▄▄▄▄ ████     ▄██▀
████ █████ ██████ █████ ████    ▄██▀
████ █████ ██████ █████ ████    ██▀
████ █████ ██████ █████ ████    ██
████ ▀▀▀▀▀ ▀▀▀▀▀▀ ▀▀▀▀▀ ████ ▄██████▄
████████████████████████████ ████████
███████▀            ▀███████ ▀██████▀
█████▀                ▀█████
▀██████████████████████████▀
  ▀▀████████████████████▀▀ 
✔️DICE           
✔️BLACKJACK
✔️PLINKO
✔️VIDEO POKER
✔️ROULETTE     
✔️LOTTO
CrazyCraig
Sr. Member
****
Offline Offline

Activity: 498
Merit: 340


Bye Felisha!


View Profile
October 23, 2016, 04:29:44 AM
 #7

The RPC calls work in the same way other HTTP APIs work where you have to provide data. You must use HTTP post requests. It isn't something you access through the browser.

You can use the bitcoin-cli program which will do everything for you and you use it like you do with the debug console. Or you can get some program that can do HTTP post requests (e.g. curl) and then send a JSON encoded HTTP Post request to call an RPC command. The bitcoind will respond with the output.

Great! Thanks for the information. I thought that it was something that could be accessed via the web browser by simply adding the necessary details. Just wanted to know more about this since I want to make my own Bitcoin web application.  Smiley


This video shows how easy it is to use the provided tools with python to handle calls locally.  I don't think using dumpprivkey from remote nodes would be considered the best security practice.

https://www.youtube.com/watch?v=3xAO4K7FC6E

Thanks for the video, mate. It will be of great use to me since I'm very familiar with using Python. My purpose would be more of making a web application using JavaScript that would send RPC calls to the Bitcoin daemon in order to make wallet addresses, deposit BTC, and more (it would be more of like an RPG game). But still, the video above would be very useful for me in case I decide to make a local application from within Python.


@everyone  Thanks guys for all your help. All of this material has greatly helped me into clearing most of my doubts regarding making RPC calls remotely in order to make my own apps with them.  Wink

Not a problem. If you need help with anything reach out.

Sorrowfox
Sr. Member
****
Offline Offline

Activity: 293
Merit: 250



View Profile
October 23, 2016, 06:08:08 AM
 #8

As an analogy, RPC works as a function call. Like a function call, when an RPC is made, the calling arguments are passed to the remote machine and the caller waits for a response to be returned from the remote machine.The client machine makes a procedure call that sends a request which included program number, version number, procedure number & etc to the server and waits. The thread is blocked from processing until either a reply is received, or it times out. When the request arrives, the remote machine calls a dispatch routine that performs the requested service, and sends the reply back to the client procedure. After the RPC call is completed, the client program continues.
Abiky
Legendary
*
Offline Offline

Activity: 1162
Merit: 1006


Crypto-Games.net: Multiple coins, multiple games


View Profile
October 24, 2016, 04:31:06 PM
 #9

As an analogy, RPC works as a function call. Like a function call, when an RPC is made, the calling arguments are passed to the remote machine and the caller waits for a response to be returned from the remote machine.The client machine makes a procedure call that sends a request which included program number, version number, procedure number & etc to the server and waits. The thread is blocked from processing until either a reply is received, or it times out. When the request arrives, the remote machine calls a dispatch routine that performs the requested service, and sends the reply back to the client procedure. After the RPC call is completed, the client program continues.

Good to know. Thanks a lot mate for this useful explanation about RPC calls. With this, I would be able to make my own Bitcoin apps that would use Bitcoin's functions like creating multi-sig addresses, viewing peer stats, and more. It would be more of like an RPG game where it pays you satoshi after a minimum amount has been reached. You could also choose to buy upgrades for your character, and many more using Bitcoin.

Basically, I find Python a lot easier for this but I would also look into making an online wallet for an altcoin, as most alts have the same RPC commands as Bitcoin.  Smiley


▄▄▄████████▄▄▄
▄██████████████████▄
▄██████████████████████▄
██████████████████████████
████████████████████████████
██████████████████████████████
██████████████████████████████
██████████████████████████████
██████████████████████████████
██████████████████████████████
████████████████████████████
██████████████████████████
▀██████████████████████▀
▀██████████████████▀
▀▀▀████████▀▀▀
   ███████
██████████
██████████
██████████
██████████
██████████
██████████
██████████
██████████
██████████
██████████
██████████
███████
BTC  ◉PLAY  ◉XMR  ◉DOGE  ◉BCH  ◉STRAT  ◉ETH  ◉GAS  ◉LTC  ◉DASH  ◉PPC
     ▄▄██████████████▄▄
  ▄██████████████████████▄        █████
▄██████████████████████████▄      █████
████ ▄▄▄▄▄ ▄▄▄▄▄▄ ▄▄▄▄▄ ████     ▄██▀
████ █████ ██████ █████ ████    ▄██▀
████ █████ ██████ █████ ████    ██▀
████ █████ ██████ █████ ████    ██
████ ▀▀▀▀▀ ▀▀▀▀▀▀ ▀▀▀▀▀ ████ ▄██████▄
████████████████████████████ ████████
███████▀            ▀███████ ▀██████▀
█████▀                ▀█████
▀██████████████████████████▀
  ▀▀████████████████████▀▀ 
✔️DICE           
✔️BLACKJACK
✔️PLINKO
✔️VIDEO POKER
✔️ROULETTE     
✔️LOTTO
katiecbell
Hero Member
*****
Offline Offline

Activity: 672
Merit: 500

HEROIC.com |The Future of AI-Powered Cybersecurity


View Profile
October 25, 2016, 05:23:13 AM
 #10

The RPC calls work in the same way other HTTP APIs work where you have to provide data. You must use HTTP post requests. It isn't something you access through the browser.

You can use the bitcoin-cli program which will do everything for you and you use it like you do with the debug console. Or you can get some program that can do HTTP post requests (e.g. curl) and then send a JSON encoded HTTP Post request to call an RPC command. The bitcoind will respond with the output.
Do yo mean we cannot access through browser at all ? This your explanation sounds too technical, I like request you to  put in more possible explanation so that everyone whether tech savvy or not will easily get how RPC calls work...

qwik2learn
Hero Member
*****
Offline Offline

Activity: 636
Merit: 505


View Profile
October 25, 2016, 05:33:39 AM
 #11

The RPC calls work in the same way other HTTP APIs work where you have to provide data. You must use HTTP post requests. It isn't something you access through the browser.

You can use the bitcoin-cli program which will do everything for you and you use it like you do with the debug console. Or you can get some program that can do HTTP post requests (e.g. curl) and then send a JSON encoded HTTP Post request to call an RPC command. The bitcoind will respond with the output.

Great! Thanks for the information. I thought that it was something that could be accessed via the web browser by simply adding the necessary details. Just wanted to know more about this since I want to make my own Bitcoin web application.  Smiley
Hey, what do you know! achow101 has written some code that you could re-use for your project!
https://bitcointalk.org/index.php?topic=1458929.0
It's great stuff, don't miss it!  Grin Maybe you could tip us both for the time that it saved you.  Wink
Abiky
Legendary
*
Offline Offline

Activity: 1162
Merit: 1006


Crypto-Games.net: Multiple coins, multiple games


View Profile
October 31, 2016, 06:49:09 PM
 #12

Hey, what do you know! achow101 has written some code that you could re-use for your project!
https://bitcointalk.org/index.php?topic=1458929.0
It's great stuff, don't miss it!  Grin Maybe you could tip us both for the time that it saved you.  Wink

Great. Thanks mate! This might be very useful for the little project I'm working on. It will consist of several Raspberry Pis with different power sources in order to determine the most efficient energy solution. Some of those Pis will be used for Bitcoin app development, but the majority would be for crypto currency mining and full nodes for them too. It is good to know about new stuff everyday.  Cheesy

P.S. If I had some BTC, I would send you a tip, but right now I'm all out since I have invested most of the BTC into ICOs.  Wink


▄▄▄████████▄▄▄
▄██████████████████▄
▄██████████████████████▄
██████████████████████████
████████████████████████████
██████████████████████████████
██████████████████████████████
██████████████████████████████
██████████████████████████████
██████████████████████████████
████████████████████████████
██████████████████████████
▀██████████████████████▀
▀██████████████████▀
▀▀▀████████▀▀▀
   ███████
██████████
██████████
██████████
██████████
██████████
██████████
██████████
██████████
██████████
██████████
██████████
███████
BTC  ◉PLAY  ◉XMR  ◉DOGE  ◉BCH  ◉STRAT  ◉ETH  ◉GAS  ◉LTC  ◉DASH  ◉PPC
     ▄▄██████████████▄▄
  ▄██████████████████████▄        █████
▄██████████████████████████▄      █████
████ ▄▄▄▄▄ ▄▄▄▄▄▄ ▄▄▄▄▄ ████     ▄██▀
████ █████ ██████ █████ ████    ▄██▀
████ █████ ██████ █████ ████    ██▀
████ █████ ██████ █████ ████    ██
████ ▀▀▀▀▀ ▀▀▀▀▀▀ ▀▀▀▀▀ ████ ▄██████▄
████████████████████████████ ████████
███████▀            ▀███████ ▀██████▀
█████▀                ▀█████
▀██████████████████████████▀
  ▀▀████████████████████▀▀ 
✔️DICE           
✔️BLACKJACK
✔️PLINKO
✔️VIDEO POKER
✔️ROULETTE     
✔️LOTTO
Pages: [1]
  Print  
 
Jump to:  

Sponsored by , a Bitcoin-accepting VPN.
Powered by MySQL Powered by PHP Powered by SMF 1.1.19 | SMF © 2006-2009, Simple Machines Valid XHTML 1.0! Valid CSS!