Documentation ¶
Index ¶
- Constants
- Variables
- type PrefixType
- type ProcessType
- type Tracker
- func (t *Tracker) AddVote(addr keys.Address, index int64, vote bool) error
- func (t *Tracker) CheckIfVoted(node keys.Address) (index int64, voted bool)
- func (t *Tracker) Clean() *Tracker
- func (t *Tracker) Failed() bool
- func (t *Tracker) Finalized() bool
- func (t *Tracker) GetJobID(state TrackerState) string
- func (t *Tracker) GetVotes() (yes, no int)
- func (t Tracker) NextStep() string
- type TrackerCtx
- type TrackerState
- type TrackerStore
- func (ts *TrackerStore) Delete(key ethereum.TrackerName) (bool, error)
- func (ts *TrackerStore) Exists(key ethereum.TrackerName) bool
- func (ts *TrackerStore) Get(key ethereum.TrackerName) (*Tracker, error)
- func (ts *TrackerStore) GetIterable() storage.Iterable
- func (ts *TrackerStore) GetOption() *ethereum.ChainDriverOption
- func (ts *TrackerStore) Iterate(fn func(name *ethereum.TrackerName, tracker *Tracker) bool) (stopped bool)
- func (ts *TrackerStore) QueryAllStores(key ethereum.TrackerName) (*Tracker, error)
- func (ts *TrackerStore) Set(tracker *Tracker) error
- func (ts *TrackerStore) SetupOption(opt *ethereum.ChainDriverOption)
- func (ts *TrackerStore) WithPrefix(prefix []byte) *TrackerStore
- func (ts *TrackerStore) WithPrefixType(prefix PrefixType) *TrackerStore
- func (ts *TrackerStore) WithState(state *storage.State) *TrackerStore
- type Vote
Constants ¶
View Source
const ( New TrackerState = iota BusyBroadcasting BroadcastSuccess BusyFinalizing Finalized Released Failed BROADCASTING string = "broadcasting" FINALIZING string = "finalizing" FINALIZE string = "finalize" MINTING string = "minting" CLEANUP string = "cleanup" CLEANUPFAILED string = "cleanupfailed" SIGNING string = "signing" VERIFYREDEEM string = "verifyredeem" REDEEMCONFIRM string = "redeemconfirm" BURN string = "burn" ProcessTypeNone ProcessType = 0x00 ProcessTypeLock ProcessType = 0x01 ProcessTypeRedeem ProcessType = 0x02 ProcessTypeLockERC ProcessType = 0x03 ProcessTypeRedeemERC ProcessType = 0x04 )
Variables ¶
View Source
var (
ErrTrackerNotFound = errors.New("tracker not found")
)
Functions ¶
This section is empty.
Types ¶
type PrefixType ¶ added in v0.14.0
type PrefixType int8
const ( PrefixFailed PrefixType = 0x00 PrefixPassed PrefixType = 0x01 PrefixOngoing PrefixType = 0x02 )
type ProcessType ¶
type ProcessType int8
func (ProcessType) String ¶ added in v0.14.0
func (t ProcessType) String() string
type Tracker ¶
type Tracker struct { // State tracks the current state of the tracker, Also used for locking distributed access Type ProcessType State TrackerState TrackerName ethereum.TrackerName SignedETHTx []byte Witnesses []keys.Address ProcessOwner keys.Address FinalityVotes []Vote To []byte }
Tracker
func NewTracker ¶
func NewTracker(typ ProcessType, owner keys.Address, signedEthTx []byte, name ethereum.TrackerName, witnesses []keys.Address) *Tracker
number of validator should be smaller than 64
func (*Tracker) CheckIfVoted ¶
func (*Tracker) GetJobID ¶
func (t *Tracker) GetJobID(state TrackerState) string
type TrackerCtx ¶
type TrackerCtx struct { Tracker *Tracker TrackerStore *TrackerStore JobStore *jobs.JobStore CurrNodeAddr keys.Address Witnesses *identity.WitnessStore Logger *log.Logger }
func NewTrackerCtx ¶
func NewTrackerCtx(t *Tracker, addr keys.Address, js *jobs.JobStore, ts *TrackerStore, ws *identity.WitnessStore, log *log.Logger) *TrackerCtx
type TrackerState ¶
type TrackerState int
func (TrackerState) String ¶ added in v0.14.0
func (t TrackerState) String() string
type TrackerStore ¶
type TrackerStore struct {
// contains filtered or unexported fields
}
func NewTrackerStore ¶
func (*TrackerStore) Delete ¶
func (ts *TrackerStore) Delete(key ethereum.TrackerName) (bool, error)
func (*TrackerStore) Exists ¶
func (ts *TrackerStore) Exists(key ethereum.TrackerName) bool
func (*TrackerStore) Get ¶
func (ts *TrackerStore) Get(key ethereum.TrackerName) (*Tracker, error)
func (*TrackerStore) GetIterable ¶ added in v0.14.0
func (ts *TrackerStore) GetIterable() storage.Iterable
func (*TrackerStore) GetOption ¶
func (ts *TrackerStore) GetOption() *ethereum.ChainDriverOption
func (*TrackerStore) Iterate ¶
func (ts *TrackerStore) Iterate(fn func(name *ethereum.TrackerName, tracker *Tracker) bool) (stopped bool)
func (*TrackerStore) QueryAllStores ¶ added in v0.14.0
func (ts *TrackerStore) QueryAllStores(key ethereum.TrackerName) (*Tracker, error)
func (*TrackerStore) Set ¶
func (ts *TrackerStore) Set(tracker *Tracker) error
func (*TrackerStore) SetupOption ¶
func (ts *TrackerStore) SetupOption(opt *ethereum.ChainDriverOption)
func (*TrackerStore) WithPrefix ¶ added in v0.14.0
func (ts *TrackerStore) WithPrefix(prefix []byte) *TrackerStore
func (*TrackerStore) WithPrefixType ¶ added in v0.14.0
func (ts *TrackerStore) WithPrefixType(prefix PrefixType) *TrackerStore
func (*TrackerStore) WithState ¶
func (ts *TrackerStore) WithState(state *storage.State) *TrackerStore
WithState updates the storage state of the tracker and returns the tracker address back
Click to show internal directories.
Click to hide internal directories.