bc4py

Simple blockchain library for python3.


Keywords
python, blockchain, p2p
License
MIT
Install
pip install bc4py==0.0.28a0

Documentation

bc4py (blockchain-for-python)

It enable you to create application with blockchain on Python3.

Function

  • UTXO base
  • Proof of works or/and proof of stake multi-consensus
  • Minting colored coin (Not token)
  • Python interpreter based smart contract (PyContract)
  • block containing result smart contract (differ from Ethereum)

Requirement

Install

cd ~
git clone https://github.com/namuyan/bc4py
mv bc4py blockchain-py
cd blockchain-py
pip install --user -r requirements.txt
pip install --user -r requirements-c.txt
wget http://example.com/boot.dat
# compile
wget https://github.com/google/leveldb/archive/v1.20.tar.gz
zcat v1.20.tar.gz | tar xf -
cd leveldb-1.20
make
make check
# copy source
sudo cp -r include/leveldb /usr/local/include/
sudo install -o root -m 644 -p out-shared/libleveldb.so.1.20 /usr/local/lib/
sudo cp -d out-shared/libleveldb.so out-shared/libleveldb.so.1 /usr/local/lib/
sudo install -o root -m 644 -p out-static/lib* /usr/local/lib/
# affect changes
sudo ldconfig
pip install plyvel

Start node

  • python localnode.py Node working on local env, for debug.
  • python publicnode.py Node with mining/staking.
  • python observenode.py Node only accept blocks/txs.

Documents

Build for windows

nuitka3 --mingw --recurse-none publicnode.py

Author

@namuyan_mine

Licence

MIT