Skip to content

machinefi/WeatherXM-IoTeX-Textile-POC

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

20 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

WeatherXM-IoTeX-Textile-POC

POC Doc

https://textile.notion.site/IoTeX-WeatherXM-Textile-POC-Scope-1f2aaa580a134daea88f281b589f8b09

Workflow

  • Ingest: WeatherXM pushes data to a Textile vault on a daily basis as a Parquet file.
  • Compute: Calculating the average QoD scores of entire networks with a ZK proof by W3bstream.
  • Visualizations: Simple analyses/visualizations of QoD data to demonstrate what could happen within WeatherXM’s Rewards dashboard—by Textile.

whiteboard_exported_image

Get started

  1. Follow the README in https://github.com/machinefi/weatherxm-qod/blob/main/README.md#running-on-docker-locally to generate All WeatherXM QoD scores of all devices into result.json file.

Notes: a lightweight result.json example is provided in ./dataset folder

  1. Prepare Prover Code methods.rs to compute the average QoD scores in w3bstream ZK engine.

Notes: a compiled methods.rs is provided in ./dataset folder, or you can build it in ./zk folder.

  1. Create a w3bstream project

Via Sandbox Frontend

  • Upload method.rs as prover code
  • Aggregation Amount: 1
  • Proof Destination: Tableland
  • Vault ID: qod_poc_vault.data
  • Click "Upload Config file to IPFS" button
  • Click "Register project onchain" button

screenshot_sandbox

Via ioctl-Cli (CLI to interact with IoTeX chain and w3bstream service)

  • Generate config for the project
// cli setup
ioctl config set wsEndpoint 'sprout-staging.w3bstream.com:9000'

ioctl ws project config -v "0.1" -t "risc0" -i "./dataset/methods.rs" -c "./dataset/textile.json"  -e "{\"image_id\":\"ZK_ID\", \"elf\":\"ZK_ELF\"}" -u "./dataset/textile_output_template.json"
  • Create a w3bstream project via ioctl
ioctl ws project --contract-address 0x02feBE78F3A740b3e9a1CaFAA1b23a2ac0793D26 create --project-config-file ./dataset/textile.json 
  1. Send raw data result.json via ioctl to w3bstream Server
# Change the project id with yours
ioctl ws message send --project-id 87 --project-version "0.1" --data "{\"data\":\"$(cat ./dataset/result.json)\", \"receipt_type\":\"Stark\"}" 
  1. Query the result
  • The status of message on the w3bstream Server could be checked via ioctl
# Change the message id with yours
ioctl ws message query -i c4a2be1c-def3-463f-813a-12efc7e46856 
image

The result and proof are written to Textile Vault once the state becomes outputted

  • Check the storage result via Basin-Cli with the vaultID qod_poc_vault.data

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages