fixed static-nodes related buf (os independent) (#598)

* fixed static-nodes related buf (os independent)

* taking static-nodes as input if default not present
This commit is contained in:
Pratik Patil 2022-11-25 17:44:05 +05:30 committed by GitHub
parent 137fb19d2a
commit d69cb20ba9
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 14 additions and 1 deletions

View file

@ -375,7 +375,7 @@ func getStaticTrustedNodes(args []string) {
fmt.Println("only TOML config file is supported through CLI")
}
} else {
path := "~/.bor/data/bor/static-nodes.json"
path := "./static-nodes.json"
if !checkFileExists(path) {
return
}

View file

@ -24,6 +24,14 @@ then
fi
read -p "* Your validator address (e.g. 0xca67a8D767e45056DC92384b488E9Af654d78DE2), or press Enter to skip if running a sentry node: " ADD
if [[ -f $HOME/.bor/data/bor/static-nodes.json ]]
then
cp $HOME/.bor/data/bor/static-nodes.json ./static-nodes.json
else
read -p "* You dont have '~/.bor/data/bor/static-nodes.json' file. If you want to use static nodes, enter the path to 'static-nodes.json' here (press Enter to skip): " STAT
if [[ -f $STAT ]]; then cp $STAT ./static-nodes.json; fi
fi
printf "\nThank you, your inputs are:\n"
echo "Path to start.sh: "$startPath
echo "Address: "$ADD
@ -113,4 +121,9 @@ chmod +x $tmpDir/3305fe263dd4a999d58f96deb064e21bb70123d9.sh
$tmpDir/3305fe263dd4a999d58f96deb064e21bb70123d9.sh $ADD
rm $tmpDir/3305fe263dd4a999d58f96deb064e21bb70123d9.sh
if [[ -f $HOME/.bor/data/bor/static-nodes.json ]]
then
rm ./static-nodes.json
fi
exit 0