Substrate Node for Anmol Network

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
Comments
  • Make local dependency version of orml_nft

    Make local dependency version of orml_nft

    This copies the orml_nft source code and brings it into a local pallet, anmol-nft. The goal of this is to bring the NFT logic to a place where we can modify it and add logic for e.g. fractionalization.

    All of the code in pallets/anmol-nft is unchanged from the 0.4.0 version of orml-nft

    I still had some questions on this, which I will put below, but I think that this PR at least fulfills what was discussed here. A direct follow-on task is to add the logic described here in 2.

    opened by justinFrevert 7
  • Nft upload cleanup

    Nft upload cleanup

    This PR resolves this ticket https://www.notion.so/dot-matrix/1b047c821544433d8703f352d347b207?v=7a4133f9bd00425d8f6f7292ad2fe3a3&p=ffed1ae3824c4544a4dafacc36a5f59f

    opened by korzewski 5
  • Ibtida testnet chain spec

    Ibtida testnet chain spec

    Changes:

    • Sets token decimals
    • Sets address prefix for Ibtida
    • Adds a JSON chain spec for the ibtida testnet

    The main goal of this is to get some code together to run two ibtida nodes. Some of this process will be manual, until we figure out some automation that makes sense for us. Given this, some pieces are intentionally omitted from this PR for containing secrets, etc.

    opened by justinFrevert 2
  • 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)
    substrate off-chain 
    opened by korzewski 2
  • Frevert/feature/fractionaliztion properties

    Frevert/feature/fractionaliztion properties

    This is meant to reach milestone 2 on this ticket: ~>- nft pallet: Expand TokenData struct to support new field eg. fraction_owned.~ ~>- orml_nft: Replace TokenInfo owner: AccountId field to owners: Vec~ ~>- orml_nft: Update transfer function to accept additional field fraction_amount(where 100% is equal to 100% of the original NFT).~ Changes made according to discussion on pr.

    opened by justinFrevert 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
  • 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
  • fix: update the chain spec to include correct keys

    fix: update the chain spec to include correct keys

    Updated the chain spec to generate the ibita raw spec we can run locally. We need to add more validators when we are ready to actually do a testnet deployment

    opened by vedhavyas 0
  • Node does not buil/run on mac M1/silicon

    Node does not buil/run on mac M1/silicon

    Description

    I tried to run the node locally but I not possible, already reported here but the fix is not included in this repo: https://github.com/substrate-developer-hub/substrate-node-template/issues/179

    Steps to Reproduce

    Pull this repo and execute: cargo check

    Expected vs. Actual Behavior

    What did you expect to happen after you followed the steps you described in the last section? What actually happened?

    Environment

    Describe the environment in which you encountered this bug. Use the list below as a starting point and add additional information if you think it's relevant.

    • Operating system: Mac OS, M1/silicon
    • Anmol Parachain version/tag:
    • Rust version (run rustup show):

    Logs, Errors or Screenshots Everything is included here: https://github.com/substrate-developer-hub/substrate-node-template/issues/179

    bug 
    opened by herou 0
  • Frevert/fix/tokens by owner

    Frevert/fix/tokens by owner

    This adds the token_id field to the TokensByOwnerData struct. This allows the frontend to query tokens by owner, and look up the received token_id(s) in the Tokens double storage map. The frontend needs to do this because the Tokens storage contains the IPFS metadata.

    opened by justinFrevert 0
  • feature: Added script to purge local chain DB

    feature: Added script to purge local chain DB

    When running chains locally, often time it is advised to remove the chain DB before running it again, this PR adds a script for that, and can be run using ./scripts/purge-chain.sh

    enhancement 
    opened by nblogist 0
  • build(deps): bump thread_local from 1.1.3 to 1.1.4

    build(deps): bump thread_local from 1.1.3 to 1.1.4

    Bumps thread_local from 1.1.3 to 1.1.4.

    Commits

    Dependabot compatibility score

    Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting @dependabot rebase.


    Dependabot commands and options

    You can trigger Dependabot actions by commenting on this PR:

    • @dependabot rebase will rebase this PR
    • @dependabot recreate will recreate this PR, overwriting any edits that have been made to it
    • @dependabot merge will merge this PR after your CI passes on it
    • @dependabot squash and merge will squash and merge this PR after your CI passes on it
    • @dependabot cancel merge will cancel a previously requested merge and block automerging
    • @dependabot reopen will reopen this PR if it is closed
    • @dependabot close will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually
    • @dependabot ignore this major version will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself)
    • @dependabot ignore this minor version will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself)
    • @dependabot ignore this dependency will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)
    • @dependabot use these labels will set the current labels as the default for future PRs for this repo and language
    • @dependabot use these reviewers will set the current reviewers as the default for future PRs for this repo and language
    • @dependabot use these assignees will set the current assignees as the default for future PRs for this repo and language
    • @dependabot use this milestone will set the current milestone as the default for future PRs for this repo and language

    You can disable automated security fix PRs for this repo from the Security Alerts page.

    dependencies 
    opened by dependabot[bot] 0
  • build(deps): bump zeroize_derive from 1.0.1 to 1.3.2

    build(deps): bump zeroize_derive from 1.0.1 to 1.3.2

    Bumps zeroize_derive from 1.0.1 to 1.3.2.

    Changelog

    Sourced from zeroize_derive's changelog.

    Changelog

    All notable changes to this project will be documented in this file.

    The format is based on Keep a Changelog, and this project adheres to Semantic Versioning.

    1.5.5 (2022-04-30)

    Added

    • Impl Zeroize for std::ffi::CString (#759)
    • AsRef<T> and AsMut<T> impls for Zeroizing (#761)

    #759: RustCrypto/utils#759 #761: RustCrypto/utils#761

    1.5.4 (2022-03-16)

    Added

    • Nightly-only upport for zeroizing ARM64 SIMD registers (#749)

    #749: RustCrypto/utils#749

    1.5.3 (2022-02-25)

    Fixed

    • Deriving ZeroizeOnDrop on DerefMut (#739)

    #739: RustCrypto/utils#739

    1.5.2 (2022-01-31) [YANKED]

    Fixed

    • Ambiguous method for AssertZeroizeOnDrop (#725)

    #725: RustCrypto/utils#725

    1.5.1 (2022-01-27) [YANKED]

    Fixed

    • Double mut on AssertZeroizeOnDrop (#719)

    #719: RustCrypto/utils#719

    1.5.0 (2022-01-14) [YANKED]

    Added

    • Zeroize impls for PhantomData, PhantomPinned, and tuples with 0-10 elements (#660)
    • #[zeroize(bound = "T: MyTrait")] (#663)
    • ZeroizeOnDrop trait and custom derive (#699, #700, #703)

    #660: RustCrypto/utils#660 #663: RustCrypto/utils#663 #699: RustCrypto/utils#699 #700: RustCrypto/utils#700 #703: RustCrypto/utils#703

    ... (truncated)

    Commits

    Dependabot compatibility score

    Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting @dependabot rebase.


    Dependabot commands and options

    You can trigger Dependabot actions by commenting on this PR:

    • @dependabot rebase will rebase this PR
    • @dependabot recreate will recreate this PR, overwriting any edits that have been made to it
    • @dependabot merge will merge this PR after your CI passes on it
    • @dependabot squash and merge will squash and merge this PR after your CI passes on it
    • @dependabot cancel merge will cancel a previously requested merge and block automerging
    • @dependabot reopen will reopen this PR if it is closed
    • @dependabot close will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually
    • @dependabot ignore this major version will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself)
    • @dependabot ignore this minor version will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself)
    • @dependabot ignore this dependency will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)
    • @dependabot use these labels will set the current labels as the default for future PRs for this repo and language
    • @dependabot use these reviewers will set the current reviewers as the default for future PRs for this repo and language
    • @dependabot use these assignees will set the current assignees as the default for future PRs for this repo and language
    • @dependabot use this milestone will set the current milestone as the default for future PRs for this repo and language

    You can disable automated security fix PRs for this repo from the Security Alerts page.

    dependencies 
    opened by dependabot[bot] 0
  • build(deps): bump crossbeam-deque from 0.7.3 to 0.7.4

    build(deps): bump crossbeam-deque from 0.7.3 to 0.7.4

    Bumps crossbeam-deque from 0.7.3 to 0.7.4.

    Changelog

    Sourced from crossbeam-deque's changelog.

    Version 0.8.1

    • Support targets that do not have atomic CAS on stable Rust (#698)

    Version 0.8.0

    • Bump the minimum supported Rust version to 1.36.
    • Bump crossbeam-channel to 0.5.
    • Bump crossbeam-deque to 0.8.
    • Bump crossbeam-epoch to 0.9.
    • Bump crossbeam-queue to 0.3.
    • Bump crossbeam-utils to 0.8.
    Commits

    Dependabot compatibility score

    Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting @dependabot rebase.


    Dependabot commands and options

    You can trigger Dependabot actions by commenting on this PR:

    • @dependabot rebase will rebase this PR
    • @dependabot recreate will recreate this PR, overwriting any edits that have been made to it
    • @dependabot merge will merge this PR after your CI passes on it
    • @dependabot squash and merge will squash and merge this PR after your CI passes on it
    • @dependabot cancel merge will cancel a previously requested merge and block automerging
    • @dependabot reopen will reopen this PR if it is closed
    • @dependabot close will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually
    • @dependabot ignore this major version will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself)
    • @dependabot ignore this minor version will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself)
    • @dependabot ignore this dependency will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)
    • @dependabot use these labels will set the current labels as the default for future PRs for this repo and language
    • @dependabot use these reviewers will set the current reviewers as the default for future PRs for this repo and language
    • @dependabot use these assignees will set the current assignees as the default for future PRs for this repo and language
    • @dependabot use this milestone will set the current milestone as the default for future PRs for this repo and language

    You can disable automated security fix PRs for this repo from the Security Alerts page.

    dependencies 
    opened by dependabot[bot] 0
  • About Nft percentage

    About Nft percentage

    Question Hello, I saw in your NFT pallet that you're using the type u8 for percentage. How would you deal with percentages of 12.3% for example? or another case: when the minter (owns 100%) wants to distribute the NFT's fractions to the buyers, based on their contributions (let's say 50.2% and 49.8%): How do you prevent the buyers to get the same percentage, while one contributed more than the other? shouldn't you use the type f32 instead? Sorry if my question is "dumb", but I'm a rust beginner. Thanks in advance for your answer.

    Kazu

    question 
    opened by ndkazu 1
  • 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
    substrate off-chain 
    opened by korzewski 0
Releases(v0.1.1)
  • v0.1.1(Oct 21, 2021)

    What's Changed

    • Correct the faucet address in chain spec

    Full Changelog: https://github.com/anmolnetwork/anmol-node/compare/v0.1.0...v0.1.1

    Source code(tar.gz)
    Source code(zip)
  • v0.1.0(Oct 15, 2021)

    What's Changed

    • Initial NFT pallet
    • NFT fractionalization
    • Configured Ibtida testnet chain spec
    • Added Docker image for running your own node

    New Contributors

    • @aelesbao made their first contribution in https://github.com/anmolnetwork/anmol-node/pull/4
    • @korzewski made their first contribution in https://github.com/anmolnetwork/anmol-node/pull/19
    • @nblogist made their first contribution in https://github.com/anmolnetwork/anmol-node/pull/27
    • @justinFrevert made their first contribution in https://github.com/anmolnetwork/anmol-node/pull/34

    Full Changelog: https://github.com/anmolnetwork/anmol-node/commits/v0.1.0

    Source code(tar.gz)
    Source code(zip)
Owner
Anmol Network
The First Cross-Chain NFT Toolkit
Anmol Network
ARYA Network is a polkadot/substrate based chain for Non-fungible Token platform on which we can own sell and buy the NFT's on polkadot network.

ARYA Network ARYA Network is a polkadot/substrate based chain for Non-fungible Token platform on which we can own sell and buy the NFT's on polkadot n

Pankaj Chaudhary 6 Dec 20, 2022
Substrate blockchain generated with Substrate Startkit

Substrate Node Template A new FRAME-based Substrate node, ready for hacking ?? Getting Started This project contains some configuration files to help

HoangDuong 1 Oct 19, 2021
Substrate blockchain generated with Substrate Startkit

Substrate Node Template A new FRAME-based Substrate node, ready for hacking ?? Getting Started This project contains some configuration files to help

HoangDuong 1 Oct 19, 2021
Substrate blockchain generated with Substrate Startkit

Substrate Node Template A new FRAME-based Substrate node, ready for hacking ?? Getting Started This project contains some configuration files to help

Liam Parry 0 Nov 6, 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 52 Dec 27, 2022
Minimal Substrate node configured for smart contracts via pallet-contracts.

substrate-contracts-node This repository contains Substrate's node-template configured to include Substrate's pallet-contracts ‒ a smart contract modu

Parity Technologies 73 Dec 30, 2022
Substrate Node Template Generator

Substrate Node Template Generator A tool to generate stand-alone node templates of a customized Substrate clients used in "Substrate Library Extension

Parity Technologies 2 Feb 11, 2022
Subsocial full node with Substrate/Polkadot pallets for decentralized communities: blogs, posts, comments, likes, reputation.

Subsocial Node by DappForce Subsocial is a set of Substrate pallets with web UI that allows anyone to launch their own decentralized censorship-resist

DappForce 74 Nov 24, 2022
Node implementation for aleph blockchain built with Substrate framework

This repository contains the Rust implementation of Aleph Zero blockchain node based on the Substrate framework. Aleph Zero is an open-source layer 1

Aleph Zero Foundation 55 Dec 15, 2022
Multy-party threshold ECDSA Substrate node

Webb DKG ??️ The Webb DKG ??‍✈️ ⚠️ Beta Software ⚠️ Running the DKG Currently the easiest way to run the DKG is to use a 3-node local testnet using dk

webb 42 Dec 19, 2022
A Substrate-based PoA node supporting dynamic addition/removal of authorities.

Substrate PoA A sample Substrate runtime for a PoA blockchain that allows: Dynamically add/remove authorities. Automatically remove authorities when t

Gautam Dhameja 10 Jun 16, 2022
The Data Highway Substrate-based blockchain node.

DataHighway-Parachain, a parachain on the Polkadot network. Planned features include a decentralized LPWAN roaming hub for LoRaWAN IoT devices and network operator roaming agreements, participative mining, an inter-chain data market, and DAO governance.

DataHighway 11 Dec 2, 2022
This is a node implementation of Thippy, a Substrate parachain for smart contracts

Thippy ‒- A Smart Contracts Parachain This is a node implementation of Thippy, a Substrate parachain for smart contracts. Developing Smart Contracts f

Arthur·Thomas 15 Mar 16, 2022
Substrate Node Template

This is a Proof of existence blockchain solution built in rust using the substrate framework, here i'm implementing custom macros & pallets provided by the frame framework

Samuel Jim Nnamdi 2 Oct 24, 2022
Faterium Substrate Node, Runtime, and Pallets. Contains "faterium-polls-pallet" with logic of Faterium Polls.

Faterium Substrate Node Faterium - a place where fates are forged. This is the official implementation of Faterium Crowdfunding Polls in Rust as Subst

Faterium 3 Dec 15, 2022
A fresh FRAME-based Substrate node, ready for hacking

Substrate Node Template A fresh FRAME-based Substrate node, ready for hacking ?? Getting Started Follow the steps below to get started with the Node T

Web 3 | Mobile | Blockchain Full Stack Engineer 6 Jun 23, 2023
Selendra is a multichains interoperable nominated Proof-of-Stake network for developing and running Substrate-based and EVM compatible blockchain applications.

Selendra An interoperable nominated Proof-of-Stake network for developing and running Substrate-based and EVM compatible blockchain applications. Read

Selendra 16 Nov 29, 2022
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