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.7.0+, or Python 3.10+ withpeaq-os-sdk0.7.1+, orpeaq-os-cli0.0.8+ onpeaq-os-sdk0.7.1+ - 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 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
JS examples load
.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, your PEAQOS_PRIVATE_KEY address becomes controller.
--json --yes for scripts. Afterwards the operator manages every machine with peaqos machine ... (status, suspend, resume, subscription renew, DID setters). See CLI: activate and CLI: machine.
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: there is no on-chain fleet index in 2.0 yet (the 1.0machines DID attribute and GET /operator/{did}/machines do not cover 2.0 machines).
Key management
A single shared key for every machine is not possible under 2.0: each machine ID maps to one owner, and a wallet may own many machines, but the machine’s DID controller and owner are what the SDK checks. Use
setMachineApprovalForAll / peaqos machine approve-all if a second address must be able to transfer the fleet’s NFTs.
Fleet queries
The 1.0 fleet listing (GET /operator/{did}/machines, built on the proxy’s machines DID attribute) does not know 2.0 machines. Read 2.0 machines by ID from your own index:
Error handling
Full code tables on errors.
Fleets onboarded before Economics 2.0
Machines registered withregisterFor / register_for before 2026-09-01 are Tokenomics 1.0 machines owned by the proxy. They keep working on a client constructed without tokenomics20 and through the 1.0 MCR API (GET /operator/{did}/machines). peaq mirrors partner fleets into Economics 2.0 through the MachineMigrationHub; see Economics 2.0: legacy machines.
