A Simple Blockchain Database.
Project description
SimpleBlockchainDatabase
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
Version
1.1.0
LICENSE
Requirements
Python >= 3.6
Project structure
├── BlockchainDataBase
│  ├── Data
│  │  ├── __init__.py
│  │  ├── DBManage.py
│  │  ├── config.json
│  ├── __init__.py
│  ├── Block.py
│  ├── Blockchain.py
├── Test
│  ├── Test1.py
│  ├── Test2.py
│  ├── Test3.py
│  ├── Test4.py
├── LICENSE
├── README.md
├── setup.py
Test
- Test1.py, This test just creates the genesis block of the blockchain.
- Test2.py, This test add a one block to the blockchain and prints the blocks.
- Test3.py, This test add 2 blocks into the blockchain, prints the blocks and validate the blockchain.
- Test4.py, This shows all the blocks.
Install
From test.pypi.org
python -m pip install --index-url https://test.pypi.org/simple/ BlockchainDataBase
From official pypi.org
python -m pip install BlockchainDataBase
Configuration
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.
├── BlockchainDataBase
│  ├── Data
│  │  ├── config.json
config.json
{
"DEFAULT": {
"DATABASE_LOCATION": "/blockchain/",
"DATABASE_NAME": "blockchain_database.bc"
}
}
Examples
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()
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
Built Distribution
Close
Hashes for BlockchainDataBase-1.1.2-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 40f7dad468783c92375807e40e0093d5fd2b45c8d5ca279e57137a5cd313d80d |
|
MD5 | 817cb48cc03adc0c412469ae13952682 |
|
BLAKE2b-256 | 68881222340625eb796a51331586635e459cf1e8a7bd4161eb0eb7114643646f |