Skip to content
Snippets Groups Projects
Commit 6a9c97c3 authored by Hernan Hegykozi's avatar Hernan Hegykozi
Browse files

Update README.md

parent f7aaff7a
No related branches found
No related tags found
No related merge requests found
......@@ -9,17 +9,18 @@ Permite instalarla por fuera del nodo transaccional (opentx) , tanto en un serve
# Instalacion en Docker
Iniciar la consola en el servidor donde se encuentra alojado el servicio de docker
* Luego descargar la apliacion
* Luego descargar el repositorio
```
sudo git clone https://gitlab.bfa.ar/hhegykozi/tsa1.git
cd [nombre_repo]
cd tsa1
```
* Compilar la imagen
```
docker build -t bfa/apitsa1:latest .
```
El contenedor posee 3 variables de entorno que deben ser enviadas al momento de su ejecucion:
* El contenedor posee 3 variables de entorno que deben ser enviadas al momento de su ejecucion
```
ACCOUNTADDRESS: 0x25UHf0...... (direccion de la cuenta)
......@@ -27,7 +28,7 @@ ACCOUNTPRIVATEKEY: 58HYUF5GHY5D...... (Clave privada de la cuenta)
SERVER: http://10.0.0.6:8545 (URL del servidor donde se encuentra el nodo transaccional opentx)
```
Crear el contenedor:
* Crear el contenedor
```
docker run -d --name apitsa1 -p 3030:3030 -e ACCOUNTADDRESS='0x25UHf0......' -e ACCOUNTPRIVATEKEY='58HYUF5GHY5D......' -e SERVER='http://10.0.0.6:8545' bfa/apitsa1
```
......@@ -45,7 +46,7 @@ cd [nombre_repo]
npm install
```
* Modificar el archivo api/config.js
* Modificar el archivo api/config.js.
Se debe modificar account, privateKey y server
```
......@@ -71,9 +72,54 @@ exports.account = account;
exports.contract = contract;
exports.server = server;
```
* Iniciar la apliacion
```
npm start
```
# Probar la aplicación
* Verificar el RD temporal
Request:
```
POST /verify/ HTTP/1.1
Host: 127.0.0.1:3030
Content-Type: application/json
{
"file_hash": "1277da84a1656e2fa197c7bc378741434632fa1928d69e6cb3780a7b06bc373r",
"rd": "MXgtMTI3N2RhODRhMTY1NmUyZmExOTdjN2JjMzc4NzQxNDM0NjMyZmExOTI4ZDY5ZTZjYjM3ODBhN2IwNmJjMzczci04MDcwMzVkZjQ2NWRkMmNjYjNiYWZhYWJhNTIzNTI0Njc4MTQ1MDhiNmUxZGQ2NmJiNzgxYjM0M2IyM2IzM2FiMDEtMHg0YTY4NDIzMzU0Y2IwNTIwNWIyZmE3YzU0ZjU3MDdhZmE2NTAxNWVlNDlkMDVlNGIyYjE4NGM1ZTRiMzlhNmZkLTIxODMwNTkw"
}
```
Response:
```
{
"attestation_time": "22/03/2022 17:14:15",
"messages": "El archivo 1277da84a1656e2fa197c7bc378741434632fa1928d69e6cb3780a7b06bc373r fue ingresado en el bloque 21830590 el 22/03/2022 17:14:15",
"permanent_rd": "MXgtMTI3N2RhODRhMTY1NmUyZmExOTdjN2JjMzc4NzQxNDM0NjMyZmExOTI4ZDY5ZTZjYjM3ODBhN2IwNmJjMzczci04MDcwMzVkZjQ2NWRkMmNjYjNiYWZhYWJhNTIzNTI0Njc4MTQ1MDhiNmUxZGQ2NmJiNzgxYjM0M2IyM2IzM2FiMDEtMHg0YTY4NDIzMzU0Y2IwNTIwNWIyZmE3YzU0ZjU3MDdhZmE2NTAxNWVlNDlkMDVlNGIyYjE4NGM1ZTRiMzlhNmZkLTIxODMwNTkw",
"status": "success"
}
```
* Realizar el stamp
Request:
```
POST /stamp/ HTTP/1.1
Host: 127.0.0.1:3030
Content-Type: application/json
{
"file_hash": "1277da84a1656e2fa197c7bc378741434632fa1928d69e6cb3780a7b06bc373r"
}
```
Response:
```
{
"temporary_rd": "MHgtMjRlZDYzNTcwZGYwZTIwODQzOTJiYTY3NTcwYmVjNjY2ZGYxYTJjZTRkNGNkMjE5ZDNlMGQ3NWEyYzQ3YjU4MjAxLTB4YjgxOGI4NTgxNThlYWU3Y2MxMDhlZTZjZTg5MTY0OWY1ODM4MDg5MWIxNTk2NWQ4NjBhNDY3YjIyOWY2Nzk2OA==",
"status": "success"
}
```
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