const express = require('express');
const evmCandidateNetworkService = require('../services/evmCandidateNetworkService');

const router = express.Router();

router.get('/status', async (req, res) => {
  const status = await evmCandidateNetworkService.getStatus();
  res.status(status.online ? 200 : 503).json({
    ok: status.online,
    ledgerRole: 'canonical-candidate-ledger',
    candidate: status
  });
});

module.exports = router;
