Documentation
¶
Index ¶
- Constants
- func GetDataDir() string
- func GetNetwork() string
- func SetDataDir(dir string)
- func SetNetwork(network string)
- type ChainState
- func (s *ChainState) BeginTransaction() (*ChainStateTransaction, error)
- func (s *ChainState) CelestiaHeightOffset() (uint64, error)
- func (s *ChainState) ChainID() (string, error)
- func (s *ChainState) Close() error
- func (s *ChainState) FinalizedHeight() (uint64, error)
- func (s *ChainState) GetBlock(height uint64) (*types.Block, error)
- func (s *ChainState) GetBlockByHash(hash HashKey) (*types.Block, error)
- func (s *ChainState) GetChunk(key HashKey) ([]byte, bool, error)
- func (s *ChainState) GetDirectoryManifest(id *types.BlobIdentifier) (*pbStorageV1.DirectoryManifest, bool, error)
- func (s *ChainState) GetFileManifest(id *types.BlobIdentifier) (*pbStorageV1.FileManifest, bool, error)
- func (s *ChainState) GetStateMMR(height uint64) (*mmr.MMR, error)
- func (s *ChainState) SetCelestiaHeightOffset(offset uint64) error
- func (s *ChainState) SetChainID(id string) error
- type ChainStateTransaction
- func (tx *ChainStateTransaction) Abort() error
- func (tx *ChainStateTransaction) Commit() error
- func (tx *ChainStateTransaction) GetChunk(key HashKey) ([]byte, bool, error)
- func (tx *ChainStateTransaction) GetFileManifest(id *types.BlobIdentifier) (*pbStorageV1.FileManifest, bool, error)
- func (tx *ChainStateTransaction) PutBlock(height uint64, block *types.Block) error
- func (tx *ChainStateTransaction) PutChunk(key HashKey, value []byte) error
- func (tx *ChainStateTransaction) PutDirectoryManifest(id *types.BlobIdentifier, manifest *pbStorageV1.DirectoryManifest) error
- func (tx *ChainStateTransaction) PutFileManifest(id *types.BlobIdentifier, manifest *pbStorageV1.FileManifest) error
- func (tx *ChainStateTransaction) PutStateMMR(height uint64, mmr *mmr.MMR) error
- func (tx *ChainStateTransaction) SetFinalizedHeight(height uint64) error
- type HashKey
- type UploadRecord
- type UploadRecordKey
- type UploadState
Constants ¶
View Source
const ( ChainStateDb = "chain.db" UploadStateDb = "upload.db" ChainIDMocha = "blobcast-mocha-1" ChainIDMammoth = "blobcast-mamo-1" ChainIDCelestia = "blobcast-1" CelestiaNamespace = "626C6F62636173742D31" // blobcast-1 StartHeightMocha = 6383285 StartHeightMammoth = 1000000000 // mammoth TODO StartHeightCelestia = 1000000000 // mainnet TODO )
Variables ¶
This section is empty.
Functions ¶
func GetDataDir ¶
func GetDataDir() string
func GetNetwork ¶
func GetNetwork() string
func SetDataDir ¶
func SetDataDir(dir string)
func SetNetwork ¶
func SetNetwork(network string)
Types ¶
type ChainState ¶
type ChainState struct {
// contains filtered or unexported fields
}
func GetChainState ¶
func GetChainState() (*ChainState, error)
func (*ChainState) BeginTransaction ¶
func (s *ChainState) BeginTransaction() (*ChainStateTransaction, error)
func (*ChainState) CelestiaHeightOffset ¶
func (s *ChainState) CelestiaHeightOffset() (uint64, error)
func (*ChainState) ChainID ¶
func (s *ChainState) ChainID() (string, error)
func (*ChainState) Close ¶
func (s *ChainState) Close() error
func (*ChainState) FinalizedHeight ¶
func (s *ChainState) FinalizedHeight() (uint64, error)
func (*ChainState) GetBlockByHash ¶
func (s *ChainState) GetBlockByHash(hash HashKey) (*types.Block, error)
func (*ChainState) GetDirectoryManifest ¶
func (s *ChainState) GetDirectoryManifest(id *types.BlobIdentifier) (*pbStorageV1.DirectoryManifest, bool, error)
func (*ChainState) GetFileManifest ¶
func (s *ChainState) GetFileManifest(id *types.BlobIdentifier) (*pbStorageV1.FileManifest, bool, error)
func (*ChainState) GetStateMMR ¶
func (s *ChainState) GetStateMMR(height uint64) (*mmr.MMR, error)
func (*ChainState) SetCelestiaHeightOffset ¶
func (s *ChainState) SetCelestiaHeightOffset(offset uint64) error
func (*ChainState) SetChainID ¶
func (s *ChainState) SetChainID(id string) error
type ChainStateTransaction ¶
type ChainStateTransaction struct {
// contains filtered or unexported fields
}
func NewChainStateTransaction ¶
func NewChainStateTransaction(state *ChainState) *ChainStateTransaction
func (*ChainStateTransaction) Abort ¶
func (tx *ChainStateTransaction) Abort() error
func (*ChainStateTransaction) Commit ¶
func (tx *ChainStateTransaction) Commit() error
func (*ChainStateTransaction) GetChunk ¶
func (tx *ChainStateTransaction) GetChunk(key HashKey) ([]byte, bool, error)
func (*ChainStateTransaction) GetFileManifest ¶
func (tx *ChainStateTransaction) GetFileManifest(id *types.BlobIdentifier) (*pbStorageV1.FileManifest, bool, error)
func (*ChainStateTransaction) PutBlock ¶
func (tx *ChainStateTransaction) PutBlock(height uint64, block *types.Block) error
func (*ChainStateTransaction) PutChunk ¶
func (tx *ChainStateTransaction) PutChunk(key HashKey, value []byte) error
func (*ChainStateTransaction) PutDirectoryManifest ¶
func (tx *ChainStateTransaction) PutDirectoryManifest(id *types.BlobIdentifier, manifest *pbStorageV1.DirectoryManifest) error
func (*ChainStateTransaction) PutFileManifest ¶
func (tx *ChainStateTransaction) PutFileManifest(id *types.BlobIdentifier, manifest *pbStorageV1.FileManifest) error
func (*ChainStateTransaction) PutStateMMR ¶
func (tx *ChainStateTransaction) PutStateMMR(height uint64, mmr *mmr.MMR) error
func (*ChainStateTransaction) SetFinalizedHeight ¶
func (tx *ChainStateTransaction) SetFinalizedHeight(height uint64) error
type UploadRecord ¶
type UploadRecord struct {
Key UploadRecordKey `json:"key"`
Completed bool `json:"completed"`
ManifestID string `json:"manifest_id,omitempty"`
}
type UploadRecordKey ¶
type UploadRecordKey [32]byte
type UploadState ¶
type UploadState struct {
// contains filtered or unexported fields
}
func GetUploadState ¶
func GetUploadState() (*UploadState, error)
func (*UploadState) DeleteUploadRecord ¶
func (s *UploadState) DeleteUploadRecord(key UploadRecordKey) error
func (*UploadState) GetUploadRecord ¶
func (s *UploadState) GetUploadRecord(key UploadRecordKey) (*UploadRecord, error)
func (*UploadState) SaveUploadRecord ¶
func (s *UploadState) SaveUploadRecord(uploadRecord *UploadRecord) error
Click to show internal directories.
Click to hide internal directories.