Skip to main content

๐ŸŽ’ Setup

Project setupโ€‹

Create a new project in a fresh directory and navigate into it by running mkdir kilt-rocks && cd kilt-rocks.

The dependencies needed are the following:

Initialize the project and install dependencies.

npm init -y
npm install @kiltprotocol/sdk-js dotenv ts-node typescript

Project Folderโ€‹

Create the following remaining files and folders to end up with the folder structure below:

โ””โ”€ kilt-rocks/ # project
โ”œโ”€ attester/ # all attester code
โ”œโ”€ claimer/ # all claimer code
โ”œโ”€ verify.ts # all verifier code
โ””โ”€ .env # environment variables
mkdir attester claimer && touch verify.ts .env

PILT Tokensโ€‹

This workshop interacts with the Peregrine test blockchain, which requires you to pay for each transaction with Peregrine Kilt (PILT) tokens.

But don't worry. PILT tokens have no value, and you can request them from the faucet.

Blockchain Connectionโ€‹

Before using any SDK functionality, you must initialize and configure the Kilt SDK.

As this workshop uses the Peregrine Testnet you use its address whenever using the SDK to interact with the Kilt blockchain.

You do this by calling the following function:

await Kilt.connect({address})

Where address is the address of the full node you want to connect to, which for this workshop, is wss://peregrine.kilt.io.

For convenience, add the address to the .env file.

.env
WSS_ADDRESS=wss://peregrine.kilt.io

That's it for the basic setup - You're good to go!