Skip to main content

Documentation Index

Fetch the complete documentation index at: https://docs.peaq.xyz/llms.txt

Use this file to discover all available pages before exploring further.

Install the SDK, generate a keypair, register a machine.
1

Install

pip install peaq-os-cli
npx @peaqos/skills add peaqos
Auto-detects Claude Code, Cursor, or Windsurf. Invoke /peaqos in Claude Code and it drives the whole flow below. To target a specific runtime, add --agent claude-code | cursor | windsurf — see the peaqOS AI page.
Full install reference on the install page.
2

Configure

Create a .env file:
# peaq mainnet RPC. See /peaqos/install#public-rpc-endpoints for alternatives.
PEAQOS_RPC_URL=https://peaq.api.onfinality.io/public
PEAQOS_PRIVATE_KEY=0x...

# Mainnet contracts auto-populated by fromEnv(); shown here for reference. Override only for custom deploys.
# For agung testnet addresses see /peaqos/install#agung-testnet-contracts.
IDENTITY_REGISTRY_ADDRESS=0xb53Af985765031936311273599389b5B68aC9956
IDENTITY_STAKING_ADDRESS=0x11c05A650704136786253e8685f56879A202b1C7
EVENT_REGISTRY_ADDRESS=0x43c6AF2E14dc1327dc3cc6c7117D1CD72fffEcbA
MACHINE_NFT_ADDRESS=0x2943F80e9DdB11B9Dd275499C661Df78F5F691F9
DID_REGISTRY_ADDRESS=0x0000000000000000000000000000000000000800
BATCH_PRECOMPILE_ADDRESS=0x0000000000000000000000000000000000000805

# Optional. Defaults to http://127.0.0.1:8000
PEAQOS_MCR_API_URL=https://mcr.peaq.xyz
Mainnet contract addresses (identity, staking, event, NFT, DID, batch) populate automatically with PeaqosClient.fromEnv(), so you don’t need to set them manually. See the environment variables table for the full list and the public RPC endpoints section for QuickNode primary plus OnFinality/PublicNode fallbacks.
3

Register

import "dotenv/config";
import { PeaqosClient } from "@peaqos/peaq-os-sdk";

const client = PeaqosClient.fromEnv();

// Register the client's own wallet as a new machine.
// The call sends the minimum bond (1 PEAQ) with the transaction.
const machineId = await client.registerMachine();

console.log("Registered machine ID:", machineId);
Proxy operators register machines on behalf of another wallet. See the self-managed and proxy operator guides for the fleet flow with registerFor.
  • PeaqosClient.fromEnv() bound the signing key from PEAQOS_PRIVATE_KEY and loaded contract addresses from the environment.
  • registerMachine sent 1 PEAQ as msg.value, registered the identity in IdentityRegistry, and returned the newly assigned machine ID.
  • The machine ID is the handle for every downstream call: minting the Machine NFT (mintNft), writing DID attributes, submitting events, and MCR queries.

Next

Self-managed onboarding

Owner = operator. One machine, one wallet.

Proxy operator fleet

One owner, many machines, registerFor.