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

chore: update log message to avoid confusion #139

Merged
merged 9 commits into from
Dec 20, 2023
Merged
Changes from 7 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
22 changes: 21 additions & 1 deletion node/node.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import (
"errors"
"fmt"
"math"
"math/big"
"os"
"sync"
"time"
Expand Down Expand Up @@ -33,6 +34,12 @@ const (
gcPercentageTime = 0.1
)

var (
eigenDAUIMap = map[string]string{
"5": "https://goerli.eigenlayer.xyz/avs/eigenda",
shrimalmadhur marked this conversation as resolved.
Show resolved Hide resolved
}
)

type Node struct {
Config *Config
Logger common.Logger
Expand All @@ -45,6 +52,7 @@ type Node struct {
Transactor core.Transactor
PubIPProvider pubip.Provider
OperatorSocketsFilterer indexer.OperatorSocketsFilterer
ChainID *big.Int

mu sync.Mutex
CurrentSocket string
Expand Down Expand Up @@ -79,6 +87,11 @@ func NewNode(config *Config, pubIPProvider pubip.Provider, logger common.Logger)
return nil, fmt.Errorf("cannot create chain.Client: %w", err)
}

chainID, err := client.ChainID(context.Background())
if err != nil {
return nil, fmt.Errorf("failed to get chainID: %w", err)
}

// Create Transactor
tx, err := eth.NewTransactor(logger, client, config.BLSOperatorStateRetrieverAddr, config.EigenDAServiceManagerAddr)
if err != nil {
Expand Down Expand Up @@ -144,6 +157,7 @@ func NewNode(config *Config, pubIPProvider pubip.Provider, logger common.Logger)
Validator: validator,
PubIPProvider: pubIPProvider,
OperatorSocketsFilterer: socketsFilterer,
ChainID: chainID,
}, nil
}

Expand Down Expand Up @@ -180,7 +194,13 @@ func (n *Node) Start(ctx context.Context) error {
return fmt.Errorf("failed to register the operator: %w", err)
}
} else {
n.Logger.Info("The node has successfully started. Note it's not opt-in to EigenDA yet (it's not receiving or validating data in EigenDA). To register, please follow the EigenDA operator guide section in docs.eigenlayer.xyz")
eigenDAUrl, ok := eigenDAUIMap[n.ChainID.String()]
if ok {
n.Logger.Infof("The node has successfully started. Note: if it's not opted in on %s, then please follow the EigenDA operator guide section in docs.eigenlayer.xyz to register", eigenDAUrl)
} else {
n.Logger.Infof("The node has started but the network with chainID %s is not supported yet", n.ChainID.String())
}

}

n.CurrentSocket = socket
Expand Down
Loading