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
working with node requires access to private fields (signer and wait group)
additionally there is a mess with lifecycle, it accepts context and Start blocks on it, but in order to wait you have to call Cleanup and then wait on private error group
/* Create or load miner identity */ifapp.edSgn, err=app.LoadOrCreateEdSigner(); err!=nil {
returnfmt.Errorf("could not retrieve identity: %w", err)
}
iferr:=app.LoadCheckpoint(ctx); err!=nil {
returnerr
}
iferr:=app.Initialize(); err!=nil {
returnerr
}
// This blocks until the context is finished or until an error is producederr=app.Start(ctx)
cleanupCtx, cleanupCancel:=context.WithTimeout(context.Background(), 30*time.Second)
defercleanupCancel()
done:=make(chanstruct{}, 1)
// FIXME: per https://github.com/spacemeshos/go-spacemesh/issues/3830gofunc() {
app.Cleanup(cleanupCtx)
_=app.eg.Wait()
close(done)
}()
The text was updated successfully, but these errors were encountered:
The text was updated successfully, but these errors were encountered: