Minimal blockchain
Project description
MinChain - minimal blockchain
For experimenting and future projects.
Install
$ pip install git+https://github.com/dyuri/repachain
or
$ git clone https://github.com/dyuri/repachain
$ pip install --user repachain
Usage
>>> from repachain import RepaChain
>>> rc = RepaChain('abc', 'sha256')
>>> rc.add_block('whatever')
>>> rc.verify()
>>> rc.to_json_file('whatever.json.gz')
>>> rc[1].hash = 'wrong hash'
>>> rc.verify()
repachain.InvalidBlockException: Wrong hash at block 1
>>> rc2 = RepaChain.from_json_file('whatever.json.gz')
>>> rc2.verify()
>>> rc2[1].data
'whatever'
TODO
- proper documentation
- tests
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
repachain-1.0.0.tar.gz
(4.3 kB
view details)
File details
Details for the file repachain-1.0.0.tar.gz
.
File metadata
- Download URL: repachain-1.0.0.tar.gz
- Upload date:
- Size: 4.3 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/1.13.0 pkginfo/1.4.2 requests/2.22.0 setuptools/41.2.0 requests-toolbelt/0.9.1 tqdm/4.32.1 CPython/3.7.4
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 28f6c2464d31d37c1db68a3e0080a3ba55c2bc5cad4b9fdc94dd296723f7f24b |
|
MD5 | 6c2ff9d12c7b48cdf10e9f99c42e0296 |
|
BLAKE2b-256 | 1753516f9b27cec7ae6817b8057fd58108a92bbedb97b5f7cb38ac375a0c992e |