Giter Site home page Giter Site logo

debunny's Introduction

ext-v2-token

Here is a quick guide for deploying ext-v2-token standard on Internet Computer.

Node js setup

1. Setup and local deployment

  • yarn install
  • dfx start
  • dfx deploy --argument '(principal "your-minting-principal")'
  • dfx ledger fabricate-cycles --all

Example :

  • dfx deploy --argument '(principal "cg5zh-ncb4u-2c4va-ijjay-4ohx2-c67hs-ey5kh-tctf7-wlmft-cn4c7-kae")'

Set the admin to mint

  • dfx canister call ext_v2 ext_setAdmin '(principal "rtbhg-rtm5i-o4hus-5riyv-pmlgd-qqwgr-d4bou-33e2d-ot57r-44cc2-cqe")'

Congrats! Now you've deployed backend canister locally and topped it up with some cycles. Take note of your canister ID.

2. Minting locally

  • open mint_script.js, you will need to edit some variables
  • isLocal switches between local and ic networks, should be set to true for local deployment
  • minterSeed enter your principal seed phrase here (the one you deployed canister with in dfx deploy)
  • canisterIdLocal enter your local canister id here
  • set up paths to your images and thumbnails ( basePath, assetPathBase, thumbsPathBase )
  • run node src/mint_script.js

After minting locally, and going to your canister id, for example -> http://127.0.0.1:8000/?canisterId=rrkah-fqaaa-aaaaa-aaaaq-cai&index=0 your asset may not display properly.

This is expected behavior as its referencing wrong url due to how local canisters are set up. If you go to developer tools -> elements in your browser, you will see this targeted url. Take note of asset canister id and index. If you open a new tab in browser and go to something like: http://127.0.0.1:8000/?canisterId=qvhpv-4qaaa-aaaaa-aaagq-cai&index=0 with your asset canister id, it should take you to correct asset.

Given that thumbnails are saved on collection canister, this should work: http://127.0.0.1:8000/?canisterId=rrkah-fqaaa-aaaaa-aaaaq-cai&index=0&type=thumbnail

3. Minting on IC

Now that you tested local deployment, you can proceed with minting on IC.

  • dfx deploy --network ic --argument '(principal "your-minting-principal")'
  • open mint_script.js again
  • set isLocal to false
  • set canisterIdIC to your IC deployed canister
  • run node src/mint_script.js

Congratulations, your NFT's should now be deployed on IC network!

debunny's People

Contributors

marspoolxyz avatar

Watchers

 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.