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

fix boot node invalid address issue #4724

Merged
merged 1 commit into from
Aug 7, 2024
Merged

fix boot node invalid address issue #4724

merged 1 commit into from
Aug 7, 2024

Conversation

GheisMohammadi
Copy link
Contributor

Issue

The following part of code from cmd/bootnode/main.go:

	fmt.Printf("bootnode BN_MA=%s",
		fmt.Sprintf("/ip4/%s/tcp/%s/p2p/%s", *ip, *port, host.GetID().Pretty()),
	)

prints the bootnode address in the format BN_MA=<address>. If any output is printed after this line, it will be appended to the same line.

In the deploy.sh script, the bootnode address is extracted using the launch_bootnode function:

function launch_bootnode() {
  echo "launching boot node ..."
  ${DRYRUN} ${ROOT}/bin/bootnode -port 19876 -max_conn_per_ip 100 -force_public true >"${log_folder}"/bootnode.log 2>&1 | tee -a "${LOG_FILE}" &
  sleep 1
  BN_MA=$(grep "BN_MA" "${log_folder}"/bootnode.log | awk -F\= ' { print $2 } ')
  echo "bootnode launched. $BN_MA"
}

This function maps the terminal log to a log file and assumes that the line containing BN_MA in the log file contains only the bootnode address.

So, If additional output is appended to the same line as the BN_MA address, the script's extraction method may fail, leading to incorrect parsing of the bootnode address. This can cause to boot failure and other issues in subsequent steps that rely on the correct bootnode address.

This PR addresses this issue. It prints the address on a new line and no further output is appended to it.

@Frozen Frozen merged commit ce9ce93 into dev Aug 7, 2024
4 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.

4 participants