Deploy Newton Protocol policies and data oracles to IPFS and on-chain using newton-cli
This guide walks through deploying your policy files to IPFS and registering them on-chain using newton-cli. By the end, you will have a deployed PolicyData contract, a deployed Policy contract, and a registered PolicyClient.
Before registering a PolicyClient, you need a deployed contract that inherits NewtonPolicyClient. Follow the Smart Contract Integration guide, then return here with your deployed contract address.
set-policy-params changes the policyId. Every call internally calls setPolicy(PolicyConfig) which re-registers with the Policy contract and returns a new policyId. Any previously recorded policyId becomes stale. Always verify the new policyId on-chain after updating params.
On-chain policy params must be flat JSON matching your params_schema.json. The gateway reads these bytes directly and passes them to Rego as data.params. Do not use the nested CLI format.
File
Purpose
Use With
policy_params.json
Template with VAULT_ADDRESS_PLACEHOLDER
Never use directly
policy_params_live.json
Nested CLI format with real vault address
Reference only
policy_params_onchain.json
Flat JSON matching the params schema
set-policy-params
If on-chain params are in the nested CLI format instead of flat JSON, policy evaluation fails with Missing required property during schema validation.