I implemented a python library myself, and because I saw that the condenser_api
would be deprecated, so in this python library I used other substitution APIs instead of using the condenser_api
.
(图源 :pixabay)
My scripts use my python library and the local node, and they work together without any problems.
But when I tried to use https://api.hive.blog, the following API call went wrong:
network_broadcast_api.broadcast_transaction
And the error message:
{“jsonrpc”:”2.0”,”id”:1,”error”:{“code”:-32603,”message”:”Internal Error”,”data”:{“error_id”:”b39f68b2-729c-4a3d-8c0e-3a55d3ae0559”,”jussi_request_id”:”000136681014195215”}}}
First of all, I thought there was a problem in my script or python library, but when I examined it closely, I found nothing wrong. In addition, I found that using my local node or https://anyx.io, my scripts worked fine.
So what’s the difference between https://api.hive.blog and my local node or https://anyx.io? The answer is https://api.hive.blog using JUSSI.
In order to test this problem, I tested some other nodes, and the results are the same: Nodes with JUSSI enabled return “internal error”, while others handle it normally.
We can use the following steps to reproduce this problem:
Step 1
Make an API Call to https://api.hive.blog (JUSSI enabled)
curl -s --data '{"jsonrpc":"2.0", "method":"network_broadcast_api.broadcast_transaction", "params":{"trx":{"ref_block_num":1097,"ref_block_prefix":2181793527,"expiration":"2016-03-24T18:00:21","operations":[{"type":"vote_operation","value":{"voter":"hiveio","author":"alice","permlink":"a-post-by-alice","weight":10000}}],"extensions":[],"signatures":[]},"max_block_age":50}, "id":1}' https://api.hive.blog
Check the response:
{“jsonrpc”:”2.0”,”id”:1,”error”:{“code”:-32603,”message”:”Internal Error”,”data”:{“error_id”:”b39f68b2-729c-4a3d-8c0e-3a55d3ae0559”,”jussi_request_id”:”000136681014195215”}}}
Step 2
Make API Call to https://api.hive.blog (without JUSSI)
curl -s --data '{"jsonrpc":"2.0", "method":"network_broadcast_api.broadcast_transaction", "params":{"trx":{"ref_block_num":1097,"ref_block_prefix":2181793527,"expiration":"2016-03-24T18:00:21","operations":[{"type":"vote_operation","value":{"voter":"hiveio","author":"alice","permlink":"a-post-by-alice","weight":10000}}],"extensions":[],"signatures":[]},"max_block_age":50}, "id":1}' https://anyx.io
Check the response:
{“error”:{“code”:-32000,”data”:{“code”:3030000,”message”:”missing required posting authority” …
Conclusion
We expect the two nodes to return the same information (step 2 is correct), but step 1 returns:”Internal Error”.
In my opinion, for an API call, whether or not the node is JUSSI enabled, the result should be consistent. So, I think this may be a BUG of JUSSI.
中文版
自己实现了个python库,因为看到condenser_api
要被弃用,所以的实现时基本上都是用其它替代API。
使用这个库的程序配合我的本地节点,一直工作的挺好没啥毛病。
不过当我偶然使用https://api.hive.blog, 发现竟然无法处理network_broadcast_api.broadcast_transaction
。
经过一系列的测试,我决定这个应该是一个BUG,没想到偶然间竟然测出JUSSI的一个BUG。因为指望JUSSI迅速更新是不可能了,只好先自己改一下库喽。
This page is synchronized from the post: ‘偶然间发现JUSSI的一个小BUG’