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

p2p: Add delete/create to algons dnsaddr command #5631

Merged
merged 33 commits into from
Aug 16, 2023

Conversation

Eric-Warehime
Copy link
Contributor

@Eric-Warehime Eric-Warehime commented Aug 2, 2023

Summary

Adds creation and deletion of dnsaddr trees. Provided a set of multiaddrs and a top level domain, algons can now be used as shown below to create a tree of records in DNS which resolves to the full set of supplied multiaddrs.

Addresses #5624

Test Plan

Just local CLI testing for now until we start including this in ping-pong tests for the p2p network.

~/g/s/g/a/go-algorand (dnsaddr-add-del)> algons dnsaddr tree create -d ericw-create6.algodev.network -m /ip4/127.0.0.1/tcp/40001 -m /ip4/127.0.0.1/tcp/40002 -m /ip4/127.0.0.1/tcp/40003 -m /ip4/127.0.0.1/tcp/40004/ws -m /ip4/127.0.0.1/tcp/40005/p2p/QmNnooDu7bfjPFoTZYxMNLWUQJyrVwtbZg5gBMjTezGAJN -m /ip4/0.0.0.0 -m /ip4/0.0.0.1 -m /ip4/0.0.0.2 -m /ip4/0.0.0.3 -m /ip4/0.0.0.4 -m /ip4/0.0.0.5 -m /ip4/0.0.0.6
~/g/s/g/a/go-algorand (dnsaddr-add-del)> algons dnsaddr tree -d ericw-create6.algodev.network -s=false
/ip4/0.0.0.6
/ip4/0.0.0.2
/ip4/0.0.0.3
/ip4/0.0.0.4
/ip4/0.0.0.5
/ip4/0.0.0.0
/ip4/0.0.0.1
/ip4/127.0.0.1/tcp/40004/ws
/ip4/127.0.0.1/tcp/40005/p2p/QmNnooDu7bfjPFoTZYxMNLWUQJyrVwtbZg5gBMjTezGAJN
/ip4/127.0.0.1/tcp/40001
/ip4/127.0.0.1/tcp/40002
/ip4/127.0.0.1/tcp/40003
~/g/s/g/a/go-algorand (dnsaddr-add-del)> algons dnsaddr tree delete -d ericw-create6.algodev.network
listing records for _dnsaddr.ericw-create6.algodev.network
found record to delete _dnsaddr.ericw-create6.algodev.network:dnsaddr=/ip4/0.0.0.6
found record to delete _dnsaddr.ericw-create6.algodev.network:dnsaddr=/dnsaddr/0ericw-create6.algodev.network
found record to delete _dnsaddr.ericw-create6.algodev.network:dnsaddr=/dnsaddr/1ericw-create6.algodev.network
found record to delete _dnsaddr.ericw-create6.algodev.network:dnsaddr=/dnsaddr/2ericw-create6.algodev.network
listing records for _dnsaddr.0ericw-create6.algodev.network
found record to delete _dnsaddr.0ericw-create6.algodev.network:dnsaddr=/ip4/0.0.0.2
found record to delete _dnsaddr.0ericw-create6.algodev.network:dnsaddr=/ip4/0.0.0.3
found record to delete _dnsaddr.0ericw-create6.algodev.network:dnsaddr=/ip4/0.0.0.4
found record to delete _dnsaddr.0ericw-create6.algodev.network:dnsaddr=/ip4/0.0.0.5
listing records for _dnsaddr.1ericw-create6.algodev.network
found record to delete _dnsaddr.1ericw-create6.algodev.network:dnsaddr=/ip4/127.0.0.1/tcp/40004/ws
found record to delete _dnsaddr.1ericw-create6.algodev.network:dnsaddr=/ip4/127.0.0.1/tcp/40005/p2p/QmNnooDu7bfjPFoTZYxMNLWUQJyrVwtbZg5gBMjTezGAJN
found record to delete _dnsaddr.1ericw-create6.algodev.network:dnsaddr=/ip4/0.0.0.0
found record to delete _dnsaddr.1ericw-create6.algodev.network:dnsaddr=/ip4/0.0.0.1
listing records for _dnsaddr.2ericw-create6.algodev.network
found record to delete _dnsaddr.2ericw-create6.algodev.network:dnsaddr=/ip4/127.0.0.1/tcp/40001
found record to delete _dnsaddr.2ericw-create6.algodev.network:dnsaddr=/ip4/127.0.0.1/tcp/40002
found record to delete _dnsaddr.2ericw-create6.algodev.network:dnsaddr=/ip4/127.0.0.1/tcp/40003
Delete these 15 entries (type 'yes' to delete)? yes
Deleting _dnsaddr.ericw-create6.algodev.network
Deleting _dnsaddr.ericw-create6.algodev.network
Deleting _dnsaddr.ericw-create6.algodev.network
Deleting _dnsaddr.ericw-create6.algodev.network
Deleting _dnsaddr.0ericw-create6.algodev.network
Deleting _dnsaddr.0ericw-create6.algodev.network
Deleting _dnsaddr.0ericw-create6.algodev.network
Deleting _dnsaddr.0ericw-create6.algodev.network
Deleting _dnsaddr.1ericw-create6.algodev.network
Deleting _dnsaddr.1ericw-create6.algodev.network
Deleting _dnsaddr.1ericw-create6.algodev.network
Deleting _dnsaddr.1ericw-create6.algodev.network
Deleting _dnsaddr.2ericw-create6.algodev.network
Deleting _dnsaddr.2ericw-create6.algodev.network
Deleting _dnsaddr.2ericw-create6.algodev.network

@jsgranados jsgranados added the p2p Work related to the p2p project label Aug 3, 2023
cmd/algons/dnsaddrCmd.go Show resolved Hide resolved
cmd/algons/dnsaddrCmd.go Outdated Show resolved Hide resolved
@algorandskiy
Copy link
Contributor

Could you also add dig output for the tree create results?

@Eric-Warehime
Copy link
Contributor Author

algons-dnsaddr

algorandskiy
algorandskiy previously approved these changes Aug 8, 2023
winder
winder previously approved these changes Aug 10, 2023
Copy link
Contributor

@winder winder left a comment

Choose a reason for hiding this comment

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

LGTM. Just left a few questions and nits for you to consider.

cmd/algons/dnsCmd.go Outdated Show resolved Hide resolved
cmd/algons/dnsCmd.go Show resolved Hide resolved
cmd/algons/dnsaddrCmd.go Show resolved Hide resolved
cmd/algons/dnsaddrCmd.go Show resolved Hide resolved
cmd/algons/dnsaddrCmd.go Show resolved Hide resolved
network/p2p/dnsaddr/resolve.go Show resolved Hide resolved
@Eric-Warehime Eric-Warehime dismissed stale reviews from winder and algorandskiy via 70cf8ff August 11, 2023 16:19
@jsgranados jsgranados linked an issue Aug 11, 2023 that may be closed by this pull request
@algorandskiy algorandskiy merged commit 0f2ab92 into algorand:master Aug 16, 2023
10 checks passed
@Eric-Warehime Eric-Warehime deleted the dnsaddr-add-del branch August 16, 2023 14:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Enhancement p2p Work related to the p2p project
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add dnsaddr record creation/deletion to algons
4 participants