Skip to content

Instantly share code, notes, and snippets.

@void4
Created February 29, 2016 23:18
Show Gist options
  • Save void4/d0389f8d3be526e99130 to your computer and use it in GitHub Desktop.
Save void4/d0389f8d3be526e99130 to your computer and use it in GitHub Desktop.
{
identity: <serviceaddr>, // multikey
api: {
location: [
/ip4/123.234.123.234/tcp/80/,
/ipfs/<identity>/tcp/80/
],
endpoints: {
http/get/echo/ : {
description: "Returns all arguments as they were sent",
},
http/get/temp/ : {
description: "Returns the current temperature at this node",
},
/ipns/<serviceaddr>/light : {
description: "Refers to the current state of the light actuator"
}
// owner doesn't require consensus over state, so interaction is direct
http/put/light/ : {
description: "Turns the light connected to this device on or off",
arguments: {
state : ["on", "off"]
},
payment: {
handler: /ethereum/<address2>
value: 0.01
}
}
// The coffee machine utilisation is exclusive and therefore requires onchain consensus
/ethereum/<address1>/coffee : {
description: "Starts the coffee machine",
}
}
}
},
contracts: {
<address1> : <info>, // represents device, info includes source, ABI and compile time information
<address2> : <info>, // handles payment
<address3> : <info> // auxiliary contract sources that above contracts relies on
}
certificates: [
<certid1> : signature,
<certid2> : signature,
]
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment