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

[DVT-819][DVT-903] Use p2p.Server and refactor #93

Merged
merged 32 commits into from
Aug 16, 2023

Conversation

minhd-vu
Copy link
Contributor

@minhd-vu minhd-vu commented Jun 27, 2023

Description

  • sensor can not receive inbound connections rather than just dialed ones
  • flags such as --nat, --dial-ratio, etc. have been added
  • adds --key-file flag which takes in a private key file so that the enodes are constant and not generated each time
  • if the --key-file flag is provided but the file doesn't exist it will generate a new file
  • rework the nodes.json file format, it's now just:
[
    "enode://f11b3c44b6d85975529f8e1eccbcc0fd9b66deb7af1a40c90f0cd9c56b1868ceba431c1d71bd42e2ca8b45d9a785aafd253f29c7ff397a3fbb23b9249cc2db4f@143.244.63.70:30010",
    "enode://6cd4797e751354e48797f01aa33ca9361a096ee2f74668ddfa1dd7e50f5ba7ed7502539294e9af0879e85272e75983245683966898c49d6464c2d2b8d88b3a4e@5.161.43.211:30303",
    "enode://8a3447dd183f6a2f06b75446b1e72fb6d33b328d96af463944d5f48edc3174bc1ccaf71c7ba02105c394c20b5776ea424c4b2913b16a64b96501c27de4ab903e@54.209.35.7:30303"
]

This is consistent across the ping, crawl, and server commands. The advantage of this is that it can be placed directly into a bor's datadir as a static-nodes.json file. Additionally, the extra fields from the crawl command will never be utilized.

Jira / Linear Tickets

Testing

  • Tested locally to confirm blocks, block events, transactions, and transaction events have been written.
  • Deploy sensors

@minhd-vu minhd-vu changed the title [DVT-819] Prepare sensors for bloXroute [DVT-819] Set enode private key Jun 27, 2023
@minhd-vu minhd-vu force-pushed the minhd-vu/set-enode-private-key branch from 44654e4 to b503cfe Compare August 2, 2023 19:33
@minhd-vu minhd-vu changed the title [DVT-819] Set enode private key [DVT-819] Use p2p.Server and refactor Aug 10, 2023
@minhd-vu minhd-vu marked this pull request as ready for review August 11, 2023 19:42
@minhd-vu minhd-vu changed the title [DVT-819] Use p2p.Server and refactor [DVT-819][DVT-903] Use p2p.Server and refactor Aug 15, 2023
Copy link
Contributor

@praetoriansentry praetoriansentry left a comment

Choose a reason for hiding this comment

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

lgtm

@@ -36,7 +37,7 @@ var (
var CrawlCmd = &cobra.Command{
Use: "crawl [nodes file]",
Short: "Crawl a network on the devp2p layer and generate a nodes JSON file.",
Long: "If no nodes.json file exists, run `echo \"{}\" >> nodes.json` to get started.",
Long: "If no nodes.json file exists, it will be created.",
Copy link
Contributor

Choose a reason for hiding this comment

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

Amazing

p2p/p2p.go Show resolved Hide resolved
@minhd-vu minhd-vu merged commit cdf7659 into main Aug 16, 2023
5 checks passed
@minhd-vu minhd-vu deleted the minhd-vu/set-enode-private-key branch August 16, 2023 17:12
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.

2 participants