Skip to content

Prerequisites & Project Setup

This guide targets the Tiramisu testnet. Check Networks for current testnets and faucets.

Before you write code, install the tools in this section and set up the project structure.

Make sure that you have these tools on your system:

  • Node.js: version 22 or higher. Version 24 is the current LTS release. This tutorial uses the --env-file flag to load environment variables.
  • A text editor: a code editor like VS Code works well.
  • An Arkiv testnet private key. To create entities (write data) on Arkiv, you need a wallet. This tutorial uses the public Tiramisu testnet, so no real funds are at risk.

If you do not have a private key, generate a new one with this command:

Terminal window
node -e "console.log('0x' + require('crypto').randomBytes(32).toString('hex'))"

Copy the output and save it in a safe place.

Now create the project directory and install the required libraries.

Open your terminal and run these commands:

  1. Create and enter the project folder:

    Terminal window
    mkdir arkiv-dashboard
    cd arkiv-dashboard
  2. Initialize a Node.js project. This command creates a package.json file.

    Terminal window
    npm init -y
    npm pkg set type=module
  3. Install dependencies. Install the Arkiv SDK for blockchain interaction and axios to fetch data from the CoinGecko API.

    Terminal window
    npm install @arkiv-network/sdk viem axios
  4. Create project files. You need a backend directory for the data-fetching script, and a frontend directory for the dashboard.

    Terminal window
    mkdir backend frontend
    touch backend/index.js backend/.env
    touch frontend/index.html frontend/style.css frontend/script.js frontend/charts.js
  5. Add your private key. Open the backend/.env file and add the private key that you generated earlier.

    backend/.env
    PRIVATE_KEY=0xYOUR_PRIVATE_KEY_HERE

Your project structure now looks like this:

  • Directoryarkiv-dashboard/
    • Directorybackend/
      • .env
      • index.js
    • Directoryfrontend/
      • index.html
      • charts.js
      • script.js
      • style.css
    • Directorynode_modules/
      • …
    • package.json
    • package-lock.json

The project is now ready. In the next section, you build the backend service.