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

peermanager plugin #18

Open
wants to merge 6 commits into
base: develop
Choose a base branch
from
Open

peermanager plugin #18

wants to merge 6 commits into from

Conversation

Akohjesse
Copy link
Contributor

No description provided.

)

type peerManagerConfig struct {
BrokerURL string `yaml:"peerManager.broker.url"`
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let's make the yaml broker.url. Since plugeth2 will have its own config files for each plugin, we don't need to namespace it here too.

log.Error("error calling getEnode from sessionService, peer manager plugin", "err", err)
}

chainTopic, err := sessionPeerService.chainIdResolver()
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let's pull the topic from the config. We can use chainIdResolver() if it's not explicitly set, but making this configurable would let us have separate clusters of nodes we don't force to peer with eachother.

}

type pseudoNodeInfo struct {
Enode string
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let's add JSON hints here. I don't like relying on struct field names for JSON encoding / decoding when we can be explicit.

result = "sepolia"
case "0x89":
result = "polygon"
case "0x13881":
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let's add amoy here too:

"0x13882"

default:
log.Warn("unknown chain, chainID could not be resolved, peer manager plugin")
result = chainID
result = "unknownChain"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We need this to at least reflect the chainid, otherwise if we're running multiple different unsupported chains they'll publish to the same topic and try to peer with eachother.

Let's set this to

result = fmt.Sprintf("%x", id)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants