Minimal blockchain
Project description
MinChain - minimal blockchain
For experimenting and future projects.
Requirements
- Python 3.6+
- [optional] scrypt for scrypt based hashing
Install
$ pip install --user repachain
or (using latest available code)
$ pip install --user 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.1.tar.gz
(4.4 kB
view details)
File details
Details for the file repachain-1.0.1.tar.gz
.
File metadata
- Download URL: repachain-1.0.1.tar.gz
- Upload date:
- Size: 4.4 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 | 0bac0af64127fb2d85fbef676803bce213d1ddcfda4646d94c965623350fe85f |
|
MD5 | 99a1fb87510471703bd238803c24bc41 |
|
BLAKE2b-256 | 75a9b228f7789b66282f52160823d0d6d35921b8f7202496c8016b5a5a1d2cb3 |