Deploy Application Contract
Deploy the oracle contract that receives and verifies price feeds. The enclave registry is already deployed on-chain — when you publish the Demo package, it automatically links to the existing registry.
Configure Sui CLI
Make sure you're connected to the right network:
# Check current environment
sui client active-env
# Switch to testnet if needed
sui client switch --env testnet
Build and Publish
Navigate to the Demo contracts directory and publish:
cd contracts/Demo
sui move build
sui client publish
Save Object IDs
The publish transaction outputs several object IDs. You need to save three of them:
| Object | Description |
|---|---|
| DEMO_PACKAGE_ID | The published package address |
| ORACLE_ID | Shared PriceOracle object |
| ADMIN_CAP_ID | Owned AdminCap capability for admin operations |
Look for these in the transaction output.
tip
Save these IDs somewhere accessible - you'll need them for PCR configuration and price updates.
Export them as environment variables for convenience:
export DEMO_PACKAGE_ID=0x...
export ORACLE_ID=0x...
export ADMIN_CAP_ID=0x...
Update Expected PCRs
Configure the oracle with the PCR values of the enclave you trust:
# Get PCR values from the enclave attestation
oyster-cvm verify --enclave-ip $PUBLIC_IP
# Update the oracle's expected PCRs
sui client call \
--package $DEMO_PACKAGE_ID \
--module oyster_demo \
--function update_expected_pcrs \
--args $ORACLE_ID $ADMIN_CAP_ID 0x<PCR0> 0x<PCR1> 0x<PCR2> 0x<PCR16> \
--gas-budget 10000000
This tells the contract which enclave configurations to trust when verifying price updates.