Installation Guides

Installation Guides - Complete Setup Instructions

This document provides comprehensive installation instructions for all Roru SDK implementations across different platforms and languages.

Prerequisites

General Requirements

  • Beta Access: Roru SDK is currently in beta. You need to register and get approved through the Roru Labs portal.

  • API Key: Obtain your API key from the portal after approval.

  • Network Access: Access to Roru infrastructure endpoints (provided in portal).

System Requirements

Minimum:

  • 2GB RAM

  • 100MB disk space

  • Network connectivity

Recommended:

  • 4GB+ RAM

  • 500MB+ disk space

  • Stable network connection

Rust SDK

Installation

Using Cargo (Recommended):

Add to your Cargo.toml:

[dependencies]
roru-sdk = { version = "0.1.0", features = ["default"] }
tokio = { version = "1.0", features = ["full"] }

Install:

cargo add roru-sdk

Features

Enable specific features as needed:

[dependencies]
roru-sdk = { 
    version = "0.1.0",
    features = [
        "default",      # Core functionality
        "async",        # Async/await support
        "wasm",         # WebAssembly support
        "hardware",     # Roru One integration
    ]
}

Quick Start

use roru_sdk::prelude::*;

#[tokio::main]
async fn main() -> Result<()> {
    let client = RoruClient::new(ClientConfig::default()).await?;
    // Use client...
    Ok(())
}

Building from Source

git clone https://github.com/roru-labs/sdk-rust
cd sdk-rust
cargo build --release

TypeScript/JavaScript SDK

Installation

npm:

npm install @roru/sdk

yarn:

yarn add @roru/sdk

pnpm:

pnpm add @roru/sdk

Browser Usage

<script src="https://cdn.roru.labs/sdk/v0.1.0/roru-sdk.min.js"></script>
<script>
    const client = new Roru.RoruClient({
        infraEndpoint: 'https://infra.roru.labs'
    });
</script>

Node.js Usage

const { RoruClient } = require('@roru/sdk');

const client = new RoruClient({
    infraEndpoint: 'https://infra.roru.labs'
});

TypeScript Usage

import { RoruClient, ClientConfig } from '@roru/sdk';

const config: ClientConfig = {
    infraEndpoint: 'https://infra.roru.labs',
    apiKey: process.env.RORU_API_KEY,
};

const client = new RoruClient(config);

Webpack Configuration

// webpack.config.js
module.exports = {
    resolve: {
        fallback: {
            "crypto": require.resolve("crypto-browserify"),
            "stream": require.resolve("stream-browserify"),
        }
    }
};

Python SDK

Installation

pip:

pip install roru-sdk

pip with specific version:

pip install roru-sdk==0.1.0

From source:

git clone https://github.com/roru-labs/sdk-python
cd sdk-python
pip install -e .

Virtual Environment

python -m venv venv
source venv/bin/activate  # On Windows: venv\Scripts\activate
pip install roru-sdk

Requirements

Create requirements.txt:

roru-sdk>=0.1.0
asyncio
aiohttp>=3.8.0

Install:

pip install -r requirements.txt

Usage

import asyncio
from roru_sdk import RoruClient

async def main():
    client = RoruClient(
        infra_endpoint="https://infra.roru.labs"
    )
    # Use client...

asyncio.run(main())

Go SDK

Installation

go get:

go get github.com/roru-labs/sdk-go

go mod:

module your-module

go 1.21

require github.com/roru-labs/sdk-go v0.1.0

Then run:

go mod tidy

Usage

package main

import (
    "context"
    "github.com/roru-labs/sdk-go"
)

func main() {
    client := roru.NewClient(roru.Config{
        InfraEndpoint: "https://infra.roru.labs",
    })
    // Use client...
}

Swift SDK (iOS/macOS)

Swift Package Manager

Add to Package.swift:

dependencies: [
    .package(url: "https://github.com/roru-labs/sdk-swift", from: "0.1.0")
]

Or in Xcode:

  1. File → Add Packages

  2. Enter: https://github.com/roru-labs/sdk-swift

  3. Select version: 0.1.0

CocoaPods

Add to Podfile:

pod 'RoruSDK', '~> 0.1.0'

Install:

pod install

Usage

import RoruSDK

let client = RoruClient(config: ClientConfig(
    infraEndpoint: "https://infra.roru.labs"
))

C Bindings

Installation

Linux/macOS:

git clone https://github.com/roru-labs/sdk-c
cd sdk-c
mkdir build && cd build
cmake ..
make
sudo make install

Windows:

git clone https://github.com/roru-labs/sdk-c
cd sdk-c
mkdir build && cd build
cmake .. -G "Visual Studio 16 2019"
cmake --build . --config Release

Linking

CMake:

find_package(roru_sdk REQUIRED)
target_link_libraries(your_target roru_sdk)

pkg-config:

pkg-config --cflags --libs roru-sdk

Usage

#include <roru_sdk.h>

int main() {
    roru_client_t* client = roru_client_new("https://infra.roru.labs");
    // Use client...
    roru_client_free(client);
    return 0;
}

Configuration

Environment Variables

Set these environment variables:

export RORU_INFRA_ENDPOINT="https://infra.roru.labs"
export RORU_API_KEY="your-api-key"
export RORU_NETWORK_ID="mainnet"  # or "testnet"

Configuration File

Create roru.config.json:

{
    "infraEndpoint": "https://infra.roru.labs",
    "apiKey": "your-api-key",
    "networkId": "mainnet",
    "stateCachePath": "./.roru/state",
    "keyStoragePath": "./.roru/keys"
}

Load in code:

let config = ClientConfig::from_file("roru.config.json")?;

Verification

Test Installation

Rust:

cargo test --package roru-sdk

TypeScript:

npm test

Python:

python -m pytest tests/

Quick Verification

Create a test file:

Rust (test.rs):

use roru_sdk::prelude::*;

#[tokio::main]
async fn main() -> Result<()> {
    let client = RoruClient::new(ClientConfig::default()).await?;
    let root = client.get_state_root().await?;
    println!("State root: {:?}", root);
    Ok(())
}

TypeScript (test.ts):

import { RoruClient } from '@roru/sdk';

async function test() {
    const client = new RoruClient({
        infraEndpoint: 'https://infra.roru.labs'
    });
    const root = await client.getStateRoot();
    console.log('State root:', root);
}

test();

Troubleshooting

Common Issues

Network Connection Errors:

  • Verify API key is correct

  • Check network connectivity

  • Ensure endpoint URL is correct

Build Errors:

  • Update to latest SDK version

  • Check compiler version requirements

  • Verify dependencies are installed

Runtime Errors:

  • Check configuration

  • Verify API key permissions

  • Review error messages

Getting Help

  • Documentation: https://docs.roru.labs

  • GitHub Issues: https://github.com/roru-labs/sdk-{language}/issues

  • Discord: https://discord.gg/roru-labs

Next Steps

After installation:

  1. Get API Key: Register at Roru Labs portal

  2. Configure Client: Set up configuration

  3. Create Wallet: Initialize your first wallet

  4. Read Tutorials: Check getting started guides

  5. Explore Examples: Review code examples

Conclusion

The SDK installation is straightforward across all platforms. Choose the language that best fits your project and follow the platform-specific instructions above.

Last updated