new register(`rho:registry:insertArbitrary`), out(`rho:io:stdout`), myContract, ret in {
contract myContract(arg1, arg2) = { out!(("These are the args: ", arg1, arg2)) } |
register!(bundle+{*myContract}, *ret) |
for (@urn <- ret) {
out!(("My contract is located at this URN: ", urn))
}
}
To look up the contract at the id in a different deployment:
new lookup(`rho:registry:lookup`), ret in {
lookup!(`rho:id:ugft58531rdrupt66fux6he4ki71o9bp4nzcede5jbfeiwcktp3g35`, *ret) |
for (myContract <- ret) {
myContract!(1, 2)
}
}
Storing a contract at a public key is similar:
new register(`rho:registry:insertSigned`), out(`rho:io:stdout`), myContract, ret in {
contract myContract(arg1, arg2) = { out!(("These are the args: ", arg1, arg2)) } |
register!(<public key>, (<nonce>, bundle+{*myContract}), <signature>, *ret) |
for (@urn <- ret) {
out!(("My contract is located at this URN: ", urn))
}
}
The nonce is an integer; to replace what is stored at the public key, increase the nonce. The signature is over the tuple (, ).