Skip to content
Snippets Groups Projects
Commit 989c6654 authored by Robert Martin-Legene's avatar Robert Martin-Legene
Browse files

Today's release is based on this setup.

parent 725022af
Branches design
No related tags found
No related merge requests found
......@@ -7,9 +7,9 @@ ENV USERNAME=bfa HOME=/home/bfa
ENV BFAHOME=${HOME}/bfa BFANETWORKIDPROD=47525974938 BFANETWORKIDTEST=55555000000 VIRTUALIZATION=DOCKER GITBRANCH=__GITBRANCH__
ENV BFANETWORKDIRPROD=${BFAHOME}/network BFANETWORKDIRTEST=${BFAHOME}/test2network PATH=${BFAHOME}/bin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
ENV BFANETWORKID=__BFANETWORKID__ BFANETWORKDIR=__BFANETWORKDIR__ GITBRANCH=__GITBRANCH__
ENV BFANODEDIR=${BFANETWORKDIR}/node BFATOML=${BFANETWORKDIR}/config.toml
ENV BFANODEDIR=${BFANETWORKDIR}/node BFATOML=${BFANETWORKDIR}/docker-config.toml
RUN mkdir ${BFANODEDIR} && ln -s ${BFANODEDIR} ${HOME}/.ethereum
USER ${USERNAME}
WORKDIR ${BFAHOME}
RUN git checkout ${GITBRANCH} && git pull
#VOLUME [ "/home/bfa" ]
VOLUME [ "/home/bfa" ]
......@@ -7,9 +7,10 @@
El **bfanodo** es un container/Docker que se puede descargar y correr en tu
propia servidor, maquina virtual o datacenter.
Se levanta como un nodo transaccional, **sin cuentas**, abierto a todo el mundo.
Se levanta como un nodo transaccional, **sin cuentas**, abierto a todo el mundo (o solamente a tu red, si usas NAT o/y firewall).
Ya que el nodo no tiene cuentas, solamente estas ofreciendo una puerta a la blockchain.
Si no deseas brindar este servicio a la red, se puede usar *ipfilter* o,
directamente no publicar los puertos 8545 y 8546 (anclados únicamente a 127.0.0.1). Para hacer eso, hay que cambiar los parametros
directamente no publicar los puertos 8545 y 8546 (anclarlos únicamente a 127.0.0.1). Para hacer eso, hay que cambiar los parametros
`-p` en `start.sh`.
Como se puede apreciar en el ejemplo aquí abajo, los puertos 30303/tcp, 8545/tcp y 8546/tcp estan abiertos al
......@@ -65,10 +66,6 @@ Las cuentas deben estar asociadas a las applicaciones que se conectan al
nodo. Esto hace que el sistema sea más seguro, y que **cada applicacion necesite su
propia cuenta**.
Si no sos miembro del grupo `docker` (en `/etc/group` ) deberás hacer todo como `root`
Así, se creará un directorio en `~/dockers/volumes/bfanodo,home,bfa,bfa,network,node,geth` . Si tenés cuentas/llaves, van allí. Toda la blockchain tambien se puede ver en ese mismo lugar, para que no haya que descargarla nuevamente al actualizar el nodo.
### Instalando Docker
En [https://docs.docker.com/install/] hay instrucciones para instalar Docker para varios
......@@ -83,7 +80,7 @@ $ update-grub
$ reboot
```
### Instalando bfanodo
### Instalando tu bfanodo
```
$ wget https://gitlab.bfa.ar/docker/bfanodo/raw/master/start.sh
......@@ -100,8 +97,6 @@ $ docker exec bfanodo localstate.pl
$ docker exec -it bfanodo bash
```
`bfalog.sh` hay que correrlo desde el bash para que se da cuenta cuando apretas ctrl-C.
### Crear
Para crear el docker se utilizó el script `build.sh`. Por favor, no lo uses si no sabés como funciona todo.
FROM ethereum/solc:0.5.10-alpine AS solc
FROM ethereum/client-go:alltools-v1.9.2
FROM ethereum/solc:0.7.2-alpine AS solc
FROM ethereum/client-go:alltools-stable
LABEL maintainer="Robert Martin-Legene <robert@nic.ar>"
CMD [ "/bin/bash" ]
COPY --from=solc /usr/local/bin/solc /usr/local/bin
EXPOSE 8545 8546 30303
ENV USERNAME=bfa HOME=/home/bfa BFAHOME=/home/bfa/bfa BFANETWORKIDPROD=47525974938 BFANETWORKIDTEST=55555000000 VIRTUALIZATION=DOCKER BFANETWORKDIRPROD=/home/bfa/bfa/network BFANETWORKDIRTEST=/home/bfa/bfa/test2network PATH=/home/bfa/bfa/bin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
RUN adduser -u 30303 -s /bin/bash -h ${HOME} -D ${USERNAME} ${USERNAME} && apk add --no-cache git bash jq perl perl-class-accessor perl-json perl-json-xs perl-lwp-protocol-https nodejs npm binutils python python3 curl make g++ && find /var/cache/apk -type f -delete
RUN adduser -u 30303 -s /bin/bash -h ${HOME} -D ${USERNAME} ${USERNAME} && apk add --no-cache git bash jq perl perl-class-accessor perl-json perl-json-xs perl-lwp-protocol-https nodejs npm binutils python3 curl make g++ && find /var/cache/apk -type f -delete
USER ${USERNAME}
WORKDIR ${HOME}
RUN git clone --quiet https://gitlab.bfa.ar/blockchain/nucleo.git ${BFAHOME} && cd ${BFAHOME} && npm update && npm audit fix
......@@ -10,44 +10,19 @@ fi
if [ "$1" = "test" ]
then
# TEST
tag="test"
class="test"
name="bfanodotest"
netdir="test2network"
elif [ "$1" = "latest" ]
then
# PROD
tag="latest"
class="prod"
name="bfanodo"
netdir="network"
else
echo Argument 1 must be either latest or test. >&2
exit 1
fi
mounts=
for guestdir in /home/bfa/bfa/${netdir}/node /home/bfa/bfa/${netdir}/cache
do
# docker dirs
d_dirs="${d_dirs} ${guestdir}"
# guestdirs
g_dir=${guestdir//\//,}
g_dirs="${g_dirs} ${g_dir}"
# hostdirs
h_dir=/home/dockers/volumes/${name}${guestdir//\//,}
h_dirs="${h_dirs} ${h_dir}"
mkdir -p ${h_dir}
mounts="${mounts} -v ${h_dir}:${guestdir}"
done
if [ "$UID" = "0" ]
then
chown -R 30303:30303 ${h_dirs}
else
# This is a bit slower, but works
docker run --rm $mounts -u root alpine chown -R 30303:30303 ${d_dirs}
fi
# Run this just a single time.
# Docker itself makes sure it autostarts if it crashes or the server reboots.
docker run \
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment