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
cd211d7c
Commit
cd211d7c
authored
4 years ago
by
Robert Martin-Legene
Browse files
Options
Downloads
Patches
Plain Diff
geth init
parent
ea4cf389
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/installbfa.sh
+8
-60
8 additions, 60 deletions
bin/installbfa.sh
with
8 additions
and
60 deletions
bin/installbfa.sh
+
8
−
60
View file @
cd211d7c
...
...
@@ -28,19 +28,16 @@ function info
# Runs as the owner of the given directory, and in the given directory
function
runasownerof
{
path
=
$1
precmd
=
local
where
=
$1
precmd
=
shift
1
pushd
$
path
>
/dev/null
pushd
$
where
>
/dev/null
if
[
$(
stat
--format
=
%u
.
)
-ne
$UID
]
then
precmd
=
"sudo --preserve-env --set-home -
u
$(
stat
--format
=
%U
.
)
PATH=
${
PATH
}
"
precmd
=
"sudo --preserve-env
--shell
--set-home -
-user=
$(
stat
--format
=
%U
.
)
PATH=
${
PATH
}
"
fi
unset
path
${
precmd
}
"
$@
"
rv
=
$?
local
rv
=
$?
popd
>
/dev/null
unset
precmd
return
$rv
}
...
...
@@ -66,56 +63,7 @@ function nodejsinstall
aptinstall nodejs
info
"Installing nodejs modules (will show many warnings)"
runasownerof
${
BFAHOME
}
npm
install
}
function
golanginstall
{
if
[
!
-d
/usr/local/go
]
then
info
"Downloading package of go binaries."
mkdir
-p
${
NEW
}
cd
${
NEW
}
local arch
=
$(
uname
-m
)
case
"
${
arch
}
"
in
x86_64
)
arch
=
amd64
;;
*
)
echo
"We have no recipe for how to build on your
\"
${
arch
}
\"
platform."
>
&2
exit
1
;;
esac
#Download go*.linux-${ARCH}.tar.gz from https://golang.org/dl/
golangurl
=
$(
curl
-f
https://golang.org/dl/ 2>/dev/null |
grep
linux-
${
arch
}
.tar.gz |
grep
downloadBox |
sed
's/.*href="//;s/".*//'
|
head
-1
)
name
=
$(
basename
$golangurl
)
if
[
-r
"
$name
"
]
then
# If we have the download, check if it is corrupt
tar
-ztf
"
$name
"
>
/dev/null 2>&1
||
rm
-f
"
$name
"
fi
if
[
!
-r
"
$name
"
]
then
curl
-f
-O
$golangurl
||
rm
-f
"
$name
"
fi
# Integrity checking the archive
tar
-xzf
"
$name
"
info
"Unpacking
$name
into /usr/local"
tar
-C
/usr/local
-xzf
go
*
.tar.gz
fi
if
[
$(
expand
< ~bfa/.bashrc |
grep
-E
"^PATH=.*/usr/local/go/bin"
|
wc
-l
)
-eq
0
]
then
echo
"PATH=
\$
{PATH}:/usr/local/go/bin"
>>
~bfa/.bashrc
fi
export
PATH
=
${
PATH
}
:/usr/local/go/bin
runasownerof
${
BFAHOME
}
npm audit fix
}
function
gethinstall
...
...
@@ -142,13 +90,14 @@ function gethinstall
function
initgenesis
{
(
HOME
=
$(
echo
~bfa
)
source
${
BFAHOME
}
/bin/env
BFANETWORKDIR
=
${
BFANETWORKDIR
:-${
BFAHOME
}
/network
}
BFANODEDIR
=
${
BFANODEDIR
:-${
BFANETWORKDIR
}
/node
}
if
[
!
-d
"
${
BFANODEDIR
}
"
-o
!
-d
"
${
BFANODEDIR
}
/geth/chaindata"
]
then
info
"Node is not initialised. Initialising with genesis."
geth
--networkid
${
BFANETWORKID
}
--cache
0
--datadir
"
${
BFANODEDIR
}
"
init
"
${
BFANETWORKDIR
}
/genesis.json"
runasownerof
"
${
BFAHOME
}
"
geth
--networkid
${
BFANETWORKID
}
--cache
0
--datadir
"
${
BFANODEDIR
}
"
init
"
${
BFANETWORKDIR
}
/genesis.json"
chown
-R
bfa:bfa ~bfa
fi
)
...
...
@@ -259,11 +208,10 @@ grep -q Ubuntu /etc/issue && apt-add-repository multiverse
#
apt update
# development tools
aptinstall dirmngr apt-transport-https curl git curl build-essential
sudo
software-properties-common
aptinstall dirmngr apt-transport-https curl git curl build-essential
sudo
software-properties-common
golang
aptinstall jq libjson-perl libwww-perl libclass-accessor-perl
userconfig
nodejsinstall
golanginstall
gethinstall
initgenesis
cronit
...
...
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