Skip to main content

Add chain contracts

A Gora app can be off-chain only, but many apps also need a chain contract, gateway, program, or smart wallet. Use a chain contract when you need to:
  • verify a Gora result or attestation on-chain
  • hold app state
  • execute transfers or callbacks
  • enforce replay protection
  • connect mobile/user signatures to chain execution

Key rule

gora deploy deploys your Gora app package. It does not deploy Base contracts, Solana programs, or Algorand applications. Use gora contract ... for chain contract metadata:
Then deploy the app package:

Local developer vs node operator

If you are developing from your local computer, prefer --node:
This asks the Gora testnet node for already deployed chain metadata and records it locally. Live endpoints and deployed contract IDs are listed in Connect to the testnet. If you are the node operator on the VM, you may deploy directly using local chain files and tools, such as Algorand --datadir.

Contract metadata endpoint

The Gora node exposes chain metadata at:
Only Algorand contract flows are live on the public testnet today; the base and solana entries report their local-devnet status. Example Algorand response (live testnet values — gateway app 767488273):
Algorand testnet algod is public and needs no token (token_included: false). The CLI uses the same endpoint when you run gora contract deploy --node ....

Diagnose setup

Run doctor before deploying:
Doctor checks local source/build/deploy receipts and remote contract metadata when a node URL is provided.

Base/EVM

Build metadata:
Resolve the gateway or contract address from a node:
The separate Gora Base gateway is not deployed, so this metadata lookup returns needs_deployment. Base Sepolia staking and managed-agent app writes are live; deploy your own app contract and follow the Base/Solana quickstart.
Or record a known address manually (local-devnet values shown):
Link it into the manifest:

Solana

Build metadata and default source scaffold:
Resolve the program id from a node:
The separate Gora Solana gateway is not deployed, so this metadata lookup returns needs_deployment. Solana devnet staking and managed-agent app writes are live; deploy your own program and follow the Base/Solana quickstart.
Or record a known program id (local-devnet values shown):
Link it:

Algorand

Build gateway TEAL metadata:
Normal local developer flow:
This records the deployed Algorand app_id from the node — on the public testnet that is gateway app 767488273 (see Connect to the testnet). VM/operator direct deploy flow (local devnet only):
--datadir must point to a local Algorand Node/ directory containing algod.net and algod.token. It only works on the machine running that Algorand localnet. Manual record-existing flow (live testnet values):

What linking writes

gora contract link --chain <chain> updates gora.app.json with a contract binding similar to:
After linking, run:

Custom fulfillment contracts

For custom EVM contracts, prefer a gateway-mediated callback. The custom contract should accept calls only from the trusted Gora gateway and reject duplicate request ids. Minimal interface:
Your contract should verify:
  • caller is the trusted gateway
  • request id was not already fulfilled
  • app id matches your app
  • output hash matches the supplied result
  • proof/attestation was accepted by the gateway
  • decoded result satisfies your policy limits
Next: Set policy and payments.