Documentation ¶
Overview ¶
Package server is SPV module
Index ¶
- type SPV
- func (s *SPV) GetAdapter() adapter.SDKAdapter
- func (s *SPV) GetCoder() coder.Coder
- func (s *SPV) GetProver() prover.Prover
- func (s *SPV) GetStateDB() storage.StateDB
- func (s *SPV) GetStateManager() *manager.StateManager
- func (s *SPV) GetVerifier() verifier.Verifier
- func (s *SPV) Start() error
- func (s *SPV) Stop() error
- type SPVServer
- func (ss *SPVServer) ForwardRequest(request *cm_pbgo.TxRequest) (*cm_pbgo.TxResponse, error)
- func (ss *SPVServer) GetAdapter(chainId string) (adapter.SDKAdapter, error)
- func (ss *SPVServer) GetCoder(chainId string) (coder.Coder, error)
- func (ss *SPVServer) GetDB() storage.StateDB
- func (ss *SPVServer) RegisterCallBack(chainId string, callBack manager.CallBack) error
- func (ss *SPVServer) SetLog(log *zap.SugaredLogger) error
- func (ss *SPVServer) Start() error
- func (ss *SPVServer) Stop() error
- func (ss *SPVServer) ValidTransaction(request *api.TxValidationRequest) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type SPV ¶
type SPV struct {
// contains filtered or unexported fields
}
SPV is a spv instance for a specific remote chain
func NewSPV ¶
func NewSPV(chain *conf.ChainConfig, store storage.StateDB, log *zap.SugaredLogger) (*SPV, error)
NewSPV creates a spv for a specific remote chain
func (*SPV) GetStateManager ¶
func (s *SPV) GetStateManager() *manager.StateManager
GetStateManager gets state manager
type SPVServer ¶
type SPVServer struct {
// contains filtered or unexported fields
}
SPVServer contains all chains' SPV
func IntSPVServer ¶
IntSPVServer inits spv server when deployed independently
func NewSPVServer ¶
func NewSPVServer(ymFile string, log *zap.SugaredLogger) (*SPVServer, error)
NewSPVServer inits spv config and creates spv server when integrated as a component
func (*SPVServer) ForwardRequest ¶
ForwardRequest Forward Request
func (*SPVServer) GetAdapter ¶
func (ss *SPVServer) GetAdapter(chainId string) (adapter.SDKAdapter, error)
GetAdapter gets the sdk adapter of spv by chain id
func (*SPVServer) GetCoder ¶
GetCoder gets the coder of spv by chain id
func (*SPVServer) GetDB ¶
GetDB gets the db of spvServer
func (*SPVServer) RegisterCallBack ¶
RegisterCallBack registers CallBack
func (*SPVServer) SetLog ¶
func (ss *SPVServer) SetLog(log *zap.SugaredLogger) error
SetLog sets log for unit test
func (*SPVServer) ValidTransaction ¶
func (ss *SPVServer) ValidTransaction(request *api.TxValidationRequest) error
ValidTransaction verifies the existence and validity of the transaction