Lay3rLabs / avs-toolkit

MIT License
7 stars 3 forks source link

CLI: Wasmatic: implement `/app` and `/info` entrypoints #73

Closed ueco-jb closed 1 month ago

ueco-jb commented 1 month ago

closes #58 Implements /app and info entrypoints to the wasmatic section of the CLI. For /info it runs in a loop for all of the endpoints, for /app it takes just the first one.

$ cargo run -- wasmatic info

Output for operator `https://op3.layer-p.net`: {
  "operators": [
    "layer1cdjph3vh5egrg0kruhxcschcy4prd05k8j9xyc",
    "layer1ks6c5jerth4gfw4pndu04vga32cg8wvc3ea580",
    "layer1wq5kw9ydjmqaw70udkf78fv8ltzhn9mh9fsd34",
    "layer1n5n8yarh6rwv9dgrry0pall9vuef4zt0mg7y2k",
    "layer164z0yxp53fn7n3vs0u3dahh2qds5665qedutxc"
  ]
}
Output for operator `https://op1.layer-p.net`: {
  "operators": [
    "layer1qyfn9l7w78kxcerwwwc6dpad305dulhk9jks0r",
    "layer1t5tjn9ycw7yj78nqq0nv8mn8rncs0tp93fxjmq",
    "layer1adv6jj7wdzpt3y65n3lv3ac72pahf34qa3ar69",
    "layer1kw6wf7sw2ngqx9j9c0zs8tdgx9nd58l8edynxu",
    "layer1h669kj0n08dtf7gupndsu6sl2w9ynmfjftp385"
  ]
}
Output for operator `https://op2.layer-p.net`: {
  "operators": [
    "layer1fx03sfs9tep8e63r3lf0as658epzg3fgsdgw0q",
    "layer1xgvmadqyjuwdhp8epge2kkzzcmgc0yqgny0v7r",
    "layer14fhyuh4h8amjykx3hn5uef5hr8pxp5pejhy9la",
    "layer1634ujmw69a7lphdd4xdn29s2ts6phaxllcw74n",
    "layer1kf503yw72yvsxtqvwk7sw08cq362prqqys0yf7"
  ]
}

$ cargo run -- wasmatic app

Output for operator `https://op1.layer-p.net`: {
  "apps": [
    {
      "name": "YOUR_NAME_HERE",
      "digest": "sha256:d902444dcc241c6d19fefbdaf2e34d3d88d17453f11450ae605c4e9357c5bd14",
      "trigger": {
        "queue": {
          "taskQueueAddr": "layer14wx6ax8tqtvh3mra9f0xswdhh8jjrx63qs5ahqnjzlvu8sps2p7qfeevdw",
          "hdIndex": 0,
          "pollInterval": 3
        }
      },
      "permissions": {},
      "testable": true
    },
  "digests": [
    "sha256:cec7675a967bc7175cdb7484cc72372d07bc7da3beb9310f37c2000c5fd8431d"
  ]
}