cancelchain


Namecancelchain JSON
Version 1.4.1 PyPI version JSON
download
home_pageNone
SummaryA Blockchain of Accountability, Forgiveness, and Support
upload_time2023-06-26 18:58:06
maintainerNone
docs_urlNone
authorNone
requires_python>=3.9
licenseNone
keywords blockchain flask
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            CancelChain
###########

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.

* `Project Home Page`_
* `Documentation`_
* `Blog`_


Quick Start
===========

Requirements
------------

Python >= 3.9

Install
-------

Install CancelChain using pip:

.. code-block:: console

  $ pip install cancelchain

It is recommended that a `python virtual environment`_ is used for `all <https://realpython.com/python-virtual-environments-a-primer/#avoid-system-pollution>`__ `the <https://realpython.com/python-virtual-environments-a-primer/#sidestep-dependency-conflicts>`__ `usual <https://realpython.com/python-virtual-environments-a-primer/#minimize-reproducibility-issues>`__ `reasons <https://realpython.com/python-virtual-environments-a-primer/#dodge-installation-privilege-lockouts>`_.


Configure
---------

Create a `python-dotenv`_ ``.env`` file. The ``cancelchain`` command loads a ``.env`` file in the current working directory by default.  See `dotenv documentation`_ to locate the file elsewhere. The following ``cancelchain`` command examples assume that the ``.env`` file is loaded by default.

A minimal ``.env`` configuration file:

.. code-block:: console

  # Flask Settings
  FLASK_APP=cancelchain
  FLASK_SECRET_KEY=0b6ceaa3b10d3e7a5dc53194

  # Flask-SQLAlchemy Settings
  FLASK_SQLALCHEMY_DATABASE_URI=sqlite:///cc.sqlite

The `FLASK_SECRET_KEY`_ value should be a unique random string.

See the `Configuration Documentation`_ for more configuration settings.


Initialize
----------

Create a local database by running the `init command`_:

.. code-block:: console

  $ cancelchain init

The `FLASK_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).

Run the `import command`_, passing it the location of the downloaded file:

.. code-block:: console

  $ 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
---

Run the ``cancelchain`` application by issuing the ``run`` command:

.. code-block:: console

  $ cancelchain run

Open `http://localhost:5000 <http://localhost:5000>`_ in a browser to explore the local copy of the blockchain.

Home Page (Current Chain)
^^^^^^^^^^^^^^^^^^^^^^^^^

.. image:: https://github.com/cancelchain/cancelchain/blob/7a4fab66dfe6026e56c79df3e147b1ecbdbb6158/readme-assets/browser-chain.png?raw=true
   :width: 500pt

Block Page
^^^^^^^^^^

.. image:: https://github.com/cancelchain/cancelchain/blob/7a4fab66dfe6026e56c79df3e147b1ecbdbb6158/readme-assets/browser-block.png?raw=true
   :width: 500pt

Transaction Page
^^^^^^^^^^^^^^^^

.. image:: https://github.com/cancelchain/cancelchain/blob/7a4fab66dfe6026e56c79df3e147b1ecbdbb6158/readme-assets/browser-txn.png?raw=true
   :width: 500pt

Running the ``cancelchain`` application also exposes a set of web service endpoints that comprise the communications layer of the blockchain. See the  `API Documentation`_ for more information.

There are other ``cancelchain`` commands for interacting with the blockchain. See the `Command Line Interface Documentation`_ for more information or run ``cancelchain --help``.


Joining The CancelChain Network
===============================

The CancelChain is run by a permissioned network of nodes. A CancelChain instance requires `miller`_ or `transactor`_ role `API access`_ to a node in the network in order to have locally milled blocks or submitted transactions propagate to the official CancelChain.

`The Cancel Button`_ allows `reader`_ role `API access`_ to any account that completes at least one transaction on the blockchain:

1) `Register for an account`_.
2) Submit a successful transaction for any subject. Access won't be granted until the sentiment transaction successfully completes.
3) Click `Download Account Key`_ on the `account page`_ to download the account's key (`PEM`_) file.
4) Create a directory called ``wallets`` and copy the downloaded key file into it.
5) Add the following settings to the ``.env`` configuration file. Replace ``CCTheCancelButtonAddressCC`` with the address on the `account page`_ and ``/path/to/wallet`` with the path to the ``wallets`` directory created above:

  .. code-block:: console

    # CancelChain Settings
    CC_NODE_HOST=http://CCTheCancelButtonAddressCC@localhost:5000
    CC_PEERS=["https://CCTheCancelButtonAddressCC@thecancelbutton.com"]
    CC_DEFAULT_COMMAND_HOST=https://CCTheCancelButtonAddressCC@thecancelbutton.com
    CC_WALLET_DIR=/path/to/wallets

6) Restart to load the new configuration.

See `Configuration Documentation`_ for more detailed information about these settings.

The `reader`_ role `API access`_ allows the `sync command`_ to update to the most recent peer block data:

.. code-block:: console

  $ cancelchain sync

This command could take a while to run depending on your computer, internet access, and the number of blocks synchronized. A progress bar will display with estimated time remaining. You can run the `sync command`_ multiple times and it will only synchronize new blocks that are not yet in the database.

Reader access also allows querying data (i.e. subject counts and balances) using the CLI. See `Command Line Interface Documentation`_ for more information.

If you would like to be granted other `API access`_ to a node in the CancelChain network, send an email to contact@cancelchain.org including what kind of role 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.


.. _account page: https://thecancelbutton.com/account
.. _API access: https://docs.cancelchain.org/en/latest/api.html#api-roles
.. _API Documentation: https://docs.cancelchain.org/en/latest/api.html
.. _Blog: https://blog.cancelchain.org
.. _CancelChain data: https://storage.googleapis.com/blocks.cancelchain.org/cancelchain.jsonl
.. _FLASK_SECRET_KEY: https://docs.cancelchain.org/en/latest/usage.html#SECRET_KEY
.. _FLASK_SQLALCHEMY_DATABASE_URI: https://docs.cancelchain.org/en/latest/usage.html#SQLALCHEMY_DATABASE_URI
.. _Command Line Interface Documentation: https://docs.cancelchain.org/en/latest/usage.html#command-line-interface
.. _Configuration Documentation: https://docs.cancelchain.org/en/latest/usage.html#configuration
.. _documentation: https://docs.cancelchain.org
.. _Documentation: https://docs.cancelchain.org
.. _dotenv documentation: https://docs.cancelchain.org/en/latest/usage.html#dotenv
.. _Download Account Key: https://thecancelbutton.com/pem
.. _import command: https://docs.cancelchain.org/en/latest/usage.html#import
.. _init command: https://docs.cancelchain.org/en/latest/usage.html#init
.. _instance folder: https://flask.palletsprojects.com/en/2.2.x/config/#instance-folders
.. _JSON Lines: https://jsonlines.org/
.. _miller: https://docs.cancelchain.org/en/latest/api.html#miller
.. _PEM: https://en.wikipedia.org/wiki/Privacy-Enhanced_Mail
.. _Project Home Page: https://cancelchain.org
.. _python virtual environment: https://docs.python.org/3/library/venv.html
.. _python-dotenv: https://pypi.org/project/python-dotenv/
.. _reader: https://docs.cancelchain.org/en/latest/api.html#reader
.. _Register for an account: https://thecancelbutton.com/register
.. _SQLite: https://sqlite.org/index.html
.. _sync command: https://docs.cancelchain.org/en/latest/usage.html#sync
.. _The Cancel Button: https://thecancelbutton.com
.. _transactor: https://docs.cancelchain.org/en/latest/api.html#transactor

            

Raw data

            {
    "_id": null,
    "home_page": null,
    "name": "cancelchain",
    "maintainer": null,
    "docs_url": null,
    "requires_python": ">=3.9",
    "maintainer_email": null,
    "keywords": "blockchain,flask",
    "author": null,
    "author_email": "Thomas Bohmbach Jr <tom@cancelchain.org>",
    "download_url": "https://files.pythonhosted.org/packages/5e/fc/8962d0e72670e9ef2634ed734df70dd655a524bf6c4b8cd36c46df0d0e98/cancelchain-1.4.1.tar.gz",
    "platform": null,
    "description": "CancelChain\n###########\n\nCancelChain 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.\n\n* `Project Home Page`_\n* `Documentation`_\n* `Blog`_\n\n\nQuick Start\n===========\n\nRequirements\n------------\n\nPython >= 3.9\n\nInstall\n-------\n\nInstall CancelChain using pip:\n\n.. code-block:: console\n\n  $ pip install cancelchain\n\nIt is recommended that a `python virtual environment`_ is used for `all <https://realpython.com/python-virtual-environments-a-primer/#avoid-system-pollution>`__ `the <https://realpython.com/python-virtual-environments-a-primer/#sidestep-dependency-conflicts>`__ `usual <https://realpython.com/python-virtual-environments-a-primer/#minimize-reproducibility-issues>`__ `reasons <https://realpython.com/python-virtual-environments-a-primer/#dodge-installation-privilege-lockouts>`_.\n\n\nConfigure\n---------\n\nCreate a `python-dotenv`_ ``.env`` file. The ``cancelchain`` command loads a ``.env`` file in the current working directory by default.  See `dotenv documentation`_ to locate the file elsewhere. The following ``cancelchain`` command examples assume that the ``.env`` file is loaded by default.\n\nA minimal ``.env`` configuration file:\n\n.. code-block:: console\n\n  # Flask Settings\n  FLASK_APP=cancelchain\n  FLASK_SECRET_KEY=0b6ceaa3b10d3e7a5dc53194\n\n  # Flask-SQLAlchemy Settings\n  FLASK_SQLALCHEMY_DATABASE_URI=sqlite:///cc.sqlite\n\nThe `FLASK_SECRET_KEY`_ value should be a unique random string.\n\nSee the `Configuration Documentation`_ for more configuration settings.\n\n\nInitialize\n----------\n\nCreate a local database by running the `init command`_:\n\n.. code-block:: console\n\n  $ cancelchain init\n\nThe `FLASK_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`_.\n\n\nImport\n------\n\nDownload the most recent export of `CancelChain data`_. This `JSON Lines`_ file is updated at every blockchain epoch (2016 blocks or approximately every two weeks).\n\nRun the `import command`_, passing it the location of the downloaded file:\n\n.. code-block:: console\n\n  $ cancelchain import path/to/cancelchain.jsonl\n\nThis 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.\n\n\nRun\n---\n\nRun the ``cancelchain`` application by issuing the ``run`` command:\n\n.. code-block:: console\n\n  $ cancelchain run\n\nOpen `http://localhost:5000 <http://localhost:5000>`_ in a browser to explore the local copy of the blockchain.\n\nHome Page (Current Chain)\n^^^^^^^^^^^^^^^^^^^^^^^^^\n\n.. image:: https://github.com/cancelchain/cancelchain/blob/7a4fab66dfe6026e56c79df3e147b1ecbdbb6158/readme-assets/browser-chain.png?raw=true\n   :width: 500pt\n\nBlock Page\n^^^^^^^^^^\n\n.. image:: https://github.com/cancelchain/cancelchain/blob/7a4fab66dfe6026e56c79df3e147b1ecbdbb6158/readme-assets/browser-block.png?raw=true\n   :width: 500pt\n\nTransaction Page\n^^^^^^^^^^^^^^^^\n\n.. image:: https://github.com/cancelchain/cancelchain/blob/7a4fab66dfe6026e56c79df3e147b1ecbdbb6158/readme-assets/browser-txn.png?raw=true\n   :width: 500pt\n\nRunning the ``cancelchain`` application also exposes a set of web service endpoints that comprise the communications layer of the blockchain. See the  `API Documentation`_ for more information.\n\nThere are other ``cancelchain`` commands for interacting with the blockchain. See the `Command Line Interface Documentation`_ for more information or run ``cancelchain --help``.\n\n\nJoining The CancelChain Network\n===============================\n\nThe CancelChain is run by a permissioned network of nodes. A CancelChain instance requires `miller`_ or `transactor`_ role `API access`_ to a node in the network in order to have locally milled blocks or submitted transactions propagate to the official CancelChain.\n\n`The Cancel Button`_ allows `reader`_ role `API access`_ to any account that completes at least one transaction on the blockchain:\n\n1) `Register for an account`_.\n2) Submit a successful transaction for any subject. Access won't be granted until the sentiment transaction successfully completes.\n3) Click `Download Account Key`_ on the `account page`_ to download the account's key (`PEM`_) file.\n4) Create a directory called ``wallets`` and copy the downloaded key file into it.\n5) Add the following settings to the ``.env`` configuration file. Replace ``CCTheCancelButtonAddressCC`` with the address on the `account page`_ and ``/path/to/wallet`` with the path to the ``wallets`` directory created above:\n\n  .. code-block:: console\n\n    # CancelChain Settings\n    CC_NODE_HOST=http://CCTheCancelButtonAddressCC@localhost:5000\n    CC_PEERS=[\"https://CCTheCancelButtonAddressCC@thecancelbutton.com\"]\n    CC_DEFAULT_COMMAND_HOST=https://CCTheCancelButtonAddressCC@thecancelbutton.com\n    CC_WALLET_DIR=/path/to/wallets\n\n6) Restart to load the new configuration.\n\nSee `Configuration Documentation`_ for more detailed information about these settings.\n\nThe `reader`_ role `API access`_ allows the `sync command`_ to update to the most recent peer block data:\n\n.. code-block:: console\n\n  $ cancelchain sync\n\nThis command could take a while to run depending on your computer, internet access, and the number of blocks synchronized. A progress bar will display with estimated time remaining. You can run the `sync command`_ multiple times and it will only synchronize new blocks that are not yet in the database.\n\nReader access also allows querying data (i.e. subject counts and balances) using the CLI. See `Command Line Interface Documentation`_ for more information.\n\nIf you would like to be granted other `API access`_ to a node in the CancelChain network, send an email to contact@cancelchain.org including what kind of role you'd like (e.g. `reader`_, `transactor`_, or `miller`_) and how you intend to use it (e.g. research, business, non-profit, hobby).\n\nSee the `documentation`_ for some potential development ideas.\n\n\n.. _account page: https://thecancelbutton.com/account\n.. _API access: https://docs.cancelchain.org/en/latest/api.html#api-roles\n.. _API Documentation: https://docs.cancelchain.org/en/latest/api.html\n.. _Blog: https://blog.cancelchain.org\n.. _CancelChain data: https://storage.googleapis.com/blocks.cancelchain.org/cancelchain.jsonl\n.. _FLASK_SECRET_KEY: https://docs.cancelchain.org/en/latest/usage.html#SECRET_KEY\n.. _FLASK_SQLALCHEMY_DATABASE_URI: https://docs.cancelchain.org/en/latest/usage.html#SQLALCHEMY_DATABASE_URI\n.. _Command Line Interface Documentation: https://docs.cancelchain.org/en/latest/usage.html#command-line-interface\n.. _Configuration Documentation: https://docs.cancelchain.org/en/latest/usage.html#configuration\n.. _documentation: https://docs.cancelchain.org\n.. _Documentation: https://docs.cancelchain.org\n.. _dotenv documentation: https://docs.cancelchain.org/en/latest/usage.html#dotenv\n.. _Download Account Key: https://thecancelbutton.com/pem\n.. _import command: https://docs.cancelchain.org/en/latest/usage.html#import\n.. _init command: https://docs.cancelchain.org/en/latest/usage.html#init\n.. _instance folder: https://flask.palletsprojects.com/en/2.2.x/config/#instance-folders\n.. _JSON Lines: https://jsonlines.org/\n.. _miller: https://docs.cancelchain.org/en/latest/api.html#miller\n.. _PEM: https://en.wikipedia.org/wiki/Privacy-Enhanced_Mail\n.. _Project Home Page: https://cancelchain.org\n.. _python virtual environment: https://docs.python.org/3/library/venv.html\n.. _python-dotenv: https://pypi.org/project/python-dotenv/\n.. _reader: https://docs.cancelchain.org/en/latest/api.html#reader\n.. _Register for an account: https://thecancelbutton.com/register\n.. _SQLite: https://sqlite.org/index.html\n.. _sync command: https://docs.cancelchain.org/en/latest/usage.html#sync\n.. _The Cancel Button: https://thecancelbutton.com\n.. _transactor: https://docs.cancelchain.org/en/latest/api.html#transactor\n",
    "bugtrack_url": null,
    "license": null,
    "summary": "A Blockchain of Accountability, Forgiveness, and Support",
    "version": "1.4.1",
    "project_urls": {
        "Documentation": "https://docs.cancelchain.org",
        "Homepage": "https://cancelchain.org",
        "Source": "https://github.com/cancelchain/cancelchain",
        "Tracker": "https://github.com/cancelchain/cancelchain/issues"
    },
    "split_keywords": [
        "blockchain",
        "flask"
    ],
    "urls": [
        {
            "comment_text": null,
            "digests": {
                "blake2b_256": "357a65868962f61a2a22977880a4eedd35242926612d36a398080cd126e08ab3",
                "md5": "8e76d095bfc09c7cd9c047efc3f55086",
                "sha256": "c2a1ab85b2ea6074bc3c1c2c1900542527667cfb3aa872653dcf04d741031597"
            },
            "downloads": -1,
            "filename": "cancelchain-1.4.1-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "8e76d095bfc09c7cd9c047efc3f55086",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.9",
            "size": 47042,
            "upload_time": "2023-06-26T18:58:08",
            "upload_time_iso_8601": "2023-06-26T18:58:08.371482Z",
            "url": "https://files.pythonhosted.org/packages/35/7a/65868962f61a2a22977880a4eedd35242926612d36a398080cd126e08ab3/cancelchain-1.4.1-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": null,
            "digests": {
                "blake2b_256": "5efc8962d0e72670e9ef2634ed734df70dd655a524bf6c4b8cd36c46df0d0e98",
                "md5": "2b728e111c3bb4bec1c0749a49093111",
                "sha256": "ff998245a250a60a42822fb012113725269ce59724151bc49b4927cac648b2c7"
            },
            "downloads": -1,
            "filename": "cancelchain-1.4.1.tar.gz",
            "has_sig": false,
            "md5_digest": "2b728e111c3bb4bec1c0749a49093111",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.9",
            "size": 38057,
            "upload_time": "2023-06-26T18:58:06",
            "upload_time_iso_8601": "2023-06-26T18:58:06.775001Z",
            "url": "https://files.pythonhosted.org/packages/5e/fc/8962d0e72670e9ef2634ed734df70dd655a524bf6c4b8cd36c46df0d0e98/cancelchain-1.4.1.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2023-06-26 18:58:06",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "cancelchain",
    "github_project": "cancelchain",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": true,
    "requirements": [],
    "lcname": "cancelchain"
}
        
Elapsed time: 0.09877s