NeoFS N3 oracle

N3 Oracle

Blockchain cannot obtain information from the external network, and Oracle solves this problem. As a gateway for smart contracts to communicate with the outside world, Oracle opens a window to the outside world for blockchain. You can read more about N3 oracles here.

  1. Deploy smart contract with oracle access. Neo-go has a great example of such contract.
  2. 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

Consider a multiplayer dApp game with an item shop. These items hold ID, description, title, price, and other game parameters. JSON is a convenient human-readable format, however, JSON files may become quite large. NeoFS can be used as a storage for such files.

{ "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