Skip to main content

A module to help you make a blockchain

Project description

BlCh

a python package that can help you make a blockchain within 50 lines of code

Example

from blch import Block, Blockchain

def  main():
	blockchain  =  Blockchain()
	database  = ["Joe gives 2 coins to jack", "Jack gives 3 coins to Joe", "May gave 10 coins to Klaus", "Klaus gave 5 coins to May"]
	
	num  =  0
	for  data  in  database:
	num  +=  1
	
	blockchain.mine(Block(num, data=data))
	for  block  in  blockchain.chain:
		print(block)

	print(blockchain.isValid())
	blockchain.mine(blockchain.chain[0])

if  __name__  ==  '__main__':
	main()

This is a simple example of the code which can be tweaked by your needs


If any problems please raise an issue in the github repo of this package


Repo

Please fork my repo and make sure to let me know for any ideas or problems to fix

Build Status

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

blch-0.5.0.tar.gz (2.5 kB view details)

Uploaded Source

Built Distribution

blch-0.5.0-py3-none-any.whl (2.6 kB view details)

Uploaded Python 3

File details

Details for the file blch-0.5.0.tar.gz.

File metadata

  • Download URL: blch-0.5.0.tar.gz
  • Upload date:
  • Size: 2.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.7.1 importlib_metadata/4.10.1 pkginfo/1.8.2 requests/2.27.1 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.10.1

File hashes

Hashes for blch-0.5.0.tar.gz
Algorithm Hash digest
SHA256 2ff27b19d8af59ddb575c6047734f61282e3dc549f3530ce4e7eeebff41a2df2
MD5 47d9d69afb59b97115b3828efafcbcf2
BLAKE2b-256 8d9a1cbe0200c95759bf731f582fa09032f838a50b9dff2af4774f4dd727aba7

See more details on using hashes here.

File details

Details for the file blch-0.5.0-py3-none-any.whl.

File metadata

  • Download URL: blch-0.5.0-py3-none-any.whl
  • Upload date:
  • Size: 2.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.7.1 importlib_metadata/4.10.1 pkginfo/1.8.2 requests/2.27.1 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.10.1

File hashes

Hashes for blch-0.5.0-py3-none-any.whl
Algorithm Hash digest
SHA256 a0102894ef7d06409cc253d50f59fb7a4e7c80438f425ba4bad522fd21cd75b5
MD5 18384bcc9d36a944bca54b9d0476a463
BLAKE2b-256 780ddaeb4f5bab3a6c273b478bf2bd36cbeadd001347b4618a5ea7df58daa1de

See more details on using hashes here.

Supported by

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