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
d3ed18c7
Commit
d3ed18c7
authored
5 years ago
by
Robert Martin-Legene
Browse files
Options
Downloads
Patches
Plain Diff
Parche para --allow-insecure-unlock
parent
15f24023
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
bin/start.sh
+68
-7
68 additions, 7 deletions
bin/start.sh
with
68 additions
and
7 deletions
bin/start.sh
+
68
−
7
View file @
d3ed18c7
...
...
@@ -78,11 +78,52 @@ function startmonitor
)
9>>
$pidfile
}
function
geth_capab
{
geth_version
=
$(
geth
--help
|
sed
-n
'/^VERSION:/{n;s/^ *//;s/-.*$//;p}'
)
# default to a dumb version
test
-n
"
${
geth_version
}
"
||
geth_version
=
0.0.0
v_major
=
${
geth_version
%%.*
}
tmp
=
${
geth_version
%.*
}
v_minor
=
${
tmp
#*.
}
v_patch
=
${
geth_version
##*.
}
unset
tmp
#
# Determine capabilities
# 0 legacy
# 1 supports --allow-insecure-unlock
cap
=
0
if
[
"
${
v_major
}
"
-lt
1
]
then
cap
=
0
elif
[
"
${
v_major
}
"
-eq
1
]
then
if
[
"
${
v_minor
}
"
-eq
8
]
then
if
[
"
${
v_patch
}
"
-gt
28
]
then
cap
=
1
fi
elif
[
"
${
v_minor
}
"
-ge
9
]
then
cap
=
1
fi
elif
[
"
${
v_major
}
"
-ge
2
]
then
cap
=
1
fi
if
[
${
cap
}
-ge
1
]
then
flexargs
=
"
${
flexargs
}
--allow-insecure-unlock"
fi
}
function
startgeth
{
# Start the node.
local
ERRTEXT
=
"geth section failed"
which geth
>
/dev/null 2>&1
||
return
0
#
(
flock
--nonblock
--exclusive
9
||
(
echo
"A geth is already running."
...
...
@@ -93,22 +134,29 @@ function startgeth
then
echo
Starting geth
echo
Logging everything to
${
BFANODEDIR
}
/log
echo
Consider running:
tail
-n
1000
-F
${
BFANODEDIR
}
/log
echo
Consider running:
bfalog.sh
fi
loop_counter
=
0
while
:
do
loop_counter
=
$((
${
loop_counter
}
+
1
))
ERRTEXT
=
"geth"
echo
echo
'***'
echo
"*** loop #
${
loop_number
}
"
echo
'***'
echo
# (re)configure parameters (you never know if they changed)
flexargs
=
"
$(
getsyncmode
)
"
geth_capab
#
xtra
=
$(
extradata
)
if
[
-n
"
$xtra
"
]
then
flexargs
=
"
${
flexargs
}
--extradata
$(
extradata
)
"
fi
unset
xtra
#
if
[
"
$netport
"
!=
30303
]
then
flexargs
=
"
${
flexargs
}
--port
$netport
"
...
...
@@ -121,14 +169,27 @@ function startgeth
then
flexargs
=
"
${
flexargs
}
--verbosity
${
BFAVERBOSITY
:-
3
}
"
fi
# the basic modules
rpcapis
=
"eth,net,web3,clique"
if
[
-e
"
${
BFANODEDIR
}
/opentx"
]
then
# INADDR_ANY
# Oh, and don't put keys in / :-)
flexargs
=
"
${
flexargs
}
--rpcapi eth,net,web3,clique --rpcaddr 0.0.0.0 --rpcvhosts localhost,opentx.bfa.ar --keystore /"
# If you want other hostnames, put them in this file (comma separated)
read
txhostnames dummy <
${
BFANODEDIR
}
/opentx
if
[
"
${
txhostnames
}
"
=
""
]
then
# but if you don't put any hostnames, these are the defaults
txhostnames
=
"localhost,opentx.bfa.ar"
fi
flexargs
=
"
${
flexargs
}
--rpcvhosts
${
txhostnames
}
"
# INADDR_ANY - listen on all addresses
flexargs
=
"
${
flexargs
}
--rpcaddr 0.0.0.0"
# Oh, and don't put your keys in / because we use that as a dummy directory
flexargs
=
"
${
flexargs
}
--keystore /"
else
flexargs
=
"
${
flexargs
}
--rpcapi eth,net,web3,admin,clique,miner,personal"
# expose more modules, if we are a private node (localhost'ed)
rpcapis
=
"
${
rpcapis
}
,admin,miner,personal"
fi
flexargs
=
"
${
flexargs
}
--rpcapi
${
rpcapis
}
"
set
-x
geth
\
--datadir
${
BFANODEDIR
}
\
...
...
@@ -137,11 +198,11 @@ function startgeth
--gcmode
archive
\
${
flexargs
}
\
--rpccorsdomain
\*
\
--allow-insecure-unlock
\
--bootnodes
"
${
bootnodes
}
"
&
set
+x
echo
$!
>
${
BFANODEDIR
}
/geth.pid
wait
rv
=
0
wait
-n
||
rv
=
$?
sleep
60
done
2>&1 |
${
BFAHOME
}
/bin/log.sh
${
BFANODEDIR
}
/log &
)
9>>
${
BFANODEDIR
}
/start-loop.pid
...
...
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