The postal system is a popular medium to transfer items and documents between people and organizations. A lot of people remain involved in it as well as huge monetary and resource transactions happen through it. So, security and reliability are the crucial factors in this system. Blockchain is a robust, decentralize, and distributed security technique used mainly for secure transactions between different parties. So, in this project, our target will be to build a blockchain-based secure, and reliable framework for the postal system.
anaconda python env
conda create -n blockchain python=3.8
conda activate blockchain
pip install -r requirements.txt
If the project cannot run, consider installing the following libraries:
conda install -c anaconda flask
conda install -c anaconda pathlib
conda install -c conda-forge pyzbar
conda install -c anaconda pillow
- blockchain.py -> Fundamental implementation of blockchain
- postalSystem -> Business implementation of the postal system
- blockchainNetwork.py -> Blockchain functionality testing
- test.png -> Used for testing QR code images
- blockchain.json -> Blockchain data stored in JSON
- user.json -> User data stored in JSON
- templates ->
- index.html -> index page
- login.html -> login page
- mail.html -> business page
- register.html -> register page
install postman or other http test tool, and run blockchainNetwork.py
get http://localhost:5000/chain
show current blockchain
get http://localhost:5000/mine
create a block
post http://localhost:5000/transactions/new
create a transaction
Regarding the testing system, you can conduct tests by calling the interface or using the Postman link I've provided. Within that link, I've included all the interfaces. You're free to test them based on your own approach or ideas.
open http://localhost:5000/
in browser
current user password: test01 123 or test02 123
- In the email page, when users send an email for the first time, they need to click on the 'new-chain' button on the right, and the QR code is a required parameter.
- Users can view all chain data related to them by clicking the 'get-chain' button.