Integrate ioID in your cloud
A "Proxy Contract" Approach
In scenarios where a DePIN project cannot integrate ioID directly into their device’s firmware, this approach enables the project’s cloud to manage ioID registration and message signing on behalf of the devices. In this setup, a “Proxy ioID Contract” serves as an intermediary between the project’s cloud and ioID contracts. The cloud acts as a “trusted entity” within the proxy contract, authorizing on-chain ioID registrations and binding them to the actual device owner.
Ensure you followed the initial steps to register your Project on the IoTeX chain.
Ensure you have development tools like git and nodejs installed
Deploy the ioID Proxy Contract
Deploy using Hardhat
If you haven’t already, clone the ioID-contracts repository:
git clone https://github.com/iotexproject/ioID-contracts
cd ioID-contracts && npm install
Export the private key for deploying the ioID Proxy contract.
This account will control your ioID proxy contract, particularly for setting the “Verifier” address. The “Verifier” is typically your service account responsible for managing ioID registrations on behalf of the devices on the cloud side
Ensure you use a dedicated wallet account as the owner of your ioID Proxy contract. Whenever possible, consider using a hardware wallet for enhanced security on mainnet.
export PRIVATE_KEY=0x
Export the ioID Store and Project Registry contract addresses (check the repository on GitHub for updated addresses):
export IOID_STORE=0x60cac5CE11cb2F98bF179BE5fd3D801C3D5DBfF2
export PROJECT_REGISTRY=0x060581AA1A4e0cC92FBd74d251913238De2F13cd
Deploy your ioID Proxy contract with:
npx hardhat run scripts/deploy-proxy.ts --network testnet
Deploy using the ioID Web Tools
Developers can also deploy an ioID proxy contract and manage it interactively on the IoTeX Hub:
Browse the ioID Web Tools on the IoTeX Hub
Select the Advanced tab:
Click the
Deploy VerifyingProxy Contract
button to deploy a new Proxy contract, orClick the
Import VerifyingProxy Address
button to import an already deployed ProxyProvice the required information then click
Confirm
Interact with the Proxy contract
Here is an example repository that shows how to generate ioIDs for your devices in the cloud and how to register them on-chain through the Proxy contract:
Last updated
Was this helpful?