rchain-api icon indicating copy to clipboard operation
rchain-api copied to clipboard

How to get value from registry ?

Open fabcotech opened this issue 6 years ago • 9 comments

In another contract I stored a value in the registry:

new
  uriChan,
  insertArbitrary(`rho:registry:insertArbitrary`),
  stdout(`rho:io:stdout`) in {

  // Tell the registry that we want to register
  // give URI back on uriChan
  insertArbitrary!(bundle+{"coucou"}  , *uriChan) |
 
  // Wait for URI response
  for(@uri <- uriChan) {
    stdout!(uri)
  }
}

The returned address is rho:id:pmc1cn6zff1pk5sf3purwby4zuqmwdiaj5xd7mu55usk88q5be9and

How can I get this value back in a node JS / web browser context using the rchain-api.js library ? Is it by using the listenForDataAtPublicName or listenForDataAtPrivateName api ? Or something else ?

fabcotech avatar Nov 17 '18 17:11 fabcotech