You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Currently, the watcher is associated with and coupled to a channel. One local instance of watcher must be started for each channel.
However, for the use case of IoT use cases (described in proposal#3), it is desirable to have a watcher that can
Run either locally or as a remote service.
Is not associated with any specific client/channel. Channels can be associated with/dissociated from a watcher dynamically during runtime.
The design for such a watcher was described in proposal#4. This is an umbrella issue to cover the changes for refactoring the watcher component based on the design in the proposal.
Details
Changes required in usage of watcher
Earlier, user need not initialize a watcher. But now, they should initialize and pass it on as an additional argument to client.New.
Usage of watcher will remain the same. User should call ch.Watch() in a go-routine after establishing the channel.
Context
Currently, the watcher is associated with and coupled to a channel. One local instance of watcher must be started for each channel.
However, for the use case of IoT use cases (described in proposal#3), it is desirable to have a watcher that can
The design for such a watcher was described in proposal#4. This is an umbrella issue to cover the changes for refactoring the watcher component based on the design in the proposal.
Details
Changes required in usage of watcher
client.New
.ch.Watch()
in a go-routine after establishing the channel.Preparatory steps
1.
Adjudicator.Subscribe
should take onlych.Id
as a parameter instead ofchannel.Params
. As the ID is sufficient for subscribing to events on the blockchain (Adjudicator.Subscribe takeschannel.Params
while onlychannel.ID
is needed #173).2. Define smaller interfaces for methods in
Adjudicator
(Define smaller interfaces for methods in Adjudicator #184).Implementation steps
go-perun/watcher
package.go-perun/local
package.statesPub
field andsetStatesPub
method on watcher and callch.statesPub.Publish
whenever a new state is created.client.New
API to take a new watcher instance and store it.ch.Watch
function to use the watcher instance stored in the client.The text was updated successfully, but these errors were encountered: