Skip to content

Commit

Permalink
Add targetEpoch index
Browse files Browse the repository at this point in the history
  • Loading branch information
kacpersaw committed Feb 28, 2024
1 parent 21e7a04 commit 71d21c9
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions storage/atx.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ func (s *Storage) InitActivationsStorage(ctx context.Context) error {
{Keys: bson.D{{Key: "layer", Value: 1}}, Options: options.Index().SetName("layerIndex").SetUnique(false)},
{Keys: bson.D{{Key: "smesher", Value: 1}}, Options: options.Index().SetName("smesherIndex").SetUnique(false)},
{Keys: bson.D{{Key: "coinbase", Value: 1}}, Options: options.Index().SetName("coinbaseIndex").SetUnique(false)},
{Keys: bson.D{{Key: "targetEpoch", Value: 1}}, Options: options.Index().SetName("targetEpochIndex").SetUnique(false)},
}
_, err := s.db.Collection("activations").Indexes().CreateMany(ctx, models, options.CreateIndexes().SetMaxTime(20*time.Second))
return err
Expand Down

0 comments on commit 71d21c9

Please sign in to comment.