Skip to content

Instantly share code, notes, and snippets.

@khssnv
Last active June 13, 2019 08:16
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save khssnv/22362d7858098d2083fbdebc13a84319 to your computer and use it in GitHub Desktop.
Save khssnv/22362d7858098d2083fbdebc13a84319 to your computer and use it in GitHub Desktop.
Handy AIRA oneliners

Start your own Liability contract

Replace fields with your values

rostopic pub /liability/incoming robonomics_liability/Liability '{address: {address: "0x5e2024cc4c286f28037C0A3B7b9487Da51fcb2B8"}, model: {multihash: "QmYb81uDNDHCnu9EZtYV4eoBDKRBAwJeNy1LT3p5Zbc357"}, objective: {multihash: "Qmea8XkcSXmvLDKES7D886pfimsWh9Vjh1ZJsoHm9MWG4C"}, result: {multihash: ""}, promisee: {address: "0xB819d9BC2E665962BCa62Cd859059875BABB134c"}, promisor: {address: "0xB85DD5F194a18657f24792a793306b218637ce40"}, lighthouse: {address: "0xD40AC7F1e5401e03D00F5aeC1779D8e5Af4CF9f1"}, token: {address: "0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2"}, cost: {uint256: "100000000000000000"}, validator: {address: "0x0000000000000000000000000000000000000000"}, validatorFee: {uint256: "0"}}'

Periodically reconnect to airalab IPFS star node

watch -n 10 ipfs --api=/ip4/127.0.0.1/tcp/5001 swarm connect /dns4/lighthouse.aira.life/tcp/4001/ipfs/QmdfQmbmXt6sqjZyowxPUsmvBsgSGQjm4VXrV7WGy62dv8

Periodically reconnect to airalab IPFS lighthouse node

watch -n 10 ipfs --api=/ip4/127.0.0.1/tcp/5001 swarm connect ipfs swarm connect /ip6/fc42:29df:dd98:605c:9b01:1ffe:e03a:54ee/tcp/4001/ipfs/Qmbtet5x9rihKHcDi1tqyJTkRV3zdfBsge38AUEjLwc52q

Switch between mainnet and Airalab sidechain like a boss

need some switcher here

Sidechain parameters: https://github.com/airalab/airapkgs/blob/nixos-unstable/nixos/modules/profiles/aira-sidechain.nix

Approve XRT to factory

Replace fields with your values

rosservice call /eth/approve '{spender: {address: "FACTORY_0x00_ADDRESS"}, value: {uint256: "1000"}}'

Pub demand (pretty similar for offers)

Replace fields with your values

rostopic pub -1 /liability/infochan/eth/signing/demand robonomics_msgs/Demand '{model: {multihash: "QmW3dTa1QZxnZzpF9TDuHKN7GDKaJDVoQys4u38xmdAGHF"}, objective: {multihash: "QmUA5ZHHqFZyR1T1KxxheyrUzEEymfKb3goPZt1jLDNEWL"}, token: {address: "0x368C35597A9068280028c424122DE9129fAF8689"}, cost: {uint256: "1"}, lighthouse: {address: "0x202a09A451DE674d2d65Bf1C90968a8d8F72cf7b"}, validator: {address: "0x368C35597A9068280028c424122DE9129fAF8689"}, validatorFee: {uint256: "0"}, deadline: {uint256: "210000"}, sender: {address: ""}, signature: []}'

How much ETH provider need to make a Liability contract?

GWei/gas ETH Example
1
3 0.0025 https://etherscan.io/tx/0x49d7ae93d675292c8b286411129d456a830c51fefb001dc6eba4ac2466d35df9
10 GWei
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment