Documentation
¶
Index ¶
- Variables
- type Config
- type PrivateTxGetter
- type PrivateTxSetter
- type PrivateTxStore
- type RelayService
- func (s *RelayService) AcceptPreconfTxs() bool
- func (s *RelayService) AcceptPrivateTxs() bool
- func (s *RelayService) CheckPreconfStatus(hash common.Hash) (bool, error)
- func (s *RelayService) Close()
- func (s *RelayService) GetPrivateTxGetter() PrivateTxGetter
- func (s *RelayService) PreconfEnabled() bool
- func (s *RelayService) PrivateTxEnabled() bool
- func (s *RelayService) PurgePrivateTx(hash common.Hash)
- func (s *RelayService) RecordPrivateTx(hash common.Hash)
- func (s *RelayService) SetTxGetter(getter TxGetter)
- func (s *RelayService) SetchainEventSubFn(fn func(ch chan<- core.ChainEvent) event.Subscription)
- func (s *RelayService) SubmitPreconfTransaction(tx *types.Transaction) error
- func (s *RelayService) SubmitPrivateTransaction(tx *types.Transaction) error
- type SendTxForPreconfResponse
- type Service
- type ServiceConfig
- type TxGetter
- type TxTask
Constants ¶
This section is empty.
Variables ¶
var DefaultServiceConfig = ServiceConfig{ // contains filtered or unexported fields }
Functions ¶
This section is empty.
Types ¶
type PrivateTxGetter ¶
type PrivateTxSetter ¶
type PrivateTxStore ¶
type PrivateTxStore struct {
// contains filtered or unexported fields
}
func NewPrivateTxStore ¶
func NewPrivateTxStore() *PrivateTxStore
func (*PrivateTxStore) Add ¶
func (s *PrivateTxStore) Add(hash common.Hash)
func (*PrivateTxStore) Close ¶
func (s *PrivateTxStore) Close()
func (*PrivateTxStore) IsTxPrivate ¶
func (s *PrivateTxStore) IsTxPrivate(hash common.Hash) bool
func (*PrivateTxStore) Purge ¶
func (s *PrivateTxStore) Purge(hash common.Hash)
func (*PrivateTxStore) SetchainEventSubFn ¶
func (s *PrivateTxStore) SetchainEventSubFn(fn func(ch chan<- core.ChainEvent) event.Subscription)
type RelayService ¶
type RelayService struct {
// contains filtered or unexported fields
}
RelayService handles all preconf and private transaction related services
func Init ¶
func Init(enablePreconf, enablePrivateTx, acceptPreconfTx, acceptPrivateTx bool, blockProducerURLs []string) *RelayService
func (*RelayService) AcceptPreconfTxs ¶
func (s *RelayService) AcceptPreconfTxs() bool
func (*RelayService) AcceptPrivateTxs ¶
func (s *RelayService) AcceptPrivateTxs() bool
func (*RelayService) CheckPreconfStatus ¶
func (s *RelayService) CheckPreconfStatus(hash common.Hash) (bool, error)
CheckPreconfStatus checks the preconfirmation status of a transaction
func (*RelayService) Close ¶
func (s *RelayService) Close()
Close closes the relay service and all its components
func (*RelayService) GetPrivateTxGetter ¶
func (s *RelayService) GetPrivateTxGetter() PrivateTxGetter
func (*RelayService) PreconfEnabled ¶
func (s *RelayService) PreconfEnabled() bool
func (*RelayService) PrivateTxEnabled ¶
func (s *RelayService) PrivateTxEnabled() bool
func (*RelayService) PurgePrivateTx ¶
func (s *RelayService) PurgePrivateTx(hash common.Hash)
func (*RelayService) RecordPrivateTx ¶
func (s *RelayService) RecordPrivateTx(hash common.Hash)
func (*RelayService) SetTxGetter ¶
func (s *RelayService) SetTxGetter(getter TxGetter)
func (*RelayService) SetchainEventSubFn ¶
func (s *RelayService) SetchainEventSubFn(fn func(ch chan<- core.ChainEvent) event.Subscription)
func (*RelayService) SubmitPreconfTransaction ¶
func (s *RelayService) SubmitPreconfTransaction(tx *types.Transaction) error
SubmitPreconfTransaction submits a transaction for preconfirmation to block producers
func (*RelayService) SubmitPrivateTransaction ¶
func (s *RelayService) SubmitPrivateTransaction(tx *types.Transaction) error
SubmitPrivateTransaction submits a private transaction to block producers
type Service ¶
type Service struct {
// contains filtered or unexported fields
}
func NewService ¶
func NewService(urls []string, config *ServiceConfig) *Service
func (*Service) CheckTxPreconfStatus ¶
CheckTxPreconfStatus checks whether a given transaction hash has been preconfirmed or not. It checks things in following order: - Checks the availability of preconf status of the task in cache - Checks locally if the transaction is already included in a block - Queries all block producers via multiclient to get the preconf status
func (*Service) SetTxGetter ¶
SetTxGetter sets the transaction getter function for querying local database
func (*Service) SubmitPrivateTx ¶
func (s *Service) SubmitPrivateTx(tx *types.Transaction, retry bool) error
SubmitPrivateTx attempts to submit a private transaction to all block producers
func (*Service) SubmitTransactionForPreconf ¶
func (s *Service) SubmitTransactionForPreconf(tx *types.Transaction) error
SubmitTransactionForPreconf attempts to queue a transaction submission task for preconf and returns true if the task is successfully queued. It fails if either the rpc clients are unavailable or if the task queue is full.
type ServiceConfig ¶
type ServiceConfig struct {
// contains filtered or unexported fields
}