Skip to content

Commit

Permalink
fixed static-nodes related buf (os independent) (#598)
Browse files Browse the repository at this point in the history
* fixed static-nodes related buf (os independent)

* taking static-nodes as input if default not present
  • Loading branch information
pratikspatil024 authored Nov 25, 2022
1 parent 137fb19 commit d69cb20
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 1 deletion.
2 changes: 1 addition & 1 deletion scripts/getconfig.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
Expand Down
13 changes: 13 additions & 0 deletions scripts/getconfig.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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

0 comments on commit d69cb20

Please sign in to comment.