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.

Files for justblockchain, version 1.0.1
Filename, size File type Python version Upload date Hashes
Filename, size justblockchain-1.0.1-py2.py3-none-any.whl (5.1 kB) File type Wheel Python version py2.py3 Upload date Hashes View
Filename, size justblockchain-1.0.1.tar.gz (9.7 kB) File type Source Python version None Upload date Hashes View

Supported by

Pingdom Pingdom Monitoring Google Google Object Storage and Download Analytics Sentry Sentry Error logging AWS AWS Cloud computing DataDog DataDog Monitoring Fastly Fastly CDN DigiCert DigiCert EV certificate StatusPage StatusPage Status page