Skip to main content
Once you have all prerequisites installed, you can install Rainbow’s dependencies and run the setup script.

Quick Install

The recommended installation process:
# Install JavaScript dependencies and run setup
yarn install && yarn setup
This runs:
  1. yarn install - Installs all npm dependencies
  2. yarn setup - Runs GraphQL codegen, design system setup, and fetches network configs

What the Setup Does

The yarn setup command runs several initialization tasks:
1

GraphQL Codegen Install

Installs dependencies for the GraphQL codegen workspace:
cd src/graphql && yarn install
2

Design System Install

Installs dependencies for the design system docs:
cd src/design-system/docs && yarn install
3

Generate GraphQL Types

Generates TypeScript types from GraphQL schemas:
yarn graphql-codegen
4

Fetch Network Configs

Downloads backend network configurations:
yarn fetch:networks
The setup script is defined in package.json as:
"setup": "yarn graphql-codegen:install && yarn ds:install && yarn graphql-codegen && yarn fetch:networks"

Postinstall Script

When you run yarn install, a postinstall script automatically runs:
./scripts/postinstall.sh
This script:
  • Generates native build configurations
  • Patches the iOS GoogleService-Info.plist with your API key from .env
  • Runs prebuild hooks from rainbow-scripts (internal developers only)
For internal developers: ensure .env and rainbow-scripts are set up before running yarn install.

Full Installation Options

Depending on your platform, you may want different installation commands:
# Standard install (recommended)
yarn install && yarn setup

Installation Commands Reference

CommandDescription
yarn installInstall npm dependencies
yarn setupRun GraphQL codegen and fetch configs
yarn install-allInstall everything including CocoaPods with repo update
yarn fastInstall everything with fast CocoaPods (no repo update)
yarn install-all-no-flipperInstall without Flipper debugger

Platform-Specific Setup

After the base installation, you need to configure your target platform(s):

iOS Setup

Install Xcode, Watchman, and CocoaPods for iOS development

Android Setup

Set up JDK 17, Android Studio, and Android SDK

Verify Installation

After installation completes, verify everything is set up correctly:
1

Check for node_modules

ls -la node_modules/
You should see thousands of installed packages.
2

Verify GraphQL codegen

ls -la src/graphql/src/__generated__/
Generated GraphQL types should exist.
3

Run linting

yarn lint:ts
TypeScript should compile without errors.

CI Installation

For continuous integration environments, use the CI setup script:
./scripts/setup-ci.sh
This is optimized for CI and skips interactive steps.

Updating Dependencies

Update JavaScript Packages

# Update all dependencies
yarn install

# Update a specific package
yarn add package-name@latest

Update iOS Pods

# Full update with repo refresh
yarn install-pods

# Fast update (no repo refresh)
yarn install-pods-fast

Update Android Dependencies

Android dependencies are managed in android/app/build.gradle and sync automatically when opening Android Studio.

Cleaning & Reinstalling

If you encounter issues, you may need to clean and reinstall:
Nuclear option - removes everything and reinstalls:
./scripts/nuke.sh
This removes:
  • node_modules/
  • iOS build artifacts and pods
  • Android build artifacts
  • Metro bundler cache
  • Gradle cache

Environment Variables

Key environment variables in your .env file:
# Testing mode (enables test-only features)
IS_TESTING=false

# Enable developer mode
ENABLE_DEV_MODE=1

# Design system playground
ENABLE_DESIGN_SYSTEM_PLAYGROUND=false

# Disable Reanimated (for debugging)
DISABLE_REANIMATED=NO

# API keys
ETHERSCAN_API_KEY=your_key_here
GOOGLE_SERVICE_API_KEY=your_key_here
IMGIX_DOMAIN=your_domain_here
IMGIX_TOKEN=your_token_here

# RPC endpoints
ETHEREUM_MAINNET_RPC=your_rpc_url
POLYGON_MAINNET_RPC=your_rpc_url
ARBITRUM_MAINNET_RPC=your_rpc_url
OPTIMISM_MAINNET_RPC=your_rpc_url

Troubleshooting

If the postinstall script fails, you can run it manually:
./scripts/postinstall.sh
For internal developers, ensure rainbow-scripts is cloned and .env exists.
If GraphQL codegen fails, try running it manually:
yarn graphql-codegen
You may need to set up the Graph ENS key:
./scripts/graph-ens-key.sh
Yarn 4 uses Zero-Installs with PnP, which should be fast. If it’s slow:
  1. Check your network connection
  2. Clear yarn cache: yarn cache clean
  3. Try again: yarn install
Some native modules may fail to build. Ensure you have:
  • Xcode Command Line Tools (macOS): xcode-select --install
  • Python 3 installed
  • Correct Node.js version (22+)

Next Steps

With dependencies installed, continue to platform-specific setup:

iOS Setup

Configure Xcode and CocoaPods for iOS development

Android Setup

Set up Android Studio and SDK for Android development

Build docs developers (and LLMs) love