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.
1. Prerequisites
Section titled “1. Prerequisites”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-fileflag 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:
node -e "console.log('0x' + require('crypto').randomBytes(32).toString('hex'))"Copy the output and save it in a safe place.
2. Project Setup
Section titled “2. Project Setup”Now create the project directory and install the required libraries.
Open your terminal and run these commands:
-
Create and enter the project folder:
Terminal window mkdir arkiv-dashboardcd arkiv-dashboard -
Initialize a Node.js project. This command creates a
package.jsonfile.Terminal window npm init -ynpm pkg set type=module -
Install dependencies. Install the Arkiv SDK for blockchain interaction and
axiosto fetch data from the CoinGecko API.Terminal window npm install @arkiv-network/sdk viem axios -
Create project files. You need a backend directory for the data-fetching script, and a frontend directory for the dashboard.
Terminal window mkdir backend frontendtouch backend/index.js backend/.envtouch frontend/index.html frontend/style.css frontend/script.js frontend/charts.js -
Add your private key. Open the
backend/.envfile and add the private key that you generated earlier.backend/.env PRIVATE_KEY=0xYOUR_PRIVATE_KEY_HERE
Open PowerShell and run these commands:
-
Create and enter the project folder:
Terminal window mkdir arkiv-dashboardcd arkiv-dashboard -
Initialize a Node.js project. This command creates a
package.jsonfile.Terminal window npm init -ynpm pkg set type=module -
Install dependencies. Install the Arkiv SDK for blockchain interaction and
axiosto fetch data from the CoinGecko API.Terminal window npm install @arkiv-network/sdk viem axios -
Create project files. You need a backend directory for the data-fetching script, and a frontend directory for the dashboard.
Terminal window mkdir backend, frontendNew-Item backend\index.js, backend\.envNew-Item frontend\index.html, frontend\style.css, frontend\script.js, frontend\charts.js -
Add your private key. Open the
backend/.envfile 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.