Merge pull request #55 from Keep-it-Monero/master
add lastblock command
This commit is contained in:
commit
7ae267ace2
10
network.py
10
network.py
|
@ -7,6 +7,7 @@ import re
|
||||||
# networkurl = "http://opennode.minemonero.pro:18081/getinfo"
|
# networkurl = "http://opennode.minemonero.pro:18081/getinfo"
|
||||||
# networkurl = "http://node.xmr.pt:18081/getinfo"
|
# networkurl = "http://node.xmr.pt:18081/getinfo"
|
||||||
networkurl = "http://node.supportxmr.com:18081/getinfo"
|
networkurl = "http://node.supportxmr.com:18081/getinfo"
|
||||||
|
lastblock = "http://node.supportxmr.com:18081/get_last_block_header"
|
||||||
|
|
||||||
@sopel.module.commands('fork', 'forkening')
|
@sopel.module.commands('fork', 'forkening')
|
||||||
def fork(bot, trigger):
|
def fork(bot, trigger):
|
||||||
|
@ -57,6 +58,15 @@ def mempool(bot, trigger):
|
||||||
bot.say("The current number of txs in Monero's mempool is {0}".format(j['tx_pool_size']))
|
bot.say("The current number of txs in Monero's mempool is {0}".format(j['tx_pool_size']))
|
||||||
except:
|
except:
|
||||||
bot.say("Something borked o_O")
|
bot.say("Something borked o_O")
|
||||||
|
|
||||||
|
@sopel.module.commands('lastblock')
|
||||||
|
def lastblock(bot, trigger):
|
||||||
|
try:
|
||||||
|
r=requests.get(lastblock)
|
||||||
|
j=r.json()
|
||||||
|
bot.say("The current number of txs in Monero's Last Block is {0}".format(j['block_header']['num_txes']))
|
||||||
|
except:
|
||||||
|
bot.say("Something borked o_O")
|
||||||
|
|
||||||
@sopel.module.commands('blocksize')
|
@sopel.module.commands('blocksize')
|
||||||
def blocksize(bot, trigger):
|
def blocksize(bot, trigger):
|
||||||
|
|
Loading…
Reference in New Issue