在之前的帖子[《昨晚steemit肿了啦?》](https://steemit.com/steemit/@oflyhigh/2trjv1-steemit)中,我提到过由于steem API RPC node 升级导致的STEEMIT网站故障。也就是说原本在0.19.2上好用的脚本用到0.19.4上可能会出一些问题。 ![](https://steemitimages.com/DQmdQJBBqEUKc1KPNv5KDRiVcfTe3U2ZNAgU2StBKf4VSTf/image.png) (图源 :[pixabay](https://pixabay.com)) 那个帖子之后就有朋友问我,如何知道自己脚本所使用的API节点是什么版本呢?这样当发生故障时,我们就可以判断是否是由于版本问题导致的不兼容。这里我就来介绍一下。 # STEEM 0.19.2 在STEEM 0.19.2 以及以前版本的节点,获取节点版本信息的JSON为: `{"jsonrpc": "2.0", "method": "call", "params": ["login_api", "get_version", []], "id": 1}` 其中最需要注意的地方是,我们使用的是login_api,换言之,使用database_api等其它组别,是行不通的。 使用curl调用,完整的指令如下: >`curl --data '{"jsonrpc": "2.0", "method": "call", "params": ["login_api", "get_version", []], "id": 1}' `https://api.steemit.com 返回结果如下: ![](https://steemitimages.com/DQmQ7upXJUsqJAtMDY5eZ36HPSk1AJQa6buAsoiZnoF4t73/image.png) 其中block_version就是我们说的steem区块链的版本号啦 steem_revision以及fc_revision代表的对应代码(steem 以及 fc)的版本, * steem_revision '07be64314ce9d277eb7da921b459c993c2e2412c'对应的是 https://github.com/steemit/steem/tree/07be64314ce9d277eb7da921b459c993c2e2412c * fc_revision: '8dd1fd1ec0906509eb722fa7c8d280d59bcca23d' 对应的是: https://github.com/steemit/fc/tree/8dd1fd1ec0906509eb722fa7c8d280d59bcca23d # STEEM 0.19.4 **login_api** 按照 [STEEM 0.19.4的Release Notes](https://github.com/steemit/steem/releases/tag/v0.19.4rc1) Login API 是要(已经)被移除的 >The login_api was designed as a way to map the API names to numeric ids. Because the APIs are no longer called via id, there is now no need for the login_api, and so ***it has been removed***. 但是,上述指令居然还好用: >curl --data '{"jsonrpc": "2.0", "method": "call", "params": ["login_api", "get_version", []], "id": 1}' https://api.steemitdev.com ![](https://steemitimages.com/DQmcnePi6nz8YYR9VMHvu3s1XWAZvq9AvL9bKsiGbdmHmC8/image.png) 这让人有点尴尬,咋就说了不算呢?尽管login_api 并未如官方说的那样不移除,但是既然官方说了,说不定啥时候就给移除掉了,用着终归不放心,那还有别的方法吗? 答案是在0.19.4节点上,database_api和condenser_api都和login_api一样可以用于获取版本信息。指令是一样的,替换一下API名称就可以了,示例如下: **database_api** >curl --data '{"jsonrpc": "2.0", "method": "call", "params": ["database_api", "get_version", []], "id": 1}' https://api.steemitdev.com **condenser_api** >curl --data '{"jsonrpc": "2.0", "method": "call", "params": ["condenser_api", "get_version", []], "id": 1}' https://api.steemitdev.com 返回内容都是一样的,就不列举出来啦。 # 如何获取版本? 你可能问了,这不对呀,我们的问题是如何获取版本,你这告诉我0.19.2如何获取,0.19.4如何获取,既然我知道版本,还获取啥啊? 这问题问的好,其实原本用login_api,没啥版本限制,一直可以用于获取版本,但0.19.4不是说要把login_api拿掉吗(尽管一直没拿掉)但是我们要做两手准备。 所以我们可以在程序中先用login_api去获取,一旦返回错误,再用condenser_api或者database_api 去获取好啰。搞这么麻烦,我也很无奈哦。 好消息是,除了STEEMIT官方节点总升着降着玩,版本变化略频繁,其它第三方节点几乎很少变化,并且一旦变化都是升级,很有有降级的,大可放心。 # 参考信息 * [昨晚steemit肿了啦?](https://steemit.com/steemit/@oflyhigh/2trjv1-steemit) * [体验一下 Steem 0.19.4 & condenser_api](https://steemit.com/steemdev/@oflyhigh/steem-0-19-4-and-condenserapi) * [Steem Equality 0.19.4 (Appbase) Release Notes](https://github.com/steemit/steem/releases/tag/v0.19.4rc1)
post_id | 37,976,001 |
---|---|
author | oflyhigh |
permlink | steem-api-rpc |
category | steemdev |
json_metadata | "{"app": "steemit/0.1", "format": "markdown", "links": ["https://steemit.com/steemit/@oflyhigh/2trjv1-steemit", "https://pixabay.com", "https://api.steemit.com", "https://github.com/steemit/steem/tree/07be64314ce9d277eb7da921b459c993c2e2412c", "https://github.com/steemit/fc/tree/8dd1fd1ec0906509eb722fa7c8d280d59bcca23d", "https://github.com/steemit/steem/releases/tag/v0.19.4rc1", "https://api.steemitdev.com", "https://steemit.com/steemdev/@oflyhigh/steem-0-19-4-and-condenserapi"], "image": ["https://steemitimages.com/DQmdQJBBqEUKc1KPNv5KDRiVcfTe3U2ZNAgU2StBKf4VSTf/image.png"], "tags": ["steemdev", "steem", "version", "cn-programming", "cn"]}" |
created | 2018-03-11 13:02:57 |
last_update | 2018-03-11 13:02:57 |
depth | 0 |
children | 4 |
net_rshares | 29,514,347,508,085 |
last_payout | 2018-03-18 13:02:57 |
cashout_time | 1969-12-31 23:59:59 |
total_payout_value | 81.702 SBD |
curator_payout_value | 15.177 SBD |
pending_payout_value | 0.000 SBD |
promoted | 0.000 SBD |
body_length | 2,890 |
author_reputation | 1,148,153,621,496,884 |
root_title | "如何获取Steem API RPC 节点的版本信息" |
beneficiaries | [] |
max_accepted_payout | 1,000,000.000 SBD |
percent_steem_dollars | 10,000 |
author_curate_reward | "" |
voter | weight | wgt% | rshares | pct | time |
---|---|---|---|---|---|
pharesim | 0 | 80,870,890,228 | 0.19% | ||
abit | 0 | 2,417,410,925,384 | 100% | ||
adm | 0 | 4,623,862,211,268 | 30% | ||
mark-waser | 0 | 112,724,912,209 | 100% | ||
slowwalker | 0 | 3,074,862,154,253 | 16% | ||
blockchainbilly | 0 | 22,397,405,826 | 50% | ||
deanliu | 0 | 1,234,024,338,510 | 100% | ||
rea | 0 | 1,985,952,651,985 | 100% | ||
joythewanderer | 0 | 196,038,826,276 | 40% | ||
ace108 | 0 | 314,783,199,687 | 25% | ||
laoyao | 0 | 34,790,363,295 | 100% | ||
somebody | 0 | 1,251,557,686,057 | 100% | ||
midnightoil | 0 | 109,132,767,357 | 100% | ||
xiaohui | 0 | 700,785,827,803 | 100% | ||
oflyhigh | 0 | 2,194,357,148,557 | 100% | ||
xiaokongcom | 0 | 10,206,968,505 | 100% | ||
yulan | 0 | 14,770,788,644 | 100% | ||
chinadaily | 0 | 179,169,909,692 | 100% | ||
helene | 0 | 587,996,359,043 | 100% | ||
ffcrossculture | 0 | 22,776,730,210 | 100% | ||
ethansteem | 0 | 190,465,004,763 | 100% | ||
sweetsssj | 0 | 3,440,728,004,358 | 10% | ||
englishtchrivy | 0 | 67,800,412,280 | 25% | ||
ivet | 0 | 23,602,385,131 | 51% | ||
davidjkelley | 0 | 5,681,031,385 | 100% | ||
digital-wisdom | 0 | 61,646,535,606 | 100% | ||
ethical-ai | 0 | 20,379,039,572 | 100% | ||
jwaser | 0 | 23,684,079,158 | 100% | ||
profitgenerator | 0 | 1,248,285,375 | 100% | ||
damarth | 0 | 199,790,255,244 | 3% | ||
bwaser | 0 | 2,132,747,883 | 100% | ||
jianghao | 0 | 231,676,028 | 10% | ||
ellepdub | 0 | 1,785,016,143 | 100% | ||
herpetologyguy | 0 | 275,581,242,763 | 100% | ||
morgan.waser | 0 | 6,057,259,582 | 100% | ||
handyman | 0 | 1,699,864,751 | 100% | ||
amylee | 0 | 81,520,786,517 | 100% | ||
mrtv2 | 0 | 61,824,505,200 | 100% | ||
strong-ai | 0 | 17,319,585,208 | 100% | ||
steemtruth | 0 | 20,821,410,598 | 10% | ||
lalala | 0 | 55,676,020,688 | 100% | ||
dapeng | 0 | 28,046,059,194 | 25% | ||
devilwsy | 0 | 2,200,881,142 | 100% | ||
janiceting | 0 | 2,199,050,842 | 100% | ||
abraomarcos | 0 | 2,392,802,983 | 100% | ||
lydiachan | 0 | 63,212,962,553 | 100% | ||
technoprogressiv | 0 | 13,187,710,573 | 100% | ||
newhope | 0 | 1,937,156,599,719 | 25% | ||
dragon40 | 0 | 2,358,032,420 | 10% | ||
jackhircus | 0 | 135,011,018,218 | 70% | ||
blackbunny | 0 | 64,009,055,614 | 100% | ||
chessmasterhex | 0 | 1,370,308,436 | 100% | ||
bxt | 0 | 164,636,619,079 | 100% | ||
lingfei | 0 | 52,528,492,645 | 100% | ||
yyyy | 0 | 447,909,706 | 100% | ||
alexis555 | 0 | 1,901,180,976,193 | 28% | ||
trafalgar | 0 | 815,978,945,512 | 3% | ||
austinsandersco | 0 | 780,364,216 | 70% | ||
kingofdew | 0 | 45,659,501,824 | 100% | ||
emcvay | 0 | 176,708,142 | 10% | ||
mandagoi | 0 | 9,067,548,201 | 21% | ||
wylo | 0 | 613,964,238 | 100% | ||
jkkim | 0 | 56,799,853 | 10% | ||
ebejammin | 0 | 5,778,528,771 | 100% | ||
nanosesame | 0 | 27,269,899,551 | 30% | ||
cryptohustler | 0 | 8,023,701,790 | 100% | ||
exec | 0 | 80,708,928,771 | 100% | ||
eval | 0 | 788,456,440 | 100% | ||
michaelwilshaw | 0 | 4,731,754,700 | 10% | ||
speeding | 0 | 3,703,089,603 | 100% | ||
walkinharmony | 0 | 12,866,970,740 | 50% | ||
asterix87 | 0 | 12,990,285,323 | 100% | ||
marram | 0 | 1,728,214,651 | 100% | ||
abetterworld | 0 | 3,154,877,973 | 100% | ||
that1consultant | 0 | 302,271,763 | 100% | ||
sanzo | 0 | 344,321,600 | 100% | ||
opc | 0 | 174,844,252 | 33% | ||
davaowhenyo | 0 | 614,503,785 | 100% | ||
allenshayzar | 0 | 614,503,785 | 100% | ||
raku | 0 | 613,122,478 | 100% | ||
resteeming | 0 | 614,860,000 | 100% | ||
ravenousappetite | 0 | 614,503,440 | 100% | ||
jleiva | 0 | 124,869,318 | 20% | ||
aabb | 0 | 10,218,904,409 | 100% | ||
catwomanteresa | 0 | 20,376,156,820 | 20% | ||
teukumuhas | 0 | 349,280,459 | 100% | ||
auntigormint | 0 | 537,652,272 | 100% | ||
mrliga | 0 | 14,099,382,611 | 100% | ||
twinkledrop | 0 | 106,225,784,556 | 100% | ||
sweethoney | 0 | 253,884,794 | 100% | ||
idx | 0 | 21,720,442,868 | 100% | ||
lancy | 0 | 5,127,177,164 | 92% | ||
steemstatistics | 0 | 436,326,238 | 71% | ||
bearpaw | 0 | 2,618,327,355 | 100% | ||
freedom-fighter | 0 | 614,503,785 | 100% | ||
technologynepal | 0 | 613,122,478 | 100% | ||
rosatravels | 0 | 27,087,800,670 | 20% | ||
veronicazhu | 0 | 4,710,504,989 | 100% | ||
dgorbunov | 0 | 534,193,600 | 100% | ||
tiffanyrej | 0 | 2,574,132,148 | 100% | ||
khalilad | 0 | 615,320,000 | 100% | ||
ms8988 | 0 | 607,421,444 | 100% | ||
xiaoshancun | 0 | 682,743,744 | 100% | ||
stakuza | 0 | 615,483,841 | 100% | ||
ikonik | 0 | 480,247,505 | 100% | ||
vfxness | 0 | 67,564,598 | 100% | ||
lemminon | 0 | 615,320,000 | 100% | ||
bobdos | 0 | 3,669,783,976 | 10% | ||
heyeshuang | 0 | 643,584,026 | 100% | ||
razor80 | 0 | 608,751,969 | 100% | ||
fastiduos | 0 | 615,320,000 | 100% | ||
rebecca80 | 0 | 577,020,459 | 100% | ||
weavingwords | 0 | 50,328,465,032 | 100% | ||
daydayup | 0 | 40,257,381,248 | 100% | ||
nitro.live | 0 | 12,218,654,220 | 100% | ||
chaerin | 0 | 607,754,139 | 100% | ||
chann | 0 | 4,997,338,012 | 10% | ||
yammyamm | 0 | 286,601,370 | 100% | ||
lebin | 0 | 6,976,973,062 | 10% | ||
saury | 0 | 303,723,844 | 100% | ||
ewq | 0 | 735,164,352 | 3% | ||
itsok | 0 | 7,486,048,281 | 100% | ||
wangyc | 0 | 533,329,343 | 100% | ||
dennis041713 | 0 | 114,750,565 | 100% | ||
fun2learn | 0 | 4,081,115,720 | 20% | ||
emmali | 0 | 1,739,679,957 | 100% | ||
omradk | 0 | 604,340,014 | 100% | ||
nostalgic1212 | 0 | 2,385,342,177 | 100% | ||
historylover | 0 | 549,777,767 | 100% | ||
mamicco | 0 | 545,646,282 | 100% | ||
btccurrency1 | 0 | 52,390,265 | 100% | ||
ethanlee | 0 | 10,407,380,676 | 100% | ||
fanso | 0 | 1,021,091,561 | 100% | ||
aellly | 0 | 122,712,714 | 100% | ||
mayuanbo1990 | 0 | 524,375,910 | 100% | ||
cryptoknight27 | 0 | 615,076,421 | 100% | ||
raybox | 0 | 89,027,743 | 100% | ||
hhjjkk | 0 | 322,862,771 | 100% | ||
fjjrc97k | 0 | 233,495,243 | 100% | ||
wr4587 | 0 | 352,326,002 | 100% | ||
tariqashraf7186 | 0 | 104,146,081 | 100% | ||
zodiac07 | 0 | 364,628,951 | 100% | ||
agoha | 0 | 0 | 100% | ||
milenakolarova07 | 0 | 128,633,056 | 100% | ||
laijihua | 0 | 606,396,070 | 100% | ||
facai | 0 | 572,707,399 | 100% |
thanks for sharing this informative post.
post_id | 37,986,766 |
---|---|
author | mdsalehin |
permlink | re-oflyhigh-steem-api-rpc-20180311t142004293z |
category | steemdev |
json_metadata | "{"app": "steemit/0.1", "tags": ["steemdev"]}" |
created | 2018-03-11 14:20:12 |
last_update | 2018-03-11 14:20:12 |
depth | 1 |
children | 0 |
net_rshares | 0 |
last_payout | 2018-03-18 14:20:12 |
cashout_time | 1969-12-31 23:59:59 |
total_payout_value | 0.000 SBD |
curator_payout_value | 0.000 SBD |
pending_payout_value | 0.000 SBD |
promoted | 0.000 SBD |
body_length | 41 |
author_reputation | 231,443,210,169 |
root_title | "如何获取Steem API RPC 节点的版本信息" |
beneficiaries | [] |
max_accepted_payout | 1,000,000.000 SBD |
percent_steem_dollars | 10,000 |
受教了
post_id | 38,267,621 |
---|---|
author | sweenyli |
permlink | re-oflyhigh-steem-api-rpc-20180313t023723510z |
category | steemdev |
json_metadata | "{"app": "steemit/0.1", "tags": ["steemdev"]}" |
created | 2018-03-13 02:37:27 |
last_update | 2018-03-13 02:37:27 |
depth | 1 |
children | 0 |
net_rshares | 0 |
last_payout | 2018-03-20 02:37:27 |
cashout_time | 1969-12-31 23:59:59 |
total_payout_value | 0.000 SBD |
curator_payout_value | 0.000 SBD |
pending_payout_value | 0.000 SBD |
promoted | 0.000 SBD |
body_length | 3 |
author_reputation | 4,847,921,239 |
root_title | "如何获取Steem API RPC 节点的版本信息" |
beneficiaries | [] |
max_accepted_payout | 1,000,000.000 SBD |
percent_steem_dollars | 10,000 |
谢谢, 受教了
post_id | 38,496,797 |
---|---|
author | facai |
permlink | re-oflyhigh-steem-api-rpc-20180314t054252581z |
category | steemdev |
json_metadata | "{"app": "steemit/0.1", "tags": ["steemdev"]}" |
created | 2018-03-14 05:42:51 |
last_update | 2018-03-14 05:42:51 |
depth | 1 |
children | 0 |
net_rshares | 0 |
last_payout | 2018-03-21 05:42:51 |
cashout_time | 1969-12-31 23:59:59 |
total_payout_value | 0.000 SBD |
curator_payout_value | 0.000 SBD |
pending_payout_value | 0.000 SBD |
promoted | 0.000 SBD |
body_length | 7 |
author_reputation | 85,769,589,859 |
root_title | "如何获取Steem API RPC 节点的版本信息" |
beneficiaries | [] |
max_accepted_payout | 1,000,000.000 SBD |
percent_steem_dollars | 10,000 |
持续学习中。
post_id | 38,510,809 |
---|---|
author | fangcan888 |
permlink | re-oflyhigh-steem-api-rpc-20180314t072552939z |
category | steemdev |
json_metadata | "{"app": "steemit/0.1", "tags": ["steemdev"]}" |
created | 2018-03-14 07:25:54 |
last_update | 2018-03-14 07:25:54 |
depth | 1 |
children | 0 |
net_rshares | 0 |
last_payout | 2018-03-21 07:25:54 |
cashout_time | 1969-12-31 23:59:59 |
total_payout_value | 0.000 SBD |
curator_payout_value | 0.000 SBD |
pending_payout_value | 0.000 SBD |
promoted | 0.000 SBD |
body_length | 6 |
author_reputation | 26,302,679,918 |
root_title | "如何获取Steem API RPC 节点的版本信息" |
beneficiaries | [] |
max_accepted_payout | 1,000,000.000 SBD |
percent_steem_dollars | 10,000 |