Skip to content

Commit

Permalink
add latest block
Browse files Browse the repository at this point in the history
  • Loading branch information
rstormsf committed Jul 17, 2020
1 parent 1ac1b6c commit 3d718bb
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,15 @@ app.get('/', function (req, res) {
res.send('This is <a href=https://tornado.cash>tornado.cash</a> Relayer service. Check the <a href=/status>/status</a> for settings')
})


app.get('/status', async function (req, res) {
let nonce = await redisClient.get('nonce')
let latestBlock = null
try {
latestBlock = await web3.eth.getBlockNumber()
} catch(e) {
console.error('Problem with RPC', e)
}
const { ethPrices } = fetcher
res.json({
relayerAddress: web3.eth.defaultAccount,
Expand All @@ -48,7 +55,8 @@ app.get('/status', async function (req, res) {
ethPrices,
relayerServiceFee,
nonce,
version
version,
latestBlock
})
})

Expand Down

0 comments on commit 3d718bb

Please sign in to comment.