Coder Social home page Coder Social logo

netgodfather / nftmart-node Goto Github PK

View Code? Open in Web Editor NEW

This project forked from nftt-studio/nftmart-node

0.0 1.0 0.0 10.3 MB

NFTMart Node Implementation

License: Apache License 2.0

Rust 72.71% Shell 3.92% Nix 0.09% Dockerfile 0.42% Makefile 0.05% JavaScript 10.75% HTML 11.58% Handlebars 0.47%

nftmart-node's Introduction

Build License DockerHub

NFTMart Node

cover

Networks

This repository contains code for NFTMart Mainnet, Staging and Dev network. These networks share the same nftmart-node binary. You can switch between different networks by specifying the correct chain spec when starting your node.

Mainnet

You can connect to NFTMart Mainnet using the following public addresses

  • wss://mainnet.nftmart.io/rpc/ws
  • https://mainnet.nftmart.io/rpc/http

Or you can start a node locally and sync with the Mainnet

docker-compose up mainnet

# If you prefer using your own binary, try this instead
./target/release/nftmart-node --chain=/specs/mainnetRaw.json

Staging Network

You can connect to NFTMart Staging Network using the following public addresses

  • wss://staging.nftmart.io/rpc/ws
  • https://staging.nftmart.io/rpc/http

Alternatively, you can start a node locally and sync with the Staging Network

docker-compose up staging

# If you prefer using your own binary, try this instead
./target/release/nftmart-node --chain=/specs/stagingRaw.json

Dev Network

To start a Dev Network, you must run your own node:

docker-compose up dev

# If you prefer using your own binary, try this instead
./target/release/nftmart-node --dev --alice

then connect to it from the following rpc endpoints:

  • ws://127.0.0.1:9944
  • http://127.0.0.1:9933

Build From Source

Prepare Toolchain

Please follow this link to prepare an development environment.

Remember to set your nightly toolchain version to nightly-2021-09-01, later versions may fail to compile.

NIGHTLY=nightly-2021-09-01
rustup install $NIGHTLY
rustup target add wasm32-unknown-unknown --toolchain $NIGHTLY
rustup default $NIGHTLY

Compile And Run

cargo build --release -p nftmart-node

./target/release/nftmart-node --dev --alice --rpc-cors=all --rpc-methods=Unsafe --unsafe-ws-external

Use Node.js to access nftmart blockchain

git clone https://github.com/NFTT-studio/nftmart-node
cd nftmart-node/nodejs-demo
yarn install

# Create a class(ID: 0) by Alice with local testing node.
node nft-apis.mjs --ws ws://127.0.0.1:9944 create-class //Alice

# Add a new class administrator to the class, ID: 0
node nft-apis.mjs --ws ws://127.0.0.1:9944 add-class-admin //Bob

# Create an another class(ID: 1) managed by Alice.
node nft-apis.mjs --ws ws://127.0.0.1:9944 create-class //Alice

# List all classes
node nft-apis.mjs --ws ws://127.0.0.1:9944 show-class-info
[
  '{"metadata":"https://xx.com/aa.jpg","totalIssuance":0,"owner":"62qUEaQwPx7g4vDz88bdp1tmZkSpPtVRL4pS98P7VEbZnM9w","data":{"deposit":2280000000000,"properties":3,"name":"0x616161","description":"0x62626262","createBlock":489},"classID":1,"adminList":[[{"delegate":"65ADzWZUAKXQGZVhQ7ebqRdqEzMEftKytB8a7rknW82EASXB","proxyType":"Any","delay":0}],261000000000000]}',
  '{"metadata":"https://xx.com/aa.jpg","totalIssuance":0,"owner":"62qUEaQwPx7g4vDz88bN4zMBTFmcwLPYbPsvbBhH2QiqWhfB","data":{"deposit":2280000000000,"properties":3,"name":"0x616161","description":"0x62626262","createBlock":8},"classID":0,"adminList":[[{"delegate":"63b4iSPL2bXW7Z1ByBgf65is99LMDLvePLzF4Vd7S96zPYnw","proxyType":"Any","delay":0},{"delegate":"65ADzWZUAKXQGZVhQ7ebqRdqEzMEftKytB8a7rknW82EASXB","proxyType":"Any","delay":0}],459000000000000]}'
]

# Mint three nft tokens to Bob in the class which ID is 0.
node nft-apis.mjs --ws ws://127.0.0.1:9944 mint-nft //Bob 0

# List all nfts in the class, `ID:0`
node nft-apis.mjs --ws ws://127.0.0.1:9944 show-all-nfts 0
{"metadata":"0x6161626263636464","owner":"63b4iSPL2bXW7Z1ByBgf65is99LMDLvePLzF4Vd7S96zPYnw","data":{"deposit":1080000000000,"createBlock":554}}
{"metadata":"0x6161626263636464","owner":"63b4iSPL2bXW7Z1ByBgf65is99LMDLvePLzF4Vd7S96zPYnw","data":{"deposit":1080000000000,"createBlock":554}}
{"metadata":"0x6161626263636464","owner":"63b4iSPL2bXW7Z1ByBgf65is99LMDLvePLzF4Vd7S96zPYnw","data":{"deposit":1080000000000,"createBlock":554}}

nftmart-node's People

Contributors

ialicebobi avatar btwiuse avatar caosbad avatar blackjooohn avatar

Watchers

James Cloos avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.