Prerequisites
- Node.js ≥ 22 with
@peaqos/peaq-os-sdk0.7.0+, or Python 3.10+ withpeaq-os-sdk0.7.1+ - A funded holding the tier plus . The bond is quoted per tier at the oracle rate (Entry quoted 0.803 PEAQ on mainnet on 2026-09-04 at 20:20 UTC; the figure moves with the daily oracle price); preview it before you fund. On peaq, bond and gas come out of the same PEAQ balance.
- Environment variables configured per the install guide
Prefer the terminal?
peaqos init then peaqos activate ... --dry-run does everything on this page in two commands. See CLI: activate.Environment setup
.env
peaq-mainnet or agung-2026-08-28) in code and the SDK verifies its addresses against InfoDesk.peer(role) on chain.
JS examples load the file 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().Full flow
1
Initialize a client from the environment
fromEnv reads the required variables. Throws ValidationError if any is missing.2
Generate a keypair (optional)
If the machine does not already have a wallet, generate one. Local operation, no chain interaction.If the machine already has a funded wallet, skip to step 6 and build the machine client with that key.
3
Set up 2FA on the owner wallet
The requires 2FA before it funds any address.
4
Confirm 2FA
5
Fund the machine wallet
Request initial gas from the Gas Station. The faucet funds the wallet or skips if the balance already suffices. The faucet covers gas, not the bond: top up the bond from any PEAQ-holding address after you have previewed the quote in step 7.
6
Build the machine client in Tokenomics mode
The machine’s own key signs the activation, so the machine becomes owner, payer, and controller. Passing
tokenomics20 selects the Economics 2.0 deployment.7
Preview the activation
The preview runs every check the activation runs (chain, contracts, peers, price, balance, allowance) without signing or spending. Use it to see the bond, any voucher credit, and the net PEAQ you must hold.If
balance is below netPeaqAmount plus gas, top up the machine wallet now.8
Activate
One transaction. The SDK approves exactly the net amount to The machine now has a peaqID (
MachineSubscription if needed, re-quotes, simulates, submits once, then requires the three receipt events and a matching on-chain state before returning.did:peaq:<machine id>), its Machine NFT (token ID equals the machine ID), and a tier bond. Confirm with getMachineActivationState / get_machine_activation_state: subscription.periodStart != 0 means activated (tier 0 is a valid tier, so never test the tier).Error handling
Full code tables on errors.
What the machine receives
- peaqID
did:peaq:<machine id>with the DID document you supplied (verification methods, authentication, service endpoints) - Machine NFT in
MachineRegistry, token ID equal to the machine ID - Subscription on the chosen tier for 365 days, bonded in PEAQ; renew before the 14-day grace and 14-day runoff windows end. See Economics 2.0
- Home chain record on peaq
- Gas Station funding (if requested)
Machines onboarded before Economics 2.0
registerMachine / register_machine, mintNft, and writeMachineDIDAttributes still work on a client constructed without tokenomics20 and still address the Tokenomics 1.0 contracts (1 PEAQ native bond, separate Machine NFT). They emit deprecation warnings and throw in Tokenomics mode. Use them only to maintain machines onboarded before 2026-09-01. See Activate: legacy flow.
