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.
# peaq mainnet RPC. See /peaqos/install#public-rpc-endpoints for alternatives.PEAQOS_RPC_URL=https://peaq.api.onfinality.io/publicPEAQOS_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=0xb53Af985765031936311273599389b5B68aC9956IDENTITY_STAKING_ADDRESS=0x11c05A650704136786253e8685f56879A202b1C7EVENT_REGISTRY_ADDRESS=0x43c6AF2E14dc1327dc3cc6c7117D1CD72fffEcbAMACHINE_NFT_ADDRESS=0x2943F80e9DdB11B9Dd275499C661Df78F5F691F9DID_REGISTRY_ADDRESS=0x0000000000000000000000000000000000000800BATCH_PRECOMPILE_ADDRESS=0x0000000000000000000000000000000000000805# Optional. Defaults to http://127.0.0.1:8000PEAQOS_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.
What just happened
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.