Simple Database based on Blockchain technology.
In this repository you can found a simple Database based on blockchain technology.
IN THIS MOMENT THE DATABASE JUST WORK AS LOCALLY AND ONE DEVICE
1.1.4
Python >= 3.6
├── BlockchainDataBase
│ ├── Data
│ │ ├── __init__.py
│ │ ├── DBManage.py
│ ├── __init__.py
│ ├── Block.py
│ ├── Blockchain.py
├── Test
│ ├── Test1.py
│ ├── Test2.py
│ ├── Test3.py
│ ├── Test4.py
├── LICENSE
├── README.md
├── setup.py
From official pypi.org
python -m pip install BlockchainDataBase
From test.pypi.org
python -m pip install --index-url https://test.pypi.org/simple/ BlockchainDataBase
On the folder you found a configuration file in a JSON format, if you want to change the folder on the database or database name you do in this file.
# The data saves on %APPDATA% directory.
├── blockchain
│ ├── config.json
config.json
{
"DEFAULT": {
"DATABASE_NAME": "blockchain_database.bc",
"CONFIG_FILE": "config.json"
}
}
Initialize the Blockchain.
from BlockchainDataBase.Blockchain import Blockchain
bc = Blockchain()
Add one block into Blockchain.
data = {"Data": "dataResult"}
bc.add_block(data)
Shows all the blocks in the Blockchain.
bc.print_blocks()
Validates the blockchain to check if not was corrupted
bc.validate_chain()