NT-NFT Pallet

January 13, 2023 ยท View on GitHub

License rustdoc

Attribution

The NT-NFT pallet's approach to interacting with NFT collections and items is inspired by Parity's Uniques Pallet Which is licensed under Apache-2.0.

NT-NFT Pallet Setup and Testing Guide (Ubuntu)

Prerequisite Setup

Install Dependencies

sudo apt install build-essential
sudo apt install -y git clang curl libssl-dev llvm libudev-dev

Install Rust

curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y

source ~/.cargo/env

rustup default stable

rustup update stable

rustup update nightly

rustup install nightly-2022-09-19 

rustup override set nightly-2022-09-19

rustup target add wasm32-unknown-unknown

rustup target add wasm32-unknown-unknown --toolchain nightly

Deploy a Local Ventur Node

Fetch the code

The following command pulls the ventur-node code from our github repo:

git clone https://github.com/PopularCoding/ventur

cd ventur

Run the node

The following command builds the node. (This may take some time):

cargo run --release -- --dev

Run Unit Tests

Unit tests can be run locally using the following command:

cargo test

Manual Test Guide

1. Start the node

cargo run --release -- --dev
Running your local node
Running the Node

2. Access the Node through the polkadot.js.org interface

Once you have a ventur node running locally, follow this link: https://polkadot.js.org/apps/?rpc=ws://127.0.0.1:9944#/explorer

Accessing your Development Node Endpoint in polkadot.js.org
Accessing the Node

Confirm that you can see the recent blocks listed. If you are not able to access the block explorer on polkadot.js.org, you should:

  1. Confirm that your Ventur node is running

  2. Check if your Ventur node is running the JSON-RPC WS server on an address and port other than 127.0.0.1:9944 a. If your node is running on a different address and port, update the custom endpoint in polkadot.js.org to the address and port number your node is serving

    Setting your Development Node Endpoint in polkadot.js.org
    Setting your Custom Endpoint

3. Test Creating an NT-NFT Collection

1. Create an NT-NFT Collection
Creating an NT-NFT Collection
Create an NT-NFT Collection.
Example values:
collectionId: 150
imageIpfsCid: QmaG1CtUr74GPQwZeAnFhpiSgwtwGyR3zK2BRYh4DPDw3c
metadataIpfsCid: Qmb232AquR57EMUGgU92TxeZ8QyAJF5nERjdPZRNNJoh6z
2. Verify created NT-NFT Collection in Chain State
Verify NT-NFT Collection in Chain State

4. Test Minting an NT-NFT

1. Mint an NT-NFT to the previously created Collection
Minting an NT-NFT
2. Verify minting NT-NFT to Collection in chain state
Verify NT-NFT Mint

5. Test Burning an NT-NFT

1. Burn the previously created NT-NFT
Burning an NT-NFT
2. Verify burning the NT-NFT in chain state
Verify NT-NFT Burn

6. Test Assigning an NT-NFT to an Address

1. Mint another NT-NFT to the previously created Collection
Minting an NT-NFT
2. Assign the new NT-NFT to an Account
Proposing an NT-NFT Assignment
3. Verify the NT-NFT Proposed Assignment in chain state
Verify the proposed assignment of an NT-NFT

7. Test Accepting an Assigned NT-NFT

1. Accept the NT-NFT assignment from the assigned account
Accept an NT-NFT Assignment
2. Verify the Accepted NT-NFT in chain state
Verify the accepted NT-NFT

8. Test Rejecting an Assigned NT-NFT

1. Mint another NT-NFT to the previously created Collection
Minting an NT-NFT
2. Assign the new NT-NFT to an Account
Proposing an NT-NFT Assignment
3. Verify the NT-NFT Proposed Assignment in Chain State
Verify the proposed assignment of an NT-NFT
3. Reject NT-NFT Proposed Assignment
Reject the proposed assignment of an NT-NFT
3. Verify the NT-NFT Rejection in Chain State
Verify the rejected assignment of an NT-NFT in chain state
Verify the rejected assignment of an NT-NFT in chain state

9. Test Discarding an Assigned NT-NFT

1. Mint another NT-NFT to the previously created Collection
Minting an NT-NFT
2. Assign the new NT-NFT to an Account
Proposing an NT-NFT Assignment
3. Accept the new NT-NFT from the Account
Accept an NT-NFT Assignment
2. Verify the Accepted NT-NFT in chain state
Verify in chain state the accepted NT-NFT
2. Discard the NT-NFT
Discard the NT-NFT
2. Verify Discarding the NT-NFT in chain state
Verify in chain state discarding the NT-NFT

10. Test Freezing an NT-NFT Collection

1. Freeze the previously created Collection
Freezing a Collection
2. Attempt to mint another NT-NFT to the Collection
Attempt to mint an NT-NFT
2. Verify in chain state that the mint failed
Verify Failed Mint

11. Test Thawing an NT-NFT Collection

1. Thaw the frozen Collection
Thaw a Collection
2. Attempt to mint another NT-NFT to the Collection
Attempt to mint an NT-NFT
2. Verify in chain state that the mint succeeded
Verify Successful Mint