Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions expressApp.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,10 @@ const expressApp = express();

expressApp.use(cors());

expressApp.get('/time', (req, res) => {
res.send(`${Math.floor(Date.now() / 1000)}`);
});

expressApp.get('/syncing', async (req, res) => {
//await syncing.resetTx404();
//await syncing.deleteBlackTxsAndAddress();
Expand Down
15 changes: 13 additions & 2 deletions src/syncing.js
Original file line number Diff line number Diff line change
Expand Up @@ -137,6 +137,7 @@
location TEXT not null,
area_code TEXT not null,
country_code TEXT not null,
mining_address TEXT,
status INTEGER DEFAULT 0
);
`);
Expand Down Expand Up @@ -4297,6 +4298,15 @@
}
};

async function getTime() {
try {
const response = await axios.get("http://"+Item.ip+"/time");
console.log(`Unix Timestamp: ${response.data}`);
} catch (error) {
console.error('Error fetching time:', error);
}
};

export default {
initChivesLightNode,
initChivesLightNodeSql,
Expand Down Expand Up @@ -4390,5 +4400,6 @@
mkdirForData,
deleteBlackTxsAndAddress,
restrictToLocalhost,
closeDb
};
closeDb,
getTime
};