-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
8 changed files
with
177 additions
and
107 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,26 @@ | ||
FROM node:18-alpine | ||
|
||
# install postgres and run databse | ||
# RUN apk add postgresql | ||
# RUN mkdir /run/postgresql | ||
# RUN chown postgres:postgres /run/postgresql | ||
# USER postgres | ||
# RUN mkdir /var/lib/postgresql/data | ||
# RUN chmod 0700 /var/lib/postgresql/data | ||
# RUN initdb -D /var/lib/postgresql/data | ||
# RUN pg_ctl start -D /var/lib/postgresql/data | ||
# su postgres -c 'pg_ctl start -D /var/lib/postgresql/data'; | ||
|
||
|
||
WORKDIR /validator_dapp | ||
COPY package*.json ./ | ||
RUN npm install | ||
COPY . . | ||
RUN npx prisma generate | ||
RUN npm run build | ||
EXPOSE 3000 | ||
CMD ["sh", "-c", "npx prisma migrate deploy && npm run start"] | ||
RUN chmod +x callApi.sh | ||
RUN chmod 0644 crntab | ||
COPY crntab /etc/crontabs/root | ||
ENV DATABASE_URL="postgres://postgres:postgres@localhost:5432/postgres" | ||
CMD ["sh", "-c", "npx prisma migrate deploy && npm run start && crond"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,91 +1,91 @@ | ||
[ | ||
{ | ||
"constant": false, | ||
"inputs": [ | ||
{ | ||
"name": "_firstName", | ||
"type": "string" | ||
}, | ||
{ | ||
"name": "_lastName", | ||
"type": "string" | ||
}, | ||
{ | ||
"name": "_contactEmail", | ||
"type": "string" | ||
}, | ||
{ | ||
"name": "_researchInstitute", | ||
"type": "string" | ||
}, | ||
{ | ||
"name": "_researchField", | ||
"type": "string" | ||
}, | ||
{ | ||
"name": "_instituteAddress", | ||
"type": "string" | ||
} | ||
], | ||
"name": "createMetadata", | ||
"outputs": [], | ||
"payable": false, | ||
"stateMutability": "nonpayable", | ||
"type": "function" | ||
}, | ||
{ | ||
"anonymous": false, | ||
"inputs": [ | ||
{ | ||
"indexed": false, | ||
"name": "memberAddress", | ||
"type": "address" | ||
} | ||
], | ||
"name": "CreatedMetadata", | ||
"type": "event" | ||
}, | ||
{ | ||
"constant": true, | ||
"inputs": [ | ||
{ | ||
"name": "memberAddress", | ||
"type": "address" | ||
} | ||
], | ||
"name": "validatorsMetadata", | ||
"outputs": [ | ||
{ | ||
"name": "firstName", | ||
"type": "string" | ||
}, | ||
{ | ||
"name": "lastName", | ||
"type": "string" | ||
}, | ||
{ | ||
"name": "contactEmail", | ||
"type": "string" | ||
}, | ||
{ | ||
"name": "researchInstitute", | ||
"type": "string" | ||
}, | ||
{ | ||
"name": "researchField", | ||
"type": "string" | ||
}, | ||
{ | ||
"name": "instituteAddress", | ||
"type": "string" | ||
}, | ||
{ | ||
"name": "sender", | ||
"type": "address" | ||
} | ||
], | ||
"payable": false, | ||
"stateMutability": "view", | ||
"type": "function" | ||
} | ||
{ | ||
"constant": false, | ||
"inputs": [ | ||
{ | ||
"name": "_firstName", | ||
"type": "string" | ||
}, | ||
{ | ||
"name": "_lastName", | ||
"type": "string" | ||
}, | ||
{ | ||
"name": "_contactEmail", | ||
"type": "string" | ||
}, | ||
{ | ||
"name": "_researchInstitute", | ||
"type": "string" | ||
}, | ||
{ | ||
"name": "_researchField", | ||
"type": "string" | ||
}, | ||
{ | ||
"name": "_instituteAddress", | ||
"type": "string" | ||
} | ||
], | ||
"name": "createMetadata", | ||
"outputs": [], | ||
"payable": false, | ||
"stateMutability": "nonpayable", | ||
"type": "function" | ||
}, | ||
{ | ||
"anonymous": false, | ||
"inputs": [ | ||
{ | ||
"indexed": false, | ||
"name": "memberAddress", | ||
"type": "address" | ||
} | ||
], | ||
"name": "CreatedMetadata", | ||
"type": "event" | ||
}, | ||
{ | ||
"constant": true, | ||
"inputs": [ | ||
{ | ||
"name": "memberAddress", | ||
"type": "address" | ||
} | ||
], | ||
"name": "validatorsMetadata", | ||
"outputs": [ | ||
{ | ||
"name": "firstName", | ||
"type": "string" | ||
}, | ||
{ | ||
"name": "lastName", | ||
"type": "string" | ||
}, | ||
{ | ||
"name": "contactEmail", | ||
"type": "string" | ||
}, | ||
{ | ||
"name": "researchInstitute", | ||
"type": "string" | ||
}, | ||
{ | ||
"name": "researchField", | ||
"type": "string" | ||
}, | ||
{ | ||
"name": "instituteAddress", | ||
"type": "string" | ||
}, | ||
{ | ||
"name": "sender", | ||
"type": "address" | ||
} | ||
], | ||
"payable": false, | ||
"stateMutability": "view", | ||
"type": "function" | ||
} | ||
] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
process.env.NODE_TLS_REJECT_UNAUTHORIZED = '0'; // Remove in production | ||
|
||
const axios = require('axios'); | ||
|
||
const callApi = async () => { | ||
try { | ||
const response = await axios.post('https://bloxberg-qa-traefik.mpdl.mpg.de/api/update-validators-details'); | ||
} catch (error) { | ||
console.log('Error calling API:', error); | ||
} | ||
}; | ||
|
||
callApi(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
#!/bin/sh | ||
/usr/local/bin/node /validator_dapp/callApi.js |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
*/5 * * * * /validator_dapp/callApi.sh 2>> /validator_dapp/logg.log |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.