Skip to content

Commit

Permalink
cleanup: remove indexer v1 from codebase (#5477)
Browse files Browse the repository at this point in the history
  • Loading branch information
gmalouf authored Jun 21, 2023
1 parent 0824e4a commit 5f496cf
Show file tree
Hide file tree
Showing 11 changed files with 12 additions and 794 deletions.
2 changes: 2 additions & 0 deletions .golangci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,8 @@ linters-settings:
exclude-functions:
# We do this 121 times and never check the error.
- (*github.com/spf13/cobra.Command).MarkFlagRequired
- (*github.com/spf13/pflag.FlagSet).MarkDeprecated
- (*github.com/spf13/pflag.FlagSet).MarkShorthandDeprecated
govet:
check-shadowing: true
settings:
Expand Down
12 changes: 8 additions & 4 deletions cmd/goal/node.go
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,6 @@ var waitSec uint32
var newNodeNetwork string
var newNodeDestination string
var newNodeArchival bool
var newNodeIndexer bool
var newNodeRelay string
var newNodeFullConfig bool
var watchMillisecond uint64
Expand Down Expand Up @@ -98,7 +97,13 @@ func init() {
createCmd.Flags().StringVar(&newNodeDestination, "destination", "", "Destination path for the new node")
createCmd.Flags().BoolVarP(&newNodeArchival, "archival", "a", localDefaults.Archival, "Make the new node archival, storing all blocks")
createCmd.Flags().BoolVarP(&runUnderHost, "hosted", "H", localDefaults.RunHosted, "Configure the new node to run hosted by algoh")
createCmd.Flags().BoolVarP(&newNodeIndexer, "indexer", "i", localDefaults.IsIndexerActive, "Configure the new node to enable the indexer feature (implies --archival)")

// The flag for enabling an internal indexer is now deprecated, but we keep it for backwards compatibility for now.
indexerFlagName := "indexer"
_ = createCmd.Flags().BoolP(indexerFlagName, "i", false, "")
createCmd.Flags().MarkDeprecated(indexerFlagName, "no longer used, please remove from your scripts")
createCmd.Flags().MarkShorthandDeprecated(indexerFlagName, "no longer used, please remove from your scripts")

createCmd.Flags().StringVar(&newNodeRelay, "relay", localDefaults.NetAddress, "Configure as a relay with specified listening address (NetAddress)")
createCmd.Flags().StringVar(&listenIP, "api", "", "REST API Endpoint")
createCmd.Flags().BoolVar(&newNodeFullConfig, "full-config", false, "Store full config file")
Expand Down Expand Up @@ -680,8 +685,7 @@ var createCmd = &cobra.Command{
reportErrorf(errorNodeCreationIPFailure, listenIP)
}
}
localConfig.Archival = newNodeArchival || newNodeRelay != "" || newNodeIndexer
localConfig.IsIndexerActive = newNodeIndexer
localConfig.Archival = newNodeArchival || newNodeRelay != ""
localConfig.RunHosted = runUnderHost
localConfig.EnableLedgerService = localConfig.Archival
localConfig.EnableBlockService = localConfig.Archival
Expand Down
4 changes: 0 additions & 4 deletions config/localTemplate.go
Original file line number Diff line number Diff line change
Expand Up @@ -237,10 +237,6 @@ type Local struct {
// the max size the sync server would return
TxSyncServeResponseSize int `version[3]:"1000000"`

// IsIndexerActive indicates whether to activate the indexer for fast retrieval of transactions
// Note -- Indexer cannot operate on non Archival nodes
IsIndexerActive bool `version[3]:"false"`

// UseXForwardedForAddress indicates whether or not the node should use the X-Forwarded-For HTTP Header when
// determining the source of a connection. If used, it should be set to the string "X-Forwarded-For", unless the
// proxy vendor provides another header field. In the case of CloudFlare proxy, the "CF-Connecting-IP" header
Expand Down
1 change: 0 additions & 1 deletion config/local_defaults.go
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,6 @@ var defaultLocal = Local{
IncomingConnectionsLimit: 2400,
IncomingMessageFilterBucketCount: 5,
IncomingMessageFilterBucketSize: 512,
IsIndexerActive: false,
LedgerSynchronousMode: 2,
LogArchiveMaxAge: "",
LogArchiveName: "node.archive.log",
Expand Down
5 changes: 0 additions & 5 deletions daemon/algod/api/server/v2/test/helpers.go
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,6 @@ import (
"github.com/algorand/go-algorand/ledger/simulation"
"github.com/algorand/go-algorand/logging"
"github.com/algorand/go-algorand/node"
"github.com/algorand/go-algorand/node/indexer"
"github.com/algorand/go-algorand/protocol"
"github.com/algorand/go-algorand/util/db"
)
Expand Down Expand Up @@ -221,10 +220,6 @@ func (m *mockNode) Uint64() uint64 {
return 1
}

func (m *mockNode) Indexer() (*indexer.Indexer, error) {
return nil, fmt.Errorf("indexer not implemented")
}

func (m *mockNode) GetTransactionByID(txid transactions.Txid, rnd basics.Round) (node.TxnWithStatus, error) {
return node.TxnWithStatus{}, fmt.Errorf("get transaction by id not implemented")
}
Expand Down
1 change: 0 additions & 1 deletion installer/config.json.example
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,6 @@
"IncomingConnectionsLimit": 2400,
"IncomingMessageFilterBucketCount": 5,
"IncomingMessageFilterBucketSize": 512,
"IsIndexerActive": false,
"LedgerSynchronousMode": 2,
"LogArchiveMaxAge": "",
"LogArchiveName": "node.archive.log",
Expand Down
279 changes: 0 additions & 279 deletions node/indexer/db.go

This file was deleted.

Loading

0 comments on commit 5f496cf

Please sign in to comment.