Skip to main content

A blockchain linker to help understand hash functions in blockchain

Project description

justblockchain

https://img.shields.io/pypi/v/justblockchain.svg https://img.shields.io/travis/koshikraj/justblockchain.svg Documentation Status Updates

A blockchain linker to help understand hash functions in blockchain

Quick start

Installation

  • pip install justblockchain

Creating simple blockchain

>>> from justblockchain import justblockchain
>>> blockchain = justblockchain.Blockchain()
>>> blockchain.add_block("some block content")

#display the blockchain
>>> blockchain.chain
[{'previous_hash': '0', 'hash':
'816534932c2b7154836da6afc367695e6337db8a921823784c14378abed4f7d7',
'timestamp': 1465154705, 'index': 0, 'data': 'my genesis block!!'},
{'previous_hash':
'816534932c2b7154836da6afc367695e6337db8a921823784c14378abed4f7d7', 'hash':
'a046e0b31d2374d171a6bf62f15261f8bb1f71e6351aab2ce7ce6d550506d9ee',
'timestamp': '1521013680', 'index': 1, 'data': 'some block content'}]

Creating a Block using proof-of-work

>>> from justblockchain import justblockchain
>>> blockchain = justblockchain.Blockchain()
>>> blockchain.difficulty_bits = 20
>>> blockchain.add_block("some block content")
Computing nonce for the block...
Success with nonce 2991544
Hash is 00000fc3d1420243cca17693bcc75334eb9f01b0943772f5d6456e17f3218abc

Credits

History

0.1.0 (2018-03-13)

  • First release on PyPI.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

justblockchain-1.0.1.tar.gz (9.7 kB view details)

Uploaded Source

Built Distribution

justblockchain-1.0.1-py2.py3-none-any.whl (5.1 kB view details)

Uploaded Python 2 Python 3

File details

Details for the file justblockchain-1.0.1.tar.gz.

File metadata

  • Download URL: justblockchain-1.0.1.tar.gz
  • Upload date:
  • Size: 9.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.12.1 pkginfo/1.4.2 requests/2.20.1 setuptools/40.6.2 requests-toolbelt/0.8.0 tqdm/4.28.1 CPython/3.6.3

File hashes

Hashes for justblockchain-1.0.1.tar.gz
Algorithm Hash digest
SHA256 79c3d99e4cca1aac969d09efc2d7144b6b1adde30903726e1428300752f44179
MD5 476c9bc37d1309fd745aab0bc7165206
BLAKE2b-256 62d08be0c35c8c10bcde2882fd60673c61338d9811ed7dd88a1b6b7a989558bd

See more details on using hashes here.

File details

Details for the file justblockchain-1.0.1-py2.py3-none-any.whl.

File metadata

  • Download URL: justblockchain-1.0.1-py2.py3-none-any.whl
  • Upload date:
  • Size: 5.1 kB
  • Tags: Python 2, Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.12.1 pkginfo/1.4.2 requests/2.20.1 setuptools/40.6.2 requests-toolbelt/0.8.0 tqdm/4.28.1 CPython/3.6.3

File hashes

Hashes for justblockchain-1.0.1-py2.py3-none-any.whl
Algorithm Hash digest
SHA256 5f41a8d7a8d8eea5545218261fc004545997dcc05075ea87b9aa715ca3f6d2f8
MD5 768b5159370f2c4a8abfa57dcce36c84
BLAKE2b-256 d6b60759fe205c99cdd77e5f7f2c85123fc218ed16a29f991928b5d54c22fbec

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page