Substrate Node for Anmol Network

Related tags

anmol-node
Overview

Anmol Substrate Node 🖼 🛠️ 👷

Anmol is the First Cross-Chain NFT Toolkit, on Polkadot. Introducing:

  • Moulds
  • NFT Breeding
  • Multi-Chain NFT Migration
  • ink! for Moulds
  • DAO-based Communities
  • Fractional NFT ownership
  • Marketplace.

Engage with Anmol

Getting Started

Follow the steps below to get started with the Anmol Node. 🛠️

Rust Setup

First, complete the basic Rust setup instructions.

Run

Use Rust's native cargo command to build and launch the node:

cargo run --release -- --dev --tmp

Build

The cargo run command will perform an initial build. Use the following command to build the node without launching it:

cargo build --release

Embedded Docs

Once the project has been built, the following command can be used to explore all parameters and subcommands:

./target/release/anmol -h

Run

The provided cargo run command will launch a temporary node and its state will be discarded after you terminate the process. After the project has been built, there are other ways to launch the node.

Single-Node Development Chain

This command will start the single-node development chain with persistent state:

./target/release/anmol --dev

Purge the development chain's state:

./target/release/anmol purge-chain --dev

Start the development chain with detailed logging:

RUST_LOG=debug RUST_BACKTRACE=1 ./target/release/anmol -lruntime=debug --dev

Multi-Node Local Testnet

If you want to see the multi-node consensus algorithm in action, refer to our Start a Private Network tutorial.

Project Structure

A Substrate project such as this consists of a number of components that are spread across a few directories.

Node

A blockchain node is an application that allows users to participate in a blockchain network. Substrate-based blockchain nodes expose a number of capabilities:

  • Networking: Substrate nodes use the libp2p networking stack to allow the nodes in the network to communicate with one another.
  • Consensus: Blockchains must have a way to come to consensus on the state of the network. Substrate makes it possible to supply custom consensus engines and also ships with several consensus mechanisms that have been built on top of Web3 Foundation research.
  • RPC Server: A remote procedure call (RPC) server is used to interact with Substrate nodes.

There are several files in the node directory - take special note of the following:

  • chain_spec.rs: A chain specification is a source code file that defines a Substrate chain's initial (genesis) state. Chain specifications are useful for development and testing, and critical when architecting the launch of a production chain. Take note of the development_config and testnet_genesis functions, which are used to define the genesis state for the local development chain configuration. These functions identify some well-known accounts and use them to configure the blockchain's initial state.
  • service.rs: This file defines the node implementation. Take note of the libraries that this file imports and the names of the functions it invokes. In particular, there are references to consensus-related topics, such as the longest chain rule, the Aura block authoring mechanism and the GRANDPA finality gadget.

After the node has been built, refer to the embedded documentation to learn more about the capabilities and configuration parameters that it exposes:

./target/release/anmol --help

Runtime

In Substrate, the terms "runtime" and "state transition function" are analogous - they refer to the core logic of the blockchain that is responsible for validating blocks and executing the state changes they define. The Substrate project in this repository uses the FRAME framework to construct a blockchain runtime. FRAME allows runtime developers to declare domain-specific logic in modules called "pallets". At the heart of FRAME is a helpful macro language that makes it easy to create pallets and flexibly compose them to create blockchains that can address a variety of needs.

Review the FRAME runtime implementation included in this project and note the following:

  • This file configures several pallets to include in the runtime. Each pallet configuration is defined by a code block that begins with impl $PALLET_NAME::Config for Runtime.
  • The pallets are composed into a single runtime by way of the construct_runtime! macro, which is part of the core FRAME Support library.

Pallets

The runtime in this project is constructed using many FRAME pallets that ship with the core Substrate repository and a pallet that is defined in the pallets directory.

A FRAME pallet is compromised of a number of blockchain primitives:

  • Storage: FRAME defines a rich set of powerful storage abstractions that makes it easy to use Substrate's efficient key-value database to manage the evolving state of a blockchain.
  • Dispatchables: FRAME pallets define special types of functions that can be invoked (dispatched) from outside of the runtime in order to update its state.
  • Events: Substrate uses events to notify users of important changes in the runtime.
  • Errors: When a dispatchable fails, it returns an error.
  • Config: The Config configuration interface is used to define the types and parameters upon which a FRAME pallet depends.

Run in Docker

First, install Docker and Docker Compose.

Then run the following command to start a single node development chain.

./scripts/docker_run.sh

This command will firstly compile your code, and then start a local development network. You can also replace the default command (cargo build --release && ./target/release/anmol --dev --ws-external) by appending your own. A few useful ones are as follow.

# Run Substrate node without re-compiling
./scripts/docker_run.sh ./target/release/anmol --dev --ws-external

# Purge the local dev chain
./scripts/docker_run.sh ./target/release/anmol purge-chain --dev

# Check whether the code is compilable
./scripts/docker_run.sh cargo check
Issues
  • NFT pending queue

    NFT pending queue

    Off-chain workers initialisation

    1. New NFT would be added to pending queue
    2. Off-chain worker checks pending queue and if any then starts a worker (simple console log)
    off-chain substrate 
    opened by korzewski 2
  • Mould breeding concept

    Mould breeding concept

    We need to figure out a mould breeding concept.

    Here is a crypto kitties genome mapping - https://medium.com/newtown-partners/cryptokitties-genome-mapping-6412136c0ae4

    Basic thoughts to discuss:

    • Mould as svg shape + colours
    • Breeding / mixing svg shapes
    • Generic mixable proporties (on-chain storage)
    enhancement research 
    opened by korzewski 1
  • Change unit to ANMO

    Change unit to ANMO

    Closes #2

    opened by aelesbao 1
  • Frontend <-> Substrate communication

    Frontend <-> Substrate communication

    We need to integrate frontend <-> substrate communication.

    Simplest way to build a POC is to use Substrate front end template https://github.com/substrate-developer-hub/substrate-front-end-template

    As a user I want to:

    • Have a blockchain data access
    opened by korzewski 1
  • Initial nft pallet

    Initial nft pallet

    Closes #6

    opened by korzewski 1
  • Add tests for GitHub actions

    Add tests for GitHub actions

    opened by korzewski 0
  • Create LICENSE GNU AGPLv3

    Create LICENSE GNU AGPLv3

    opened by nblogist 0
  • Delete LICENSE

    Delete LICENSE

    opened by nblogist 0
  • Save nft on-chain

    Save nft on-chain

    Closes #23

    opened by korzewski 0
  • Added NftPendingQueue and offchain worker trigger

    Added NftPendingQueue and offchain worker trigger

    Closes #22

    off-chain substrate 
    opened by korzewski 0
  • Use off-chain storage

    Use off-chain storage

    We can use off-chain indexing to save NFT's pending queue in off-chain storage

    1. Replace on-chain NftPendingQueue with off-chain storage
    2. Add mutex lock's to avoid duplicates
    off-chain substrate 
    opened by korzewski 0
  • Http request

    Http request

    Http request via off-chain worker

    1. Example http request (GET & POST)
    2. Handle success and error

    Simple overview: Utility method to simplify http communication fn make_request<T: MouldParam + NftParam etc>(type: Enum POST/GET, base_url: Vec<u8>, params: T)

    Useful links:

    • https://substrate.dev/recipes/off-chain-workers/http-json.html
    • https://github.com/atomiklabs/jackblock-node/blob/master/pallets/jackblock/src/lib.rs#L472
    off-chain substrate 
    opened by korzewski 0
  • User blockchain interactions with polkadot wallet

    User blockchain interactions with polkadot wallet

    User need a way to do some blockchain interactions via web browser

    As a user I want to:

    • Login with my polkadot wallet
    • Generate a new NFT
    • See all my available NFT's
    • Create a new mould
    front end 
    opened by korzewski 0
  • On-chain dna storage

    On-chain dna storage

    Once we finish this https://github.com/anmolnetwork/anmol-node/milestone/1

    We need to figure out how to store DNA:

    • It has to be a unique
    • Blending possible
    • Blending rule restrictions (if required by mould)
    • IPFS pin with off-chain worker?

    Crypto kitties genome mapping https://medium.com/newtown-partners/cryptokitties-genome-mapping-6412136c0ae4

    blocked substrate 
    opened by korzewski 0
  • Configure CI/CD

    Configure CI/CD

    Configure Github Actions to run tests and trigger Docker Hub to build and publish the node Docker image. The destination image name should be anmolnetwork/node.

    enhancement 
    opened by aelesbao 0
  • Edit Readme to reflect about Anmol

    Edit Readme to reflect about Anmol

    documentation 
    opened by nblogist 0
  • Add BABE pallet to the node template

    Add BABE pallet to the node template

    Add a BABE pallet on the substrate node

    enhancement substrate 
    opened by nblogist 0
Owner
Anmol Network
The First Cross-Chain NFT Toolkit
Anmol Network
Substrate: The platform for blockchain innovators

Substrate · Substrate is a next-generation framework for blockchain innovation ?? . Trying it out Simply go to substrate.dev and follow the installati

Parity Technologies 5k Jun 14, 2021
Joystream Monorepo

Joystream This is the main code repository for all Joystream software. In this mono-repo you will find all the software required to run a Joystream ne

Joystream 65 Jun 16, 2021
Polkadot Node Implementation

Polkadot Implementation of a https://polkadot.network node in Rust based on the Substrate framework. NOTE: In 2018, we split our implementation of "Po

Parity Technologies 3.6k Jun 16, 2021
A node and runtime configuration for polkadot node.

MANTA NODE This repo is a fresh FRAME-based Substrate node, forked from substrate-developer-hub/substrate-node-templte ?? It links to pallet-manta-dap

Manta Network 14 Apr 25, 2021
Basilisk node - cross-chain liquidity protocol built on Substrate

Basilisk node Local Development Follow these steps to prepare a local Substrate development environment ??️ Simple Setup Install all the required depe

Galactic Council 8 Jun 16, 2021
⋰·⋰ Feeless is a Nano cryptocurrency node, wallet, tools, and Rust crate.

⋰·⋰ Feeless What is Feeless? Feeless is a Nano cryptocurrency node, wallet, tools, and Rust crate. This is not the official project for Nano, only an

null 103 Jun 5, 2021
A Rust library for generating cryptocurrency wallets

Table of Contents 1. Overview 2. Build Guide 2.1 Install Rust 2.2a Build from Homebrew 2.2b Build from Crates.io 2.2c Build from Source Code 3. Usage

Aleo 374 Jun 14, 2021
The Phala Network Blockchain, pRuntime and the bridge.

Phala Blockchain Phala Network is a TEE-Blockchain hybrid architecture implementing Confidential Contract. This repo includes: node/: the main blockch

Phala Network 123 Jun 5, 2021
Source project for the Internet Computer software

The Internet Computer is the world’s first blockchain that runs at web speed and can increase its capacity without bound. Like the Internet (which is composed of many machines adhering to TCP/IP protocol) and blockchain protocols (such as Bitcoin and Ethereum).

DFINITY 642 Jun 15, 2021
Left Recursive PEG for rust

Left Recursive Parsing Expression Grammar (PEG) lrpeg allows left recursive rules, and uses ratpack parsing for speed. I wrote a blog post to introduc

Sean Young 42 Jun 14, 2021
A substrate pallet that enables Manta's decentialized anynonymous payment (DAP) protocol.

This is a pallet that enables decentialized anynonymous payment (DAP) protocol. The best way to use this repo is to invoke it with a manta-runtime, available from either manta-node or cumulus.

Manta Network 22 Jun 11, 2021
Byzantine-fault-tolerant time synchronization

Byztime Byztime is a Byzantine-fault-tolerant protocol for synchronizing time among a group of peers, without reliance on any external time authority.

Akamai Unofficial 30 May 23, 2021
EVM compatible chain with NPoS/PoC consensus

Reef Chain Reef chain is written in Rust. A basic familiarity with Rust tooling is required. To learn more about Reef chain, please refer to Documenta

Reef Finance 99 May 27, 2021
2021 春季黑客松

Demo Day 演示队伍注意事项 每一队伍演示时间为 6 分钟,然后会有 2 分钟评委们提问及点评。评委们根据以下维度打分: 产品完成度 技术难题 商业价值 创新性 用户体验 演示时讲个好故事,所以尽量演示: 项目源起,背后的市场应用,现在做到什么程度,未来半年到一年有什么发展计划。 在黑客松期间

null 18 Jun 3, 2021