add latest block
This commit is contained in:
parent
1ac1b6c5ce
commit
3d718bb9a3
10
src/index.js
10
src/index.js
@ -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')
|
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) {
|
app.get('/status', async function (req, res) {
|
||||||
let nonce = await redisClient.get('nonce')
|
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
|
const { ethPrices } = fetcher
|
||||||
res.json({
|
res.json({
|
||||||
relayerAddress: web3.eth.defaultAccount,
|
relayerAddress: web3.eth.defaultAccount,
|
||||||
@ -48,7 +55,8 @@ app.get('/status', async function (req, res) {
|
|||||||
ethPrices,
|
ethPrices,
|
||||||
relayerServiceFee,
|
relayerServiceFee,
|
||||||
nonce,
|
nonce,
|
||||||
version
|
version,
|
||||||
|
latestBlock
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user