Loading [a11y]/accessibility-menu.js
access accident account accountrecovery address advertisement aes agricultural airdrop airplay alcohol alipay altcoin amazon android animal animals annual ansi anti-phishing anti-scam anti-spam anti-spamming ants apache apache2 api app appbase appdirs apple apr aptedit architecture arduino art ascii asksteem asset assets atom audio authentication autossl autumn aux avatar aws axel b1 backup balance bananapi bandwidth bank base58 base58check bat bbq bbs beauty beer beneficiaries bicycle bigdata binance bip birds birthday bitcny bitcoin bitshares bittrex blacklist blackmail ble block blockchain blocktrades blog bmi160 bom bomb bonus book boost bootstrap bot botany bp bsv bts buddha buddhism buetooth bug bugs build business busy buy byteorder bytes calculator calendar call car card carrier cartoon cat categories cd cdr certbot chair chance changes chat cheers child childhood children chinese christmas chrome cieme claim cleaning cleanplanet cleos click cn cn-chat cn-cleaners cn-diy cn-iot cn-news cn-programing cn-programming cn-prorgamming cn-stem cn-writing coca-cola code coffee coin cola cold collision color comment community community-governance computer condenser container content contest cooperation couplets cpanel cpanl cplusplus cpp cpu craigrant credit creditcard cron crontab crypto-news cryptocurrency css cterm culture curation curie curl custom-json cutehive cx cyberspace dapp data database ddns dead decathlon delegate delegation delete design device diary dictionary dig discord diseases disk diy dlive dns docker dog doge dogecoin dollar domain down downvote downvotes dpoll dream dreamland dreams drink drinks driver dtube dtube-test dyson ebs ec2 ecc ecdsa economic edison edit education egg eip email embed emoticon encode encoding encrypt environment eos eosdac eosio epicdice equality error esp8266 essay esteem etc eth ethtool evil excel exchange exchange-blast exchanges experience explode explorer eztk face fair faith fan favicon favorites fdisk feature fee feed festival filezilla fingerprint fire firefox fireworks firmware flag flower flowers follow followed follower followers followes following food footprint forecast forever format forum forward fossa fraud friend friends friendship fruit fruits fstab ftp funny future galaxy gamble gambling game gameboy gangster gateway gdex ghost gift github giveaway glyphicon gold google gpio gprs grape group gsm guide hack hacker happy harddisk hardfork hardware hash hdd hdparm headache header health hexdump hf20 hf21 hf22 hifi history hive hive-105017 hivedev hivemind hivesigner hivewatchers hmac home host hosting hosts hot hotpost house how-to howto htaccess html http https icbc ice icloud ico icon idea identicon idiom ikea image include index info insurance intel intelligence intercom interest introduceafriend introducemyself introduceyourself invest investigation investment io iot ip ipad ipfs iptables ipv6 it java jd jdenticon jp jquery js json jsonrpc jussi keep-alive keosd kernel key keyboard kfc ksitigarbha kungfu kyc lamp lan landscapes lantern laodr laodr-teahouse laptop law learning lesson libcurl library life lifestyle limit linksys linode linux liquor list literature live livelihood lm35 loan lock logic login lonely lotus love lvm lxc lxdcontainer mac macosx mail mainnet maintenance makefriends maker mana manabar map markdown market math matplotlib mausoleum md5sum meltdown memo memories memory message metro mfc microsoft mini mining minnowsupport mira mke2fs mkfs mobile modem momey money mongodb movie mpm-itk msp mssql multi-language multisig multisignature music mute mutex mysql mysqldump nat natue nature navigation net netplan network neusoft news newyear nginx night nightmare node nodejs nodeos nodes notebook notepad notification npm ns nuc ocd ocr odbc online opencv openledger openssh openssl opera opration option order otc outlet overload pal parameter paranormal parted partiko party passport password pay payout paypal peace pem pen permission pet phishing phone photo photofeed photograph photography photographynature photograpy php phptography pi piano pinyin pip piston plagiarism plan plant play plugin plus pm2 poem poetry points policies poloniex popular post posting power powershell powerup ppk ppoe pptp prayer prettytable price printer privacy probability program programing programming promo-steem promote promoted property proxy putty pwm pycurl pypi python python-bitshares python-ecdsa qq quantmod r radio rain rainbow ram random raspberrypi raspbian rc reading reblog recall reindexing replay reply report reputation requests research resteem review reward rewards rewrite rex richlist right rights risk rm robohash robot rocksdb root route router rpc rs232 rshares rubaiyat rules sailing sales sample samsung sbd sbds scam score screen script sct sct-cn se search secp256k1 secp256k1-py security sendgrid seo serialized server service setup sevendaybnwchallenge sftp sha256 shairport shared shell shopping show signal signature signup sing site skype sleep smartctl smartqq sms snow social socialmedia socks4 softfork softlayer software song sp spam spectre split sport sports spring sps spud sql ssd ssh sshd ssl stats stduy steem steem-help steem-python steem-stats steemalliance steemcommunity steemconnect steemd steemdata steemdev steemgg steemit steemit-dev steemitdev steemitphotochallenge steemitui steempowerupday steempy steemsql steemstem steemstemfeed steemthought steemtorch steemui steemvoter steenit stem stick stock stone stopthepowerdown stopthepowerdownm story string study stupas sudo suggestion supply surfer system systemd tags tags-cloud taobao tapos taxi tea tea-house team-cn teamwork technology telecom telegram telephone telgram temple testing testnet thanksgiving thinkpad thought thunderbird time timeago tips tool tools toys trade trafficking transaction transfer translation traval travel tree trending tron ttl tuling tulip tutorial ubuntu ufo ufw ui ultraedit unicode unix unor3 update upgrade uptick uptime upvote url urllib urllib3 usd user utc utf-8 utopian utopian-io uuid valuable varint vc vector vedio vegetables verification version vesting vi viewly vim virtualenv visa visualstudio vitamin vnc voice volume vote vpn vps vscode wakeonlan walk wallet wang war warning water wealth weather web webmaster website wechat welcome welfare wget whitelist whm whois wif wifi win10 windows wine wish witness witness-category witness-update witnesses wol wordpress work wps writing wrting www x x230 x61 xlm xml xxd xxx yoyow yy zb zip 中文标签 测试

用Active Key来发表文章

玩过STEEM/HIVE一段时间的朋友,一般都会听说,POSTING Key用于发文/点赞,Active KEY用来转账/投见证人票等。很长一段时间,我也是这样认为的。


(图源 :pixabay)

但是后来一个朋友和我说,Posting Key、Active Key、Owner Key的级别一个比一个高,而后者能做前者的所有操作

也就是说,Active Key除了可以进行转账等需要Active Key权限的操作外,还可以用来发帖/点赞,Hive钱包中的一副权限图也表明了这个问题:

image.png

对此我非常好奇,一直想测试一下,到底能不能用Active Key发帖,然而当我尝试用Active登录https://hive.blog 时,却得到如下提示:

image.png

也就是说,尽管我知晓并愿意承担用Active Key 登录可能带来的风险,它还是不让我登录:

This password is bound to your account’s active key and can not be used to login to this page.

好在我之前学会了如何用程序去进行HIVE区块链的写操作,那么让我来试试能不能用Active Key把帖子发出去。

在这之前,我先来看看发帖的操作大概长什么样子,经过分析,它大概长成这个样子:

1
2
3
4
5
6
7
8
9
op_comment = ['comment',
{'author': '',
'body': '',
'json_metadata': '',
'parent_author': '',
'parent_permlink': '',
'permlink': '',
'title': ''
}]

对于主贴来讲,parent_author是空的,所以我们可以先不理会。parent_permlink是分类目录(也就是正常发文时第一个tag,我们可以设置为test

其它的就好理解多了,author是作者,title是标题,body是内容,permlink是文章链接(相同用户名下标识文章的独立标志,json_metadata是文章tags等数据我们可以先设置为空。

经过代码处理,并用Active Key签名 我们得出如下签名后transaction:

1
2
3
4
5
6
7
8
9
10
11
12
13
{'expiration': '2020-04-19T12:29:00',
'extensions': [],
'operations': [['comment',
{'author': 'oflyhigh.test',
'body': 'Test Active Key Post, Hello World!',
'json_metadata': '',
'parent_author': '',
'parent_permlink': 'test',
'permlink': 'testpost',
'title': 'Test Active Key Post'}]],
'ref_block_num': 12864,
'ref_block_prefix': 901786240,
'signatures': ['202e162abc10900c23fb22d11f2ab2f2a31c71a6c1c3d1db031c3698c7d816b0fa511dad561514007b4f9b20e7ffcec7e25ca3bc0914017dcc87a74de96d1335ed']}

广播如上transaction,发现成功发布到网络上,所以证实了使用Active Key发帖是完全可行的。

image.png

感兴趣的朋友还可以尝试用我之前的从签名恢复公钥的方法来试试从签名中恢复出来的到底是不是Active Key 对应的公钥,我就不做尝试啦。

尽管如此,必须强调的是,在进行发表文章/点赞等操作时,为了安全,请使用Posting Key登录,本文仅作探究之用,不建议这样使用。

相关链接


This page is synchronized from the post: ‘用Active Key来发表文章’

非常满意请按10

这几天被联通的宽带折磨得不得了,访问国内网站还好,网速嗷嗷快,可是访问国外网站,那就和蜗牛一样。


(图源 :pixabay)

要是就那么一两个网站慢,我也就忍了,总会有办法解决的,可是哪个国外网站都慢,让我如何破?

被折磨几天后,我终于忍不住打了联通的客服电话,客服小妹听了我反馈的问题后,告诉我她会给我切换端口(刷新端口),然后让我过十分钟重启光猫,态度好得不得了。

客服小妹回答完问题后,联通语音系统提示我对客服进行评价,小妹态度这么好,我肯定要给一个超级好评啊,语音系统提示:非常满意请按10

既然我是非常满意,那就按个10呗,可是我刚按完1,语音系统就提示我:谢谢您的评价,再见,擦,不会是我给服务态度这么好的小妹打了1分吧?

越想越觉得愧疚,人家那么热心地帮我解决问题,我却给人家评价了一分,这也太过分了吧?

于是我再次打通联通的客服,说了评价的问题,客服告诉我刚刚我评价的是非常满意,并不是最低分,这样还好,总算放下心来。

然后语音系统又提示我非常满意请按10,我按了一个1,系统又是:谢谢您的评价,再见,这是什么垃圾语音系统啊。


(图源 :pixabay)

好吧,服务评价的问题到是解决好了,然而访问国外的速度,依然是慢的不得了,哎,如果能就网络质量打分,那么一分还真不少。


This page is synchronized from the post: ‘非常满意请按10’

两年半前的大坑:区块链的写操作

2017年11月16日,我发布了一篇文章STEEM 签名学习笔记 (一)/ 读操作与写操作,在这篇文章中,我把STEEM区块链的操作分为两大类:读和写。


(图源 :pixabay)

并根据我的理解,给出如下定义:

  • 读操作:从区块链获取信息
  • 写操作:对区块链进行操作,将信息写入到区块链

同时在文章中,我给出读写的示例,然而读操作还好,其实就是调用API获取信息即可,写操作这块我是取巧的操作,使用steem-python来生成对应的transaction并签名,然后使用broadcast API广播。

但是其实对于transaction是如何签名的,我一定也不了解,反正steem-python满足大部分需求,我也懒得去学了,当然怕自己学不明白也是一方面。

Hive分叉后,steem-python等库都有一些故障,尽管各路大牛很快修复了故障,让其好用,但是让我意识到,如果不了解底层的工作原理,那么出问题的时候就会抓狂,要么做一些是是而非的修改,要么就只能被动等待了。

于是这阶段每天都耗费一些时间去学习签名相关的内容,总算有了一些眉目。对于区块链的写操作,了解的更为具体了。

那么到底如何对STEEM/HIVE区块链进行写操作呢?我对其总结如下:

  • 设置我们要进行的操作(operations)
  • 将操作放到事务中(transaction)
  • 设置事务的TaPos信息(refblock)*
  • 设置事务的超时时间(expiration)
  • 序列化事务(serialize)
  • 用chain_id和序列化后的事务来生成摘要(digest)
  • 对摘要进行签名(sign)并附加到事务中
  • 广播事务(broadcast)

弄清了写操作,并弄清其中每个细节之后,我们就可以做任意操作了,比如说投票操作。

依据之前学习的成功,我没用steem-python、beem等库,也成功地生成了签名后的transaction:

image.png

并将上述transaction成功地广播到Hive区块链上:

image.png

两年半过去了,总算填上了写操作这个大坑。

相关链接


This page is synchronized from the post: ‘两年半前的大坑:区块链的写操作’

选择或许比坚持更重要

昨天和我一个朋友闲聊一会,好多年前他和我从事相同的行业,但是在大家都对这个还很看好的时候激流勇退,切到手游赛道,再手游赛道掘金大笔后,又切到了区块链赛道。


(图源 :pixabay)

现在我从事的行业已经基本没落,我还在为生存而努力的时候,我的这个朋友却混的风生水起,现在保守估计资产过5亿。

这又让我想起另外一个朋友家的孩子,这个孩子学习并不好,初中毕业在家混一年后,家里送他去学厨师,这样有一技之长以后至少生存不是问题,然而这个小孩学了没多久就嫌累跑回家了。

然后家里又送他去工厂打工,做了几个月以后又嫌累辞掉了工作,在家继续混着。家里人都很失望,觉得即不肯好好学习,又不肯付出辛苦,这孩子将来可咋办?

然而在家又混半年之后,这个孩子突然和一个朋友合伙开了个服装店,每天上货、销售各种忙,也不喊累也不觉得辛苦了。在很多人都选择网购服装的背景下,他的小店竟然凭借服装质量以及贴心的服务吸引了很多顾客。

后来这个孩子的服装生意越做越大,开了几家连锁店,购置了豪车,娶了一个漂亮的老婆和他一起打拼。这大概是他家里人怎么也想不到的吧?

当然,有些人会反驳,是金子总是会发光的,你的第一个朋友在原来的行业坚持也一定会成为翘楚,你的这个朋友的孩子好好学厨师没准也会成为星级大厨。

我并不否认有这种可能,但是第一个朋友之前从事的行业已经没落,就好比胶片相机之于数码相机,就好比传呼机之于手机。再怎么坚持,也会被历史的滚滚洪流无情地碾过。

第二个朋友的孩子之所以在服装行业混得风生水起,我觉得无外乎两个字:热爱。如果继续学厨师,可能因为厌烦一事无成。


(图源 :pixabay)

以前流行寄信件的时候,我给朋友写信的时候写过,迷惘的时候也不要忘记前行,胜过原地踏步。可是现在觉得选择真的比坚持更重要,否则可能在错误或者偏离的道路上越走越远了。


This page is synchronized from the post: ‘选择或许比坚持更重要’

每天进步一点点:TaPos 以及我们可以引用多久之前的块?

在之前的一篇文章中,我学习了ref_block_num以及ref_block_prefix两个transaction中需要设置的内容,而且这个两个内容还有个学名叫:TaPos(Transaction as Proof of Stake)


(图源 :pixabay)

在学习这个内容的之前,我用一个取巧的方法来设置这两个值:

取最近的一个块中的一个transaction,然后取出其中的ref_block_num以及ref_block_prefix来设置我的transaction。

大部分情况,这个操作就是好用的,但是偶尔会出现错误,为什么有的好用有的就会出错呢?

另外,我还曾设想,既然TaPos,引用的是之前的一个块,那么是否我的程序中可以一直用固定的ref_block_num以及ref_block_prefix值呢?

在学习了相关内容之后,我知道为什么我取巧的方法时灵时不灵,我也知道了我用固定的ref_block_*值的想法有多么可笑。

这一切都可以用如下代码来解释:

image.png

也就是说ref_block_num的类型是uint16_t,也就是说两个字节长度的无符号整数,取值范围为00xFFFF,换句话说,只能引用最近65536个块,超出这个范围,hash值ref_block_prefix就会对不上了。

我们来做一下测试,取出当前head_block_number,然后减去0xFFFF后,用对应的块做为输入来生成ref_block_num以及ref_block_prefix两个参数,然后设置测试用的transaction并进行广播。

我会发现这样计算出来的结果时而成功时而不成功,之所以有时候不成功,我猜测是当我广播时头块已经又前进了一个,所以,实际我们引用的已经是65536个块之外的块了。

如果引用dgp["head_block_number"] - 0xFFFF + 1,则每次广播都是成功的:

image.png

反之,如果引用dgp["head_block_number"] - 0xFFFF - 1,则每次广播都是失败的,部分错误信息如下:

image.png

其中关键的信息就是:

‘message’: ‘transaction tapos exception’

所以引用别人的transaction中的ref_block_*数据以及使用固定的ref_block_*数据都是不靠谱的想法。

那么时间上,我们到底可以引用多久之前的块呢?我们知道HIVE/STEEM出块周期是3秒一个0xFFFF个块换算成时间是0xFFFF*3/3600/24 大概是2.28天,大概54个小时多一些。

EOS上才用差不多的机制,但是EOS是0.5秒出块周期,那么换成成时间的话就是约0.37天,9个小时多一些。

所以还是老实地使用head块或者最近不可逆块来生成TaPos信息吧,或者学steem-python,用head块再往前数三个,也不错。

相关链接


This page is synchronized from the post: ‘每天进步一点点:TaPos 以及我们可以引用多久之前的块?’

笔记本电池坏掉了

我最近一台笔记本电脑购置于2012年,当时给美国一家公司远程办公,他们给配置了笔记本等工具。笔记本是从美国联想官网下单订购的X230。


(图源 :pixabay)

笔记本到手后,公司又出钱让我升级配置,于是又将内存升级到12G,硬盘换成SSD(三星840PRO好像是),配合大屏DELL显示器,以及鼠标键盘,既能当主机工作机,又能移动办公。

后来又配置了Intel NUC的主机,笔记本就只是用来移动办公了,不过因为自己很少外出,所以需要用到笔记本的频率并不高,也许一周一次也许半个月。

一直打算换个笔记本,毕竟这个已经用了快8年了,然而这个笔记本用在移动办公上一直很给力,无论是聊天还是文档/表格处理还是编程,一直没让我失望过。

它又没坏掉,换个新的有些浪费,况且换新的还要把装软件、导文件等流程统统走一遍,想想就很心累。

这个笔记本唯一不给力的地方就是电池,用了好多年,电池续航时间非常短了。记不得是去年还是前年,我京东买了一个电池换上,这样又变成完美的移动办公机了。

原本虽然不频繁但是也时不时地开机用一下,可是因为疫情的缘故,这几个月几乎一直宅在家中,哪里也没去过。而大主机用着又很爽,所以笔记本这几个月一直也没开机。

今天要用到笔记本里的一些数据,于是想着打开看看,顺便更新一下系统啥的,结果开机不久后就提示我:

发生电池错误,电池无法充电,请更换电池。

擦,这是肿么了,于是我各种开机关机重新插拔电池等等,并在网上查找各种资料,可是试了很久之后,我得出一个结论:电池可能没救了

笔记本要没有了电池,大概就相当于失去了它作为笔记本的灵魂了吧,这让我很是纠结,是重新买一块电池呢,还是重新买一个笔记本呢?


(图源 :pixabay)

想想还是什么也不要买吧,反正插着电源还能用,而因为疫情的缘故我依旧一时半会儿无法出门,无论是电池还是新本,买来都是浪费,还是先这样将就吧。


This page is synchronized from the post: ‘笔记本电池坏掉了’

Your browser is out-of-date!

Update your browser to view this website correctly. Update my browser now

×