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

Add API for updating bootnodes and getting default ones from chainspecs #1294

Merged
merged 20 commits into from
Nov 18, 2022

Conversation

wirednkod
Copy link
Contributor

  • Add API for updating bootnodes and getting default ones from chainspecs
  • Create Settings page with Bootnodes editing content

Fixes #981 #982

Replaces #1128

@wirednkod wirednkod requested a review from tomaka October 26, 2022 16:23
@wirednkod wirednkod marked this pull request as ready for review October 26, 2022 16:23
@wirednkod wirednkod requested a review from tomaka November 14, 2022 16:03
projects/extension/CHANGELOG.md Outdated Show resolved Hide resolved
projects/extension/src/environment.ts Outdated Show resolved Hide resolved
projects/extension/src/components/Bootnodes.tsx Outdated Show resolved Hide resolved
projects/extension/src/components/Bootnodes.tsx Outdated Show resolved Hide resolved
projects/extension/src/components/Bootnodes.tsx Outdated Show resolved Hide resolved
projects/extension/src/components/Bootnodes.tsx Outdated Show resolved Hide resolved
projects/extension/src/components/Bootnodes.tsx Outdated Show resolved Hide resolved
projects/extension/src/components/Bootnodes.tsx Outdated Show resolved Hide resolved
projects/extension/src/components/Bootnodes.tsx Outdated Show resolved Hide resolved
projects/extension/src/components/Bootnodes.tsx Outdated Show resolved Hide resolved
@wirednkod wirednkod requested a review from tomaka November 16, 2022 11:55

const checkMultiAddr = (addr: string) => {
const ws =
/\/(ip4|ip6|dns4|dns6|dns)\/([a-zA-z0-9.-]{3,})\/tcp\/[0-9]{0,5}\/(ws|wss|tls\/ws)\/p2p\/[a-zA-Z1-9^Il0O]{52}/i
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
/\/(ip4|ip6|dns4|dns6|dns)\/([a-zA-z0-9.-]{3,})\/tcp\/[0-9]{0,5}\/(ws|wss|tls\/ws)\/p2p\/[a-zA-Z1-9^Il0O]{52}/i
/\/(ip4|ip6|dns4|dns6|dns)\/(.?)\/tcp\/[0-9]{0,5}\/(ws|wss|tls\/ws)\/p2p\/[a-zA-Z1-9^Il0O]{52}/i

Domain names are surprisingly complicated

Aside from this, I'm not super sure that the peer ID is always 52 characters long, but I'm too lazy to check this

/\/(ip4|ip6|dns4|dns6|dns)\/([a-zA-z0-9.-]{3,})\/tcp\/[0-9]{0,5}\/(ws|wss|tls\/ws)\/p2p\/[a-zA-Z1-9^Il0O]{52}/i

const webrtc =
/\/(ip4|ip6)\/([a-zA-z0-9.-]{3,})\/udp\/(.?)\/webrtc\/certhash\/(.*?)\/p2p\/[a-zA-Z1-9^Il0O]{52}/i
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
/\/(ip4|ip6)\/([a-zA-z0-9.-]{3,})\/udp\/(.?)\/webrtc\/certhash\/(.*?)\/p2p\/[a-zA-Z1-9^Il0O]{52}/i
/\/(ip4|ip6)\/(.?)\/udp\/(.?)\/webrtc\/certhash\/(.*?)\/p2p\/[a-zA-Z1-9^Il0O]{52}/i

@wirednkod wirednkod merged commit 48f5831 into main Nov 18, 2022
@wirednkod wirednkod deleted the nik-bootnodes-new-version branch November 18, 2022 08:01
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.

Add bootnodes functionality API and save in extension localstorage
2 participants