Skip to content
A simple IPC python client for the Nano currency
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
src
test
.gitignore
LICENSE
README.md
setup.py

README.md

nano-ipc-py

A python library for interacting with the Nano currency node IPC.

The library's client accepts JSON serializable objects and returns a dictionary, deserialized from the node's JSON response.

This code is experimental and not production tested. Use at your own risk.

Requirements

  • Python 3
  • Enabling the local IPC server in the node's config.json

Setup

git clone https://github.com/guilhermelawless/nano-ipc-py.git && cd nano-ipc-py
python3 setup.py install --user

After setup you can remove the source folder nano-ipc-py.

Using

# imports the Client and custom Exceptions
import nano_ipc

# this is the default UNIX socket for the node's local IPC
server = '/tmp/nano'

# provides a persistent connection until c.close() is called
c = nano_ipc.Client(server, timeout=15)

# example request/response
req = {"action": "block_count"}
response = c.request(req)
print(response['unchecked'])

For developers

An example is provided in test/test_client.py with custom error handling.

You can’t perform that action at this time.