diff --git a/Dockerfile b/Dockerfile
index ce7de56..7bd2568 100644
--- a/Dockerfile
+++ b/Dockerfile
@@ -1,4 +1,17 @@
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
@@ -6,4 +19,8 @@ COPY . .
RUN npx prisma generate
RUN npm run build
EXPOSE 3000
-CMD ["sh", "-c", "npx prisma migrate deploy && npm run start"]
\ No newline at end of file
+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"]
diff --git a/abis/ValidatorMetadataTest.abi.json b/abis/ValidatorMetadataTest.abi.json
index 37843f6..b47e135 100644
--- a/abis/ValidatorMetadataTest.abi.json
+++ b/abis/ValidatorMetadataTest.abi.json
@@ -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"
+ }
]
diff --git a/callApi.js b/callApi.js
new file mode 100644
index 0000000..fb419c3
--- /dev/null
+++ b/callApi.js
@@ -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();
\ No newline at end of file
diff --git a/callApi.sh b/callApi.sh
new file mode 100644
index 0000000..e6772ac
--- /dev/null
+++ b/callApi.sh
@@ -0,0 +1,2 @@
+#!/bin/sh
+/usr/local/bin/node /validator_dapp/callApi.js
\ No newline at end of file
diff --git a/crntab b/crntab
new file mode 100644
index 0000000..e0e9330
--- /dev/null
+++ b/crntab
@@ -0,0 +1 @@
+*/5 * * * * /validator_dapp/callApi.sh 2>> /validator_dapp/logg.log
\ No newline at end of file
diff --git a/pages/inactiveValidators.js b/pages/inactiveValidators.js
index 6d96572..74b3a5b 100644
--- a/pages/inactiveValidators.js
+++ b/pages/inactiveValidators.js
@@ -12,7 +12,7 @@ import {
const inactiveValidators = ({ validators }) => {
const [searchTerm, setSearchTerm] = useState("");
- const [isValidKey, setiIsValidKey] = useState(false);
+ // const [isValidKey, setiIsValidKey] = useState(false);
useEffect(() => {
if (checkEthereumExists()) {
@@ -22,28 +22,24 @@ const inactiveValidators = ({ validators }) => {
window.ethereum.on("chainChanged", () => {
window.location.reload();
});
- getConnectedAccounts()
- .then((value) => {
- checkAccessKey(value).then((finalvalue) => {
- setiIsValidKey(finalvalue);
- });
- })
- .catch((err) => {
- console.log(err);
- });
+ // getConnectedAccounts()
+ // .then((value) => {
+ // checkAccessKey(value).then((finalvalue) => {
+ // setiIsValidKey(finalvalue);
+ // });
+ // })
+ // .catch((err) => {
+ // console.log(err);
+ // });
}
}, []);
- return isValidKey ? (
+ return (