This document outlines the steps required to set up your local development environment for the stellar_client project, which includes a Next.js frontend, Soroban smart contracts, and a TypeScript SDK.
Before you begin, ensure you have the following installed:
- Node.js: Version 18 or higher.
node -v
- pnpm: Version 8 or higher. This project uses
pnpmexclusively for package management.pnpm -v- If not installed, install with:
npm install -g pnpm - Do not use
npm installoryarn— doing so will create apackage-lock.jsonoryarn.lockthat conflicts with the monorepo setup and will fail CI.
- Rust: For compiling the Soroban smart contracts.
- Install
rustupby following instructions on rustup.rs. rustc --version
- Install
- Soroban CLI: Essential for interacting with Soroban smart contracts (e.g., building, testing, deploying).
- Follow the installation guide on the official Soroban documentation: Soroban CLI Setup
soroban version
Follow these steps to get the project up and running on your local machine.
First, clone the stellar_client repository to your local machine:
git clone git@github.com:Fundable-Protocol/stellar_client.git
cd stellar_clientNavigate to the project root and install the necessary dependencies for all workspaces using pnpm:
pnpm installThe Soroban smart contracts need to be built. Navigate to the contracts directory and build them:
cd contracts
cargo build --release
# Optionally, go back to the root
cd ..Alternatively, you can run the build:contracts script from the project root after pnpm install:
pnpm build:contractsOnce setup is complete, you can use the following commands for development:
To start the Next.js frontend application in development mode:
pnpm devThis will typically start the application on http://localhost:3000.
-
Build Contracts pnpm:
pnpm build:contracts
-
Build Contracts cargo:
cd contracts cargo build --release -
Run Contract Tests pnpm:
pnpm test:contracts
-
Run Contract Tests cargo:
cd contracts cargo test
The project is structured as a monorepo containing:
apps/web: The Next.js frontend application.contracts/: Soroban smart contracts written in Rust.payment-stream/: Contract for payment streaming.distributor/: Contract for token distribution.
packages/sdk: A TypeScript SDK for interacting with the deployed contracts.