From a10e4c32cb206b6973e003798365d8a2a14a47d1 Mon Sep 17 00:00:00 2001 From: donkeydonkey <79725339+donkey-donkey@users.noreply.github.com> Date: Tue, 30 Mar 2021 09:20:43 -0700 Subject: [PATCH 1/2] add lastblock command --- network.py | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/network.py b/network.py index 43f0e0d..c40ea99 100644 --- a/network.py +++ b/network.py @@ -7,6 +7,7 @@ import re # networkurl = "http://opennode.minemonero.pro:18081/getinfo" # networkurl = "http://node.xmr.pt:18081/getinfo" networkurl = "http://node.supportxmr.com:18081/getinfo" +lastblock = "http://node.supportxmr.com:18081/get_last_block_header" @sopel.module.commands('fork', 'forkening') 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'])) except: bot.say("Something borked o_O") + +@sopel.module.commands('lastblock') +def mempool(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') def blocksize(bot, trigger): From 799f8d7dd07dad737fcc1b557637b799146291b6 Mon Sep 17 00:00:00 2001 From: donkeydonkey <79725339+donkey-donkey@users.noreply.github.com> Date: Tue, 30 Mar 2021 09:40:55 -0700 Subject: [PATCH 2/2] give unique command name --- network.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/network.py b/network.py index c40ea99..d0c776b 100644 --- a/network.py +++ b/network.py @@ -60,7 +60,7 @@ def mempool(bot, trigger): bot.say("Something borked o_O") @sopel.module.commands('lastblock') -def mempool(bot, trigger): +def lastblock(bot, trigger): try: r=requests.get(lastblock) j=r.json()