NeoFS N3 oracle

N3 Oracle

  1. Create a container and upload a JSON object. Attention! Make sure that oracle nodes have read access. To do so, make your container public or read-only with -basic-acl public or --basic-acl readonly CLI arguments. Read more about NeoFS CLI operations in our first article.
  2. Deploy smart contract with oracle access. Neo-go has a great example of such contract.
  3. Invoke method with oracle call. In neo-go example invoke Request or FilteredRequest methods. When the oracle answer will persist on chain, the result will be printed out in node logs.

Enhanced oracle example

{ "store": {
"item": [
{ "id": 1,
"category": "clothing",
"title": "Aloha Shirt",
"price": 700
},
{ "id": 2,
"category": "clothing",
"title": "Pearl Tee",
"price": 400
},
{ "id": 3,
"category": "headgear",
"title": "Fugu Bell Hat",
"price": 1700
},
{ "id": 4,
"category": "headgear",
"title": "Splash Goggles",
"price": 2800
},
{ "id": 5,
"category": "shoes",
"title": "Cherry Kicks",
"price": 2400
},
{ "id": 6,
"category": "shoes",
"title": "Red Hi-Tops",
"price": 1800
}
]
}
}

--

--

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store