Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
nucleo
Manage
Activity
Members
Labels
Plan
Issues
4
Issue boards
Milestones
Wiki
Code
Merge requests
1
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Container Registry
Model registry
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
blockchain
nucleo
Commits
fa4b25a2
Commit
fa4b25a2
authored
6 years ago
by
Robert Martin-Legene
Browse files
Options
Downloads
Patches
Plain Diff
grep -v does not return a reliable return code?
parent
3e39f6cd
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
bin/installbfa.sh
+1
-1
1 addition, 1 deletion
bin/installbfa.sh
bin/libbfa.sh
+48
-58
48 additions, 58 deletions
bin/libbfa.sh
with
49 additions
and
59 deletions
bin/installbfa.sh
+
1
−
1
View file @
fa4b25a2
...
...
@@ -165,7 +165,7 @@ function usersetup
function
cronit
{
if
crontab
-u
bfa
-l
2>/dev/null |
expand
|
grep
-
qv
E
'
^@reboot +
bfa/bin/cron.sh$'
if
[
$(
crontab
-u
bfa
-l
2>/dev/null |
expand
|
grep
-E
'bfa/bin/cron.sh$'
|
wc
-l
)
-eq
0
]
then
info Install crontab to start automatically upon reboot
(
crontab
-u
bfa
-l
;
echo
'@reboot bfa/bin/cron.sh'
)
| crontab
-u
bfa -
...
...
This diff is collapsed.
Click to expand it.
bin/libbfa.sh
+
48
−
58
View file @
fa4b25a2
...
...
@@ -16,11 +16,6 @@ test -n "$BASH_VERSION" ||
test
"
$(
caller
2>/dev/null |
awk
'{print $1}'
)
"
!=
"0"
||
fatal
"This file must be source(d), not executed."
function
stderr
{
echo
"
$@
"
>
&2
}
function
cleanup
{
if
[
$#
-gt
0
]
...
...
@@ -148,58 +143,53 @@ function contractSendTx
###############
# bfainit #
test
-n
"
${
BFAHOME
}
"
-a
\
-d
"
${
BFAHOME
}
"
||
fatal
"
\$
BFAHOME in your environment must point to a directory."
#
# BFANETWORKID
test
-n
"
${
BFANETWORKID
}
"
||
BFANETWORKID
=
47525974938
#
# BFANETWORKDIR
test
-n
"
${
BFANETWORKDIR
}
"
||
BFANETWORKDIR
=
"
${
BFAHOME
}
/network"
mkdir
-p
"
${
BFANETWORKDIR
}
"
test
-d
"
${
BFANETWORKDIR
}
"
||
fatal
"
\$
BFANETWORKDIR (
\"
${
BFANETWORKDIR
}
\"
) not found."
#
# BFANODEDIR
test
-n
"
$BFANODEDIR
"
||
BFANODEDIR
=
"
${
BFANETWORKDIR
}
/node"
if
[
!
-d
"
${
BFANODEDIR
}
"
]
then
echo
"Node directory not found. Initialising a new node."
geth
--datadir
${
BFANODEDIR
}
init
${
BFAHOME
}
/src/genesis.json
fi
if
[
!
-d
"
${
BFANODEDIR
}
/geth/chaindata"
]
then
echo
"Node is not initialised. Initialising with BFA genesis."
geth
--datadir
"
${
BFANODEDIR
}
"
init
"
${
BFAHOME
}
/src/genesis.json"
fi
#
# netport
netport
=
30303
if
[
-r
"
${
BFANODEDIR
}
/netport"
]
then
netport
=
$(
cat
${
BFANODEDIR
}
/netport
)
test
$?
=
0
fi
#
# rpcport
rpcport
=
8545
if
[
-r
"
${
BFANODEDIR
}
/rpcport"
]
test
-n
"
${
BFAHOME
}
"
-a
\
-d
"
${
BFAHOME
}
"
||
fatal
"
\$
BFAHOME in your environment must point to a directory."
#
# BFANETWORKID
test
-n
"
${
BFANETWORKID
}
"
||
BFANETWORKID
=
47525974938
#
# BFANETWORKDIR
test
-n
"
${
BFANETWORKDIR
}
"
||
BFANETWORKDIR
=
"
${
BFAHOME
}
/network"
mkdir
-p
"
${
BFANETWORKDIR
}
"
test
-d
"
${
BFANETWORKDIR
}
"
||
fatal
"
\$
BFANETWORKDIR (
\"
${
BFANETWORKDIR
}
\"
) not found."
#
# BFANODEDIR
test
-n
"
$BFANODEDIR
"
||
BFANODEDIR
=
"
${
BFANETWORKDIR
}
/node"
if
[
!
-d
"
${
BFANODEDIR
}
"
-o
!
-d
"
${
BFANODEDIR
}
/geth/chaindata"
]
then
echo
"Node is not initialised. Initialising with BFA genesis."
geth
--cache
0
--datadir
"
${
BFANODEDIR
}
"
init
"
${
BFAHOME
}
/src/genesis.json"
fi
#
# netport
netport
=
30303
if
[
-r
"
${
BFANODEDIR
}
/netport"
]
then
netport
=
$(
cat
${
BFANODEDIR
}
/netport
)
test
$?
=
0
fi
#
# rpcport
rpcport
=
8545
if
[
-r
"
${
BFANODEDIR
}
/rpcport"
]
then
rpcport
=
$(
cat
${
BFANODEDIR
}
/rpcport
)
test
$?
=
0
fi
#
# BFAACCOUNT
if
[
-z
"
$BFAACCOUNT
"
]
then
if
[
!
-d
"
${
BFANODEDIR
}
/keystore"
]
then
rpcport
=
$(
cat
${
BFANODEDIR
}
/rpcport
)
test
$?
=
0
fi
#
# BFAACCOUNT
if
[
-z
"
$BFAACCOUNT
"
]
then
if
[
!
-d
"
${
BFANODEDIR
}
/keystore"
]
then
echo
"No accounts found. Creating a new one (they are free)."
geth
--cache
0
--datadir
${
BFANODEDIR
}
--password
/dev/null account new
fi
BFAACCOUNT
=
$(
ls
-1dl
"
${
BFANODEDIR
}
"
/keystore/
*
--
*
2>/dev/null |
head
-1
|
sed
's/.*--//'
)
echo
"No accounts found. Creating a new one (they are free)."
geth
--cache
0
--datadir
${
BFANODEDIR
}
--password
/dev/null account new
fi
BFAACCOUNT
=
$(
ls
-1d
"
${
BFANODEDIR
}
"
/keystore/
*
--
*
2>/dev/null |
head
-1
|
sed
's/.*--//'
)
fi
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment