Package: 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 PageDocumentationBlogQuick StartRequirementsPython >= 3.9InstallInstall CancelChain using pip:$pipinstallcancelchainIt is recommended that apython virtual environmentis used foralltheusualreasons.ConfigureCreate apython-dotenv.envfile. Thecancelchaincommand loads a.envfile in the current working directory by default.  Seedotenv documentationto locate the file elsewhere. The followingcancelchaincommand examples assume that the.envfile is loaded by default.A minimal.envconfiguration file:#FlaskSettingsFLASK_APP=cancelchain
FLASK_SECRET_KEY=0b6ceaa3b10d3e7a5dc53194#Flask-SQLAlchemySettingsFLASK_SQLALCHEMY_DATABASE_URI=sqlite:///cc.sqliteTheFLASK_SECRET_KEYvalue should be a unique random string.See theConfiguration Documentationfor more configuration settings.InitializeCreate a local database by running theinit command:$cancelchaininitTheFLASK_SQLALCHEMY_DATABASE_URIvalue in the example configuration above specifies aSQLitedatabase calledcc.sqlitewith a file path relative to thecancelchaininstance folder.ImportDownload the most recent export ofCancelChain data. ThisJSON Linesfile is updated at every blockchain epoch (2016 blocks or approximately every two weeks).Run theimport command, passing it the location of the downloaded file:$cancelchainimportpath/to/cancelchain.jsonlThis 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 theimportcommand multiple times and it will only import new blocks that are not yet in the database.RunRun thecancelchainapplication by issuing theruncommand:$cancelchainrunOpenhttp://localhost:5000in a browser to explore the local copy of the blockchain.Home Page (Current Chain)Block PageTransaction PageRunning thecancelchainapplication also exposes a set of web service endpoints that comprise the communications layer of the blockchain. See theAPI Documentationfor more information.There are othercancelchaincommands for interacting with the blockchain. See theCommand Line Interface Documentationfor more information or runcancelchain--help.Joining The CancelChain NetworkThe CancelChain is run by a permissioned network of nodes. A CancelChain instance requiresmillerortransactorroleAPI accessto a node in the network in order to have locally milled blocks or submitted transactions propagate to the official CancelChain.The Cancel ButtonallowsreaderroleAPI accessto any account that completes at least one transaction on the blockchain:Register for an account.Submit a successful transaction for any subject. Access won’t be granted until the sentiment transaction successfully completes.ClickDownload Account Keyon theaccount pageto download the account’s key (PEM) file.Create a directory calledwalletsand copy the downloaded key file into it.Add the following settings to the.envconfiguration file. ReplaceCCTheCancelButtonAddressCCwith the address on theaccount pageand/path/to/walletwith the path to thewalletsdirectory created above:#CancelChainSettingsCC_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/walletsRestart to load the new configuration.SeeConfiguration Documentationfor more detailed information about these settings.ThereaderroleAPI accessallows thesync commandto update to the most recent peer block data:$cancelchainsyncThis 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 thesync commandmultiple 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. SeeCommand Line Interface Documentationfor more information.If you would like to be granted otherAPI accessto a node in the CancelChain network, send an email tocontact@cancelchain.orgincluding what kind of role you’d like (e.g.reader,transactor, ormiller) and how you intend to use it (e.g. research, business, non-profit, hobby).See thedocumentationfor some potential development ideas.