gautamdhameja / substrate-tcr

A Parity Substrate runtime implementation of a simple Token Curated Registry (TCR)

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Substrate - Token Curated Registries

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.

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

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.

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 in production or value bearing applications.

About

A Parity Substrate runtime implementation of a simple Token Curated Registry (TCR)

License:The Unlicense


Languages

Language:Rust 98.9%Language:Shell 1.1%