package storage import "github.com/Fuwn/plutia/internal/types" type BlockHashEntry struct { BlockID uint64 Hash string } type OperationMutation struct { State types.StateV1 Ref *types.BlockRefV1 } type Store interface { Close() error GetMode() (string, error) SetMode(mode string) error GetGlobalSeq() (uint64, error) SetGlobalSeq(seq uint64) error PutState(state types.StateV1) error DeleteState(did string) error GetState(did string) (types.StateV1, bool, error) ListStates() ([]types.StateV1, error) ForEachState(fn func(types.StateV1) error) error PutThinCacheMeta(meta types.ThinCacheMetaV1) error GetThinCacheMeta(did string) (types.ThinCacheMetaV1, bool, error) ListThinCacheMeta() ([]types.ThinCacheMetaV1, error) DeleteThinCacheMeta(did string) error ApplyOperationsBatch(ops []OperationMutation, blockHashes []BlockHashEntry) error SetChainHead(did string, seq uint64) error GetChainHead(did string) (uint64, bool, error) AddDIDSequence(did string, seq uint64) error ListDIDSequences(did string) ([]uint64, error) PutOpSeqRef(seq uint64, ref types.BlockRefV1) error GetOpSeqRef(seq uint64) (types.BlockRefV1, bool, error) ForEachOpSeqRef(fn func(seq uint64, ref types.BlockRefV1) error) error PutBlockHash(blockID uint64, hash string) error GetBlockHash(blockID uint64) (string, bool, error) ListBlockHashes() ([]string, error) ListBlockHashEntries() ([]BlockHashEntry, error) PutCheckpoint(cp types.CheckpointV1) error GetCheckpoint(sequence uint64) (types.CheckpointV1, bool, error) GetLatestCheckpoint() (types.CheckpointV1, bool, error) }