Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(eventindexer): add some startup logs #17276

Merged
merged 13 commits into from
May 21, 2024
1 change: 0 additions & 1 deletion packages/eventindexer/cmd/flags/common.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ var (
commonCategory = "COMMON"
indexerCategory = "INDEXER"
generatorCategory = "GENERATOR"
disperserCategory = "DISPERSER"
txmgrCategory = "TX_MANAGER"
)

Expand Down
41 changes: 0 additions & 41 deletions packages/eventindexer/cmd/flags/disperser.go

This file was deleted.

16 changes: 0 additions & 16 deletions packages/eventindexer/cmd/flags/indexer.go
Original file line number Diff line number Diff line change
Expand Up @@ -37,27 +37,13 @@ var (
Category: indexerCategory,
EnvVars: []string{"BRIDGE_ADDRESS"},
}
SwapAddresses = &cli.StringFlag{
Name: "swapAddresses",
Usage: "Comma-delinated list of Swap contract addresses",
Required: false,
Category: indexerCategory,
EnvVars: []string{"SWAP_ADDRESSES"},
}
AssignmentHookAddress = &cli.StringFlag{
Name: "assignmentHookAddress",
Usage: "Address of the AssignmentHook contract",
Required: false,
Category: indexerCategory,
EnvVars: []string{"ASSIGNMENT_HOOK_ADDRESS"},
}
SgxVerifierAddress = &cli.StringFlag{
Name: "sgxVerifierAddress",
Usage: "Address of the SGXVerifier contract",
Required: false,
Category: indexerCategory,
EnvVars: []string{"SGX_VERIFIER_ADDRESS"},
}
BlockBatchSize = &cli.Uint64Flag{
Name: "blockBatchSize",
Usage: "Block batch size when iterating through blocks",
Expand Down Expand Up @@ -96,8 +82,6 @@ var IndexerFlags = MergeFlags(CommonFlags, []cli.Flag{
ETHClientTimeout,
L1TaikoAddress,
BridgeAddress,
SwapAddresses,
SgxVerifierAddress,
AssignmentHookAddress,
BlockBatchSize,
SubscriptionBackoff,
Expand Down
8 changes: 0 additions & 8 deletions packages/eventindexer/cmd/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ import (
"github.com/taikoxyz/taiko-mono/packages/eventindexer/api"
"github.com/taikoxyz/taiko-mono/packages/eventindexer/cmd/flags"
"github.com/taikoxyz/taiko-mono/packages/eventindexer/cmd/utils"
"github.com/taikoxyz/taiko-mono/packages/eventindexer/disperser"
"github.com/taikoxyz/taiko-mono/packages/eventindexer/generator"
"github.com/taikoxyz/taiko-mono/packages/eventindexer/indexer"
"github.com/urfave/cli/v2"
Expand Down Expand Up @@ -59,13 +58,6 @@ func main() {
Description: "Taiko time-series data generator",
Action: utils.SubcommandAction(new(generator.Generator)),
},
{
Name: "disperser",
Flags: flags.DisperserFlags,
Usage: "Starts the disperser software",
Description: "Taiko TTKO disperser",
Action: utils.SubcommandAction(new(disperser.Disperser)),
},
}

if err := app.Run(os.Args); err != nil {
Expand Down
99 changes: 0 additions & 99 deletions packages/eventindexer/disperser/config.go

This file was deleted.

125 changes: 0 additions & 125 deletions packages/eventindexer/disperser/disperser.go

This file was deleted.

15 changes: 0 additions & 15 deletions packages/eventindexer/indexer/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ package indexer

import (
"database/sql"
"strings"

"github.com/ethereum/go-ethereum/common"
"github.com/taikoxyz/taiko-mono/packages/eventindexer/cmd/flags"
Expand Down Expand Up @@ -33,8 +32,6 @@ type Config struct {
L1TaikoAddress common.Address
BridgeAddress common.Address
AssignmentHookAddress common.Address
SgxVerifierAddress common.Address
SwapAddresses []common.Address
BlockBatchSize uint64
SubscriptionBackoff uint64
SyncMode SyncMode
Expand All @@ -45,16 +42,6 @@ type Config struct {

// NewConfigFromCliContext creates a new config instance from command line flags.
func NewConfigFromCliContext(c *cli.Context) (*Config, error) {
// swapAddresses is a comma-delinated list of addresses to index, so we need to
// parse that from a single string.
swapAddresses := strings.Split(c.String(flags.SwapAddresses.Name), ",")

swaps := make([]common.Address, 0)

for _, v := range swapAddresses {
swaps = append(swaps, common.HexToAddress(v))
}

return &Config{
DatabaseUsername: c.String(flags.DatabaseUsername.Name),
DatabasePassword: c.String(flags.DatabasePassword.Name),
Expand All @@ -68,8 +55,6 @@ func NewConfigFromCliContext(c *cli.Context) (*Config, error) {
L1TaikoAddress: common.HexToAddress(c.String(flags.L1TaikoAddress.Name)),
BridgeAddress: common.HexToAddress(c.String(flags.BridgeAddress.Name)),
AssignmentHookAddress: common.HexToAddress(c.String(flags.AssignmentHookAddress.Name)),
SgxVerifierAddress: common.HexToAddress(c.String(flags.SgxVerifierAddress.Name)),
SwapAddresses: swaps,
BlockBatchSize: c.Uint64(flags.BlockBatchSize.Name),
SubscriptionBackoff: c.Uint64(flags.SubscriptionBackoff.Name),
RPCUrl: c.String(flags.IndexerRPCUrl.Name),
Expand Down
2 changes: 0 additions & 2 deletions packages/eventindexer/indexer/config_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@ var (
l1TaikoAddress = "0x63FaC9201494f0bd17B9892B9fae4d52fe3BD377"
bridgeAddress = "0x73FaC9201494f0bd17B9892B9fae4d52fe3BD377"
assignmentHookAddress = "0x83FaC9201494f0bd17B9892B9fae4d52fe3BD377"
swapAddresses = "0x33FaC9201494f0bd17B9892B9fae4d52fe3BD377,0x13FaC9201494f0bd17B9892B9fae4d52fe3BD377"
databaseMaxIdleConns = "10"
databaseMaxOpenConns = "10"
databaseMaxConnLifetime = "30"
Expand Down Expand Up @@ -78,7 +77,6 @@ func TestNewConfigFromCliContext(t *testing.T) {
"--" + flags.DatabaseName.Name, "dbname",
"--" + flags.L1TaikoAddress.Name, l1TaikoAddress,
"--" + flags.BridgeAddress.Name, bridgeAddress,
"--" + flags.SwapAddresses.Name, swapAddresses,
"--" + flags.AssignmentHookAddress.Name, assignmentHookAddress,
"--" + flags.MetricsHTTPPort.Name, metricsHttpPort,
"--" + flags.DatabaseMaxIdleConns.Name, databaseMaxIdleConns,
Expand Down
Loading
Loading