Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 1 addition & 7 deletions config.toml
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ chain_id = 162
eth_rpc_url = "http://localhost:9650/ext/bc/C/rpc"
# api key may be needed for access to production nodes
api_key = ""
# private_key_file is needed for voting and mirroring clients
# private_key_file is needed for mirroring client
private_key_file = "path/to/private/key/file"

[x_chain_indexer]
Expand All @@ -52,12 +52,6 @@ period = "90s"
uptime_threshold = 0.8
delete_old_uptimes_epoch_threshold = 5

[voting_cronjob]
enabled = false
timeout = "10s"
# first epoch to be voted for (do not leave this empty since the first epoch is well back in time)
first = 1111

[mirroring_cronjob]
enabled = false
timeout = "10s"
Expand Down
7 changes: 0 additions & 7 deletions indexer/config/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@ type Config struct {
PChainIndexer IndexerConfig `toml:"p_chain_indexer"`
UptimeCronjob UptimeConfig `toml:"uptime_cronjob"`
Mirror MirrorConfig `toml:"mirroring_cronjob"`
VotingCronjob VotingConfig `toml:"voting_cronjob"`
ContractAddresses ContractAddresses `toml:"contract_addresses"`
}

Expand All @@ -44,12 +43,6 @@ type MirrorConfig struct {
config.EpochConfig
}

type VotingConfig struct {
CronjobConfig
config.EpochConfig
GasLimit uint64 `toml:"gas_limit" envconfig:"VOTING_GAS_LIMIT"`
}

type UptimeConfig struct {
CronjobConfig
Period time.Duration `toml:"period" envconfig:"UPTIME_EPOCH_PERIOD"`
Expand Down
11 changes: 0 additions & 11 deletions indexer/cronjob/cronjob.go
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
package cronjob

import (
"flare-indexer/database"
"flare-indexer/indexer/config"
"flare-indexer/indexer/shared"
"flare-indexer/logger"
Expand Down Expand Up @@ -98,11 +97,6 @@ func (c *epochCronjob) UpdateCronjobStatus(status shared.HealthStatus) {
}
}

// Get processing range (closed interval)
func (c *epochCronjob) getEpochRange(start int64, now time.Time) *epochRange {
return c.getTrimmedEpochRange(start, c.epochs.GetEpochIndex(now)-1)
}

// Get trimmed processing range (closed interval)
func (c *epochCronjob) getTrimmedEpochRange(start, end int64) *epochRange {
start = utils.Max(start, c.epochs.First)
Expand All @@ -118,11 +112,6 @@ func (c *epochCronjob) getTrimmedEpochRange(start, end int64) *epochRange {
return &epochRange{start, end}
}

func (c *epochCronjob) indexerBehind(idxState *database.State, epoch int64) bool {
epochEnd := c.epochs.GetEndTime(epoch)
return epochEnd.After(idxState.Updated.Add(-c.delay)) || idxState.NextDBIndex <= idxState.LastChainIndex
}

func (c *epochCronjob) updateLastEpochMetrics(epoch int64) {
if c.metrics != nil {
c.metrics.lastEpoch.Set(float64(epoch))
Expand Down
10 changes: 0 additions & 10 deletions indexer/cronjob/migrations.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,19 +9,9 @@ import (
)

func init() {
migrations.Container.Add("2023-08-25-00-00", "Create initial state for voting cronjob", createVotingCronjobState)
migrations.Container.Add("2023-08-30-00-00", "Create initial state for mirror cronjob", createMirrorCronjobState)
}

func createVotingCronjobState(db *gorm.DB) error {
return database.CreateState(db, &database.State{
Name: votingStateName,
NextDBIndex: 0,
LastChainIndex: 0,
Updated: time.Now(),
})
}

func createMirrorCronjobState(db *gorm.DB) error {
return database.CreateState(db, &database.State{
Name: mirrorStateName,
Expand Down
191 changes: 0 additions & 191 deletions indexer/cronjob/voting.go

This file was deleted.

Loading