Quickstart#
This is the fastest way to go from console to working API.
You will:
- Create a project
- Create a contract from template
- Deploy it
- Call one
invokeand onequeryendpoint
Base URL:
https://api.velarics.com/v1
What you need#
- Console access
- One deployed contract
- Runtime API key from the project
Use these placeholders:
YOUR_PROJECT_IDYOUR_CONTRACT_IDYOUR_API_KEY
1. Create project (UI)#
In console:
- Open Projects
- Click Create Project
- Enter a name, for example
SupplyChain Demo - Save
2. Create contract from template (UI)#
In the same project:
- Open Contracts
- Click Create Contract
- Select template Asset Tracking
- Name it
AssetContract - Click Create
3. Deploy (UI)#
In contract page:
- Open Deployments
- Click Deploy
- Wait until status becomes Active
When active, open Functions tab and copy:
projectIdcontractId- Endpoint names
4. Call runtime API#
Invoke CreateAsset:
bashcurl -X POST https://api.velarics.com/v1/projects/YOUR_PROJECT_ID/contracts/YOUR_CONTRACT_ID/invoke/CreateAsset \ -H "X-API-Key: YOUR_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "params": { "id": "asset-1001", "owner": "alice" } }'
Query GetAsset:
bashcurl -X GET "https://api.velarics.com/v1/projects/YOUR_PROJECT_ID/contracts/YOUR_CONTRACT_ID/query/GetAsset?id=asset-1001" \ -H "X-API-Key: YOUR_API_KEY"
Expected result#
CreateAssetreturnsstatus: committedGetAssetreturnsstatus: evaluated- Response includes the asset you created
What just happened#
- You created everything from the UI.
- Velarics generated runtime endpoints for your deployed contract.
- You wrote data with
invokeand read it withquery.
