Giter Club home page Giter Club logo

ecosystem-performance-benchmarks's Introduction

Polkadot Ecosystem Performance Benchmarks

This repository is meant to aggregate performance benchmarks from the Polkadot Ecosystem.

It is based on Substrate Devhub Parachain Template.

However, instead of polkadot-launch, we use zombienet for its convenient features as a DSL-based test framework.

The proposed collaborative workflow:

  • Each team writes a pallet with the extrinsic calls that they wish to evaluate the performance.
  • The team adds their own .js, .toml and .feature files into the tests directory, according to zombienet's network and test definitions, respectively.
  • Finally, the zombienet.sh script automates the test execution.

Note: the test DSL specs document is currently outdated and some assertion styles are missing. One of the missing features is to run custom javascript assertions, allowing to interact with the network through @polkadot/api.

This assertion style allows users to specify a .js file in order to interact with the parachain runtime. It must export a run function that will be called by zombienet with the following input parameters:

  • node name
  • network info
  • any other argument set in the assertion

zombienet will execute the .js and assert the return value.

Here is a simple example, which already populates the directory for each team:

const polkadotApi = require("@polkadot/api");

async function connect(apiUrl, types) {
    const provider = new polkadotApi.WsProvider(apiUrl);
    const api = new polkadotApi.ApiPromise({ provider, types });
    await api.isReady;
    return api;
}

async function run(nodeName, networkInfo, args) {
    const {wsUri, userDefinedTypes} = networkInfo.nodesByName[nodeName];
    const api = await connect(wsUri, userDefinedTypes);
    const validator = await api.query.session.validators();
    return validator.length;
}

module.exports = { run }

For example, here's how to execute this test:

$ ./zombienet.sh test tests/acala/polkadot-js-example.feature

ecosystem-performance-benchmarks's People

Contributors

bernardoaraujor avatar pepoviola 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.