Skip to content

RPC/Websocket HelloWorld style code --Answered-- #9711

Closed Answered by baerrs
baerrs asked this question in Q&A
Discussion options

You must be logged in to vote

I think I got it working now, would love to if this works for others:
Here is the python RPC example:

import requests
import urllib3
import json
urllib3.disable_warnings()

headers = {'Content-Type': 'application/json'}
url = "https://localhost:8555/get_blockchain_state"
data = '{}'
cert = ('ssl/full_node/private_full_node.crt', 'ssl/full_node/private_full_node.key')
response = json.loads(requests.post(url, data=data, headers=headers, cert=cert, verify=False).text)
print(json.dumps(response, indent=4, sort_keys=True))

python Websocket example:

import json
from datetime import datetime
import websocket
import ssl


# websocket.enableTrace(True)
def on_message(ws, message):
    print('{0}:…

Replies: 2 comments 2 replies

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
2 replies
@mariano54
Comment options

@danieljperry
Comment options

Answer selected by baerrs
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
3 participants