Documentation
¶
Index ¶
- Variables
- type DeployedContract
- func (*DeployedContract) Descriptor() ([]byte, []int)deprecated
- func (x *DeployedContract) GetAddress() []byte
- func (x *DeployedContract) GetClassHash() []byte
- func (*DeployedContract) ProtoMessage()
- func (x *DeployedContract) ProtoReflect() protoreflect.Message
- func (x *DeployedContract) Reset()
- func (x *DeployedContract) String() string
- type Manager
- func (m *Manager) Close()
- func (m *Manager) GetBlockOfProcessedEvent(starknetFact int64) int64
- func (m *Manager) GetLatestBlockSaved() int64
- func (m *Manager) GetLatestBlockSync() int64
- func (m *Manager) GetLatestStateRoot() string
- func (m *Manager) GetStateUpdate(blockHash *felt.Felt) (*types.StateUpdate, error)
- func (m *Manager) StoreBlockOfProcessedEvent(starknetFact, l1Block int64)
- func (m *Manager) StoreLatestBlockSaved(latestBlockSaved int64)
- func (m *Manager) StoreLatestBlockSync(latestBlockSync int64)
- func (m *Manager) StoreLatestStateRoot(stateRoot string)
- func (m *Manager) StoreStateUpdate(stateDiff *types.StateUpdate, blockHash *felt.Felt) error
- type Nonce
- type StateUpdate
- func (*StateUpdate) Descriptor() ([]byte, []int)deprecated
- func (x *StateUpdate) GetBlockHash() []byte
- func (x *StateUpdate) GetDeclaredContracts() [][]byte
- func (x *StateUpdate) GetDeployedContracts() []*DeployedContract
- func (x *StateUpdate) GetNewRoot() []byte
- func (x *StateUpdate) GetNonces() []*Nonce
- func (x *StateUpdate) GetOldRoot() []byte
- func (x *StateUpdate) GetStorageDiffs() map[string]*StorageDiffs
- func (*StateUpdate) ProtoMessage()
- func (x *StateUpdate) ProtoReflect() protoreflect.Message
- func (x *StateUpdate) Reset()
- func (x *StateUpdate) String() string
- type StorageDiff
- type StorageDiffs
Constants ¶
This section is empty.
Variables ¶
var ( DbError = errors.New("database error") UnmarshalError = errors.New("unmarshal error") MarshalError = errors.New("marshal error") )
var File_sync_proto protoreflect.FileDescriptor
Functions ¶
This section is empty.
Types ¶
type DeployedContract ¶
type DeployedContract struct {
Address []byte `protobuf:"bytes,1,opt,name=address,proto3" json:"address,omitempty"`
ClassHash []byte `protobuf:"bytes,2,opt,name=classHash,proto3" json:"classHash,omitempty"`
// contains filtered or unexported fields
}
func (*DeployedContract) Descriptor
deprecated
func (*DeployedContract) Descriptor() ([]byte, []int)
Deprecated: Use DeployedContract.ProtoReflect.Descriptor instead.
func (*DeployedContract) GetAddress ¶
func (x *DeployedContract) GetAddress() []byte
func (*DeployedContract) GetClassHash ¶
func (x *DeployedContract) GetClassHash() []byte
func (*DeployedContract) ProtoMessage ¶
func (*DeployedContract) ProtoMessage()
func (*DeployedContract) ProtoReflect ¶
func (x *DeployedContract) ProtoReflect() protoreflect.Message
func (*DeployedContract) Reset ¶
func (x *DeployedContract) Reset()
func (*DeployedContract) String ¶
func (x *DeployedContract) String() string
type Manager ¶
type Manager struct {
// contains filtered or unexported fields
}
Manager is a Block database manager to save and search the blocks.
func NewManager ¶
NewManager returns a new Block manager using the given database.
func (*Manager) GetBlockOfProcessedEvent ¶
GetBlockOfProcessedEvent returns the block of the latest event processed,
func (*Manager) GetLatestBlockSaved ¶
GetLatestBlockSaved returns the latest block sync.
func (*Manager) GetLatestBlockSync ¶
GetLatestBlockSync returns the latest block sync.
func (*Manager) GetLatestStateRoot ¶
GetLatestStateRoot returns the latest state root.
func (*Manager) GetStateUpdate ¶
func (*Manager) StoreBlockOfProcessedEvent ¶
StoreBlockOfProcessedEvent stores the block of the latest event processed,
func (*Manager) StoreLatestBlockSaved ¶
StoreLatestBlockSaved stores the latest block sync.
func (*Manager) StoreLatestBlockSync ¶
StoreLatestBlockSync stores the latest block sync.
func (*Manager) StoreLatestStateRoot ¶
StoreLatestStateRoot stores the latest state root.
func (*Manager) StoreStateUpdate ¶
StoreStateUpdate stores the state diff for the given block.
type Nonce ¶
type Nonce struct {
ContractAddress []byte `protobuf:"bytes,1,opt,name=contractAddress,proto3" json:"contractAddress,omitempty"`
Nonce []byte `protobuf:"bytes,2,opt,name=nonce,proto3" json:"nonce,omitempty"`
// contains filtered or unexported fields
}
func (*Nonce) Descriptor
deprecated
func (*Nonce) GetContractAddress ¶
func (*Nonce) ProtoMessage ¶
func (*Nonce) ProtoMessage()
func (*Nonce) ProtoReflect ¶
func (x *Nonce) ProtoReflect() protoreflect.Message
type StateUpdate ¶
type StateUpdate struct {
BlockHash []byte `protobuf:"bytes,1,opt,name=blockHash,proto3" json:"blockHash,omitempty"`
NewRoot []byte `protobuf:"bytes,2,opt,name=newRoot,proto3" json:"newRoot,omitempty"`
OldRoot []byte `protobuf:"bytes,3,opt,name=oldRoot,proto3" json:"oldRoot,omitempty"`
// NOTE: map <contractAddressHex, diffs>
StorageDiffs map[string]*StorageDiffs `` /* 165-byte string literal not displayed */
DeclaredContracts [][]byte `protobuf:"bytes,5,rep,name=declaredContracts,proto3" json:"declaredContracts,omitempty"`
DeployedContracts []*DeployedContract `protobuf:"bytes,6,rep,name=deployedContracts,proto3" json:"deployedContracts,omitempty"`
Nonces []*Nonce `protobuf:"bytes,7,rep,name=nonces,proto3" json:"nonces,omitempty"`
// contains filtered or unexported fields
}
func (*StateUpdate) Descriptor
deprecated
func (*StateUpdate) Descriptor() ([]byte, []int)
Deprecated: Use StateUpdate.ProtoReflect.Descriptor instead.
func (*StateUpdate) GetBlockHash ¶
func (x *StateUpdate) GetBlockHash() []byte
func (*StateUpdate) GetDeclaredContracts ¶
func (x *StateUpdate) GetDeclaredContracts() [][]byte
func (*StateUpdate) GetDeployedContracts ¶
func (x *StateUpdate) GetDeployedContracts() []*DeployedContract
func (*StateUpdate) GetNewRoot ¶
func (x *StateUpdate) GetNewRoot() []byte
func (*StateUpdate) GetNonces ¶
func (x *StateUpdate) GetNonces() []*Nonce
func (*StateUpdate) GetOldRoot ¶
func (x *StateUpdate) GetOldRoot() []byte
func (*StateUpdate) GetStorageDiffs ¶
func (x *StateUpdate) GetStorageDiffs() map[string]*StorageDiffs
func (*StateUpdate) ProtoMessage ¶
func (*StateUpdate) ProtoMessage()
func (*StateUpdate) ProtoReflect ¶
func (x *StateUpdate) ProtoReflect() protoreflect.Message
func (*StateUpdate) Reset ¶
func (x *StateUpdate) Reset()
func (*StateUpdate) String ¶
func (x *StateUpdate) String() string
type StorageDiff ¶
type StorageDiff struct {
Key []byte `protobuf:"bytes,1,opt,name=key,proto3" json:"key,omitempty"`
Value []byte `protobuf:"bytes,2,opt,name=value,proto3" json:"value,omitempty"`
// contains filtered or unexported fields
}
func (*StorageDiff) Descriptor
deprecated
func (*StorageDiff) Descriptor() ([]byte, []int)
Deprecated: Use StorageDiff.ProtoReflect.Descriptor instead.
func (*StorageDiff) GetKey ¶
func (x *StorageDiff) GetKey() []byte
func (*StorageDiff) GetValue ¶
func (x *StorageDiff) GetValue() []byte
func (*StorageDiff) ProtoMessage ¶
func (*StorageDiff) ProtoMessage()
func (*StorageDiff) ProtoReflect ¶
func (x *StorageDiff) ProtoReflect() protoreflect.Message
func (*StorageDiff) Reset ¶
func (x *StorageDiff) Reset()
func (*StorageDiff) String ¶
func (x *StorageDiff) String() string
type StorageDiffs ¶
type StorageDiffs struct {
Diffs []*StorageDiff `protobuf:"bytes,1,rep,name=diffs,proto3" json:"diffs,omitempty"`
// contains filtered or unexported fields
}
func (*StorageDiffs) Descriptor
deprecated
func (*StorageDiffs) Descriptor() ([]byte, []int)
Deprecated: Use StorageDiffs.ProtoReflect.Descriptor instead.
func (*StorageDiffs) GetDiffs ¶
func (x *StorageDiffs) GetDiffs() []*StorageDiff
func (*StorageDiffs) ProtoMessage ¶
func (*StorageDiffs) ProtoMessage()
func (*StorageDiffs) ProtoReflect ¶
func (x *StorageDiffs) ProtoReflect() protoreflect.Message
func (*StorageDiffs) Reset ¶
func (x *StorageDiffs) Reset()
func (*StorageDiffs) String ¶
func (x *StorageDiffs) String() string