GithubHelp home page GithubHelp logo

polka-defi / substrate-debug-kit Goto Github PK

View Code? Open in Web Editor NEW

This project forked from paritytech/substrate-debug-kit

0.0 0.0 0.0 6.41 MB

A collection of debug tools, scripts and libraries on top of substrate.

License: GNU General Public License v3.0

Rust 65.98% JavaScript 18.40% TypeScript 15.30% Shell 0.32%

substrate-debug-kit's Introduction

Substrate debug-kit ๐Ÿ› โš™๏ธ

A collection of debug tools and libraries around substrate chains.

This project has evolved from the historical name offline-phragmen. I first created this repo prior to Kusama's NPoS enabling as a tool to predict the outcome. Henceforth, it has evolved into this repo. This functionality is still provided in the offline-elections crate.

Overview

  • sub-storage: This is the backbone of all of the crates in this repo. It provides a minimal wrapper around substrate's storage rpc call for easier use. It provides all you need to read any module's storage items, constants, and metadata. All of this is independent of any chain or pallet and should work in any substrate chain. Additionally, it provide some pallet-dependent helpers as well under the helpers feature (such as reading identity of an account).
  • sub-du: a disk-usage-like tool that prints the storage usage of a chain. It reads all the info it needs from metadata, so independent chain or runtime. Arguably not super useful, but I find it cool.
  • offline-elections: The historical main purpose of this repo. It can scrape the staking module's info and run election algorithms of sp-npos-elections offline. Given the correct parameters, it can be used to predict the next validator set. It also provide other election related functionalities. See the sub-commands for more info.
  • remote-externalities: It provides the ability to write simple rust unit tests over a specific state of a chain. It can be very useful to debug breaking changes and storage migrations.
  • tokens: Quite a dumb and small crate that provides wrappers for easy pretty-printing tokens like DOT. Somewhat similar to the toHuman() interface of the javascript API.
  • laboratory: This is where I try new stuff.

Brain Dump ๐Ÿง 

  • Substrate module sidecar: A wrapper around remote-externalities that allows you to run a substrate module in a TextExternalities environment and constantly feed the new block data into it. Would need to listen to new blocks, upon each block:
    1. call Module::on_initialize().
    2. scan for any transaction in that block that might be targeted to this module (how? call matching), call them directly
    3. call Module::on_finalize().
    4. Wipe the state and update it to the new state of the newly imported block.

Notes: will probably be a pain to do because of rust dependency clashes. Using wasm would make this easier, but then debugging will become harder.

substrate-debug-kit's People

Contributors

kianenigma avatar ascjones avatar shawntabrizi avatar gavofyork 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.