@peeramid-labs/sdk
v2.0.3
Published
Peeramid Labs js client library
Downloads
288
Readme
SDK
This is SDK for use with Rankify game. You can ease interaction with smart contracts.
Prerequisites
Before setting up the local development environment, ensure you have the following installed:
Node.js and pnpm
# Using homebrew brew install node npm install -g pnpm
Foundry (for Anvil)
curl -L https://foundry.paradigm.xyz | bash foundryup
tmux
# Using homebrew brew install tmux
Local Development Setup
To set up your local development environment:
Create your environment file:
cp .env.example .env
Then edit
.env
to set your local repository paths.Set the required environment variables:
export RANKIFY_CONTRACTS_PATH="/path/to/rankify/contracts" export EDS_PATH="/path/to/eds" export MULTIPASS_PATH="/path/to/multipass"
Make the setup script executable:
chmod +x scripts/setup-local-dev.sh
Run the setup script:
source .env && ./scripts/setup-local-dev.sh
This will:
- Start a local Anvil development network in a tmux session (or use existing one if running)
- Install dependencies for all repositories
- Run local deployment scripts (
playbook/utils/deploy-to-local-anvil.sh
) in each repository - Set up local pnpm links between packages
The script uses a fixed mnemonic for consistent addresses across runs.
Managing Anvil
- View Anvil logs:
tmux attach -t anvil
- Detach from logs: Press
Ctrl+B
thenD
- Stop Anvil:
tmux kill-session -t anvil
Documentation
The SDK comes with comprehensive API documentation generated using TypeDoc. The documentation is automatically generated during the package build process and is included in the npm package.
Generating Documentation
To generate the documentation locally:
pnpm run docs
This will create a docs
directory with the generated documentation.
For development, you can use the watch mode:
pnpm run docs:watch
Accessing Documentation
- Local Development: Open
docs/index.html
in your browser after generating the documentation - Published Package: Documentation is available through the npm package page