Skip to content

A simple proof of understanding demonstration of the blockchain technology

Notifications You must be signed in to change notification settings

manh-vnguyen/minichain

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

10 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Minichain Project

Dependency

  • python3 (ecdsa, requests, flask)

Kickoff chain

Init Blockchain service

cp development/fullchain_init.json blockchain/fullchain.json
export CHAIN_ENDPOINT=http://127.0.0.1:8080
export MINER_ENDPOINT=http://127.0.0.1:9090
python3 blockchain/fullchain.py

Create miner wallet

from wallet.wallet import Wallet
wallet = Wallet('<wallet_file_name>', True, '<wallet_name>')

Mine Genesis Block

export CHAIN_ENDPOINT=http://ec2-54-254-131-32.ap-southeast-1.compute.amazonaws.com:8080
python3 kickoff_chain.py

Init Miner Service

cp development/mempool_database_init.json miner/mempool_database.json
export CHAIN_ENDPOINT=http://127.0.0.1:8080
export MINER_ENDPOINT=http://127.0.0.1:9090
export MINER_WALLET_ADDRESS=<wallet_pubKey>
python3 miner/miner.py

Transaction

Configure chain/miner endpoints

# published endpoint of chain service
export CHAIN_ENDPOINT=http://ec2-54-254-131-32.ap-southeast-1.compute.amazonaws.com:8080
# published endpoint of miner service
export MINER_ENDPOINT=http://ec2-54-254-131-32.ap-southeast-1.compute.amazonaws.com:9090

Create and Register a wallet

from wallet.wallet import Wallet
wallet = Wallet('<wallet_file_name>', True, '<wallet_name>')
wallet.register_wallet()

Look up wallets

Your wallet

from wallet.wallet import Wallet
wallet = Wallet('<wallet_file_name>')
wallet.get_wallet_data()

All wallets

# all wallets
curl ${CHAIN_ENDPOINT}/wallets

Send Coin

from wallet.wallet import Wallet
wallet = Wallet('<wallet_file_name>')
wallet.send_coin('<other_wallet_pubKey>', <coin_amount>)

About

A simple proof of understanding demonstration of the blockchain technology

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published