Blockchains are, at their essence, a distributed database. The transactions in a blockchain are an example of time-series data. You can use Timescale to query transactions on a blockchain, in exactly the same way as you might query time-series transactions in any other database.

In this tutorial, you use Timescale to ingest, store, and analyze transactions on the Bitcoin blockchain. You can use these skills to query any data on a blockchain, including other cryptocurrencies, smart contracts, or health data.

Before you begin, make sure you have:

This tutorial covers:

  1. Setting up your dataset
  2. Querying your dataset
  3. Bonus: Store data efficiently

This tutorial uses a sample Bitcoin dataset to show you how to construct queries for blockchain data. The queries you do in this tutorial is used to do things like determine if a cryptocurrency is performing as expected, graph currency values over time, and compare currencies.

It starts by teaching you how to set up and connect to a Timescale database, create tables, and load data into the tables using psql.

You then learn how to conduct analysis on your dataset. It walks you through using PostgreSQL queries to obtain information, including finding the most recent transactions on the blockchain, and gathering information about the transactions using aggregation functions.

When you've completed this tutorial, you can use the same dataset to complete the advanced blockchain tutorial, which shows you how to analyze the blockchain data using Timescale hyperfunctions.

Keywords

Found an issue on this page?Report an issue or Edit this page in GitHub.