@fusill/sdk
v0.1.0
Published
Client SDK for Fusill — decentralized server resilience testing on Solana. Create and manage on-chain load-test jobs and read verified results.
Downloads
25
Maintainers
Readme
@fusill/sdk
Client SDK for Fusill — decentralized server resilience testing on Solana. Create and manage on-chain load-test jobs, run multi-vector campaigns, and read consensus-verified results (baseline vs. latency under load).
Install
npm install @fusill/sdkPeer requirements: @solana/web3.js and @coral-xyz/anchor (installed automatically).
Usage
Node.js (with a Keypair)
import { FusillClient } from '@fusill/sdk'
import { Keypair } from '@solana/web3.js'
const keypair = Keypair.fromSecretKey(/* ... */)
const client = new FusillClient(keypair, 'https://api.devnet.solana.com', './fusill-idl.json')
const { jobPubkey } = await client.createJob({
target: 'https://your-server.com',
runnerType: 'httpFlood',
runnerConfig: { concurrent_connections: 100 },
durationSeconds: 30,
minNodes: 3,
paymentSol: 0.03,
})
const result = await client.waitForFinalization(jobPubkey)Browser (with a wallet adapter)
Pass an AnchorProvider built from the connected wallet and the IDL object — no Keypair needed; the wallet signs.
import { FusillClient } from '@fusill/sdk'
import { AnchorProvider } from '@coral-xyz/anchor'
import IDL from './fusill-idl.json'
const provider = new AnchorProvider(connection, wallet, { commitment: 'confirmed' })
const client = new FusillClient(undefined, provider, IDL)API
| Method | Purpose |
|--------|---------|
| createJob(opts) | Create a single load-test job |
| createMultiVectorJob(opts) | Create a campaign — one job per vector (per-vector minNodes/paymentSol supported) |
| scheduleJob(pubkey, runAt) / scheduleMultiVectorJob(pubkeys, runAt) | Set the coordinated execution timestamp |
| waitForAllFilled(pubkeys) | Wait until every campaign job is claimed |
| cancelJob(pubkey) / cancelMultiVectorJob(pubkeys) | Cancel and refund expired jobs |
| getJob(pubkey) / listJobs() / listAllJobs() | Read job state |
| getJobResults(pubkey) | Per-node revealed results: baseline vs. under-attack latency, degradation, error rate, requests |
| onJobFinalized(pubkey, cb) / waitForFinalization(pubkey) | Subscribe to / await finalization |
License
MIT
