Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
Nodo y API para Docker
Manage
Activity
Members
Labels
Plan
Issues
0
Issue boards
Milestones
Wiki
Code
Merge requests
0
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD 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
GreyKoda
Nodo y API para Docker
Commits
e137c729
Commit
e137c729
authored
3 years ago
by
GreyKoda
Browse files
Options
Downloads
Patches
Plain Diff
Initial commit
parents
Branches
master
No related tags found
No related merge requests found
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
README.md
+39
-0
39 additions, 0 deletions
README.md
api/Dockerfile
+28
-0
28 additions, 0 deletions
api/Dockerfile
docker-compose.yml
+29
-0
29 additions, 0 deletions
docker-compose.yml
nodo/Dockerfile
+32
-0
32 additions, 0 deletions
nodo/Dockerfile
with
128 additions
and
0 deletions
README.md
0 → 100644
+
39
−
0
View file @
e137c729
## Nodo y API BFA para Docker
### Docker
Para poder levantar los contenedores es necesario contar con
[
Docker instalado
](
https://docs.docker.com/engine/install/
)
.
### Descripción
El presente repositorio levanta dos contenedores Docker:
-
[
nodo transaccional
](
https://gitlab.bfa.ar/blockchain/nucleo
)
(
producción
)
-
[
api (tsa2)
](
https://gitlab.bfa.ar/blockchain/tsa2
)
El nodo crea una cuenta y esa cuenta es la que levanta la API.
### Implementación
Para poder levantar todo con docker-compose primero es necesario crear las imágenes:
**NODO**
````
docker build -t nodobfa nodo/
````
**API**
````
docker build -t apibfa api/
````
**Por último:**
````
docker-compose up -d
````
### Importante
Al levantar los contenedores el nodo empezará a sincronizar. La API quedará expuesta en el puerto 3000.
**Comandos útiles:**
````
docker exec nodobfa bfalog.sh
docker exec nodobfa localstate.pl
````
O cualquier otro comando documentado del
[
nodo
](
https://gitlab.bfa.ar/blockchain/nucleo
)
This diff is collapsed.
Click to expand it.
api/Dockerfile
0 → 100644
+
28
−
0
View file @
e137c729
FROM
ubuntu:latest
ARG
DEBIAN_FRONTEND=noninteractive
RUN
apt-get update
&&
apt-get
install
-y
software-properties-common cron wget curl locales npm git zip unzip
RUN
locale-gen es_AR.UTF-8
RUN
export
LANG
=
es_AR.UTF-8
RUN
git clone https://gitlab.bfa.ar/blockchain/tsa2.git
RUN
cd
tsa2/api
&&
npm
install
-g
truffle
&&
npm
install
RUN
cd
tsa2/api
&&
npm run build
RUN
sed
-i
"s/chainId: '99118822',/ /g"
/tsa2/api/dist/StamperWrapper.js
&&
sed
-i
's/txPromise = await this.web3.eth.sendSignedTransaction/txPromise = this.web3.eth.sendSignedTransaction/g'
/tsa2/api/dist/StamperWrapper.js
RUN
apt-get clean
&&
rm
-rf
/var/lib/apt/lists/
*
/tmp/
*
/var/tmp/
*
EXPOSE
3000
ENV
GETH_ACCOUNT_JSON="/nodo_data/account.json"
ENV
GETH_ACCOUNT_PASSWORD=""
ENV
GETH_HOST=http://nodobfa:8545
ENV
CONTRACT_ABI_PATH="tsa2/api/abi.json"
ENV
CONTRACT_ADDRESS=0x7e56220069CAaF8367EA42817EA9210296AeC7c6
CMD
[ "node", "tsa2/api/dist/index.js" ]
This diff is collapsed.
Click to expand it.
docker-compose.yml
0 → 100644
+
29
−
0
View file @
e137c729
version
:
"
3"
services
:
nodobfa
:
container_name
:
nodobfa
image
:
nodobfa
tty
:
true
ports
:
-
"
8545:8545"
-
"
8546:8546"
-
"
30303:30303/tcp"
-
"
30303:30303/udp"
-
"
30304:30304/udp"
environment
:
-
BFAHOME=/home/bfa/bfa
-
PATH=${PATH}:/home/bfa/bfa/bin:/home/bfa/bin
volumes
:
-
nodo_data:/nodo_data/
apibfa
:
container_name
:
apibfa
image
:
apibfa
tty
:
true
ports
:
-
"
3000:3000"
volumes
:
-
nodo_data:/nodo_data/
links
:
-
nodobfa
volumes
:
nodo_data
:
This diff is collapsed.
Click to expand it.
nodo/Dockerfile
0 → 100644
+
32
−
0
View file @
e137c729
FROM
ubuntu:latest
ARG
DEBIAN_FRONTEND=noninteractive
RUN
apt-get update
&&
apt-get
install
-y
software-properties-common cron wget curl locales npm git zip unzip net-tools nano
RUN
locale-gen es_AR.UTF-8
RUN
export
LANG
=
es_AR.UTF-8
RUN
git clone https://gitlab.bfa.ar/blockchain/nucleo.git /bfa
RUN
mkdir
-p
/nodo_data/
RUN
/bfa/bin/installbfa.sh
RUN
chown
bfa:bfa
-R
/nodo_data/
RUN
sed
-i
's/--rpccorsdomain \\\*/--rpccorsdomain \\\* \\\n --rpcaddr 0.0.0.0\t\\\n --rpcport 8545/g'
/home/bfa/bfa/bin/start.sh
RUN
apt-get clean
&&
rm
-rf
/var/lib/apt/lists/
*
/tmp/
*
/var/tmp/
*
USER
bfa
RUN
export
BFAHOME
=
/home/bfa/bfa
&&
PATH
=
${
PATH
}
:/home/bfa/bfa/bin:/home/bfa/bin
&&
admin.sh account
RUN
cp
/home/bfa/bfa/network/node/keystore/UTC
*
/nodo_data/account.json
VOLUME
/nodo_data/
EXPOSE
8545 8546 30303
ENTRYPOINT
["/bin/sh", "-c" , "/home/bfa/bfa/bin/start.sh && tail -F /dev/null"]
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