Just made this repo and decided to share it.
I am going to make a security audit of my canisters with this.
Purpose
Made for easy testing of any canisters, including Motoko Playground canisters without manually providing interface spec.
If you use too high concurrency you may get IP blocked by gateways.
By default works with production IC network.
You can also make it work with your local replica if you specify NODE_ENV=development and IC_HOST in .env
Easy as:
let output = await(await anycan("x2ojg-ciaaa-aaaab-qadba-cai")).anyfunc(input);
Usage
import { anycan, fileIdentity, blast } from "./sys/index.js";
let identityJohn = fileIdentity(0);
// TIP: Go to Motoko Playground at https://m7sm4-2iaaa-aaaab-qabra-cai.raw.ic0.app/
// Choose "Counter" and deploy it
// Take the canister id and put replace it in this code
let counterCanJohn = await anycan("x2ojg-ciaaa-aaaab-qadba-cai", identityJohn);
// If you need different callers
// let identityPeter = fileIdentity(1);
// let counterCanPeter = await anycan("x2ojg-ciaaa-aaaab-qadba-cai", identityPeter);
// sends 10 requests with max concurrency 5 at a time
let results = await blast(10, 5, (idx) => {
return counterCanJohn.get();
});