{"modulePath":"github.com/onflow/flow-archive","version":"v0.31.9-decrease-wait-interval","isLatest":false,"isStandardLibrary":false,"goos":"all","goarch":"all","docs":"# package archive\n\n## Constants\n\n```go\nconst (\n\tFlowBlockchain = \"flow\"\n\tFlowMainnet    = flow.Mainnet\n\tFlowTestnet    = flow.Testnet\n\tFlowLocalnet   = flow.Localnet\n\tFlowSymbol     = \"FLOW\"\n\tFlowDecimals   = 8\n\n\tStatusCompleted = \"COMPLETED\"\n\n\tOperationTransfer = \"TRANSFER\"\n)\n```\nFlow constant parameters.\n\n## Variables\n\n```go\nvar (\n\tErrFinished    = errors.New(\"finished\")\n\tErrUnavailable = errors.New(\"unavailable\")\n)\n```\nSentinel errors.\n\n```go\nvar FlowParams = make(map[flow.ChainID]Params)\n```\nFlowParams is a map that contains the parameters for each known Flow chain.\n\n## Functions\n\n```go\nfunc DefaultOptions(dir string) badger.Options\n```\nDefaultOptions returns the default Badger options preferred by the DPS for its index database.\n\n## Types\n\n```go\ntype Chain interface {\n\tRoot() (uint64, error)\n\tHeader(height uint64) (*flow.Header, error)\n\tCommit(height uint64) (flow.StateCommitment, error)\n\tEvents(height uint64) ([]flow.Event, error)\n\tCollections(height uint64) ([]*flow.LightCollection, error)\n\tGuarantees(height uint64) ([]*flow.CollectionGuarantee, error)\n\tTransactions(height uint64) ([]*flow.TransactionBody, error)\n\tResults(height uint64) ([]*flow.TransactionResult, error)\n\tSeals(height uint64) ([]*flow.Seal, error)\n}\n```\nChain represents something that has access to chain data.\n\n```go\ntype Codec interface {\n\tEncode(value interface{}) ([]byte, error)\n\tCompress(data []byte) ([]byte, error)\n\n\tDecode(data []byte, value interface{}) error\n\tDecompress(compressed []byte) ([]byte, error)\n\n\tMarshal(value interface{}) ([]byte, error)\n\tUnmarshal(compressed []byte, value interface{}) error\n}\n```\nCodec represents something that can encode and decode data, as well as compress and decompress it.\n\n```go\ntype Library interface {\n\tReadLibrary\n\tWriteLibrary\n}\n```\nLibrary represents something that produces operations to read/write from/on a DPS index database.\n\nDEPRECATED: please move methods to Library2.\n\n```go\ntype Library2 interface {\n\tReadLibrary2\n\tWriteLibrary2\n\n\tio.Closer\n}\n```\nNew pebble-based database interface.\n\n```go\ntype Params struct {\n\tChainID          flow.ChainID\n\tFungibleToken    flow.Address\n\tFlowFees         flow.Address\n\tStakingTable     flow.Address\n\tLockedTokens     flow.Address\n\tStakingProxy     flow.Address\n\tNonFungibleToken flow.Address\n\tTokens           map[string]Token\n}\n```\nParams contains the parameters of a Flow chain.\n\n```go\nfunc (p Params) Symbols() []string\n```\nSymbols returns the sorted symbols of all tokens within the parameters.\n\n```go\ntype ReadLibrary interface {\n\tRetrieveFirst(height *uint64) func(*badger.Txn) error\n\tRetrieveLast(height *uint64) func(*badger.Txn) error\n\n\tLookupHeightForBlock(blockID flow.Identifier, height *uint64) func(*badger.Txn) error\n\tLookupHeightForTransaction(txID flow.Identifier, height *uint64) func(*badger.Txn) error\n\n\tRetrieveCommit(height uint64, commit *flow.StateCommitment) func(*badger.Txn) error\n\tRetrieveHeader(height uint64, header *flow.Header) func(*badger.Txn) error\n\tRetrieveEvents(height uint64, types []flow.EventType, events *[]flow.Event) func(*badger.Txn) error\n\n\tLookupTransactionsForHeight(height uint64, txIDs *[]flow.Identifier) func(*badger.Txn) error\n\tLookupTransactionsForCollection(collID flow.Identifier, txIDs *[]flow.Identifier) func(*badger.Txn) error\n\tLookupCollectionsForHeight(height uint64, collIDs *[]flow.Identifier) func(*badger.Txn) error\n\tLookupSealsForHeight(height uint64, sealIDs *[]flow.Identifier) func(*badger.Txn) error\n\n\tRetrieveCollection(collID flow.Identifier, collection *flow.LightCollection) func(*badger.Txn) error\n\tRetrieveGuarantee(collID flow.Identifier, collection *flow.CollectionGuarantee) func(*badger.Txn) error\n\tRetrieveTransaction(txID flow.Identifier, transaction *flow.TransactionBody) func(*badger.Txn) error\n\tRetrieveResult(txID flow.Identifier, result *flow.TransactionResult) func(*badger.Txn) error\n\tRetrieveSeal(sealID flow.Identifier, seal *flow.Seal) func(*badger.Txn) error\n}\n```\nReadLibrary represents something that produces operations to read from a DPS index database.\n\nDEPRECATED: please move methods to ReadLibrary2.\n\n```go\ntype ReadLibrary2 interface {\n\tGetPayload(height uint64, reg flow.RegisterID) ([]byte, error)\n}\n```\n\n```go\ntype Reader interface {\n\tFirst() (uint64, error)\n\tLast() (uint64, error)\n\n\tHeightForBlock(blockID flow.Identifier) (uint64, error)\n\tHeightForTransaction(txID flow.Identifier) (uint64, error)\n\n\tCommit(height uint64) (flow.StateCommitment, error)\n\tHeader(height uint64) (*flow.Header, error)\n\tEvents(height uint64, types ...flow.EventType) ([]flow.Event, error)\n\tValues(height uint64, regs flow.RegisterIDs) ([]flow.RegisterValue, error)\n\n\tCollection(collID flow.Identifier) (*flow.LightCollection, error)\n\tGuarantee(collID flow.Identifier) (*flow.CollectionGuarantee, error)\n\tTransaction(txID flow.Identifier) (*flow.TransactionBody, error)\n\tSeal(sealID flow.Identifier) (*flow.Seal, error)\n\tResult(txID flow.Identifier) (*flow.TransactionResult, error)\n\n\tCollectionsByHeight(height uint64) ([]flow.Identifier, error)\n\tTransactionsByHeight(height uint64) ([]flow.Identifier, error)\n\tSealsByHeight(height uint64) ([]flow.Identifier, error)\n}\n```\nReader represents something that can read from a DPS index.\n\n```go\ntype SafeDeque struct {\n\t// contains filtered or unexported fields\n}\n```\nSafeDeque is a concurrency-safe double-ended queue. NOTE: As specified in the original Deque documentation, concurrency safety is up to the consumer to provide. See [https://github.com/gammazero/deque](https://github.com/gammazero/deque)\n\n```go\nfunc NewDeque() *SafeDeque\n```\nNewDeque instantiates and returns a new empty double-ended queue.\n\n```go\nfunc (s *SafeDeque) Back() interface{}\n```\nBack returns the element at the back of the queue. It panics if the queue is empty.\n\n```go\nfunc (s *SafeDeque) Cap() int\n```\nCap returns the capacity of the queue.\n\n```go\nfunc (s *SafeDeque) Clear()\n```\nClear removes all elements from the queue, but retains the current capacity.\n\n```go\nfunc (s *SafeDeque) Front() interface{}\n```\nFront returns the element at the front of the queue. It panics if the queue is empty.\n\n```go\nfunc (s *SafeDeque) Len() int\n```\nLen returns the length of the queue.\n\n```go\nfunc (s *SafeDeque) PopBack() interface{}\n```\nPopBack removes and returns the element from the back of the queue.\n\n```go\nfunc (s *SafeDeque) PopFront() interface{}\n```\nPopFront removes and returns the element from the front of the queue.\n\n```go\nfunc (s *SafeDeque) PushBack(v interface{})\n```\nPushBack appends an element to the back of the  queue.\n\n```go\nfunc (s *SafeDeque) PushFront(v interface{})\n```\nPushFront prepends an element to the front of the queue.\n\n```go\nfunc (s *SafeDeque) Rotate(n int)\n```\nRotate rotates the deque n steps front-to-back.\n\n```go\nfunc (s *SafeDeque) Set(i int, v interface{})\n```\nSet puts the element at index i in the queue.\n\n```go\nfunc (s *SafeDeque) SetMinCapacity(cap uint)\n```\nSetMinCapacity sets a minimum capacity of 2^cap. If the value of the minimum capacity is less than or equal to the minimum allowed, then capacity is set to the minimum allowed.\n\n```go\ntype Token struct {\n\tSymbol   string\n\tAddress  flow.Address\n\tType     string\n\tVault    string\n\tReceiver string\n\tBalance  string\n}\n```\nToken contains the details of a crypto token.\n\n```go\ntype WriteLibrary interface {\n\tSaveFirst(height uint64) func(*badger.Txn) error\n\tSaveLast(height uint64) func(*badger.Txn) error\n\n\tIndexHeightForBlock(blockID flow.Identifier, height uint64) func(*badger.Txn) error\n\tIndexHeightForTransaction(txID flow.Identifier, height uint64) func(*badger.Txn) error\n\n\tSaveCommit(height uint64, commit flow.StateCommitment) func(*badger.Txn) error\n\tSaveHeader(height uint64, header *flow.Header) func(*badger.Txn) error\n\tSaveEvents(height uint64, typ flow.EventType, events []flow.Event) func(*badger.Txn) error\n\n\tIndexTransactionsForHeight(height uint64, txIDs []flow.Identifier) func(*badger.Txn) error\n\tIndexTransactionsForCollection(collID flow.Identifier, txIDs []flow.Identifier) func(*badger.Txn) error\n\tIndexCollectionsForHeight(height uint64, collIDs []flow.Identifier) func(*badger.Txn) error\n\tIndexSealsForHeight(height uint64, sealIDs []flow.Identifier) func(*badger.Txn) error\n\n\tSaveCollection(collection *flow.LightCollection) func(*badger.Txn) error\n\tSaveGuarantee(guarantee *flow.CollectionGuarantee) func(*badger.Txn) error\n\tSaveTransaction(transaction *flow.TransactionBody) func(*badger.Txn) error\n\tSaveResult(results *flow.TransactionResult) func(*badger.Txn) error\n\tSaveSeal(seal *flow.Seal) func(*badger.Txn) error\n}\n```\nWriteLibrary represents something that produces operations to write on a DPS index database.\n\nDEPRECATED: please move methods to WriteLibrary2.\n\n```go\ntype WriteLibrary2 interface {\n\tBatchSetPayload(height uint64, entries flow.RegisterEntries) error\n}\n```\n\n```go\ntype Writer interface {\n\tFirst(height uint64) error\n\tLast(height uint64) error\n\n\tHeight(blockID flow.Identifier, height uint64) error\n\n\tCommit(height uint64, commit flow.StateCommitment) error\n\tHeader(height uint64, header *flow.Header) error\n\tEvents(height uint64, events []flow.Event) error\n\tPayloads(height uint64, payloads []*ledger.Payload) error\n\tRegisters(height uint64, registers []*wal.LeafNode) error\n\n\tCollections(height uint64, collections []*flow.LightCollection) error\n\tGuarantees(height uint64, guarantees []*flow.CollectionGuarantee) error\n\tTransactions(height uint64, transactions []*flow.TransactionBody) error\n\tResults(results []*flow.TransactionResult) error\n\tSeals(height uint64, seals []*flow.Seal) error\n}\n```\nWriter represents something that can write on a DPS index.\n\n","path":"github.com/onflow/flow-archive/models/archive","name":"archive","synopsis":"","isRedistributable":true}
