Python client to the InterlockLedger Node REST API
Project description
InterlockLedger REST Client in Python
This package is a python client to the InterlockLedger Node REST API. It connects to InterlockLedger nodes, allowing the creation of chains, interlocks, and storage of records and documents.
This library replaces the original client, interlockledger-rest-client-python, that is now deprecated.
The InterlockLedger
An InterlockLedger network is a peer-to-peer network of nodes. Each node runs the InterlockLedger software. All communication between nodes is point-to-point and digitally signed, but not mandatorily encrypted. This means that data is shared either publicly or on a need-to-know basis, depending on the application.
In the InterlockLedger, the ledger is composed of myriads of independently permissioned chains, comprised of blockchained records of data, under the control of their owners, but that are tied by Interlockings, that avoid them having their content/history being rewritten even by their owners. For each network the ledger is the sum of all chains in the participating nodes.
A chain is a sequential list of records, back chained with signatures/hashes to the previous records, so that no changes in them can go undetected. A record is tied to some enabled Application, that defines the metadata associate with it, and the constraints defined in this public metadata, forcibly stored in the network genesis chain, is akin to validation that each correct implementation of the node software is able to enforce, but more importantly, any external logic can validate the multiple dimensions of validity for records/chains/interlockings/the ledger.
Dependencies
-
Python 3.11.3
- pydantic 2.6.1
- requests 2.32.2
- pyOpenSSL 24.1.0
- pyilint 0.2.2
- pyiltags 0.1.1
-
InterlockLedger:
- API 14.2.2
How to install
This library has been published on pypi.org, thus you can install it using pip directly:
pip install pyil2
Documentation
The documentation for this library can be found at here.
Example
How to use the interlockledger rest client. This example will show how to list the chains in a node and store an encrypted JSON document in the first chain:
from pyil2 import IL2Client
client = IL2Client(
host='https://il2.node:32032/',
cert_filepath='rest.api.pfx',
cert_password='Str0ngPassword'
)
chain_api = client.api('chain')
chains = chain_api.list_chains()
chain_id = chains[0].id
json_api = client.api('json')
encrypted_json = json_api.add_json_document(
chain_id,
{
'attribute': "value"
}
)
License
This program is licensed under the BSD 3-Clause License.
Contributions
We are not actively looking for contributions but if you want to help, feel free to do so via the project's gitHub page.
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 Distributions
Built Distribution
File details
Details for the file pyil2-0.1.2-py3-none-any.whl
.
File metadata
- Download URL: pyil2-0.1.2-py3-none-any.whl
- Upload date:
- Size: 50.8 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.0.0 CPython/3.11.3
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | fa141a1ad50b5d1114a87ecfcbaf1b7eddde17541515c66c1cebf7d8083b050c |
|
MD5 | 83dd02a703a80a25b0fabe69ae1894ae |
|
BLAKE2b-256 | 7d1d4ec943c08b1c5520e2f7b76f740ae9f2cd3a09ff80a7022a17bcf591eb5c |