Subsquid Leverages Filebase to Bring Decentralized Storage to Squid SDK Indexing Stack

Subsquid
squid Blog
Published in
3 min readApr 4, 2023

We are pleased to formally announce our partnership with Filebase, the first S3-compatible object storage platform to allow developers to store data in a secure, redundant, and performant manner using decentralized storage networks.

Subsquid Archives already make use of Filebase’s reliable and very competitively priced S3 service for storage of a massive quantity of indexed blockchain data. As we progress towards the decentralization of these Archives, Filebase will play an essential role, making it trivial for us — and later network participants — to pin data and distribute it using IPFS.

Concurrently, we are collaborating with our new partners to streamline the Web3 developer experience through the seamless integration of Filebase into the Aquarium, our hosted service for squid indexers. Learn how to use Filebase as a Subsquid user here.

An essential tool for Subsquid users

The S3 service provided by Filebase is excellent for analytic datasets (i.e. as parquet or csv files) indexed using Squid SDK and the recently released s3-compatible store. For this reason, we have made it part of the Aquarium roadmap to enable registration and configuration of the service as an add-on.

Of course, the front-end integration is not necessary to begin using Filebase as a Subsquid user. You can find a complete example of a Filebase squid implementation below, or refer to the dedicated article in our official documentation.

// FIXME: replace with a dedicated gateway
export const BASE_URL = 'https://ipfs.filebase.io/ipfs'

export const api = Axios.create({
baseURL: BASE_URL,
headers: {
'Content-Type': 'application/json',
},
withCredentials: false,
timeout: 5000,
httpsAgent: new https.Agent({ keepAlive: true }),
})


export const fetchMetadata = async (
ctx: BlockHandlerContext<Store>,
cid: string
): Promise<any | null> => {
try {
const { status, data } = await api.get(`${BASE_URL}/${cid}`)
ctx.log.info(`[IPFS] ${status} CID: ${cid}`)
if (status < 400) {
return data
}
} catch (e) {
ctx.log.warn(
`[IPFS] ERROR CID: ${cid} TRY ${(e as Error).message}`
)
}
return null
}


processor.run(new TypeormDatabase(), async (ctx) => {
for (let c of ctx.blocks) {
for (let i of c.items) {
// track and decode NFT events to get CID
// use fetchMetadata() to fetch metadata
}
}
})

Prioritizing DevEx

Together with the Filebase team, we have committed to collaborating on multiple developer relations initiatives, including the production of tutorials, carrying out workshops, and organizing events. The Filebase docs already contain an excellent tutorial on querying NFT data by leveraging Subsquid and a dedicated IPFS gateway. Likewise, the Subsquid YouTube channel contains a video guide on using Squid SDK and Filebase for blockchain data analysis. More such content is currently under development.

About Subsquid

Subsquid is the team behind squids, a new standard for Web3 data extraction and transformation. Squids already power hundreds of applications across dozens of EVM, Substrate, and WASM-based chains. With modular architecture and a host of advanced features, Subsquid offers the most resource-efficient and developer-friendly way to build, test, and deploy customized GraphQL APIs and ETLs for dApps and blockchain analytics.

Twitter | Discord | LinkedIn | Telegram | GitHub

About Filebase

Filebase is a decentralized storage and geo-redundant IPFS pinning provider that offers scalable, highly performant, and redundant storage across multiple decentralized storage networks. Filebase operates by enabling users to create buckets and pin files to the IPFS network through their S3 and IPFS pinning service APIs.

Twitter | Discord | LinkedIn | Email

--

--

Subsquid
squid Blog

Building a better standard for Web3 indexing and ETL. Support for EVM, Substrate, and WASM chains. http://t.me/subsquid & http://discord.gg/subsquid