Queried by: minersdevelopers
The Big Picture
PoW solutions can only be used once. This storage tracks used solutions to prevent replay attacks on PoW registration.
Use Cases
- Check if PoW solution is fresh
- Debug PoW registration
- Build PoW tooling
Purpose & Usage
Purpose
Prevent replay of PoW solutions.
Common Query Patterns
- Query by work hash
Query Keys
| # | Name | Type | Description |
|---|---|---|---|
| 1 | key1 | Vec<u8> Vec | key1 (Vec<u8>) |
Stored Value
Code Examples
import { ApiPromise, WsProvider } from "@polkadot/api";
import { stringCamelCase } from "@polkadot/util";
const provider = new WsProvider("wss://entrypoint-finney.opentensor.ai:443");
const api = await ApiPromise.create({ provider });
// Query UsedWork storage
const key1 = 0;
const result = await api.query
[stringCamelCase("SubtensorModule")]
[stringCamelCase("UsedWork")](
key1
);
console.log("UsedWork:", result.toHuman());Runtime Info
View Source- Pallet
- SubtensorModule
- Storage Kind
- Map
- First Version
- v101
- Current Version
- v393