def connect_to_local(): """ Connect to default bitcoin instance owned by this user, on this machine. Returns a :class:`~bitcoin.connection.BitcoinConnection` object. """ from bitcoin.connection import BitcoinConnection from bitcoin.config import read_default_config cfg = read_default_config() port = int(cfg.get('rpcport', '8332')) return BitcoinConnection(cfg['rpcuser'],cfg['rpcpassword'],'localhost',port)
def connect_to_local(): """ Connect to default bitcoin instance owned by this user, on this machine. Returns a :class:`~bitcoin.connection.BitcoinConnection` object. """ from bitcoin.connection import BitcoinConnection from bitcoin.config import read_default_config cfg = read_default_config() port = int(cfg.get('rpcport', '8332')) return BitcoinConnection(cfg['rpcuser'], cfg['rpcpassword'], 'localhost', port)
from argparse import Namespace args = Namespace(user='', password='', host='localhost', port=8332) urls = ( '/', 'main', '/api/(.*)', 'API', '/tests', 'testingInterface' ) if args.user or args.host != 'localhost': btcJson = BitcoindJson(**args.__dict__) else: from bitcoin.config import read_default_config cfg = read_default_config() btcJson = BitcoindJson( user=cfg.get('rpcuser', ''), password=cfg['rpcpassword'], host='localhost', port=int(cfg.get('rpcport', '8332'))) db = sqlite.connect('main.db') dbc = db.cursor() render = web.template.render('templates/') class API: def GET(self, action = None):