Code Monkey home page Code Monkey logo

polkadot_apps's Introduction

polkadot_apps

Interacting with Polkadot

Setup

  1. Ensure that you have recent versions of Node and Yarn
  2. Install dependencies with yarn - you may also have to do yarn add @polkadot/api@beta
  3. To run, node foo.js

Kinds of Calls

  1. Constants - A constant feature of the chain. These are things that the API does not need to do any work to get, they can just see the value.
  2. Queries - These are basically function calls to get some data.
  3. Tx - Issue an actual on-chain extrinsic. Note that even though this looks like it would only contain transactions, it is for any extrinsic.
  4. Events - Listening for events occurring on-chain.

Basic Connection

Connect to Kusama

See basic_connect.js

Connect to local node (could be connected to Kusama, running local chain, etc.)

See basic_connect_local.js

Reading Constants

See read_constants.js

Calling Functions

See read_account.js

Script to Check Balances

See read_any_account.js

Subscribing to Events

See display_data.js

See account_watcher.js

Transactions

See tx.js

See better_tx.js

A More Complex Script

See Anson Lau's Validator Stats script

Moving Beyond

  1. Dig into the API https://polkadot.js.org/api/
  2. Start programming the UI https://polkadot.js.org/ui/start/
  3. polkadot.js source and links to other tutorials: https://github.com/polkadot-js/apps
  4. Various CLI tools to help your development https://github.com/polkadot-js/tools
  5. Dealing with types, enums, structs, etc. https://polkadot.js.org/api/start/types.basics.html

polkadot_apps's People

Contributors

laboon 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.