- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
如果特定地址上有新交易,我想扫描 tron 网络的最新区 block https://trx.tokenview.com/en/blocklist
。
我设法获得了最新的区 block 和地址的余额,但我不知道如何扫描最新的区 block 并寻找该地址的任何新交易。任何想法都会非常有帮助。
from tronpy import Tron
client = Tron()
#-- Get the latest block
latestBlock = client.get_latest_block_number()
print (latestBlock)
#-- Get the balance
accountBalance = client.get_account_balance('TTzPiwbBedv7E8p4FkyPyeqq4RVoqRL3TW')
print (accountBalance)
#-- if the address has new transaction in the latest block at the time of the scan:
#-- display all the data (receiver, sender and amount, etc)
最佳答案
所以我尝试并为我工作的一件事如下:我达到了两个终点:trc20url = f"https://api.trongrid.io/v1/accounts/{address}/transactions/trc20?&contract_address={contract_add}&min_timestamp={getminTime}&max_timestamp={maxTime}"trxurl = f"https://api.trongrid.io/v1/accounts/{地址}/transactions"
对于 trc20 端点,请检查:https://stackoverflow.com/a/72162936/17474386
现在对于 trx 或 trc10 也有:我所做的我调用的获取请求如下:
headers = {
"Accept": "application/json",
"Content-Type": "application/json"
}
trxresponse = requests.get(trxurl, headers = headers)
trxdicResponse = trxresponse.json()
然后我遍历结果:
for tx in trxdicResponse['data']:
if (tx["raw_data"]["contract"][0]['type']) ==
'TransferContract':
# this means this is a trx tx , (transferAssetContract for trc10, and triggersmartcontract for trc20)
从那里你可以建立一个交易列表并做任何你想做的事情,如果你想让这个过程自动化,你可以做以下事情:
trxblock = client.get_block()
lastBlockNum = trxblock['block_header']['raw_data']['number']
maxTime = trxblock['block_header']['raw_data']['timestamp']
getuserBlock = get from DB
getfirstBlock = getuserBlock.trxLastBlock
getminTime = client.get_block(getfirstBlock)['block_header']['raw_data']['timestamp']
所以你要做的是获取最新的 block 并获取其时间戳,然后获取你从数据库循环过来的最后一个 block 并获取其时间戳,然后你只需将它们提供给请求参数,然后更新最后扫描的 block 在您的数据库中然后重复。
关于python - 如何扫描最新的 TRX 区 block 以获取转账事件以检查地址是否有新交易,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/72655194/
我们使用 Visual Studio 2008 和 MSTest。 我们有一个批处理文件,开发人员可以使用它来获取最新版本、构建解决方案、运行数据库脚本和运行所有测试。 问题是我们有很多测试项目。所以
我已经搜索过这个主题,没有找到任何好的信息来逐步完成,所以我研究了它并在这里分享。这是一个简单的解决方案。 最佳答案 在你安装的VisualStudio中找到vstst.xsd文件,使用xsd.exe
我正在尝试使用 vstest.console.exe 测试运行程序对 azure 角色运行测试。它在模拟器上运行良好,但在真正的 azure 云实例中,我想要使用的 TRX-Logger 不可用。 我
我经常编写更新数百万行数据的数据清理。数据驻留在使用 InnoDB 的 24x7x365 OLTP MySQL 数据库中。更新可能会清理表的每一行(其中 DB 最终获得表级锁)或者可能只是清理表中 1
我们一直在使用 TFS 来运行自动化测试。这些测试可以作为构建的一部分运行,也可以根据测试计划的需要运行。我们正在使用 Specflow 生成测试场景。 在我执行这些测试的第一个月,将生成一个 .TR
如果特定地址上有新交易,我想扫描 tron 网络的最新区 block https://trx.tokenview.com/en/blocklist。 我设法获得了最新的区 block 和地址的余额,但
在 msbuild 过程中,我得到了 TRX 文件,我想将此文件添加到 TFS 单元测试报告中。我该怎么做? 最佳答案 [MSDN] To publish command-line test resu
在我们的 Cruise Control 构建中,我们为 3 种浏览器运行了一套 Selenium 测试。为此,我们通过 MSTest 运行相同的测试套件,但我们在每次运行之间更改 app.config
在我们的 Cruise Control 构建中,我们为 3 种浏览器运行了一套 Selenium 测试。为此,我们通过 MSTest 运行相同的测试套件,但我们在每次运行之间更改 app.config
我想定期执行我的负载测试,并将其作为我的 CI 流程的一部分。 我想从控制台运行 Visual Studio 负载测试并以人类可读的格式(最好是 HTML 页面)提供测试结果。 为了执行测试,我使用
Knex 的交易文档中的代码如下所示: knex.transaction(function(trx) { var books = [ {title: 'Canterbury T
构建完成后,我在目录 TestResults 中有一堆测试结果文件 (*.trx)。 是否可以在 Jenkins 中显示这些测试结果?如何?我尝试了 MSTest Jenkins 插件,但它只允许每个
在 Microsoft MSTest 中,我在 ClassInitialize 的单元测试中动态创建自定义日志文件 (.xlsx)并将其关闭于 ClassCleanup 。它被创建并填充,但是当测试运
我正在运行一个在 TFS 服务器上构建的测试解决方案。我正在使用命令生成 .trx 文件 dotnet test --logger:trx; 关于整个解决方案,其中包括多个测试项目。但是,默认的 .t
我正在 Azure 管道中运行我的自动化测试并使用 NUnit VS 测试适配器和 Visual Studio 测试任务。 .trx文件被附加在 测试运行摘要。但是在发布测试结果任务中我可以看到警告
刚刚开始使用 Visual Studio Professional 的内置单元测试功能,据我所知,它使用 MS Test 来运行测试。 测试生成的 .trx 文件是 xml,但想知道是否有一种简单的方
我刚刚接触 knex,遇到了事务。我认为它很有用,因为它具有回滚功能。尝试使用它(参见下面的代码) await knex.transaction(trx => { knex.raw(delete fr
我试图在我的构建服务器上运行以下命令, c:\Program Files (x86)\Microsoft Visual Studio 12.0\Common7\IDE\CommonExtensions
我知道这个问题已被问过一百万次,但我的 ~/.gitconfig 只包含两行,它们与教程中的字符正确。 git config --global user.name "trx" git config -
我正在使用下面的代码进行knex连接,但经常出现错误 Knex: Timeout acquiring a connection. The pool is probably full. Are you
我是一名优秀的程序员,十分优秀!