7 Interacting With External Resources

 

This chapter covers:

  • Examining the need for Oracles and how to use them
  • Designing a UI for DLTs using Web3
  • Implementing Ethereum Events to automate services

“The outside world touches against her outside skin, but not the other part of herself, inside.”

― Sally Rooney, Normal People

You should be feeling quite comfortable with writing simple smart contracts and deploying them to a permissioned network by now. You may have even taken the time to go beyond the call of duty and practices more smart contract writing. However, so far we have been dealing with the blockchain world in a silo. Any application, to be useful, will have to interact with external services, users and other networks. In this chapter, we’ll see how we do that with smart contracts.

7.1      There is a whole world outside

7.1.1                     How does it look?

7.2      Lack of intrinsic triggers in smart contracts

7.2.1                     Oracles to the rescue

7.3      Polishing the card game

7.3.1                     Bolting on the UI

7.4      Introducing randomness

7.4.1                     Randomness on a blockchain

7.4.2                     Redesigning the betting game

7.4.3                     Playing the game

7.4.4                     Interfacing contracts and Events

7.4.5                     Random number generator service

7.4.6                     Troubleshooting UI Problems

7.5      Summary