Skip to main content

Setup Ika Localnet

🚧 Under Construction 🚧
This SDK is still in an experimental phase. We advise you use the SDK with localnet.

Prerequisites​

Before setting up the Ika localnet, ensure you have the following software installed on your system:

The programming language and toolchain required to build Ika

Quick install:
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh

The command-line interface for interacting with Sui blockchain

Recommended for macOS and Linux users

brew install sui

Clone the Ika Repository​

First, you need to clone the Ika repository to your local machine. This will download all the necessary source code and configuration files.

git clone https://github.com/dwallet-labs/ika.git
cd ika

Start the Sui Localnet​

The Ika localnet depends on a running Sui localnet instance. This command starts a local Sui blockchain with a faucet for testing purposes.

RUST_LOG="off,sui_node=info" sui start --with-faucet --force-regenesis --epoch-duration-ms 1000000000000000

Parameters explained:

  • --with-faucet: Enables the faucet service for obtaining test tokens
  • --force-regenesis: Forces a new genesis block creation
  • --epoch-duration-ms 1000000000000000: Sets a very long epoch duration for testing

Start the Ika Localnet​

Once the Sui localnet is running, you can start the Ika localnet in a separate terminal. This will launch the Ika node that connects to the Sui localnet.

cargo run --bin ika --release --no-default-features -- start

Parameters explained:

  • --bin ika: Specifies which binary to run from the workspace (the main Ika node executable)
  • --release: Builds and runs the binary with optimizations enabled for better performance
  • --no-default-features: Disables default Cargo features to run only the core functionality needed for localnet, for example removes min 16 cpu cores requirement
  • start: Command passed to the Ika binary to initialize and start the local node