How to synchronize onchain data to Timescale

This guide will show you how to synchronize onchain data to your Timescale instance.

Grab the Timescale connection string

The first step is to grab the connection string from your Timescale dashboard. If you have the addon, you should use the "connection pooler" connection string since the number of concurrent connections is limited.

Timescale connection string

Create the table

Use the connection string from the previous point to create the table. In this tutorial, we are going to use pgcli but any tool is fine.

Create table

Connect the indexer

Set the POSTGRES_CONNECTION_STRING environment variable to the value copied from the dashboard.

Terminal
export POSTGRES_CONNECTION_STRING="postgres://tsdbadmin:[YOUR-PASSWORD]@[YOUR-INSTANCE].tsdb.cloud.timescale.com:38660/tsdb?sslmode=require"

Run the indexer and after a few seconds you will see onchain data appear in your database.

Last modified
Edit on GitHub
Apibara

Apibara is the fastest platform to build production-grade indexers that connect onchain data to web2 services.

© 2024 GNC Labs Limited. All rights reserved.