An updated version of the Substrate TCR runtime sample is available at - https://github.com/substrate-developer-hub/tcr-substrate. In favor of that, this repository has been archived.
An implementation of (a subset of) Token Curated Registries (TCR) as a Parity Substrate runtime. Built using substrate-node-template codebase. The full tutorial for this sample can be found here.
The TCR runtime is implemented as a multi-module runtime with following two modules.
- tcr.rs - The main module with all curation and initialization functions. The module implements a simple-TCR as described and implemented here. The full TCR functionality in not implemented but only basic curation functions are.
- token.rs - Implementation of the modified ERC20 interface to serve as the native token for the TCR module. There are some additional functions implemented for locking and unlocking of tokens.
If you are new to Substrate, please go through the getting started tutorial first. It will give you a sense of how the code is structured in a substrate-node-template
and how to get it up and running.
This will also ensure that you have Rust and Substrate installed on your system.
Clone this repository. Inside the directory where you have cloned, run the following commands,
- To build the rust code and the node:
cargo build --release
- To start the node:
./target/release/substrate-tcr --dev
A local Substrate node with the TCR runtime should be up and running at localhost:9944
.
You can either use the Substrate-TCR-UI to connect with this runtime or you can try it out using the Polkadot Apps UI.
To try it with the Polkadot Apps UI, follow the following steps,
- Once the local node is running, open the following in your browser,
https://polkadot.js.org/apps/
- Go to the settings page and select
Local Node
in theremote node/endpoint to connect to
input. ClickSave & Reload
.
For further instructions on using the runtime with the Polkadot Apps UI, please see this wiki page in this repository.
This code is just a sample for learning purposes. It is not audited and reviewed for production use cases. You can expect bugs and security vulnerabilities. Do not use it in production or value bearing applications.