Skip to main content

Prerequisites

Before you begin, ensure you have the following installed on your system:

Node.js

Version 18 or higher recommended

pnpm

Fast, disk space efficient package manager

MetaMask

Or another Web3 wallet for blockchain interactions

Git

For cloning the repository

Installing Prerequisites

Download and install Node.js from nodejs.org. We recommend using the LTS version.Verify installation:
MetaVault AI uses pnpm as its package manager. Install it globally:
Verify installation:
Install the MetaMask browser extension from metamask.io.You’ll need this to interact with the vault through the frontend.

Repository Structure

MetaVault AI is a monorepo containing three main packages:
Each package can be developed independently, but they work together to form the complete MetaVault AI system.

Initial Setup

1

Clone the Repository

Clone the MetaVault AI repository to your local machine:
2

Install Dependencies

Install all dependencies for the entire monorepo:
This command will:
  • Install root-level dependencies
  • Install dependencies for all packages (contracts, frontend, agents)
  • Set up workspace links between packages
The installation uses pnpm workspaces, which efficiently manages dependencies across the monorepo and creates symlinks between packages.
3

Configure Smart Contracts

Navigate to the contracts package and set up environment variables:
Edit .env and add your configuration:
Never commit your .env file or share your private key. Use a test wallet with no real funds for development.
4

Configure AI Agents

Navigate to the agents package and set up environment variables:
Edit .env and configure the following:
You’ll need to obtain an OpenRouter API key from openrouter.ai to run the AI agents. Contract addresses will be populated after deploying the contracts.
5

Configure Frontend

Navigate to the frontend package and set up environment variables:
Edit .env.local:
6

Compile Contracts

Return to the contracts directory and compile the smart contracts:
Or from the root:
This will generate TypeScript types and compile all Solidity contracts.

Verify Installation

To verify your setup is complete, run these checks:
Should compile without errors.

Tech Stack Overview

Smart Contracts

  • Solidity 0.8.28
  • Hardhat 2.26.5
  • OpenZeppelin 5.4.0

Frontend

  • Next.js 14
  • TypeScript 5.5
  • Wagmi & Viem
  • Tailwind CSS

AI Agents

  • ADK-TS 0.5.7
  • Express 5.2.1
  • TypeScript 5.9
  • node-cron 4.2.1

Common Issues

Make sure pnpm is installed globally:
Check your Node.js version:
Update to Node.js 18 or higher if needed.
Try cleaning and reinstalling:
If ports 3000, 3001, 3002, or 8545 are already in use, you can:
  • Change the ports in your .env files
  • Kill the process using the port
  • Use different port numbers in your configuration

Next Steps

Now that your environment is set up, you can:

Run Locally

Learn how to run the full stack locally

Testing Guide

Run tests and verify functionality