Documentation
¶
Index ¶
- func ContractAbiFromMap(config *config.Config) (contractAbi map[string]*abi.ABI, err error)
- type AssetsCalculator
- func (self *AssetsCalculator) GetAssetsFromLog(methodName string, tx *types.Transaction, assetsNames []string) (assets interface{}, err error)
- func (self *AssetsCalculator) GetAssetsNames(methodName string, methodType MethodType) (assetsNames []string)
- func (self *AssetsCalculator) WithContractAbi(contractAbi map[string]*abi.ABI) *AssetsCalculator
- func (self *AssetsCalculator) WithEthClient(ethClient *ethclient.Client) *AssetsCalculator
- func (self *AssetsCalculator) WithInputChannel(v chan *SommelierTransactionPayload) *AssetsCalculator
- func (self *AssetsCalculator) WithMonitor(monitor monitoring.Monitor) *AssetsCalculator
- type BlockDownloader
- func (self *BlockDownloader) WithEthClient(ethClient *ethclient.Client) *BlockDownloader
- func (self *BlockDownloader) WithInitStartBlockHeight(db *gorm.DB, syncedComponent model.SyncedComponent) *BlockDownloader
- func (self *BlockDownloader) WithMonitor(monitor monitoring.Monitor) *BlockDownloader
- func (self *BlockDownloader) WithPollerCron() *BlockDownloader
- type BlockInfoPayload
- type Controller
- type Input
- type InteractionPayload
- type LastSyncedBlockPayload
- type Member
- type MethodType
- type PollerDeposit
- type Prices
- type SommelierTransactionPayload
- type Store
- type StoreDeposit
- type SyncerDelta
- type SyncerDeposit
- func (self *SyncerDeposit) WithContractAbi(contractAbi map[string]*abi.ABI) *SyncerDeposit
- func (self *SyncerDeposit) WithDb(v *gorm.DB) *SyncerDeposit
- func (self *SyncerDeposit) WithInputChannel(v chan *BlockInfoPayload) *SyncerDeposit
- func (self *SyncerDeposit) WithMonitor(monitor monitoring.Monitor) *SyncerDeposit
- type Writer
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type AssetsCalculator ¶ added in v0.2.228
type AssetsCalculator struct {
*task.Task
Output chan *SommelierTransactionPayload
// contains filtered or unexported fields
}
func NewAssetsCalculator ¶ added in v0.2.228
func NewAssetsCalculator(config *config.Config) (self *AssetsCalculator)
func (*AssetsCalculator) GetAssetsFromLog ¶ added in v0.2.259
func (self *AssetsCalculator) GetAssetsFromLog(methodName string, tx *types.Transaction, assetsNames []string) (assets interface{}, err error)
func (*AssetsCalculator) GetAssetsNames ¶ added in v0.2.259
func (self *AssetsCalculator) GetAssetsNames(methodName string, methodType MethodType) (assetsNames []string)
func (*AssetsCalculator) WithContractAbi ¶ added in v0.2.228
func (self *AssetsCalculator) WithContractAbi(contractAbi map[string]*abi.ABI) *AssetsCalculator
func (*AssetsCalculator) WithEthClient ¶ added in v0.2.228
func (self *AssetsCalculator) WithEthClient(ethClient *ethclient.Client) *AssetsCalculator
func (*AssetsCalculator) WithInputChannel ¶ added in v0.2.228
func (self *AssetsCalculator) WithInputChannel(v chan *SommelierTransactionPayload) *AssetsCalculator
func (*AssetsCalculator) WithMonitor ¶ added in v0.2.228
func (self *AssetsCalculator) WithMonitor(monitor monitoring.Monitor) *AssetsCalculator
type BlockDownloader ¶
type BlockDownloader struct {
*task.Task
Output chan *BlockInfoPayload
OutputPollTxs chan uint64
// contains filtered or unexported fields
}
func NewBlockDownloader ¶
func NewBlockDownloader(config *config.Config) (self *BlockDownloader)
When started, this task checks database for the latest block synced and store the result in lastSyncedBlockHeight field Then, compare lastSyncedBlockHeight to the current external network's block height and loads info for all of the missing blocks for the indicated range Lastly, it emits to the Output channel block's height, block's hash and all transactions that this block contains and update lastSyncedBlockHeight to the last processed block
func (*BlockDownloader) WithEthClient ¶
func (self *BlockDownloader) WithEthClient(ethClient *ethclient.Client) *BlockDownloader
func (*BlockDownloader) WithInitStartBlockHeight ¶
func (self *BlockDownloader) WithInitStartBlockHeight(db *gorm.DB, syncedComponent model.SyncedComponent) *BlockDownloader
func (*BlockDownloader) WithMonitor ¶
func (self *BlockDownloader) WithMonitor(monitor monitoring.Monitor) *BlockDownloader
func (*BlockDownloader) WithPollerCron ¶ added in v0.2.186
func (self *BlockDownloader) WithPollerCron() *BlockDownloader
type BlockInfoPayload ¶
type BlockInfoPayload struct {
Transactions []*types.Transaction
Height uint64
Hash string
Timestamp uint64
}
type Controller ¶
func NewController ¶
func NewController(config *config.Config) (self *Controller, err error)
type Input ¶
type Input struct {
Function string `json:"function"`
Points int64 `json:"points"`
AdminId string `json:"adminId"`
Members []Member `json:"members"`
NoBoost bool `json:"noBoost"`
Cap int64 `json:"cap"`
InitialCapInteraction bool `json:"initialCapInteraction"`
}
func (Input) MarshalJSON ¶
type InteractionPayload ¶
type LastSyncedBlockPayload ¶
type MethodType ¶ added in v0.2.262
type MethodType int
const ( FromLog MethodType = iota FromInput MethodType = iota )
type PollerDeposit ¶ added in v0.2.192
type PollerDeposit struct {
*task.Task
Output chan *[]InteractionPayload
// contains filtered or unexported fields
}
func NewPollerDeposit ¶ added in v0.2.192
func NewPollerDeposit(config *config.Config) (self *PollerDeposit)
func (*PollerDeposit) WithAddressesToPoll ¶ added in v0.2.225
func (self *PollerDeposit) WithAddressesToPoll(addresses string) *PollerDeposit
func (*PollerDeposit) WithDB ¶ added in v0.2.192
func (self *PollerDeposit) WithDB(db *gorm.DB) *PollerDeposit
func (*PollerDeposit) WithInputChannel ¶ added in v0.2.192
func (self *PollerDeposit) WithInputChannel(v chan uint64) *PollerDeposit
func (*PollerDeposit) WithMonitor ¶ added in v0.2.192
func (self *PollerDeposit) WithMonitor(monitor monitoring.Monitor) *PollerDeposit
type Prices ¶ added in v0.2.240
func (*Prices) GetByTokenName ¶ added in v0.2.259
type SommelierTransactionPayload ¶
type SommelierTransactionPayload struct {
Transaction *types.Transaction
FromAddress string
Block *BlockInfoPayload
Method *abi.Method
ParsedInput []byte
Input map[string]interface{}
Assets float64
}
type Store ¶
type Store struct {
*task.Processor[*LastSyncedBlockPayload, *LastSyncedBlockPayload]
// contains filtered or unexported fields
}
Store is responsible for saving last synced block height in sync_state table It updates the table periodically to not overload database with updates done each time after new block has been processed
func (*Store) WithInputChannel ¶
func (self *Store) WithInputChannel(v chan *LastSyncedBlockPayload) *Store
func (*Store) WithMonitor ¶
func (self *Store) WithMonitor(v monitoring.Monitor) *Store
func (*Store) WithSyncedComponent ¶
func (self *Store) WithSyncedComponent(syncedComponent model.SyncedComponent) *Store
type StoreDeposit ¶ added in v0.2.192
func NewStoreDeposit ¶ added in v0.2.192
func NewStoreDeposit(config *config.Config) (self *StoreDeposit)
func (*StoreDeposit) WithDB ¶ added in v0.2.192
func (self *StoreDeposit) WithDB(db *gorm.DB) *StoreDeposit
func (*StoreDeposit) WithInputChannel ¶ added in v0.2.192
func (self *StoreDeposit) WithInputChannel(v chan *SommelierTransactionPayload) *StoreDeposit
func (*StoreDeposit) WithMonitor ¶ added in v0.2.192
func (self *StoreDeposit) WithMonitor(monitor monitoring.Monitor) *StoreDeposit
type SyncerDelta ¶
type SyncerDelta struct {
*task.Task
Output chan *LastSyncedBlockPayload
OutputInteractionPayload chan *[]InteractionPayload
// contains filtered or unexported fields
}
func NewSyncerDelta ¶
func NewSyncerDelta(config *config.Config) (self *SyncerDelta)
This task receives block info in the input channel, iterate through all of the block's transactions in order to check if any of it contains Redstone data and if so - writes an interaction to Warpy. It emits block height and block hash in the Output channel
func (*SyncerDelta) WithInputChannel ¶
func (self *SyncerDelta) WithInputChannel(v chan *BlockInfoPayload) *SyncerDelta
func (*SyncerDelta) WithMonitor ¶
func (self *SyncerDelta) WithMonitor(monitor monitoring.Monitor) *SyncerDelta
type SyncerDeposit ¶ added in v0.2.192
type SyncerDeposit struct {
*task.Task
Output chan *LastSyncedBlockPayload
OutputTransactionPayload chan *SommelierTransactionPayload
// contains filtered or unexported fields
}
func NewSyncerDeposit ¶ added in v0.2.192
func NewSyncerDeposit(config *config.Config) (self *SyncerDeposit)
This task receives block info in the input channel, iterate through all of the block's transactions in order to check if any contains Sommelier transaction and saves transaction in the db
func (*SyncerDeposit) WithContractAbi ¶ added in v0.2.192
func (self *SyncerDeposit) WithContractAbi(contractAbi map[string]*abi.ABI) *SyncerDeposit
func (*SyncerDeposit) WithDb ¶ added in v0.2.192
func (self *SyncerDeposit) WithDb(v *gorm.DB) *SyncerDeposit
func (*SyncerDeposit) WithInputChannel ¶ added in v0.2.192
func (self *SyncerDeposit) WithInputChannel(v chan *BlockInfoPayload) *SyncerDeposit
func (*SyncerDeposit) WithMonitor ¶ added in v0.2.192
func (self *SyncerDeposit) WithMonitor(monitor monitoring.Monitor) *SyncerDeposit
type Writer ¶
func (*Writer) WithInputChannel ¶
func (self *Writer) WithInputChannel(v chan *[]InteractionPayload) *Writer
func (*Writer) WithMonitor ¶
func (self *Writer) WithMonitor(monitor monitoring.Monitor) *Writer