System Requirements
Before you begin, ensure your system meets these requirements:- Operating System: macOS, Linux, or WSL2 on Windows
- Node.js: Version 16 or higher
- Memory: At least 4GB RAM available
- Disk Space: 2GB free space for tools and dependencies
Step 1: Install Node.js
The SDK requires Node.js version 16 or higher for package management and development tools.- macOS
- Linux
- Windows (WSL2)
Step 2: Install dfx (Internet Computer SDK)
dfx is the command-line tool for developing on the Internet Computer. The SDK requires dfx version 0.14 or higher.
Add dfx to your PATH
The installer typically adds dfx to your PATH automatically. If not, add this to your Then reload your shell configuration:
~/.bashrc or ~/.zshrc:For more installation options and troubleshooting, see the official dfx installation guide.
Step 3: Clone the Repository
Clone the OpenChat Bot SDK repository:Step 4: Install Dependencies
The SDK uses both npm and Mops (Motoko Package Manager) for dependencies.Install npm packages
Install Node.js development dependencies:This installs:
ic-mops: Motoko package managermo-dev: Live reload development servernpm-run-all: Script runnerprettierandprettier-plugin-motoko: Code formatting
Install Mops packages
Mops packages are automatically installed via the This installs Motoko dependencies from
postinstall script, but you can also run manually:mops.toml:base: Motoko base librarymap: Efficient map data structuretime-consts: Time constantsprng: Pseudo-random number generatordatetime: Date and time utilities
Step 5: Set Up Local Development Environment
Configure your local Internet Computer replica for development:Start the local replica
Start a local Internet Computer replica in the background:The
--clean flag starts with a fresh state, and --background runs it in the background.Create and deploy canisters
Create canisters and deploy them to your local replica:This command:
- Installs all dependencies
- Creates canister IDs
- Generates type bindings
- Deploys canisters to the local replica
Step 6: Verify Installation
Verify everything is working correctly:getBotStatus:
Project Structure
After installation, your project should look like this:Configuration Files
dfx.json
Thedfx.json file defines your canisters:
mops.toml
Themops.toml file defines Motoko dependencies:
Environment Variables
After runningdfx deploy, dfx generates a .env file with canister IDs:
Optional: Install Candid UI
For visual inspection and testing of your canister interfaces:Troubleshooting
dfx: command not found
dfx: command not found
Ensure dfx is in your PATH. Add to your shell configuration:Then reload:
source ~/.bashrcMops packages fail to install
Mops packages fail to install
Ensure you have internet connectivity and try:
Canister deployment fails
Canister deployment fails
Stop and restart dfx:
Port 4943 already in use
Port 4943 already in use
dfx is already running. Either use the existing instance or stop it:
Next Steps
Quickstart
Deploy your first bot and send a message
Bot Architecture
Understand the SDK’s module structure
Bot Initialization
Learn how to register and configure your bot
API Reference
Explore the complete API documentation