Skip to main content

SimpleBlockchainDatabase Open Source Helpers

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

Requirements

Python >= 3.6

Project structure

├── 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.
├── BlockchainDataBase
│   ├── Data
│   │   ├── 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()

Metadata

Release files for BlockchainDataBase 1.1.4

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for BlockchainDataBase 1.1.4
File Size Uploaded
BlockchainDataBase-1.1.4.tar.gz 4.3 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for BlockchainDataBase 1.1.4
File Interpreter ABI Platform
BlockchainDataBase-1.1.4-py3-none-any.whl Python 3 none any Details

Total release size: 9.5 kB

Release files / BlockchainDataBase-1.1.4.tar.gz

Download URL BlockchainDataBase-1.1.4.tar.gz
Size 4.3 kB
Tags Source
SHA-256 checksum
How to use checksums
24b6a1d8c486b23c8b52d3cdc59b4b20c377d8ffdef6a41878ba5e8a4cec1130
BLAKE2b-256 checksum
How to use checksums
df1b9f72d7802d1995901147436882960ad9b74d4b6425b6177c40da7d24ef26
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/1.12.1 pkginfo/1.4.2 requests/2.19.1 setuptools/40.4.3 requests-toolbelt/0.8.0 tqdm/4.26.0 CPython/3.6.6

Release files / BlockchainDataBase-1.1.4-py3-none-any.whl

Download URL BlockchainDataBase-1.1.4-py3-none-any.whl
Size 5.2 kB
Tags Python 3
SHA-256 checksum
How to use checksums
8cc1d75b2a0f9b9748edfd1e8e0b7337207f833bc29b144768fe7a2c237b7d8b
BLAKE2b-256 checksum
How to use checksums
ad3769430b3dc91a8b37273dac955c0d15f96546c71b18872bf39416c4b3c145
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/1.12.1 pkginfo/1.4.2 requests/2.19.1 setuptools/40.4.3 requests-toolbelt/0.8.0 tqdm/4.26.0 CPython/3.6.6

Release history Release notifications | RSS feed

This release

1.1.4 This release

2 release files

1.1.3

2 release files

1.1.2

2 release files

1.1.1

2 release files

1.0.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page