Code Monkey home page Code Monkey logo

asset_cli_tool's Introduction

Asset CLI tool

  • This tool is meant to help in interacting with the Asset Pallet (๐Ÿšงunder active development๐Ÿšง)

Run

  •   $ yarn
      $ yarn start 
    
  • Then follow prompts on screen.

Running a dev environment

  • To test the ledger integration you can use an asset-hub-polkadot-dev, asset-hub-kusama-dev or asset-hub-westend-dev chain which requires setting up the relay chain and attaching the corresponding Asset Hub as a parachain. For this purpose, zombienet is the preferred choice.

  • To run in a dev environment:

    • Clone and build Polkadot's three binaries: polkadot, polkadot-execute-worker and polkado-prepare-worker, with --features=fast-runtime, in order to decrease the epoch time for development, and copy it into the zombienet folder.

    • Download the latest binary for polkadot-parachain into the zombienet folder.

    • Setup zombienet by downloading your OS's executable from the latest release into the zombienet directory. Note: For macos users if permission is denied to run the binary you can chmod 755 <file_name> to allow permissions.

    • Edit the config.toml file according to your needs.

    • If you are on linux:

      • $ yarn
        $ yarn dev-linux
        
    • If you are running on macOS:

      • $ yarn
        $ yarn dev-macos
        
    • Then on a different terminal:

    •   $ yarn start
      
    • Select local from the list:

    • network-options

    • After setup you must send funds from your relay chain to Polkadot Asset Hub. You can do that in polkadot.js.org/apps .

    • Set chain to Local Node under the Development option from the dropdown list.

    • On the Developer tab go to RPC calls, choose xcm pallet > teleportAssets.

    • teleport

    Note: Ledger does not support Westend Asset Hub.

Multsig support

  • There are 3 steps to making and executing a multisig call

    • First - create a multsig account

      • this only needs to be done if the account is a new account
      • note - this account is not stored on chain
    • Second - Create a multisig tx

      • All calls have been abstracted to a Calls class. When you are promted for the call, just write the function name in the class and you should be routed to the proper call (ex. mint)
      • The argument parameters need to be passed in order and in string quotes "" in an array
      • This should generate the call automatically
    • Third - Approve a multisig tx

      • This should have similar steps to creating the tx
      • If the threshold is greater than the approvals this will approve the call, if threshold is equal this will approve and fire tx
  • Troubleshooting

    • Signatories out of order - Need to order the passed through signatories

Ledger Support

  • To interact with the ledger first you need to install the Ledger applications for Kusama Asset Hub and Polkadot Asset Hub from Ledger Live.

  • To use the Ledger just type ledger instead of inputting a mnemonic.

Running from a fresh machine

  • Follow the installation guide appropiate for your machine to setup rust and cargo.
  • Install nvm:
     $ curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.38.0/install.sh | bash 
    
  • Install node via nvm:
     $ nvm install node 
    
  • install yarn via npm:
     $ npm install --global yarn 
    
  • Follow the steps for running a dev environment.

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.