github.com/koko1123/flow-go-1@v0.29.6/storage/badger/all.go (about)

     1  package badger
     2  
     3  import (
     4  	"github.com/dgraph-io/badger/v3"
     5  
     6  	"github.com/koko1123/flow-go-1/module"
     7  	"github.com/koko1123/flow-go-1/storage"
     8  )
     9  
    10  func InitAll(metrics module.CacheMetrics, db *badger.DB) *storage.All {
    11  	headers := NewHeaders(metrics, db)
    12  	guarantees := NewGuarantees(metrics, db, DefaultCacheSize)
    13  	seals := NewSeals(metrics, db)
    14  	index := NewIndex(metrics, db)
    15  	results := NewExecutionResults(metrics, db)
    16  	receipts := NewExecutionReceipts(metrics, db, results, DefaultCacheSize)
    17  	payloads := NewPayloads(db, index, guarantees, seals, receipts, results)
    18  	blocks := NewBlocks(db, headers, payloads)
    19  	setups := NewEpochSetups(metrics, db)
    20  	epochCommits := NewEpochCommits(metrics, db)
    21  	statuses := NewEpochStatuses(metrics, db)
    22  
    23  	commits := NewCommits(metrics, db)
    24  	transactions := NewTransactions(metrics, db)
    25  	transactionResults := NewTransactionResults(metrics, db, 10000)
    26  	collections := NewCollections(db, transactions)
    27  	events := NewEvents(metrics, db)
    28  	chunkDataPacks := NewChunkDataPacks(metrics, db, collections, 1000)
    29  
    30  	return &storage.All{
    31  		Headers:            headers,
    32  		Guarantees:         guarantees,
    33  		Seals:              seals,
    34  		Index:              index,
    35  		Payloads:           payloads,
    36  		Blocks:             blocks,
    37  		Setups:             setups,
    38  		EpochCommits:       epochCommits,
    39  		Statuses:           statuses,
    40  		Results:            results,
    41  		Receipts:           receipts,
    42  		ChunkDataPacks:     chunkDataPacks,
    43  		Commits:            commits,
    44  		Transactions:       transactions,
    45  		TransactionResults: transactionResults,
    46  		Collections:        collections,
    47  		Events:             events,
    48  	}
    49  }