Skip to content

Commit

Permalink
chore: update log message to avoid confusion (#139)
Browse files Browse the repository at this point in the history
  • Loading branch information
shrimalmadhur authored Dec 20, 2023
1 parent 837398e commit ee891ca
Showing 1 changed file with 22 additions and 1 deletion.
23 changes: 22 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,13 @@ const (
gcPercentageTime = 0.1
)

var (
// eigenDAUIMap is a mapping for ChainID to the EigenDA UI url.
eigenDAUIMap = map[string]string{
"5": "https://goerli.eigenlayer.xyz/avs/eigenda",
}
)

type Node struct {
Config *Config
Logger common.Logger
Expand All @@ -45,6 +53,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 +88,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 +158,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 +195,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

0 comments on commit ee891ca

Please sign in to comment.