https://github.com/demg-dev/simpleblockchaindatabase
Simple Database based on Blockchain technology.
https://github.com/demg-dev/simpleblockchaindatabase
blockchain blockchain-technology database python
Last synced: about 2 months ago
JSON representation
Simple Database based on Blockchain technology.
- Host: GitHub
- URL: https://github.com/demg-dev/simpleblockchaindatabase
- Owner: DEMG-DEV
- License: mit
- Created: 2018-09-24T21:38:34.000Z (almost 8 years ago)
- Default Branch: master
- Last Pushed: 2021-02-22T07:05:43.000Z (over 5 years ago)
- Last Synced: 2026-01-03T20:08:29.511Z (6 months ago)
- Topics: blockchain, blockchain-technology, database, python
- Language: Python
- Homepage: https://demg-dev.github.io/SimpleBlockchainDataBase/
- Size: 31.3 KB
- Stars: 6
- Watchers: 1
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# SimpleBlockchainDatabase [](https://www.codetriage.com/demg-dev/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.4**
## LICENSE
[MIT License](LICENSE)
## Requirements
Python >= 3.6
## Project structure
```bash
├── 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
```
## 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 official pypi.org
```
python -m pip install BlockchainDataBase
```
From test.pypi.org
```
python -m pip install --index-url https://test.pypi.org/simple/ 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.
├── blockchain
│ ├── config.json
```
```
config.json
{
"DEFAULT": {
"DATABASE_NAME": "blockchain_database.bc",
"CONFIG_FILE": "config.json"
}
}
```
## 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()
```