In plutus playground in game example there is a function
-- | The "startGame" contract endpoint, telling the wallet to start watching
-- the address of the game script. See note [Contract endpoints]
startGame :: MonadWallet m => m ()
startGame =
-- 'startWatching' is a function of the wallet API. It instructs the wallet
-- to keep track of all outputs at the address. Player 2 needs to call
-- 'startGame' before Player 1 uses the 'lock' endpoint, to ensure that
-- Player 2's wallet is aware of the game address.
startWatching gameAddress
I don't like the
Player 2 needs to call
'startGame' before Player 1 uses the 'lock' endpoint, to ensure that
Player 2's wallet is aware of the game address.
Is there really no way to connect to game after game is started (lock
function is called)?
Do we need this function at all? Can we go only with guess
and lock
functions?
I can understand how startWatching
can make sense for light wallets/clients (that use merkle proofs to validate transactions) but don't understand how startGame
function may be useful for full clients. (Actually I don't, light client still should be able to ask info from other need)