activateMachine becomes the machine’s owner and pays its , so a fleet is built the other way round from Tokenomics 1.0: each machine signs its own activation with its own key, and your operator address is recorded as the machine’s DID controller. The operator then runs lifecycle, renewals, and DID updates for the whole fleet.
Rights in the machine-owned, operator-controlled model
Credits from renewals (bonding reward and voucher credit) land on the owner, even when the controller pays. Both parties should know this before onboarding.
Prerequisites
- Node.js ≥ 22 with
@peaqos/peaq-os-sdk0.8.0+ anddotenv(npm i @peaqos/peaq-os-sdk dotenv; the examples use top-levelawait, so run them as an ES module), or Python 3.10+ withpeaq-os-sdk0.8.0+ andpython-dotenv(pip install peaq-os-sdk python-dotenv), orpeaq-os-cli0.0.13+ - An operator wallet for gas (it signs nothing during activation, but signs later renewals and DID updates)
- Each machine wallet funded with its tier bond plus gas. The bond is quoted per tier at the daily oracle rate: preview one activation first and fund every machine to that amount plus a gas margin. The operator can fund machine wallets from the Gas Station (2FA-gated) for gas and top up the bond from any PEAQ-holding address.
- Environment variables configured per the install guide
.env via import "dotenv/config". Python’s from_env() reads from the shell, so export the file first with set -a && source .env && set +a or call load_dotenv().
From the terminal
The CLI does one machine per command.--for and --machine-key switch to machine-owned mode: the machine key signs and pays, and your configured signer (the PEAQOS_OWS_WALLET wallet or the PEAQOS_PRIVATE_KEY address) becomes controller.
Each --machine-key file holds one line: the machine’s 0x-prefixed 64-hex private key. To make one and print the address to pass to --for (the file is created readable only by your user and never overwritten):
--json --yes --skip-funding for scripts, after funding each machine wallet with its bond plus gas. Without --skip-funding, a machine wallet under 0.5 PEAQ makes the CLI enroll that machine’s address in the Gas Station and wait for an authenticator code, which --yes does not answer. If your signer is an OWS wallet, export OWS_PASSPHRASE too. Afterwards the operator manages every machine with peaqos machine ... (status, suspend, resume, subscription renew, DID setters). See CLI: activate and CLI: machine. --for and --machine-key are rejected with --chain solana: a machine homed on Solana is owned by its Solana owner wallet and linked to the peaq operator wallet that reserved it and paid its bond. See Onboard a machine on Solana.
Single machine, from code
1
Create the operator client
Used for funding, previews, and later management. It never signs an activation.
2
Generate a keypair for the machine
Each machine needs its own . Store the key on the device or in a secrets vault: it is the owner key of that machine’s NFT.
3
Fund the machine wallet
Gas from the Gas Station (2FA on the operator wallet), the bond from any PEAQ-holding address.
4
Build the machine client in Tokenomics mode
5
Activate with the operator as controller
controller is the operator address. The machine signs, owns the NFT, and pays the bond.6
Manage from the operator client
From here the operator client (constructed with the same
tokenomics20 deployment) runs the fleet. Renewals paid by the operator credit the owner.Batch activation
Activate machines sequentially; each iteration builds a machine client from that machine’s key and records the operator as controller. Persist every returned machine ID:MachineRegistry does not enumerate a fleet.
Key management
A shared owner key for every machine is possible under 2.0 (a wallet may own many machines), but that key can transfer each NFT and rotate each controller, so one leak exposes the whole fleet. Use
setMachineApprovalForAll / peaqos machine approve-all if a second address must be able to transfer the fleet’s NFTs.
Fleet queries
queryOperatorMachines / query_operator_machines lists the machines the MCR API holds for an operator DID (did:peaq:0x<operator address>). In Tokenomics mode the client reads that listing from https://mcr.peaq.xyz. For chain state, read each machine by ID from your own index (ops is the operator client from the “Manage from the operator client” step, fleet the index from the batch script):
Error handling
Full code tables on errors.
Fleets onboarded before Economics 2.0
Machines registered withregisterFor / register_for are Tokenomics 1.0 machines operated by the proxy: the proxy pays the bond and becomes proxy operator, while the Identity NFT is minted to the machine address. They keep working on a client constructed without tokenomics20. The fleet listing above covers Economics 2.0 machines only. peaq mirrors partner fleets into Economics 2.0 through the MachineMigrationHub; see Economics 2.0: legacy machines.
