Install core

TrueBlocks runs on Linux and Mac. We do not support Windows.

These instructions assume you can navigate the command line and edit configuration files. If you need help with a particular step, see the installation’s troubleshooting section.

Installation

  • Open a terminal window.

  • Type go version. If Go is not installed or less than Go Version 1.23, install the latest version of Go

  • Install or upgrade the build dependencies: git, cmake, ninja, curl, python, clang-format, jq

  • Clone the repo and compile the executable:

git clone --depth 1 --no-single-branch --recurse-submodules --branch develop https://github.com/TrueBlocks/trueblocks-core
cd trueblocks-core
mkdir build && cd build
../scripts/go-work-sync.sh
cmake ../src
make
  • Switch to the master branch if you want a more stable version.

  • The build may be faster with make -j <nproc>.

  • Add ./trueblocks-core/bin to your shell’s $PATH. Check Google if you don’t know what this means.

  • Type chifra config --paths. This will produce a display similar to the following (ignore any errors). Note the $CONFIG paths.

chifra config --paths:
  Config: $HOME/Library/Application Support/TrueBlocks/
  Cache : $HOME/Library/Application Support/TrueBlocks/cache/mainnet
  Index : $HOME/Library/Application Support/TrueBlocks/unchained/mainnet
  • Next, edit a configuration file called $CONFIG/trueBlocks.toml. Edit this file and locate the [chains.mainnet] section. Add a valid RPC endpoint. If you don’t know what this means, search Google.
[chains.mainnet]
...
rpcProvider = "http://localhost:8545"
...
  • If you wish to use the --articulate feature (you probably do), add an API key to the following section:
[keys.etherscan]
...
apiKey = "<your Etherscan api key>"   # optional
...

Testing the install

If you’ve installed things properly, you should be able to now run the following command, which should return this data:

chifra blocks 12

You should get results similar to these:

{
  "data": [
    {
      "gasLimit": 5000,
      "gasUsed": 0,
      "hash": "0xc63f666315fa1eae17e354fab532aeeecf549be93e358737d0648f50d57083a0",
      "blockNumber": 12,
      "parentHash": "0x3f5e756c3efcb93099361b7ddd0dabfeaa592439437c1c836e443ccb81e93242",
      "miner": "0x0193d941b50d91be6567c7ee1c0fe7af498b4137",
      "difficulty": 17179844608,
      "finalized": true,
      "timestamp": 1438270144,
      "baseFeePerGas": 0
    }
  ]
}

More information

There’s a lot left to learn. Have fun:

Edit this page on GitHub