Skip to content
A Parity Substrate runtime implementation of a simple Token Curated Registry (TCR)
Branch: master
Clone or download
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
docs/img upgraded to latest node-template Jan 29, 2019
runtime upgraded to work with Substrate v1.0 branch Jun 14, 2019
scripts v1.0 base Jun 14, 2019
src upgraded to work with Substrate v1.0 branch Jun 14, 2019
.editorconfig upgraded to latest node-template Jan 29, 2019
.gitignore v1.0 base Jun 14, 2019
Cargo.lock v1.0 base Jun 14, 2019
Cargo.toml v1.0 base Jun 14, 2019
LICENSE v1.0 base Jun 14, 2019
README.md upgraded to work with Substrate v1.0 branch Jun 14, 2019
build.rs v1.0 base Jun 14, 2019

README.md

Substrate - Token Curated Registries

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.

  1. 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.
  2. 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.

Usage

Step 0

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.

Step 1

Clone this repository. Inside the directory where you have cloned, run the following commands,

  • To build the WASM runtime for the node (run this first),
./scripts/build.sh
  • To build the rust code and the node (run this after ./scripts/build.sh completes),
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.

Step 2 (UI)

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 the remote node/endpoint to connect to input. Click Save & Reload.

For further instructions on using the runtime with the Polkadot Apps UI, please see this wiki page in this repository.

Important Note

The Substrate framework, related libraries and APIs are rapidly evolving. In case this module does not work with the latest Substrate build, please submit an issue in this repo. You can also try porting the runtime module into a freshly cloned substrate-node-template codebase.

Disclaimer

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 as-is in real applications.

You can’t perform that action at this time.