Created
May 19, 2013 18:47
-
-
Save kokjo/5608566 to your computer and use it in GitHub Desktop.
Simple and short bitcoind jsonrpc api access.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import jsonrpc | |
from jsonrpc import ServiceProxy | |
from os.path import expanduser | |
conf = {p[0]: p[1].strip() for p in | |
(l.split("=", 1) for l in open(expanduser("~/.bitcoin/bitcoin.conf"))) | |
if len(p) == 2} | |
proxy = ServiceProxy("http://%(rpcuser)s:%(rpcpassword)[email protected]:8332"%conf) | |
info = proxy.getinfo() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment