Skip to content

guilhermelawless/nano-ipc-py

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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.

About

A simple IPC python client for the Nano currency

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages