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
091b8502
Commit
091b8502
authored
6 years ago
by
Robert Martin-Legene
Browse files
Options
Downloads
Patches
Plain Diff
Cambios en start.sh
parent
b8d741f4
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
bin/libbfa.sh
+31
-25
31 additions, 25 deletions
bin/libbfa.sh
bin/start.sh
+12
-8
12 additions, 8 deletions
bin/start.sh
with
43 additions
and
33 deletions
bin/libbfa.sh
+
31
−
25
View file @
091b8502
...
...
@@ -99,21 +99,34 @@ function geth_rpc
echo
"
$json
"
| jq .result
}
function
create_account
{
geth
--cache
0
--datadir
${
BFANODEDIR
}
--password
/dev/null account new
}
function
extradata
{
# something uniqueish
## find default interface
local
def_if
=
$(
(
ip
-4
route show
;
ip
-6
route show
)
|
expand
|
sed
-ne
'/^default /{s/ */ /g;s/^.* dev //;s/ .*//;p;q}'
)
local
mymac
=
$(
ip
link
show
${
def_if
}
|
sed
-ne
'/link\|ether/{s/^.*link.ether //;s/ .*//;s/://g;p;q}'
local
acct
=
$(
ls
-1d
"
${
BFANODEDIR
}
"
/keystore/
*
--
*
2>/dev/null |
head
-1
|
sed
's/.*--//'
)
#
echo
-n
"
${
BFAACCOUNT
:0:19
}
.
${
mymac
:0:12
}
"
if
[
-n
"
$acct
"
]
then
# something uniqueish
## find default interface
local
def_if
=
$(
(
ip
-4
route show
;
ip
-6
route show
)
|
expand
|
sed
-ne
'/^default /{s/ */ /g;s/^.* dev //;s/ .*//;p;q}'
)
local
mymac
=
$(
ip
link
show
${
def_if
}
|
sed
-ne
'/link\|ether/{s/^.*link.ether //;s/ .*//;s/://g;p;q}'
)
#
echo
-n
"
${
acct
:0:19
}
.
${
mymac
:0:12
}
"
fi
}
function
prereq
...
...
@@ -191,6 +204,10 @@ then
netport
=
$(
cat
${
BFANODEDIR
}
/netport
)
test
$?
=
0
fi
if
[
"
$netport
"
!=
"30303"
]
then
netportarg
=
"--port
${
netport
}
"
fi
#
# rpcport
rpcport
=
8545
...
...
@@ -199,18 +216,7 @@ then
rpcport
=
$(
cat
${
BFANODEDIR
}
/rpcport
)
test
$?
=
0
fi
#
# BFAACCOUNT
if
[
-z
"
$BFAACCOUNT
"
]
if
[
"
$rpcport
"
!=
"8545"
]
then
if
!
ls
-1d
${
BFANODEDIR
}
/keystore/
*
--
*
>
/dev/null 2>&1
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
-1d
"
${
BFANODEDIR
}
"
/keystore/
*
--
*
2>/dev/null |
head
-1
|
sed
's/.*--//'
)
rpcportarg
=
"--rpcport
${
rpcport
}
"
fi
This diff is collapsed.
Click to expand it.
bin/start.sh
+
12
−
8
View file @
091b8502
...
...
@@ -26,10 +26,6 @@ function getsyncmode
echo
"--syncmode
${
syncmode
}
"
}
test
-n
"
${
BFAACCOUNT
}
"
||
fatal
"No account defined."
function
startbootnode
{
local
ERRTEXT
=
"bootnode section failed"
...
...
@@ -101,18 +97,26 @@ function startgeth
echo
# (re)configure parameters (you never know if they changed)
flexargs
=
"
$(
getsyncmode
)
--extradata
$(
extradata
)
"
if
[
"
$netport
"
!=
30303
]
then
flexargs
=
"
${
flexargs
}
--net
$netport
"
fi
if
[
"
$rpcport
"
!=
30303
]
then
flexargs
=
"
${
flexargs
}
--rpcport
$rpcport
"
fi
if
[
-n
"
$BFAVERBOSITY
"
-a
"
$BFAVERBOSITY
"
!=
3
]
then
flexargs
=
"
${
flexargs
}
--verbosity
${
BFAVERBOSITY
:-
3
}
"
fi
set
-x
geth
\
--datadir
${
BFANODEDIR
}
\
--networkid
${
BFANETWORKID
}
\
--rpc
\
--rpcport
$rpcport
\
--rpcapi
"eth,net,web3,admin,clique,miner,personal"
\
--port
$netport
\
--nousb
\
--gcmode
archive
\
--cache
512
\
--verbosity
${
BFAVERBOSITY
:-
3
}
\
${
flexargs
}
\
--bootnodes
"
${
bootnodes
}
"
&
set
+x
...
...
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