This is an excerpt from Manning's book Blockchain in Action. Login to get full access to this book.
MetaMask will require you to connect to the web application before interaction because privacy mode on MetaMask is enabled by default.