Documentation ¶
Index ¶
- type ChainGovernorConfigChain
- type ChainGovernorConfigToken
- type ChainGovernorConfigUpdate
- type ChainGovernorStatusChain
- type ChainGovernorStatusEmitter
- type ChainGovernorStatusEnqueuedVAA
- type GovernorStatusUpdate
- type IndexingTimestamps
- type MongoConnections
- type MongoStatus
- type ObservationUpdate
- type Repository
- func (r *Repository) FindVaaByChainID(ctx context.Context, chainID vaa.ChainID, page int64, pageSize int64) ([]*VaaUpdate, error)
- func (r *Repository) GetMongoStatus(ctx context.Context) (*MongoStatus, error)
- func (s *Repository) ReplaceVaaTxHash(ctx context.Context, vaaID, oldTxHash, newTxHash string) error
- func (s *Repository) UpsertGovernorConfig(govC *gossipv1.SignedChainGovernorConfig) error
- func (s *Repository) UpsertGovernorStatus(govS *gossipv1.SignedChainGovernorStatus) error
- func (s *Repository) UpsertHeartbeat(hb *gossipv1.Heartbeat) error
- func (s *Repository) UpsertObservation(o *gossipv1.SignedObservation) error
- func (s *Repository) UpsertTxHash(ctx context.Context, vaaTxHash VaaIdTxHashUpdate) error
- func (s *Repository) UpsertVaa(ctx context.Context, v *vaa.VAA, serializedVaa []byte) error
- type Uint64
- type VaaIdTxHashUpdate
- type VaaUpdate
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ChainGovernorConfigUpdate ¶
type ChainGovernorConfigUpdate struct { NodeName string Counter int64 Timestamp int64 Chains []*ChainGovernorConfigChain Tokens []*ChainGovernorConfigToken }
type ChainGovernorStatusChain ¶
type ChainGovernorStatusChain struct { ChainId uint32 `bson:"chainid"` RemainingAvailableNotional Uint64 `bson:"remainingavailablenotional"` Emitters []*ChainGovernorStatusEmitter `bson:"emitters"` }
type ChainGovernorStatusEmitter ¶
type ChainGovernorStatusEmitter struct { EmitterAddress string `bson:"emitteraddress"` TotalEnqueuedVaas Uint64 `bson:"totalenqueuedvaas"` EnqueuedVaas []*ChainGovernorStatusEnqueuedVAA `bson:"enqueuedvaas"` }
type GovernorStatusUpdate ¶
type GovernorStatusUpdate struct { NodeName string `bson:"nodename"` Counter int64 `bson:"counter"` Timestamp int64 `bson:"timestamp"` Chains []*ChainGovernorStatusChain `bson:"chains"` }
type IndexingTimestamps ¶
type MongoConnections ¶
type MongoConnections struct { Current int32 `bson:"current"` Available int32 `bson:"available"` TotalCreated int32 `bson:"totalCreated"` }
MongoConnections represents a mongo server connection.
type MongoStatus ¶
type MongoStatus struct { Ok int32 `bson:"ok"` Host string `bson:"host"` Version string `bson:"version"` Process string `bson:"process"` Pid int32 `bson:"pid"` Uptime int32 `bson:"uptime"` Connections *MongoConnections `bson:"connections"` }
MongoStatus represent a mongo server status.
type ObservationUpdate ¶
type ObservationUpdate struct { MessageID string `bson:"messageId"` ChainID vaa.ChainID `bson:"emitterChain"` Emitter string `bson:"emitterAddr"` Sequence string `bson:"sequence"` Hash []byte `bson:"hash"` TxHash []byte `bson:"txHash"` PhylaxAddr string `bson:"phylaxAddr"` Signature []byte `bson:"signature"` UpdatedAt *time.Time `bson:"updatedAt"` }
func (*ObservationUpdate) ToMap ¶
func (v *ObservationUpdate) ToMap() map[string]string
type Repository ¶
type Repository struct {
// contains filtered or unexported fields
}
TODO separate and maybe share between fly and web
func NewRepository ¶
func NewRepository(alertService alert.AlertClient, metrics metrics.Metrics, db *mongo.Database, vaaTopicFunc producer.PushFunc, log *zap.Logger) *Repository
TODO wrap repository with a service that filters using redis
func (*Repository) FindVaaByChainID ¶
func (*Repository) GetMongoStatus ¶
func (r *Repository) GetMongoStatus(ctx context.Context) (*MongoStatus, error)
GetMongoStatus get mongo server status
func (*Repository) ReplaceVaaTxHash ¶
func (s *Repository) ReplaceVaaTxHash(ctx context.Context, vaaID, oldTxHash, newTxHash string) error
func (*Repository) UpsertGovernorConfig ¶
func (s *Repository) UpsertGovernorConfig(govC *gossipv1.SignedChainGovernorConfig) error
func (*Repository) UpsertGovernorStatus ¶
func (s *Repository) UpsertGovernorStatus(govS *gossipv1.SignedChainGovernorStatus) error
func (*Repository) UpsertHeartbeat ¶
func (s *Repository) UpsertHeartbeat(hb *gossipv1.Heartbeat) error
func (*Repository) UpsertObservation ¶
func (s *Repository) UpsertObservation(o *gossipv1.SignedObservation) error
func (*Repository) UpsertTxHash ¶
func (s *Repository) UpsertTxHash(ctx context.Context, vaaTxHash VaaIdTxHashUpdate) error
type VaaIdTxHashUpdate ¶
type VaaIdTxHashUpdate struct { ChainID vaa.ChainID `bson:"emitterChain"` Emitter string `bson:"emitterAddr"` Sequence string `bson:"sequence"` TxHash string `bson:"txHash"` OriginTxHash *string `bson:"_originTxHash,omitempty"` //this is temporary field for fix enconding txHash UpdatedAt *time.Time `bson:"updatedAt"` }
type VaaUpdate ¶
type VaaUpdate struct { ID string `bson:"_id"` Version uint8 `bson:"version"` EmitterChain vaa.ChainID `bson:"emitterChain"` EmitterAddr string `bson:"emitterAddr"` Sequence string `bson:"sequence"` PhylaxSetIndex uint32 `bson:"phylaxSetIndex"` Vaa []byte `bson:"vaas"` TxHash string `bson:"txHash,omitempty"` OriginTxHash *string `bson:"_originTxHash,omitempty"` //this is temporary field for fix enconding txHash Timestamp *time.Time `bson:"timestamp"` UpdatedAt *time.Time `bson:"updatedAt"` }
Click to show internal directories.
Click to hide internal directories.