diff --git a/Dockerfile b/Dockerfile index 6cf146f4076834cb90ca2b0122fe62ce4c5a0375..2c3b17ec6671b2cef662da4d1e7b864e8d578015 100644 --- a/Dockerfile +++ b/Dockerfile @@ -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" ] diff --git a/README.md b/README.md index 1cd9f0bf167abe1839d24343e282cecf9e747a20..7899c97eac27d116b537402015316c5481d46944 100644 --- a/README.md +++ b/README.md @@ -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. diff --git a/bfatoolbase/Dockerfile b/bfatoolbase/Dockerfile index d658a74f438cb71036be8382d30cf1e507cb4d6a..e27d4db0dfe0535e421a44cfd573a7fa821163b5 100644 --- a/bfatoolbase/Dockerfile +++ b/bfatoolbase/Dockerfile @@ -1,11 +1,11 @@ -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 diff --git a/start.sh b/start.sh index 0c8f3f0e97e876024cccf575409bb2721aaa8e29..e962766ebd8838b9fc022ea11b9f6d37d9a59ef4 100755 --- a/start.sh +++ b/start.sh @@ -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 \