Skip to content

Instantly share code, notes, and snippets.

View justinkalland's full-sized avatar
❄️

Justin Kalland justinkalland

❄️
View GitHub Profile
This post links my 3Box profile to my Github account! Web3 social profiles by 3Box.
✅ did:3:bafyreigupinve3vipad4mulftpsd3xhxittgxtgrhbatx6727wv56jucy4 ✅
Create your profile today to start building social connection and trust online at https://3Box.io/
@justinkalland
justinkalland / fetchAllRequests.ts
Created May 20, 2021 11:05
Fetch all subgraph PoH requests using ghetto creation time pagination
const PAGE_SIZE = 1000
async function fetchAllRequests (resolved = false): Promise<Array<{}>> {
let requests: Array<{}> = []
let creationTimeOffset = Math.floor(Date.now() / 1000)
while (creationTimeOffset > 0) {
logger.debug(`Fetching ${PAGE_SIZE} ${resolved ? 'resolved' : 'unresolved'} requests starting at ${creationTimeOffset}`)
const response = await axios.post('https://api.thegraph.com/subgraphs/name/kleros/proof-of-humanity-mainnet', {
query: `