transferchain abci read client
Project description
tcabci-read-python-client
It is used to listen to the read nodes of TransferChain and send requests to the Block Explorer.
Installation
This client requires python>=3.8
pip install tcabci-read-client
pip install git+https://github.com/TransferChain/tcabci-read-python-client@main
Constants
Read node websocket url
wss://read-node-01.transferchain.io/ws
Read node http url
https://read-node-01.transferchain.io
Examples
read-node event listener and subscribe example
from tcabci_read_client import WsClient
def message_callback(message):
print(f"Received message: {message}")
def error_callback(error):
print(f"Error: {error}")
client = WsClient("wss://read-node-01.transferchain.io/ws",
message_callback=message_callback,
error_callback=error_callback)
client.start()
client.subscribe(['addresses'])
client.unsubscribe(['addresses'])
client.get_subscribe_addresses()
Http client example
from tcabci_read_client import HttpClient
client = HttpClient("https://read-node-01.transferchain.io")
client.get_last_block()
'''
client.tx_search params;
limit, order_field,offset,order_by,hashes,typ,sender_addrs,recipient_addrs
'''
client.tx_search(sender_addrs='test_address', recipient_addrs='test_address2')
client.broadcast(tx_id=1, version=1, fee=0, data="", sign="", tx_type="", sender_address="from", recipient_address="to")
License
MIT
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Close
Hashes for tcabci_read_client-0.1.3-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 3b5bbad20864331b07eff7552968f235af059c6c5392831fe3a52d0a0fa7d799 |
|
MD5 | ecc2f53b430ee3ce06c1a84aaf572fc0 |
|
BLAKE2b-256 | 3b6cd3a06cb00359baf600fa84431eb5a4e7e7efcb0acd5a2aaf3b33ae31c653 |