A Blockchain of Accountability, Support, and Forgiveness
Project description
CancelChain is an open-source python project that implements a custom blockchain ledger. The ledger protocol allows for the assigning of tokens to subjects (utf-8 strings of less than 80 characters) as indications of either opposition or support. Opposition entries are allowed to be rescinded later. Support is forever.
Quick Start
Requirements
Python >= 3.9
Installation
Install CancelChain using pip:
$ pip install cancelchain
It is recommended that a python virtual environment is used for all the usual reasons.
Configuration
Create a python-dotenv .env file. Here is an example minimal configuration:
# Flask Settings
FLASK_APP=cancelchain
FLASK_RUN_HOST=0.0.0.0
# CancelChain Settings
CC_SECRET_KEY=0b6ceaa3b10d3e7a5dc53194
CC_SQLALCHEMY_DATABASE_URI=sqlite:///cc.sqlite
The CC_SECRET_KEY value should be a unique random string.
See the Configuration Documentation for more configuration settings.
The cancelchain command loads a .env file by default if it is located either in the current working directory or in the cancelchain instance folder. Use the --env-file parameter to specify an alternate file path.
You can find the location of the instance folder by running the cancelchain shell command:
$ cancelchain --env-file path/to/.env shell
Python 3.10.11 (main, Apr 8 2023, 14:38:50) [GCC 11.3.0] on linux
App: cancelchain
Instance: /home/arlo/.pyenv/versions/3.10.11/envs/my-cancelchain/var/cancelchain-instance
By default, it is the directory $PREFIX/var/cancelchain-instance where $PREFIX is the prefix of the Python installation.
The following cancelchain command examples assume that the .env file is loaded by default.
Initialize
Create a local database by running the init command:
$ cancelchain init
Initialized the database.
The CC_SQLALCHEMY_DATABASE_URI value in the example configuration above specifies a SQLite database called cc.sqlite with a file path relative to the cancelchain instance folder.
Import
Download the most recent export of CancelChain data. This JSON Lines file is updated at every blockchain epoch (2016 blocks or approximately every two weeks).
Next, run the import command, passing it the location of the downloaded file:
$ cancelchain import path/to/cancelchain.jsonl
This command could take a while to run depending on your computer and the number of blocks imported. A progress bar will display with estimated time remaining. You can run the import command multiple times and it will only import new blocks that are not yet in the database.
Run
You run the cancelchain application by issuing the cancelchain run command:
$ cancelchain run
* Serving Flask app 'cancelchain'
* Debug mode: off
WARNING: This is a development server. Do not use it in a production deployment. Use a production WSGI server instead.
* Running on all addresses (0.0.0.0)
* Running on http://127.0.0.1:5000
Press CTRL+C to quit
Open http://localhost:5000 in a browser to explore the local copy of the blockchain.
Home (Current Chain)
Block
Transaction
Running the cancelchain application also exposes a number of web service endpoints that comprise the communications layer of the blockchain. See the API Documentation for much more information.
There are also many other cancelchain commands for interacting with the blockchain. See the Command Line Interface Documentation or run cancelchain --help.
Joining The CancelChain Network
The CancelChain is run by a permissioned network of nodes. A CancelChain instance requires API access to a node in the network in order to have locally milled blocks or submitted transactions propagate to the official CancelChain.
If you would like to be granted API access to a node in the CancelChain network, send an email to contact@cancelchain.org including what kind of access you’d like (e.g. reader, transactor, or miller) and how you intend to use it (e.g. research, business, non-profit, hobby).
See the documentation for some potential development ideas.
Project details
Release history Release notifications | RSS feed
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
File details
Details for the file cancelchain-1.3.1.tar.gz
.
File metadata
- Download URL: cancelchain-1.3.1.tar.gz
- Upload date:
- Size: 37.9 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: python-httpx/0.23.3
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | e0e11fd986ea268dba8bb2dbeb6e90264c07384640cf9470090f2d8b43115ab1 |
|
MD5 | 9e2d14725cf74f323b4e58bc405b3a44 |
|
BLAKE2b-256 | c96b3039da0af5b8edf4c3b980e93b5724b8f504f5106ebc23a23d0fc96d7751 |
File details
Details for the file cancelchain-1.3.1-py3-none-any.whl
.
File metadata
- Download URL: cancelchain-1.3.1-py3-none-any.whl
- Upload date:
- Size: 46.8 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: python-httpx/0.23.3
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 0db147bbd483f1772e85e2ff2e789e679e7ad40dba2227432d9d56034bed6320 |
|
MD5 | 0fbb47a6631cd9063294ab48dcc125d0 |
|
BLAKE2b-256 | 32bf30941330f2ff00dbe7fd2ecc64831a36e65718d53befd58e7c6e8046bcbd |