Skip to main content

Installation

Set up your development environment to build on VIDDHANA.

Prerequisites

Ensure you have the following installed:

ToolVersionPurpose
Node.js>= 18.0JavaScript runtime
pnpm/npmLatestPackage manager
Git>= 2.0Version control
Docker>= 24.0Container runtime (optional)

Install Node.js

# Using nvm (recommended)
curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.0/install.sh | bash
nvm install 18
nvm use 18

# Verify installation
node --version # v18.x.x

Install the SDK

JavaScript / TypeScript

# Using npm
npm install @viddhana/sdk

# Using pnpm
pnpm add @viddhana/sdk

# Using yarn
yarn add @viddhana/sdk

Python

pip install viddhana

Network Configuration

Add VIDDHANA networks to your configuration:

Mainnet

PropertyValue
Network NameVIDDHANA Atlas
RPC URLhttps://rpc.viddhana.com
Chain ID13370
Currency SymbolVDH
Block Explorerhttps://scan.viddhana.com

Testnet (Local Development)

PropertyValue
Network NameVIDDHANA Testnet
RPC URLhttp://localhost:8545
Chain ID1337
Currency SymbolVDH

Deployed Contract Addresses

Testnet (Chain ID: 1337)

ContractAddress
VDH Token0x384B37ab47B51f13D32fc2C19ea97147eC89fCD4
VaultManager0xdC503c4E0F865C2cF198528354A8BCD19ffAF3F5
PolicyEngine0xCD375A9355f765990b3f030B71C316e52a5353d2
VDHGovernance0xAF53F4F1feAbea3aA9030b38Cac6dB68691BfD03

Wallet Setup

MetaMask Configuration

  1. Open MetaMask and click on the network dropdown
  2. Select "Add Network" → "Add a network manually"
  3. Enter the network details from the table above
  4. Click "Save"

Programmatic Configuration

import { ViddhanaClient } from '@viddhana/sdk';

const client = new ViddhanaClient({
rpcUrl: 'https://rpc.viddhana.com',
chainId: 13370,
});

API Endpoints

ServiceURLDescription
RPChttps://rpc.viddhana.comBlockchain JSON-RPC
APIhttps://api.viddhana.comREST & JSON-RPC API
Docshttps://docs.viddhana.comDocumentation
Explorerhttps://scan.viddhana.comBlock Explorer

Verify Installation

Test your setup with a simple script:

import { ethers } from 'ethers';

async function main() {
const provider = new ethers.JsonRpcProvider('https://rpc.viddhana.com');

const blockNumber = await provider.getBlockNumber();
console.log('Current block:', blockNumber);

const network = await provider.getNetwork();
console.log('Chain ID:', network.chainId);
}

main().catch(console.error);

Using curl

# Check API health
curl https://api.viddhana.com/health

# Get chain info
curl -X POST https://api.viddhana.com/rpc \
-H "Content-Type: application/json" \
-d '{"jsonrpc":"2.0","id":1,"method":"atlas_getChainInfo","params":[]}'

Docker Setup (Optional)

Run a complete VIDDHANA development stack:

# Clone repository
git clone https://github.com/viddhana/viddhana.git
cd viddhana

# Start all services
docker-compose up -d

# Check status
docker-compose ps

Services Started

ServicePortDescription
Blockchain Node8545Local RPC endpoint
API Server4000REST & JSON-RPC API
Block Explorer15000Transaction explorer
PostgreSQL5432Database
Redis6379Cache

Hardhat Configuration

Example hardhat.config.ts for VIDDHANA:

import { HardhatUserConfig } from "hardhat/config";
import "@nomicfoundation/hardhat-toolbox";
import * as dotenv from "dotenv";

dotenv.config();

const config: HardhatUserConfig = {
solidity: "0.8.20",
networks: {
viddhana: {
url: "https://rpc.viddhana.com",
chainId: 13370,
accounts: process.env.PRIVATE_KEY ? [process.env.PRIVATE_KEY] : [],
},
localhost: {
url: "http://localhost:8545",
chainId: 1337,
},
},
};

export default config;

Troubleshooting

Common Issues

Node.js version mismatch

nvm use 18

Connection refused

  • Ensure the RPC endpoint is accessible
  • Check firewall settings
  • Verify RPC URL is correct

Transaction failed

  • Check account has sufficient VDH for gas
  • Verify contract address is correct
  • Ensure correct network is selected

Invalid chain ID

  • Mainnet: 13370
  • Testnet: 1337

Next: Quickstart Guide