cross

package
v1.0.6 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jun 12, 2023 License: GPL-3.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

View Source
const (
	LogDir   = "crosslog"
	TxLogDir = "crosstxlog"
	DataDir  = "crossdata"
)

Variables

View Source
var (
	ErrVerifyCtx       = errors.New("verify ctx failed")
	ErrInvalidSignCtx  = fmt.Errorf("[%w]: verify signature failed", ErrVerifyCtx)
	ErrDuplicateSign   = fmt.Errorf("[%w]: signatures already exist", ErrVerifyCtx)
	ErrExpiredCtx      = fmt.Errorf("[%w]: ctx is expired", ErrVerifyCtx)
	ErrAlreadyExistCtx = fmt.Errorf("[%w]: ctx is already exist", ErrVerifyCtx)
	ErrLocalSignCtx    = fmt.Errorf("[%w]: remote ctx signed by local anchor", ErrVerifyCtx)
	ErrFinishedCtx     = fmt.Errorf("[%w]: ctx is already finished", ErrVerifyCtx)
	ErrReorgCtx        = fmt.Errorf("[%w]: ctx is on sidechain", ErrVerifyCtx)
	ErrInternal        = fmt.Errorf("[%w]: internal error", ErrVerifyCtx)
	ErrRepetitionCtx   = fmt.Errorf("[%w]: repetition cross transaction", ErrVerifyCtx) // 合约重复接单

)
View Source
var DefaultConfig = Config{
	SyncMode: synchronise.ALL,
}

Functions

This section is empty.

Types

type Config added in v1.0.6

type Config struct {
	MainContract common.Address       `json:"mainContract"`
	SubContract  common.Address       `json:"subContract"`
	Signer       common.Address       `json:"signer"`
	Anchors      []common.Address     `json:"anchors"`
	SyncMode     synchronise.SyncMode `json:"syncMode"`
}

func (*Config) Sanitize added in v1.0.6

func (config *Config) Sanitize() Config

type ProtocolChain added in v1.0.6

type ProtocolChain interface {
	ChainID() *big.Int
	GenesisHash() common.Hash
	RegisterAPIs([]rpc.API) //TODO: 改成由backend自己注册API
}

type ServiceContext added in v1.0.6

type ServiceContext struct {
	Config        *Config
	ProtocolChain ProtocolChain
	Subscriber    trigger.Subscriber
	Retriever     trigger.ChainRetriever
	Executor      trigger.Executor
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL