Documentation ¶
Index ¶
- Constants
- func FormatTransactionId(txId []byte) string
- func NewSynchronizerCreateWorker(inputRepository *repository.InputRepository, ...) supervisor.Worker
- type AbiDecoder
- type FilterID
- type FilterInput
- type FilterOutput
- type Output
- type Pagination
- type RawInput
- type RawRepository
- func (s *RawRepository) FindAllInputsByFilter(ctx context.Context, filter FilterInput, pag *Pagination) ([]RawInput, error)
- func (s *RawRepository) FindAllOutputsByFilter(ctx context.Context, filter FilterID) ([]Output, error)
- func (s *RawRepository) FindAllOutputsExecutedAfter(ctx context.Context, afterUpdatedAt time.Time, rawId uint64) ([]Output, error)
- func (s *RawRepository) FindAllOutputsWithProof(ctx context.Context, filter FilterID) ([]Output, error)
- func (s *RawRepository) FindAllReportsByFilter(ctx context.Context, filter FilterID) ([]Report, error)
- func (s *RawRepository) FindInputByOutput(ctx context.Context, filter FilterID) (*RawInput, error)
- type Report
- type RosettaStatusRef
- type SynchronizerCreateWorker
- type SynchronizerInputCreator
- type SynchronizerOutputCreate
- func (s *SynchronizerOutputCreate) CreateOutput(ctx context.Context, rawOutputRef *repository.RawOutputRef, rawOutput Output) error
- func (s *SynchronizerOutputCreate) GetConvenienceNotice(rawOutput Output) (*model.ConvenienceNotice, error)
- func (s *SynchronizerOutputCreate) GetConvenienceVoucher(rawOutput Output) (*model.ConvenienceVoucher, error)
- func (s *SynchronizerOutputCreate) GetRawOutputRef(rawOutput Output) (*repository.RawOutputRef, error)
- func (s *SynchronizerOutputCreate) SyncOutputs(ctx context.Context) error
- type SynchronizerOutputExecuted
- type SynchronizerOutputUpdate
- type SynchronizerReport
- type SynchronizerUpdate
Constants ¶
View Source
const DEFAULT_DELAY = 3 * time.Second
View Source
const DefaultBatchSize = 50
View Source
const LIMIT = uint64(50)
Variables ¶
This section is empty.
Functions ¶
func NewSynchronizerCreateWorker ¶
func NewSynchronizerCreateWorker( inputRepository *repository.InputRepository, inputRefRepository *repository.RawInputRefRepository, dbRawUrl string, rawRepository *RawRepository, synchronizerUpdate *SynchronizerUpdate, decoder *decoder.OutputDecoder, synchronizerReport *SynchronizerReport, synchronizerOutputUpdate *SynchronizerOutputUpdate, outputRefRepository *repository.RawOutputRefRepository, synchronizerOutputCreate *SynchronizerOutputCreate, synchronizerCreateInput *SynchronizerInputCreator, synchronizerOutputExecuted *SynchronizerOutputExecuted, ) supervisor.Worker
Types ¶
type AbiDecoder ¶
type AbiDecoder struct {
// contains filtered or unexported fields
}
func NewAbiDecoder ¶
func NewAbiDecoder(abi *abi.ABI) *AbiDecoder
type FilterInput ¶
type FilterOutput ¶
type Output ¶
type Output struct { ID uint64 `db:"id"` Index string `db:"index"` InputIndex string `db:"input_index"` RawData []byte `db:"raw_data"` Hash []byte `db:"hash,omitempty"` OutputHashesSiblings []byte `db:"output_hashes_siblings,omitempty"` InputID uint64 `db:"input_id"` TransactionHash []byte `db:"transaction_hash,omitempty"` UpdatedAt time.Time `db:"updated_at"` AppContract []byte `db:"app_contract"` }
type Pagination ¶
type Pagination struct {
Limit uint64
}
type RawInput ¶
type RawInput struct { ID uint64 `db:"id"` Index uint64 `db:"index"` // numeric(20,0) RawData []byte `db:"raw_data"` BlockNumber uint64 `db:"block_number"` // numeric(20,0) Status string `db:"status"` MachineHash []byte `db:"machine_hash,omitempty"` OutputsHash []byte `db:"outputs_hash,omitempty"` ApplicationAddress []byte `db:"application_address"` EpochID uint64 `db:"epoch_id"` TransactionId []byte `db:"transaction_id"` UpdatedAt time.Time `db:"updated_at"` }
type RawRepository ¶
func NewRawRepository ¶
func NewRawRepository(connectionURL string, db *sqlx.DB) *RawRepository
func (*RawRepository) FindAllInputsByFilter ¶
func (s *RawRepository) FindAllInputsByFilter(ctx context.Context, filter FilterInput, pag *Pagination) ([]RawInput, error)
func (*RawRepository) FindAllOutputsByFilter ¶
func (*RawRepository) FindAllOutputsExecutedAfter ¶
func (*RawRepository) FindAllOutputsWithProof ¶
func (*RawRepository) FindAllReportsByFilter ¶
func (*RawRepository) FindInputByOutput ¶
type RosettaStatusRef ¶
type RosettaStatusRef struct { RawStatus string Status model.CompletionStatus }
func GetStatusRosetta ¶
func GetStatusRosetta() []RosettaStatusRef
type SynchronizerCreateWorker ¶
type SynchronizerCreateWorker struct { SynchronizerReport *SynchronizerReport DbRawUrl string RawRepository *RawRepository SynchronizerUpdate *SynchronizerUpdate Decoder *decoder.OutputDecoder SynchronizerOutputUpdate *SynchronizerOutputUpdate SynchronizerOutputCreate *SynchronizerOutputCreate SynchronizerCreateInput *SynchronizerInputCreator SynchronizerOutputExecuted *SynchronizerOutputExecuted // contains filtered or unexported fields }
func (SynchronizerCreateWorker) Start ¶
func (s SynchronizerCreateWorker) Start(ctx context.Context, ready chan<- struct{}) error
Start implements supervisor.Worker.
func (SynchronizerCreateWorker) String ¶
func (s SynchronizerCreateWorker) String() string
String implements supervisor.Worker.
func (SynchronizerCreateWorker) WatchNewInputs ¶
func (s SynchronizerCreateWorker) WatchNewInputs(stdCtx context.Context) error
type SynchronizerInputCreator ¶
type SynchronizerInputCreator struct { InputRepository *repository.InputRepository RawInputRefRepository *repository.RawInputRefRepository RawNodeV2Repository *RawRepository AbiDecoder *AbiDecoder }
func NewSynchronizerInputCreator ¶
func NewSynchronizerInputCreator( inputRepository *repository.InputRepository, rawInputRefRepository *repository.RawInputRefRepository, rawRepository *RawRepository, abiDecoder *AbiDecoder, ) *SynchronizerInputCreator
func (*SynchronizerInputCreator) CreateInput ¶
func (s *SynchronizerInputCreator) CreateInput(ctx context.Context, rawInput RawInput) error
func (*SynchronizerInputCreator) GetAdvanceInputFromMap ¶
func (s *SynchronizerInputCreator) GetAdvanceInputFromMap(rawInput RawInput) (*model.AdvanceInput, error)
func (SynchronizerInputCreator) SyncInputs ¶
func (s SynchronizerInputCreator) SyncInputs(ctx context.Context) error
type SynchronizerOutputCreate ¶
type SynchronizerOutputCreate struct { VoucherRepository *repository.VoucherRepository NoticeRepository *repository.NoticeRepository RawNodeV2Repository *RawRepository RawOutputRefRepository *repository.RawOutputRefRepository AbiDecoder *AbiDecoder }
func NewSynchronizerOutputCreate ¶
func NewSynchronizerOutputCreate( voucherRepository *repository.VoucherRepository, noticeRepository *repository.NoticeRepository, rawRepository *RawRepository, rawOutputRefRepository *repository.RawOutputRefRepository, abiDecoder *AbiDecoder, ) *SynchronizerOutputCreate
func (*SynchronizerOutputCreate) CreateOutput ¶
func (s *SynchronizerOutputCreate) CreateOutput(ctx context.Context, rawOutputRef *repository.RawOutputRef, rawOutput Output) error
func (*SynchronizerOutputCreate) GetConvenienceNotice ¶
func (s *SynchronizerOutputCreate) GetConvenienceNotice(rawOutput Output) (*model.ConvenienceNotice, error)
func (*SynchronizerOutputCreate) GetConvenienceVoucher ¶
func (s *SynchronizerOutputCreate) GetConvenienceVoucher(rawOutput Output) (*model.ConvenienceVoucher, error)
func (*SynchronizerOutputCreate) GetRawOutputRef ¶
func (s *SynchronizerOutputCreate) GetRawOutputRef(rawOutput Output) (*repository.RawOutputRef, error)
func (*SynchronizerOutputCreate) SyncOutputs ¶
func (s *SynchronizerOutputCreate) SyncOutputs(ctx context.Context) error
type SynchronizerOutputExecuted ¶
type SynchronizerOutputExecuted struct { VoucherRepository *repository.VoucherRepository NoticeRepository *repository.NoticeRepository RawNodeV2Repository *RawRepository RawOutputRefRepository *repository.RawOutputRefRepository }
func NewSynchronizerOutputExecuted ¶
func NewSynchronizerOutputExecuted( voucherRepository *repository.VoucherRepository, noticeRepository *repository.NoticeRepository, rawRepository *RawRepository, rawOutputRefRepository *repository.RawOutputRefRepository, ) *SynchronizerOutputExecuted
func (*SynchronizerOutputExecuted) SyncOutputsExecution ¶
func (s *SynchronizerOutputExecuted) SyncOutputsExecution(ctx context.Context) error
func (*SynchronizerOutputExecuted) UpdateExecutionData ¶
func (s *SynchronizerOutputExecuted) UpdateExecutionData( ctx context.Context, rawOutput Output, ) error
type SynchronizerOutputUpdate ¶
type SynchronizerOutputUpdate struct { VoucherRepository *repository.VoucherRepository NoticeRepository *repository.NoticeRepository RawNodeV2Repository *RawRepository RawOutputRefRepository *repository.RawOutputRefRepository }
func NewSynchronizerOutputUpdate ¶
func NewSynchronizerOutputUpdate( voucherRepository *repository.VoucherRepository, noticeRepository *repository.NoticeRepository, rawRepository *RawRepository, rawOutputRefRepository *repository.RawOutputRefRepository, ) *SynchronizerOutputUpdate
func (*SynchronizerOutputUpdate) SyncOutputs ¶
func (s *SynchronizerOutputUpdate) SyncOutputs(ctx context.Context) error
func (*SynchronizerOutputUpdate) UpdateProof ¶
type SynchronizerReport ¶
type SynchronizerReport struct { ReportRepository *repository.ReportRepository RawRepository *RawRepository }
func NewSynchronizerReport ¶
func NewSynchronizerReport( reportRepository *repository.ReportRepository, rawRepository *RawRepository, ) *SynchronizerReport
func (*SynchronizerReport) SyncReports ¶
func (s *SynchronizerReport) SyncReports(ctx context.Context) error
type SynchronizerUpdate ¶
type SynchronizerUpdate struct { DbRawUrl string RawNode *RawRepository RawInputRefRepository *repository.RawInputRefRepository InputRepository *repository.InputRepository BatchSize int }
func NewSynchronizerUpdate ¶
func NewSynchronizerUpdate( rawInputRefRepository *repository.RawInputRefRepository, rawNode *RawRepository, inputRepository *repository.InputRepository, ) SynchronizerUpdate
func (*SynchronizerUpdate) SyncInputStatus ¶
func (s *SynchronizerUpdate) SyncInputStatus(ctx context.Context) error
Click to show internal directories.
Click to hide internal directories.