Skip to content

Instantly share code, notes, and snippets.

@juliangruber
Last active February 25, 2025 10:00
Show Gist options
  • Save juliangruber/93733ddc76a5db4d47e98e4aebdb251c to your computer and use it in GitHub Desktop.
Save juliangruber/93733ddc76a5db4d47e98e4aebdb251c to your computer and use it in GitHub Desktop.
const aggregators = [
"https://aggregator.walrus-testnet.walrus.space",
"https://wal-aggregator-testnet.staketab.org",
"https://walrus-testnet-aggregator.bartestnet.com",
"https://walrus-testnet.blockscope.net",
"https://walrus-testnet-aggregator.nodes.guru",
"https://walrus-cache-testnet.overclock.run",
"https://walrus-testnet-aggregator.stakin-nodes.com",
"https://testnet-aggregator-walrus.kiliglab.io",
"https://walrus-cache-testnet.latitude-sui.com",
"https://walrus-testnet-aggregator.nodeinfra.com",
"https://walrus-testnet.stakingdefenseleague.com",
"https://walrus-aggregator.rubynodes.io",
"https://walrus-testnet-aggregator.brightlystake.com",
"https://walrus-testnet-aggregator.nami.cloud",
"https://testnet.walrus-publisher.sm.xyz",
"https://walrus-testnet-aggregator.stakecraft.com",
"https://agg.test.walrus.eosusa.io",
"https://walrus-agg.testnet.obelisk.sh",
"https://sui-walrus-testnet.bwarelabs.com/aggregator",
"https://walrus-testnet.chainbase.online/aggregator",
"https://walrus-tn.juicystake.io:9443",
"https://walrus-agg-testnet.chainode.tech:9002",
"https://walrus-testnet-aggregator.starduststaking.com:11444",
"http://walrus-testnet-aggregator.everstake.one:9000",
"http://walrus.testnet.pops.one:9000",
"http://scarlet-brussels-376c2.walrus.bdnodes.net:9000",
"http://aggregator.testnet.sui.rpcpool.com:9000",
"http://walrus.krates.ai:9000",
"https://walrus.sui.thepassivetrust.com",
"http://walrus.globalstake.io:9000",
"http://walrus-testnet-aggregator.natsai.xyz:9000",
"http://walrus-testnet.staking4all.org:9000",
"https://walrus.testnet.aggregator.stakepool.dev.br",
"https://aggregator.walrus.banansen.dev",
"https://aggregator.walrus.silentvalidator.com"
]
const getBlobs = async asc => {
const orderBy = asc ? 'ASC' : 'DESC'
const res = await fetch(`https://walruscan.com/api/walscan-backend/testnet/api/blobs?page=0&sortBy=TIMESTAMP&orderBy=${orderBy}&searchStr=&size=20`)
if (!res.ok) throw new Error(`Cannot fetch blob list from https://walruscan.com: ${res.status}`)
const body = await res.json()
return body.content
}
const measure = async (aggregator, blob) => {
try {
const res = await fetch(`${aggregator}/v1/blobs/${blob.blobIdBase64}`, {
signal: AbortSignal.timeout(60_000)
})
if (!res.ok) throw new Error(`${aggregator} responded with ${res.status}`)
return { retrievable: true, aggregator }
} catch (err) {
return { retrievable: false, aggregator }
}
}
const blobs = [
...await getBlobs(true),
...await getBlobs(false)
]
let total = 0
let successful = 0
while (true) {
const aggregator = aggregators[Math.floor(Math.random() * aggregators.length)]
const blob = blobs[Math.floor(Math.random() * blobs.length)]
const measurement = await measure(aggregator, blob)
total++
if (measurement.retrievable) successful++
console.log(Math.round((successful / total) * 100), '% RSR after', total, 'tests')
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment