mirror of
https://github.com/HerodotusDev/snapshot-hodl-time-poc.git
synced 2026-09-19 17:05:20 +00:00
No description
- Cairo 100%
|
|
||
|---|---|---|
| custom_module | ||
| .gitignore | ||
| README.md | ||
Snapshot <> Herodotus DP -- Proof of Concept
1. Build
Build the compiled contract class file:
scarb build
You should see that a new build file has been added:
custom_module \
src \
lib.cairo
target \
dev \
custom_module_custom_module.compiled_contract_class.json
2. Upload
Upload the compiled contract class file to the program registry:
curl --location 'https://sharp.api.herodotus.cloud/submit-program?apiKey={API_KEY}' \
--form 'programFile=@"custom_module_custom_module.compiled_contract_class.json"'
This request will return a program hash as a response:
0xaae117f9cdfa4fa4d004f84495c942adebf17f24aec8f86e5e6ea29956b47e
To comfirm if the program is registered, you can query the program registry:
curl --location 'http://program-registery.api.herodotus.cloud/get-metadata?program_hash=0xaae117f9cdfa4fa4d004f84495c942adebf17f24aec8f86e5e6ea29956b47e'
3. Request
/submit-batch-query is retired. Schedule the module through the Data Processor API POST /tasks (auth: X-API-KEY header).
Provide compiled-class input for pub fn main() — see Create task and Upload module.
curl -X POST https://hdp.api.herodotus.cloud/tasks \
-H "Content-Type: application/json" \
-H "X-API-KEY: {API_KEY}" \
-d '{
"destination_chain_id": 11155111,
"input": {
"params": [
{"visibility": "public", "value": "0x3"},
{"visibility": "public", "value": "0x5222A4"},
{"visibility": "public", "value": "0x5222A7"},
{"visibility": "public", "value": "0x5222C4"},
{"visibility": "public", "value": "0x13cb6ae34a13a0977f4d7101ebc24b87bb23f0d5"}
],
"compiled_class": { "<<INSERT_COMPILED_CLASS>>": true },
"entry_points_by_type": {
"EXTERNAL": [],
"L1_HANDLER": [],
"CONSTRUCTOR": []
}
}
}'