Generic blockchain access library and tooling
Go to file
nolash f38ece7c2b Revert "Remove bluto"
This reverts commit 6a94208c68.
2021-12-21 15:00:45 +00:00
.bluto Revert "Remove bluto" 2021-12-21 15:00:45 +00:00
chainlib Add option to skip ssl validation on rpc 2021-12-06 18:55:36 +01:00
doc/texinfo Remove unnecessary nodes 2021-10-26 19:44:54 +02:00
tests Add custom fields to chain spec, harden custom field imports, improve dumpconfig handle 2021-10-28 12:16:23 +02:00
.gitignore Add missing jsonrpc module, add address code retrieve to get cli util 2021-04-17 13:01:26 +02:00
.gitlab-ci.yml Update .gitlab-ci.yml 2021-08-24 16:27:36 +00:00
CHANGELOG Add option to skip ssl validation on rpc 2021-12-06 18:55:36 +01:00
LICENSE.txt Add block and tx class 2021-02-11 10:16:05 +01:00
Makefile Add missing jsonrpc module, add address code retrieve to get cli util 2021-04-17 13:01:26 +02:00
MANIFEST.in Add docstrings 2021-08-21 07:31:59 +00:00
README.md Add docstrings 2021-08-21 07:31:59 +00:00
requirements.txt Remove prerelease tag 2021-11-06 15:30:03 +01:00
run_tests.sh Add docstrings for config, test for config 2021-08-23 08:27:48 +02:00
setup.cfg Add option to skip ssl validation on rpc 2021-12-06 18:55:36 +01:00
setup.py Add bluto package info renderer 2021-11-08 07:49:02 +01:00

chainlib

Chainlib is a prototype attempt at writing a generalized code library structure in python3 for concepts that are valid across blockchains, either within the same chain technology or across them. If useful and/or successful, it should be considered ported to a more performant language (rust?).

It is primarily aimed at (possibly threaded) console-environment development.

It aims to give fine-grained control and transparency to all operations and transformations.

It library code should be easy to understand and maintain.

To achieve transparency and improve maintainability, it deliberately exposes the user of this code to a certain degree of complexity.

Ultimately, the chainlib library is for the developer who seeks to understand and contribute, rather than merely defer and consume.

Requirements

Chainlib seeks to keep its dependency graph and small as possible. Because of baggage from the initial phase of development, it depends on the crypto-dev-signer library to represent transaction structures. As this dependency also includes other routines not necessary for the code in the library, it will be replaced with a dedicated component. crypto-dev-signer will still be used as default for tests, and for the time being also for the CLI runnables.

To generate the bitcoin-style keccak256 hashes, pysha3 is used. pysha3 is a very fast python wrapper around the official keccak implementation from XKCP.

The other requirements are very this code fragments that merely help to relieve a bit of tedium, and add no magic.

Chainlib is not compatible with python2, nor is there any reason to expect it will aim to be.

Structure

Any generalizable structures and code can be found in the base module directory chainlib/

Currently the only operational code for available targets is for the evm and the Ethereum network protocol. This code can be found in the separate package chainlib-eth.

Every module will have a subdirectory runnable which contains CLI convenience tooling for common operations. Any directory example will contain code snippets demonstrating usage.

How to use

There are no (exhaustive) tutorial planned for chainlib. All you need to know should be possible to easily understand from code in the example tests and runnable subfolders.

See also

  • The chainsyncer project, which provides a simple chain syncer framework allowing for an arbitrary amount of pluggable code to be executed for each block transaction.
  • The chainqueue project, which provides a transaction queueing daemon that handles conditional submisssion and resubmission of transactions to the network.