Coder Social home page Coder Social logo

cw-load-test's Introduction

cw-load-test

cw-load-test is a tool for load testing Cosmwasm networks based on tm-load-test.

Requirements

In order to build and use the tools, you will need:

  • Go 1.17+
  • make

Building

To build the cw-load-test binary in the build directory:

make build

Usage

Require WALLET and CHAINID environment variables.

# wallet paraphrase
export WALLET="dss hgg ssa yyrre ere ere erre ..."
export CHAINID=torri-1

1. Storing wasm code

This command generates different wasm files from a custom wat (text format) using wasmtime-go, and sends 6 wasm codes with a timeout height (+5).

./build/cw-load-test -b 5 -r 6 \
    --wat-path res/code.wat \
    --broadcast-tx-method async \
    --lcd http://127.0.0.1:1317 \
    --endpoints ws://127.0.0.1:26657/websocket \
    --gas 2000000 --gas-prices 0.00ucosm
  • -b: Max block to wait txs complete
  • -r: Txs in batch transaction
  • --lcd: Cosmos API
  • --endpoints: Tendermint RPC

2. Execute contract

Send 10 MsgExecuteContract txs with timeout height +5. Use custom contract

./build/cw-load-test -b 5 -r 10 \
    --contract wasm1hm4y6fzgxgu688jgf7ek66px6xkrtmn3gyk8fax3eawhp68c2d5qphe2pl
    --exec-msg '{"allocate_memory": {"limit": 500}}' \
    --broadcast-tx-method async \
    --lcd http://127.0.0.1:1317 \
    --endpoints ws://127.0.0.1:26657/websocket \
    --gas 2000000 --gas-prices 0.00ucosm
  • --contract: Contract to be executed.
  • --exec-msg: Execute msg to send to contract.

cw-load-test's People

Contributors

giansalex avatar

Stargazers

dzmitry-lahoda avatar

Watchers

James Cloos avatar  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.