Access to RPC console

1

I am new to Bitcoin, can anyone tell me how I can access to my RPC console and type in commands. I am using Bitcoin Core on my PC. If there is a tutorial for beginners to access to RPC please notify me.

Mohammad

Posted 2015-04-01T14:09:45.833

Reputation: 23

Answers

2

Here is a Step-by-Step tutorial

  • Set up bitcoin.conf.
    rpcuser=user <br>
    rpcpassword=password <br>
    rpcallowip=172.28.128.1 # The ip of your machine. Use 127.0.0.1 if you use local machine<br>
    

  • Start a bitcoin client by
    bitcoind -server=1 -daemon
    

  • Download this library and install it by running
    python setup.py install 
    

  • Create a python script to connect to RPC server.
    from jsonrpc import ServiceProxy
    access = ServiceProxy("http://user:password@172.28.128.4:8332")
    print(access.getbalance())
    

  • moshaholo

    Posted 2015-04-01T14:09:45.833

    Reputation: 575

    Re: rpcallowip=172.28.128.1 # The ip of your machine. Use 127.0.0.1 if you use local machine; is the local host allowed by default? Also, could you provide clarification on whether using both rpcallowip lines - ie 172.28.128.1 & 127.0.0.1, respectively, is problematic in the above conf file eg? I.e. Is there any harm adding local machine in addition to the machine IP?Wizard Of Ozzie 2015-04-03T10:32:54.703

    Yes, local host is allowed by default..moshaholo 2015-04-06T13:32:03.487

    1

    1. RPC @ Bitcoin Wiki
    2. *Mastering Bitcoin" (A. Antonopoulos)
    3. Open console >, type help

    You'll need a Bitcoin.conf file setup, which lives in your home directory (what OS?)

    Full instruction guide

    Wizard Of Ozzie

    Posted 2015-04-01T14:09:45.833

    Reputation: 4 535

    1

    If you are using Bitcoin-QT then simply go to Help->Debug Window->Console. This gives you full RPC capability inside of the wallet. If you want to work with the data you output, then you will need to use an RPC wrapper of your choice.

    presstab

    Posted 2015-04-01T14:09:45.833

    Reputation: 166