Articles about 'Tutorials'

Monthly Token Balances

Can I create a list of token balances by month?
Posted January 6, 2023 ‐ 1 min read
tags: [ Tutorials ]

Factories

Can I get a list of all contracts created by an address?
Posted January 6, 2023 ‐ 1 min read
tags: [ Tutorials ]

Recipe: List Tokens I Own

What do I Own?

A TrueBlocks recipe to show ERC 20 token balances for an address.

Note: The following assumes you have a copy of (either by having built it yourself or downloaded it) the TrueBlocks Appearance Index.

Preliminaries

We start by extracting from the chain all the transactions for the address in question. We will use a randomly selected address that we know owns a number of different tokens.

chifra list 0x03fdcadc09559262f40f5ea61c720278264eb1da

This produces a list of 2,129 appearances (at the time of this writing). Each appearances is a pair of integers detailing the blockNumber and transactionIndex of the transaction. Note that other methods of getting such a list (such as EtherScan APIs) return far fewer transactions. We will explain this in a later post.

Posted April 13, 2021 ‐ 6 min read
tags: [ Tutorials ]

Running Against Multiple Rpc Endpoints

Can I run against different RPC endpoints?

One user asked if it was possible to run TrueBlocks against multiple RPC endpoints at the same time. This is short recipe to accomplish just that.

Preliminaries

The first thing to understand is that the TrueBlocks core runs against a local configuration file stored in your $HOME folder called $HOME/.local/share/TrueBlocks/trueBlocks.toml. It’s an almost ridiculously simple file.

The file gets created and populated with default values the first time you build TrueBlocks. When you do cmake ../src and then make in the build folder of the TrueBlocks repo, you can look inside the file $HOME/.local/share/trueblocks/trueBlocks.toml.

Posted April 21, 2021 ‐ 3 min read
tags: [ Tutorials ]

Showing ERC-20 Transfers

Can I show all token transfers on a contract?

A TrueBlocks recipe to show every ERC20 Transfer event from a given smart contract.

Note: The following assumes you have a copy of (either by having built it yourself or downloaded it) the TrueBlocks Appearance Index. These instructions also assume that the address you’re querying is an ERC 20 smart contract.

Preliminaries

To get started, we want to extract (from the TrueBlocks index) a list of every transaction that our address has ever appeared in.

Posted April 13, 2021 ‐ 6 min read
tags: [ Tutorials ]