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