Skip to main content

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'

Testing

You need pyenv for running the testsuite for both python 3.6 and 3.7.

$ pip install --user tox tox-pyenv pytest pytest-cov
$ tox

TODO

  • proper documentation

Metadata

Release files for repachain 1.0.2

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for repachain 1.0.2
File Size Uploaded Provenance Actions
repachain-1.0.2.tar.gz 4.5 kB Without provenance Details for repachain-1.0.2.tar.gz

Release files / repachain-1.0.2.tar.gz

Download URL repachain-1.0.2.tar.gz
Size 4.5 kB
Tags Source
SHA-256 checksum
How to use checksums
3380f60224d4beb7d4b01d9a22db85496b0410a2676d149a86bd3046f024d9d5
BLAKE2b-256 checksum
How to use checksums
f41ed532b8950368021c1f5a9a3080916f4272629b96ebf09b5274eaf179a365
Upload date
Uploaded using Trusted Publishing?
What is 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

Security for repachain 1.0.2

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page