Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

http json-rpc error connect to wallet #69

Closed
SuperCipher opened this issue Jul 2, 2020 · 1 comment
Closed

http json-rpc error connect to wallet #69

SuperCipher opened this issue Jul 2, 2020 · 1 comment

Comments

@SuperCipher
Copy link

bchwallet --version bchwallet version 0.9.0
bchd --version bchd version 0.16.3
bchwallet --simnet --noclienttls --noservertls --username admin --password adminpass —rpcconnect localhost:18556

I'm trying to connect to bchwallet through python http post

import getpass
import json
import requests
from requests.auth import HTTPBasicAuth
# python json rpc

# bchd
# URL = "http://127.0.0.1:18556/"

# bchwallet
URL = "http://127.0.0.1:18554/"


def instruct_wallet(method, params):
    payload = json.dumps({"jsonrpc":"1.0","id":"0","method": method, "params": params})
    headers = {'content-type': "application/json", 'cache-control': "no-cache"}
    try:
        response = requests.request("POST", URL, data=payload, headers=headers, auth=HTTPBasicAuth(rpc_user, rpc_password))
        print( json.loads(response.text))
    except requests.exceptions.RequestException as e:
        print (e)
    except:
        print(response)
        # print ('No response from Wallet, check Bitcoin is running on this machine')

rpc_user='admin'
rpc_password='adminpass'

# instruct_wallet('getinfo', [])
instruct_wallet('getbalance', [])

and got this error
Screen Shot 2020-07-02 at 4 03 12 PM

@zquestz
Copy link
Contributor

zquestz commented Jan 4, 2025

Closing due to inactivity and much older release.

@zquestz zquestz closed this as completed Jan 4, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants