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

feat: backport addrbook command (backport #2623 and #2783) #2796

Merged
merged 3 commits into from
Nov 1, 2023

Conversation

rootulp
Copy link
Collaborator

@rootulp rootulp commented Oct 31, 2023

Backports #2623 and #2783

Testing

$ ./build/celestia-appd addrbook ~/git/rootulp/celestia/networks/celestia/peers.txt ~/Downloads/addrbook.json
Error adding [email protected]:26656: Cannot add non-routable address [email protected]:26656
Converted /Users/rootulp/git/rootulp/celestia/networks/celestia/peers.txt into /Users/rootulp/Downloads/addrbook.json

$ head -n 10  /Users/rootulp/Downloads/addrbook.json
{
	"key": "8957397890a66cd0f716cbc9",
	"addrs": [
		{
			"addr": {
				"id": "a41b4bc451b1b71d537aa1018226e08d7fa7e44e",
				"ip": "5.255.77.44",
				"port": 26656
			},
			"src": {

…g#2623)

Closes celestiaorg#2619

## Description

Adds a new command to celestia-appd called `addrbook`.

```
./build/celestia-appd addrbook --help

Convert a list of peers into an address book.
The first argument (peers.txt) should contain a new line separated list of peers. The format for a peer is `id@ip:port` or `id@domain:port`.
The second argument (addrbook.json) should be the output filename. The address book is saved to the output file in JSON format.

Usage:
  celestia-appd addrbook peers.txt addrbook.json [flags]
```

## Testing

I was able to run a node on arabica-10 with an `addrbook.json` that was
created from
[arabica-10/peers.txt](https://github.com/celestiaorg/networks/blob/master/arabica-10/peers.txt).
Note, testing failed on mocha-4 due to
celestiaorg/networks#349
@celestia-bot celestia-bot requested a review from a team October 31, 2023 15:32
@rootulp rootulp self-assigned this Oct 31, 2023
@rootulp rootulp changed the title feat: backport addrbook command feat: backport addrbook command (backport #2623 and #2783) Oct 31, 2023
@rootulp rootulp enabled auto-merge (squash) October 31, 2023 15:32
@rootulp rootulp requested review from staheri14 and rach-id October 31, 2023 15:34
rach-id
rach-id previously approved these changes Oct 31, 2023
evan-forbes
evan-forbes previously approved these changes Oct 31, 2023
@rootulp rootulp dismissed stale reviews from evan-forbes and rach-id via 4e67e53 October 31, 2023 15:45
@celestia-bot celestia-bot requested a review from a team October 31, 2023 15:46
@rootulp rootulp merged commit c105756 into celestiaorg:v1.x Nov 1, 2023
20 of 21 checks passed
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.

5 participants