Quantcast
Channel: 懒得折腾
Viewing all 764 articles
Browse latest View live

亮亮中美较量中双方的底牌与底线

$
0
0

 

  本博主按:写了一篇分析中美关系走向的长文章,从昨天晚上6点一口气写到今日凌晨2点。今天早上请了三位朋友帮忙校对,然后上传到微信公众号上,但改了多次无论如何无法通过审核,只好拆分成几篇文章分别发表,能发出来多少是多少。这个是成功发出来的第一篇(微信公众号每天只能发一篇文章)。文章发出来后,得到了许多朋友的热情鼓励和赞赏。

 

亮亮中美较量中双方的底牌与底线

  目前中美关系面临的巨大困难和严峻考验不言而喻。近两年来,我写过100多篇有关中美关系走向分析的文章,几乎所有的结果都如我预料。如果有任何人怀疑我在吹牛,可以在本人微信公众号、新浪博客和凯迪社区本人的专题文章中,查阅最近两年本人发表的文章来印证——尽管大约20%的文章被屏蔽或删除,但在上面三处特别是本人新浪博客上,还能找出几十篇相关文章,几乎涵盖了中美近两年来发生的所有大事,详细记录了我对中美关系演变过程的分析。

今天这篇文章,着重分析美国对华政策的底牌是什么,中国的底线在哪里,双方讨价还价的余地有多大。

 一、中美价值观水火不容

众所周知,美国坚守所谓自由、民主的价值观,实行多党平等竞争的资本主义民主制度。中国践行的社会主义核心价值观,虽然字面上与西方标榜的自由、民主极为相似,但根本的区别在于中国实行一党领导下的社会主义制度。

两种水火不相容的社会制度,孰优孰劣,世界上绝大多数国家与中国、朝鲜等少数国家的看法,截然不同,尖锐对立。美国为首的西方势力,与中国进行全面接触,从来没有掩饰他们的真实目的,那就是对中国进行和平演变——用他们比较委婉的话来说,是要让中国逐步融入国际主流社会。

他们为什么要这么做呢?他们也说得清清楚楚,一是像中国、朝鲜这样的体制,做出任何决策都缺乏必要的外部约束和透明度,这本身对他们就是巨大的威胁;二是他们希望中国人民也过上自由、民主的生活。当然,这是西方敌对势力一厢情愿的痴心妄想。实际上,按照中朝两国的官方宣传,中国和朝鲜人民作为国家的主人,早就过上了远比这些西方国家民众更自由、民主的幸福生活。

正因为美国为首的西方势力居心叵测,当中国40年前决定改革开放的时候,他们欢欣鼓舞,张开了双臂来欢迎,要钱给钱,要技术给技术,要管理经验就传授管理经验,甚至明知道中国可能并不会完全遵守所签的国际协议——其实我们一直就有喜欢废除所谓不平等条约,以及认为签过的国际协议过段时间就成了没有法律效力的历史文件,而且中国的专家们一直就有按中国的需要来解释国际协议的爱好——美国人还是力排众议,把中国带入了后来让中国迅速成为世界工厂、快速暴富的WTO组织。

40年过去,中国从改革开放中迅速强大,特别是每年从美国获得高达3500亿美元的贸易顺差(按中国口径,扣除香港的转口贸易,则金额减少约1000亿美元),加之这些外汇通过强制结汇完全掌握在政府手中,腰杆一下子硬了起来,不但对西方罪恶的资本主义制度嗤之以鼻,而且在杭州G20峰会上,正式提出要把中国治理的成功经验推向全球。更厉害的是,中国不光是说说而已,而且在此之前推出了“一带一路”战略,倡议创办了亚洲基础设施投资银行。包括美国在内的西方世界一下子醒了过来,并迅速做出了强烈反应。

而且,中国近年来对内采取日益严厉的维稳政策和舆论管制,也受到西方各国的强烈批评。为本文能见光考虑,这部分略去不谈。

最先做出反应的是美国前国务卿希拉里,她提出了亚太再平衡战略;特朗普上台之后,更是在去年联大发言、《美国国家安全战略报告》和《美国国防战略报告》中,赤裸裸地提出了对中国全面围堵的战略。2018年2月16日至18日在德国慕尼黑举行的第54届“慕尼黑安全会议”上,中国的雄心壮志则是受到了西方世界特别是欧洲各主要国家领导人的围剿(见本人所写的《欧洲反华声浪无法遏制中国成功治理经验推向全球》)。

一句话,美国等西方势力,本来是想通过与中国的全面接触,来诱惑中国和平演变,但万万没想到,刚刚进入小康还谈不上富裕的中国,已经牛气冲天,不仅大力加强内部管制,高调发展军事力量,而且竟然要把自己的治理模式推向全球!特朗普上台后,在多次公开大骂历届美国总统都是大傻逼的同时,发誓自己绝对不再做这样的傻逼了。这是中美关系出现重大转折的根源。

显然,中美两国在这个问题上,没有任何妥协的空间。

 二、南海问题上的正面冲突

与价值观水火不相容高度重叠,但值得单独列出的是中美在南海问题上的正面冲突。

大约六、七年前,在媒体披露中国准备在南海填海造陆的重大决策后,我就专门写了长篇文章,分析南海问题的高度敏感性,建议国家在南海问题上顾忌国际社会的感受,切勿被高涨的民族主义和民粹主义情绪所绑架。可惜本人一介草民,人微言轻,在被网上无数爱国者们骂为汉奸、卖国贼之后,文章也被删除得尸骨不存。之后,我也在其他多篇文章中,零星提及在南海问题上必须慎之又慎的立场。

在中国南海填海造岛之前,中国发起了一轮南海主权问题的国际宣传,美国表示强烈关注,多次通过外交途径和公开声明,要求中国清晰地说明九线段的法律含义。中国迄今为止却拒绝做出明确的说明,刻意保持模糊战略。

中国官方、主流媒体和专家们,在不同场合提出三种不同的主张:一是九段线内都是中国领土和领海;二是南海岛、礁属于中国领土,拥有12海里领海及200海里专属经济区,且不在上述范围内的南海九段线内,属于中国传统势力范围——这个说法本身不具有明确的法律含义,意思您懂的;三是南海岛、礁属于中国领土,且拥有12海里领海及200海里专属经济区,其他属于公海。

我可以负责任地说,第一,我完全支持中国政府在南海问题上的任何主张,不管是上面三种说法中的任何一种——实际上,只要是中国政府的对外主张,我都没胆不高举双手双脚赞成;第二,就我所知,南海岛礁尤其是填海造陆形成的人工岛,按照中国加入的国际海洋公约,单纯从法律上讲没有主权地位——除非整个南海都属于中国内海,则另当别论;第三,就我所知,世界上许多国家主张以和平方式解决南海纷争,但迄今尚没有任何一个国家明确表示支持中国对南海的主权申张,而几乎整个西方社会和南海域内国家都明确表示强烈反对。

在中国快速实施南海造岛计划后,美国做出强烈的外交和军事反应,第一,要求中国立即停止南海造岛及南海人工岛的军事化,第二,联系世界各主要国家,单独或联合实施所谓南海自由航行行动,派军舰和军机随意进入中国主张的南海领海、领空范围内进行公开挑衅,旨在证明这些地方是公海,拒绝承认中国的主权主张。

中国无数次强烈谴责美国作为域外国家多管闲事,无事生非。美国则公开宣称中国在南海的行为,一是破坏了现行国际准则,二是威胁到南海这个全球最繁忙国际航道的安全,明确表示美国不但要管,而且要管到底。美军太平洋司令甚至强硬表示,美军做出了“今夜就战”的准备。

在南海问题上,中国最大的妥协是不再填海造岛,不搞大规模的军事化建设,但中国绝对不会放弃南海的主权主张,也绝对不会明确说明自己南海主权主张的确切法律含义。因此,中美在南海问题上的正面冲突,即使可能会以某种妥协暂时平息,但冲突的根源永远不会消除——除非有一天美国在中国强大的军事力量面前彻底屈服。

 三、台湾问题上的危险较量

这个问题同样与价值观冲突高度重叠,但也有必要单独列出加以说明。

中国几十年来,一直强调领土和主权完整神圣不可侵犯,这一理念已经深入每个中国人的骨髓。如果放任台独势力得逞,甚至动摇中国党和政府的执政合法性基础——在对这个问题的判断上,我与官方的立场完全一致,跟许多自媒体人的看法有所不同。因此,我认为在台湾问题上,中美两国存在直接军事对抗的危险较量——这个与国内主流媒体和专家们的看法完全不同——他们认为美国没有这个魄力与胆量。

由于台湾岛内政局变化,岛内主流民意逆转,今天台独势力已经坐大。于是,中国便有了统一台湾的强烈紧迫感;同时由于大陆经济崛起,特别是政府掌握的财富全球无敌,军事现代化进程极为神速,大陆便有了不能和平统一就武力解决的强大自信。这就是《反分裂国家法》出台的背景。

美国在这个问题上同样没有任何退路。这是因为美国有两个具有强制约束力的法律,一个是《与台湾关系法》,另一个是包含在其他法律中的“对台六项保证”,这两个法律明确规定,美国必须以一切手段保证台湾的社会制度和生活方式,不会被以非和平方式强制改变。换句话说,如果大陆进攻台湾,美国就会出兵制止台湾被武力改变。

美国当然不希望跟中国打仗,但美国的确从来没有害怕过打仗。古巴导弹危机时,美国甚至做好了与苏联直接开战的准备——如果不是苏联舰队最后一刻下令撤离,美苏战争就真的打起来了——所有的解密文件都显示,当时美国总统已经向军方下达了苏联舰队越过红线就全面攻击的指令。

大陆当然也不希望跟美国打仗——虽然中国军队战无不胜,但打仗毕竟是要死人的,何况好多都是独生子女,而且在侦查卫星高度发达的今天,跨过台湾海峡的军事技术难度,不知道比当年夜幕掩护下跨过鸭绿江大桥大多少倍。

矛盾在于,树欲静而风不止。美国近年来配合全面围堵中国的战略,不断强化美台实质关系,包括将原先保密的“对台六项保证”公然写进法律,在《2017年国防拨款法案》和《2018年国防拨款法案》中实质性恢复了美台军事同盟关系,以及最近国会参众两院通过的《与台湾交往法》(又译《台湾旅行法》),全都赤裸裸地挑战了中国极为敏感的“一中”底线。美国这样做,一方面确实是为了切实履行保护台湾安全的法律责任——这当然是狗拿耗子多管闲事,另一方面不排除有意刺激大陆进行军备竞赛,更可怕的是,不管是美国人有意还是无意,正如中国外交部、国台办多次公开指出的那样,美国政府给台独势力发出了错误的信息。几天前的2月28日,岛内台独势力结成联盟,宣布正式启动独立公投进程,就是极为危险的举动。

在台湾问题上,中美确实存在直接军事对抗的巨大风险,甚至不排除美国纵容台独势力冒险,从而提前与中国军事摊牌。

 四、经贸问题上的势不两立

看这个小标题,许多人可能认为我危言耸听,生意场上无非双方讨价还价,哪来势不两立。看完我下面的分析,就会知道中美经贸问题上的矛盾,用“势不两立”来描述其实非常贴切、准确的。

在经贸问题上,美国对中国的不满与中国的底线,概括起来包括如下几个方面:

1、美国认为中国政府通过不透明的政策和不按市场出牌的国企,打乱了自由、公平的市场交易。比如,中国为了打垮全球钢铁企业,前年居然把钢材价格打到令人难以置信的2000元以下一吨,这导致了全球许多钢铁企业关门,而负债累累的中国国有钢铁企业却依靠无限制的银行贷款得以生存下来;仅仅一年之后,钢材价格又奇迹地上涨到了4500元以上,为中国钢铁企业谋取了暴利。美国强烈要求中国停止对国企的补贴和违反市场原则的金融支持,要求中国按照加入WTO的承诺加大对国企的改革。可是,美国这样的想法非常幼稚,因为中国政府正是利用国企的这一优势,打遍天下无敌手。中国没有西方那样出色的创新能力和雄厚的科技基础,不这样玩,如何能参与国际市场竞争。

2、兑现16年前加入WTO时的承诺,开放对银行、证券、保险等金融业外商投资,以及在法律服务、文化产品进口等方面的对外开放,取消对进口农产品进行限制的不合理政策。这个在中美两国去年达成的百日计划清单,以及后来特朗普访华时,中国已经做出了重大让步。但美国人很快发现原来中国人的这些承诺尽是忽悠。举例说,中国承诺开放进口美国牛肉,但规定只能通过中国两家国企统一组织进口,进来的美国牛肉,在美国市场上本来折合人民币几十元一斤的牛肉,到中国市场上却变成了300元一斤,以至中国普通百姓无人问津;说是签署了2500亿美元的大订单,实际上除了少量常规进口,大部分都是不落实的意向协议。结果,2017年中美贸易逆差不仅没有减少,反而增加了100多亿美元。针对中国政府和中国企业的这套忽悠术,我就专门写了一篇文章《中美2500亿美元大单 难敌马云百万就业岗位》来分析,并提醒这套办法用来对付企业家出身的特朗普,很可能导致难以想像的恶劣后果,现在不幸而言中。

3、美国要求中国取消所有违反世贸规则的不公平贸易行为,包括取消一切非关税贸易壁垒,降低不合理的高额关税和进口消费税,禁止限制和变相限制进口产品的投标。这个中国政府倒是完全可以做出法律上的让步,至于实际执行中,像“禁止限制和变相限制进口产品的投标”这样的承诺,即使写得再漂亮,一样可以通过设定特殊的技术和售后服务条款,不让美国人抓住任何把柄的情况下,轻而易举地将进口产品排除在外。问题在于,特朗普这种商人出身的总统,根本不看你嘴上说得多么动听,或者纸上的承诺多么漂亮,他要看到实际的经济成果。你做的手脚再高明,即使让他抓不到任何把柄,正如他公开表态的,我玩不过你,不跟你玩了,OK?于是,一切中国式的聪明对特朗普就毫无作用,相反,只会在特朗普这种视诚信为生命的商人脑海中留下极为恶劣的印象——事实上,特朗普对政客们的虚伪和媒体的忽悠从来都是深恶痛绝——这就是成功商人跟职业政客的最大区别。

4、所谓中国窃取美国知识产权问题。以往这么多年,中国在外商投资合作或成套设备进口中,都要求必须附带技术转让。最成功的例子,就是我们集成全世界最优秀的高铁技术,极短时间内,建成了中国有完全知识产权的全世界最先进的高铁系统。这样的伟大成就,比比皆是。其实,不管是百度、淘宝、京东,还是支付宝、滴滴打车和共享单车,这些现在最让中国人自豪的东西,无一不是西方人的发明。没办法,中国缺乏创新能力,因此只能山寨、模仿来快速追赶。虽然未必像特朗普指控的那样,由于中国盗用美国的知识产权,让美国企业每年损失高达几千亿美元,但如果真按世贸规则规定的那样强化知识产权保护,中国如何实现跨越式超常规发展?在我看来,中国以市场换技术无可厚非,怪只怪美国企业急于进入中国市场,主动或被迫放弃了自己的权利。至于说中国政府打假不力,说实话这也确实为难了中国政府,中国人或中国企业都喜欢生产和购买物美价廉的假冒伪劣商品,不但美国企业深受其害,中国有点创新能力的企业都深受其害,真打假确实打不过来。

5、人民币可自由兑换上的尖锐对立。美国和西方各主要国家,一直强烈要求中国尽快实现人民币可自由兑换,理由是你都已经是全球第二大经济体了,为何还不让人民币自由兑换。许多经济学家在解释为何不能让人民币自由兑换时,总说得云山雾罩,这次我就用通俗的语言把这个问题说清楚。说白了,不让人民币自由兑换是为了方便进行严格的外汇管制;而中国政府正是由于实行严格的外汇管制,再加上关税和非关税贸易壁垒,才能把物美价廉的外国商品牢牢地拦在了国门外。很多人都知道关税和非关税贸易壁垒的作用,却很少人了解不让人民币可自由兑换并实行严格的外汇管制,同样可以将物美价廉的外国商品挡在门外。道理非常简单,外国的东西再好、价格再便宜,人民币不能自由兑换,你手里又没有外汇,无论是企业还是个人,都只能望洋兴叹。把外汇全部集中在国家手中,进什么,不进什么,进来卖什么价格,就完全由政府说了算。此外,不让人民币可自由兑换并实行严格的外汇管制,还可以保证中国金融体系的稳定,以及房价和大宗商品价格想怎么玩就怎么玩。西方妄图让人民币可自由兑换,根本就是想动摇中国的经济基础,对此中国政府必定心知肚明,绝对不会上当受骗。在这个问题上,压根就没有一丝一毫的讨价还价余地。

最重要的是,如果没有美国每年提供的3500亿美元贸易顺差,人民币汇率要跌成卢布,“一带一路”也失去了强大的实力支撑,好多人的饭碗都有了问题。正因为有这个好处,中国最高领导人才提出“我们有一千个理由把中美关系搞好,没有一个理由把中美关系搞坏”;如果没有这个好处,中国政府凭什么要跟一个时刻想对自己和平演变的敌人打成一片,凭什么这么多年与狼共舞,甚至让资本主义的一些腐朽东西污染了许多国人纯洁的心灵?

虽然特朗普一再表示,他不在乎中国获得了多少贸易顺差、每年从美国拿走了多少千亿美元,他在乎的是这种贸易不平衡是中国通过不公平、不正当的贸易手段获得的,他不能像历届傻逼的美国总统那样被中国人继续玩弄,可是他应该非常清楚,如果真的像他希望的那样实现公平贸易,不让中国占美国的便宜,中国在政治上实在是有一千条理由与你美帝不共戴天,没有一个理由与你美帝和平相处。

除了上面这四大问题,中美两国在解决朝鲜核问题上,以及中日钓鱼岛主权争端问题上,中美两国都有严重分歧——美国声称钓鱼岛在美日安保协定保护的范围内;就在上周,中国还在联合国安理会否决了美国提出的制裁涉朝企业和船舶的黑名单。但鉴于在这两个问题上,美日两国掌握了绝对主导权,反而不会造成中美之间尖锐的冲突;即使在朝鲜问题上美国一再压中国帮忙,其实美国并没有把宝押在中国身上,中美之间的对立远不如上面四大问题那么突出。


一个数独引发的惨案:零知识证明(Zero-Knowledge Proof)

$
0
0

一个数独引发的惨案:零知识证明(Zero-Knowledge Proof)

Xiaoyao QianXiaoyao Qian

这篇文章大部分译自:medium.com/qed-it/the-i 原文的作者是著名的Ghost和Spectre 这两个协议的创始团队的领队Aviv Zohar。原文作者说他的这篇原文又是引用了以下这两篇学术论文:

  1. How to Explain Zero Knowledge Protocols to Your Children (Quisquater et. al.)
  2. Cryptographic and Physical Zero-Knowledge Proof Systems for Solutions of Sudoku Puzzles (Gradwohl et. al.).

老钱觉得原文是零知识证明方面写的最好最接地气的科普类的文章。所以想要翻译一下,顺便在原文基础上加上一些自己的解读。想要了解零知识证明,或者匿名性极强的区块链加密货币ZCash的朋友不妨读一读。


小明,小红,小刚三个好朋友很喜欢玩数独。平日里他们三个也会互相出题给对方做。有时候他们会出一些非常变态的数独题互相挑战。他们会挑一个人在纸上画出一个NxN的格子,填上谜面(Constraint),然后交给另外两人去解。

证明

有一天,小明出了一道非常难的数独题,小红花了很长时间尝试去解开这个数独,但是怎么都解不出结果。小红觉得小明在耍她,“这题压根就无解!小明你耍我!”,她跑到小明那抱怨。

“呵呵,我能证明给你看这题是有解的,而且我知道这个解“,小明淡定的回答道。

“好啊“,小红暗自想着,“哼哼,等你证明给我看之后,我就把解记下来然后去戏耍一下小刚,给他也做一下这题。”

小明接着说:“我会用零知识证明的方法给你证明我会这题的解。也就是说我不会把解给你看,却能让你信服我确实有这题的解。”

小红并不相信他能这样做到,还在想象小刚被耍的样子。

承诺

小明拿出81(9×9)张空白的卡片放在桌上,在每张纸上写上1-9中的一个数字,他让小红转过身闭上眼,然后把这81张卡片小心翼翼地按照解的排列放在桌上,代表谜底的卡片,数字面朝下放在桌上;代表谜面的卡片,则数字面朝上放在桌上。

随机试验

小明放好卡片后,让小红睁开眼转过身。小红很激动,她觉得谜底就要揭晓了,很是开心。她可花了好几天时间都没能解出这题。

小明对小红说:“小红,你不能偷看这些面朝下的卡片。“,明显能看出小红很失望,她以为能看到完整的一个解。“但是我能让你检验这些解:你可以随意选择按照行(row),或者按照列(column),或者按照3×3的九宫格(box) 来检验我的解。你挑一种吧~”

小红很困惑,嘴上念叨着什么鬼心里想着mmp,然后告诉小明她决定选择按照行的方法来验证,小明接着把每一行的9张卡片收起来单独放到一个麻布袋里。所有卡片都被收完放在了9个麻布袋里。小明接着摇了摇每个麻布袋,把里面的卡片顺序都打散。最后把这9个麻布袋交给小红。

验证

“好了,你可以打开这些布袋了。“小明对小红说,“每个布袋里应该都有正好9张,没有重复数字的,分别是数字1-9的卡片。” 小红打开每个布袋一看,还果真是这样。

“可这啥都证明不了啊!我也可以这样做给你看。我只要保证每一行都是1-9这9张卡片,不去管纵列和九宫格里的数字是不是也都是没有重复的不就行了。“小红气急败坏的说道。

小明解释说:“可是我事先也不知道你会选按照行来收集卡片,还是按照列,还是按照九宫格啊。我又不是你肚子里的蛔虫。。。我是按照题解来放置卡片的,你选啥我都没在怕的”

小红想了想,确实,一个数独只有真正正确的解才能保证每一行每一列每一个九宫格里的数字都是没有重复的1-9。小明如果真的在骗她,小明不会那么理直气壮,小红也至少有1/3的概率可以抓到他在骗人。

重复

小红还是不服气。觉得小明仍然有可能在骗她,所以要求小明再把卡片复原,按照原来的方法,重新选。这样接连试了几次,小红每次都选一个不一样的试验方法。试了好多次都是一样的结果。小红这下不得不承认,小明要么运气非常非常好,每次都能押中小红会选择哪种试验方式,要么就是他确实知道题解,(或者小明会读心术能预先知道小红会选什么试验方式)。小红很失望,这么多次试验下来,她还是不知道真正的题解,她只知道每次小明放置卡片的排列里很大几率每行每列每个九宫格确实都是没有重复的1-9,这就说明很大几率这题是有解的,而且小明很大几率确实知道这题的解。

小明把这种零知识证明的方法也给小刚展示了一遍。从此之后三个好友养成了通过零知识证明去证明给对方看自己知道某题解的习惯。毕竟每个人在解题的时候都花了很大功夫,不想轻易地把题解直接告诉对方。虽然每次零知识证明的过程很花时间,但是他们都乐在其中。

席卷全球的数独风暴

逐渐的,小明和小红发现全世界有很多数独爱好者,他俩决定在斗鱼上开一个直播间,直播解数独。为了展现自己的聪明才智,每周开播前,小明在粉丝团里随机抽取一个粉丝递交的数独,直播时,小明会把题解告诉小红,然后由小红用零知识证明的方法向观看直播的老铁们证明这题有解,并且自己知道题解,老铁们纷纷表示666并送上飞机火箭。就这样小明和小红的直播间人气暴涨,两人成为了斗鱼的签约艺人。

开挂

一天,小明来到小红家准备直播一个非常难的数独,可是他发现他把解出的题解落在自己家了。时间紧迫,要重新算一遍指定赶不上开播时间会被斗鱼老板骂。但是他和小红还是决定开播。开播前小明和小红说:“咱俩假装弄一弄零知识证明,我告诉你一会儿我会怎么选试验方式。你只要确保每次我选的那种试验方式(每行,或每列,或每个九宫格)里的数字不要重复就行了。” 小红同意了。

小刚,在自己家看完了直播,事后小明和小红把他俩这次作假的方法告诉小刚,小刚义愤填膺的斥责他们俩,“你们这样做和卢本伟开挂有什么区别!对得起支持你们的粉丝吗?我再也不相信你们俩的零知识证明了!”

神奇的机器和非交互式证明 (Non-interactive Proofs)

小刚很不爽。一来他很享受之前和小明和小红一起玩数独,但是现在他觉得挂逼不值得信任。小刚想找另一种方法来保证直播中他俩不能再这样作假。几个不眠的夜晚过去之后,小刚告诉小明小红,他想到了一个好方法。小刚把自己关在屋里忙活了一整天,第二天早上他把小明小红叫来,给他们展示自己的新发明:零知识数独非交互式证明机(“The Zero-Knowledge Sudoku Non-Interactive Proof Machine” or zk-SNIPM)。

这台机器基本上就是把小明和小红之前当面做的那套证明自动化,不再需要人为交互。小明只要把卡片放在传送带上,机器会自动选择按行,或列,或九宫格来收取卡片,放到袋子里打乱顺序,然后把袋子通过传送带再送出来。然后小明就可以当着镜头的面拆开袋子展示里面的卡片。

这台机器有一个控制面板,打开里面是一串旋钮,这些旋钮用来指示每次试验的选择(行,列, 九宫格)。

小刚已经设置好了试验的序列,然后把控制面板焊死,以保证小明和小红不会知道他到底选择了怎么样一个试验序列。

这下小刚很放心,他可以完全信任自己这台机器,放心的把机器交给小明和小红,让他俩下次直播就直接用这台机器来证明。小刚相信有了这台机器他俩就没法再开挂了。

仪式

小明和小红很嫉妒小刚的这台机器,并且想也能用这台机器来验证小刚自己出的数独题。但是问题是,小刚是知道自己选了什么样的试验序列的,如果用同一台机器去验证小刚自己的数独题解,小刚就可以开挂。小明把大伙聚集起来提议让小刚把控制面板重新打开,然后大家一起来设置控制面板上的试验序列。小明把这个过程称为“可信任的初始设置仪式(trusted setup ceremony)”。

小明提议把这台机器放在一个漆黑的屋子里,把旋钮上的指示贴纸都撕去。他们三人分别进入这个屋子,小红还提议大家进房间时蒙上眼来保证随机性,并且带一顶锡纸做的金属帽子(小红还是怀疑小明多少会一点读心术,想通过锡纸帽子来屏蔽脑电波信号防止读心术(side-channel attack))。这样,最后这些旋钮所代表的试验序列他们三个人都没有办法知道。就算他们3人中有2人事先商量好自己会怎么选,他们也无法得知第三个人会怎么选,从而没有办法作假。这个仪式结束之后,他们一起把控制面板焊死。

破解这台机器?

一天下午,小红和小刚出去玩儿了。小明一个人在家守着这台机器。他开始琢磨它是不是像小刚说的那样安全可靠。过了一会,他开始给机器故意传送一些假的题解(只保证每行或每列或每九宫格的数字不重复),试图通过这种试错来找出机器里设置的试验序列。慢慢的,小明把机器里的试验序列都推断出来了。他既兴奋又沮丧,你能帮小明设计一个更好的证明机吗?

透过故事看本质

故事讲完了,相信大家对零知识证明有了一个大概的印象。零知识证明的本质就是在不揭晓我所知道或拥有的某样东西的前提下,向别人证明我有很大几率(这点很重要,零知识证明说到底是一个概率上的证明)确实知道或拥有这个东西。

故事里要证明的东西就是一个数独题的解,小明让小红每次随机抽取行,列,九宫格的卡片,并收集在一起随机打乱,小红通过拆开袋子并不能知道题解,但是却能相信小明很大几率确实知道题解。

这个故事里的zk-SNIPM也是半开玩笑地暗指了零知识证明现在最普遍的zk-SNARKs(Zero-Knowledge Succinct Non-Interactive Argument of Knowledge)算法。故事中的zk-SNIPM虽然存在漏洞,但是他还有改进的余地,比如用一台扫描仪把第一次卡片的组合就全扫描下来,然后一次性同时验证所有的试验序列。这样就很难通过试错的方式来破解机器。

小明和小红之间最开始那种互动式的证明方法暗指的是交互式零知识证明(interactive zero-knowledge proof)。交互式零知识证明需要验证方(小红)在证明方(小明)放好答案(commitment)后,不断的发送随机试验。如果验证和证明双方事先串通好,那么他们就可以在不知道真实答案的情况下开挂(simulate/forge a proof)。

非交互式的证明则不需要这种互动。但是会额外需要一些机器或者程序,并且需要一串试验序列,这个试验序列不能被任何人知道。有了这么一个程序和试验序列,证明机就能自动算出一个证明,并且能防止任何一方作假。

主打匿名性的区块链加密货币ZCash里用到了零知识证明来保证交易双方和交易金额的匿名性。ZCash团队举行过2次故事中的那种仪式,第一次仪式他们甚至拍摄了一个纪录片,第二次仪式中一组人甚至不惜代价去切尔诺贝利核事故发生地取来了带有核辐射的废料,然后在高空中用利用核辐射来生成随机数。 有兴趣的各位可以去看看ZCash仪式的相关资料,非常有趣。

老钱打算接下去再写几篇关于零知识证明的系列文章,继续介绍零知识证明的正式定义,在以太坊中的应用,以及zk-SNARKs的一些细节。

Crypto_Trader

$
0
0

Crypto_Trader

A Live Machine-Learning based Cryptocurrency Trader for the Poloniex Exchange

The goal of the project is to create an open sourced, machine learning based cryptocurrency portfolio optimizer including as many relevant variables as possible.

These will include:

  • Community Sentiment (such as forum and twitter sentiment analysis)
  • Analyst Opinions (notable twitter account/analyst feeds with a history of winning strategies – ex. “Haejin” a successful elliot wave trader with an established history)
  • Global Economic Indexes (DOW, Nikkei225, FOREX data, etc.)
  • Open/Close/High/Low/Volume
  • Live Orderbook Data (spread, bid, ask, order size)
  • Technical Indicators (MACD’s, MA’s, VWAPS, etc.)
  • Any Other Variable of interest found to be important (Please feel free to brainstorm and send suggestions)

Boruta Analysis (variation of Random forest) will be used to reduce these input variables by removing “unimportant” features.

Using this input dataset, a machine learning Binary Classifier will be created to assign trading pairs on Poloniex a confidence score from 0 to 1. This value will represent the confidence that the trading pair will increase over a certain timeframe. Multiple machines may be constructed to score for a 5 minute window, 10 minute, 15 minute, 30 minute, 1 hour, etc.

Using these scores, a Q-Learning Bot (“reinforcement learning”) will be created that will optimize a trading strategy based on the binary classifier scores. The machine will read the amount of capital in the users Poloniex Account, and automatically place trades to optimize the portfolios holdings. These strategies will use stop losses and sell limits. Because it is q learning based, the machine will receive, and use live data to make decisions in a live auto-updating context with a reward that optimizes profit. This will allow the machine to continue to train and optimize itself over time while feeding in live data and placing trades.

Ultimately, the program will have the ability to be run 24 hours a day while optimizing a portfolio using live data, while taking into account fees in order to identify and take advantage of all trading opportunities accross the entire cryptocurrency market on Poloniex. Because of the decimal based system of cryptocurrencies, in theory a portfolio of any size should be able to be used as long as the user has the minimum trade size on Poloniex.

Major Design Features Purpose
Identified Variables Related to Price Action
Data Scraper Live Variables to Array
Binary Classifers Score Trading Pairs Live
Q-Learning Bot Optimize Trade Strategy
Poloniex API Link Allow Bot to Make Trades

If you would like to donate to the project, please do so at the following Bitcoin/Litecoin/Ethereum addresses. All donations appreciated 🙂

https://github.com/bshaw19/Crypto_Trader

 

Machine Learning Top 10 Articles for the Past Month (v.Mar 2018)

$
0
0

Machine Learning Top 10 Articles for the Past Month (v.Mar 2018)

For the past month, we ranked nearly 1,400 Machine Learning articles to pick the Top 10 stories that can help advance your career (0.7% chance).

  • Topics in this list: Tensor Comprehensions, Deepfakes, Neural Network, Deep reinforcement learning, Audio, DMLab-30, MR images, Lyric Analysis, IRL
  • “Watch” Machine Learning Monthly Top 10 on Github and get email once a month.

As an article ranking service for professionals, we take quality very seriously and make sure each article you read is great. Mybridge AI considers the total number of shares, minutes read, and uses our machine learning algorithm to rank articles. This is a competitive list and you’ll find the experience and techniques shared by the Machine Learning leaders useful.

Course of the month:

A) Beginners: Machine Learning A-Z™: Hands-On Python & R In Data Science[34,991 recommends, 4.5/5 stars]

B) Beginners: Data Science, Deep Learning, & Machine Learning with Python. [7,610 recommends, 4.5/5 stars]

Rank 1

Announcing Tensor Comprehensions. Courtesy of Facebook Research


Rank 2

Family fun with deepfakes. Or how I got my wife onto the Tonight Show. Courtesy of Sven Charleer


Rank 3

How I Shipped a Neural Network on iOS with CoreML, PyTorch, and React Native — Stefano J. Attardi. Courtesy of Stefano J. Attardi


Rank 4

Deep Reinforcement Learning Doesn’t Work Yet. Courtesy of Alexirpan


Rank 5

How you can train an AI to convert your design mockups into HTML and CSS. Courtesy of Emil Wallner


Rank 6

Synthesizing Audio with Generative Adversarial Networks. Courtesy of Chris Donahue


Rank 7

IMPALA: Scalable Distributed DeepRL in DMLab-30. Courtesy of DeepMind


Rank 8

It’s a no-brainer! Deep learning for brain MR images. Courtesy of Henrik Marklund


Rank 9

R NLP & Machine Learning: Lyric Analysis. Courtesy of Debbie Liske


Rank 10

Inverse Reinforcement Learning pt. I. Courtesy of Johannes Heidecke

That’s it for Machine Learning Monthly Top 10. If you like this curation, read best daily articles based on your programming skills on our website.

Node.js Top 10 Open Source for the Past Month (v.Feb 2018)

$
0
0

Node.js Top 10 Open Source for the Past Month (v.Feb 2018)

This is a new monthly series

For the past month, we ranked nearly 250 Node.js Open Source Projects to pick the Top 10.

We compared projects with new or major release during this period. Mybridge AI ranks projects based on a variety of factors to measure its quality for professionals.

  • Average number of Github stars in this edition: 6,870 ⭐
  • “Watch” Node.js Top 10 Open Source on Github and get email once a month.
  • Topics: ORM, Performance, Bot, Headless Chrome, Scratchpad, CLI, Dashboard, async, Web Screenshots, Console

Open source projects can be useful for programmers. Hope you find an interesting project that inspires you.

Rank 1

Objection.JS: An SQL-friendly Object-relational mapping for Node.js [2319 stars on Github]. Courtesy of Vincit


Rank 2

Node-clinic: Clinic diagnoses your Node.js performance issues [958 stars on Github]. Courtesy of nearForm


Rank 3

Auto-like-my-gf-insta-pic: Bot to automatically like your friend’s Instagram post and notify you on Slack [428 stars on Github]. Courtesy of Gulzar Ahmed


Rank 4

Puppeteer: Headless Chrome Node API [v.1.0] [26965 stars on Github]. Courtesy of GoogleChrome


Rank 5

Scratches: A scratchpad. Read, Evaluate, Print, Loop, but with a nicer editor. [965 stars on Github]. Courtesy of Paolo Fragomeni


Rank 6

Snyk: CLI and build-time tool to find & fix known vulnerabilities in open-source dependencies [969 stars on Github]. Courtesy of Snyk


Rank 7

Nodejs-dashboard: Telemetry dashboard for node.js apps from the terminal [3295 stars on Github]. Courtesy of Formidable


Rank 8

Greenlet: Move an async function into its own thread. [3058 stars on Github]. Courtesy of Jason Miller


Rank 9

Webshot-factory: Web Screenshots at scale based on headless chrome [217 stars on Github]. Courtesy of Ashish Shubham


Rank 10

Janeway: A curses-based console for node.js [184 stars on Github]. Courtesy of Jelle De Loecker

That’s it for Node.js Monthly Open Source. If you like this curation, read best daily articles based on your programming skills on our website.

12 BEST DEEP LEARNING BOOKS IN 2018 – RANKED IN ORDER OF AWESOMENESS!

$
0
0

12 BEST DEEP LEARNING BOOKS IN 2018 – RANKED IN ORDER OF AWESOMENESS!

If you want to be part of the AI revolution, then you need to learn Deep Learning. Check out these 12 best Deep Learning books to get started!
I’m sure you’ll agree that Artificial Intelligence, in particular Deep Learning, has made huge strides in the last 5 years or so.

But what began as a relatively niche field with just a handful of researchers, has now become so mainstream that the apps and services that we use everyday now use Deep Learning to perform tasks that were unthinkable not that long ago.

But Deep Learning isn’t new. It’s been around since the 1940s when Warren McCulloch and Walter Pitts created a computational model for neural networks based on mathematics and algorithms.

However “Deep Learning” only began to gain in popularity in the mid-2000s when Geoffrey Hinton and Ruslan Salakhutdinov released a paper showed how a multi-layered neural network could be pre-trained one layer at a time.

In 2009 it was discovered that with large enough datasets, you didn’t actually need the pre-training and that error rates could drop significantly as a result.

Fast forward to 2012 and Google’s Deep Learning system achieved a human-level ability to discover cats.

In 2017 Google’s DeepMind built an algorithm called AlphaGo which can teach itself to master games like chess, Go, Shogi and other games without human intervention.

But this is just the start.  Deep Learning is going to continually improve as datasets become larger and processors get fast enough to be able to train on even more vast amounts of data.

So, if you want to be part of this revolution, there’s no better time to start learning about Deep Learning than at the present moment.

With GPUs and big data sets readily available, there’s a huge opportunity to learn Deep Learning. And doing so will enable you to train machines to perform some incredible tasks such as facial recognitioncancer detection and even stock market prediction.

That’s where these books come in handy as they will allow you to learn Deep Learning from scratch.

Each of the books in this roundup have their own merits and each of them are excellent in their own right.

However, I have ranked them starting from which I think is the best and the order in which I would recommend buying.

So without further ado, here are the 12 best Deep Learning books on the interwebs at the moment.  Enjoy.

Hands-On Machine Learning with Scikit-Learn and TensorFlow

First up, and the best one in this roundup in my opinion, is a book that takes a “hands-on” approach to Deep Learning using the popular machine learning library Scikit-Learn and Google’s TensorFlow.

Like many “Deep Learning” books, and especially the next book in this roundup, it is packed full of equations but it’s much less of a reference book and more readable than one too.

The author tries to explain complex topics in a way that almost anybody can understand, which is a big plus in my oppinion.

What I like about Hands-On Machine Learning is that it takes you through a machine learning project from beginning to end. So you can see what it’s like to work with real data, how to visualize the data to gain insights and importantly, how to prep the data for machine learning algorithms.

Later on in the book, you’ll look at the famous MNIST classifier, how models are trained and some basic machine learning classifiers such as SVMs, Decision Trees, Random Forests etc.

All this is written to prepare you for the second part of the book which deals with Tensorflow (including installation) and a look at basic neural networks and deep neural networks.

I think the way this book is structured is excellent and introduces topics in the correct order. Despite the fact that there are lots of equations in this book, the ideas and concrete examples in the book are explained very well.

Deep Learning

OK, so next up is Deep Learning. Probably the most comprehensive and complete book in this roundup.

The book has been written by three experts in the field, Ian Goodfellow, Yoshua Bengio and Aaron Courville.

Also this book is the only book in this roundup to have an endorsement by the entrepreneur Elon Musk.

This bool is considered by many to be the bible of Deep Learning and rightly so – it brings together years and years worth of learning and dedicated research in one single book.

This book is not for the faint hearted though and may be better used for bedtime reading, because it is crammed full of equations and written in a typical textbook fashion – so it’s not written in the most interesting style.

It does however start from the beginning so to speak and introduces basic mathematics such as Linear Algebra, Probability Theory before moving onto Machine Learning Basics and finally Deep Networks and Deep Learning.

So, if you’re an aspiring student looking to master the subject and get into Deep Learning research or even if you want to teach it, then this book will definitely benefit you. It’s probably the most comprehensive book on the subject at the moment.

Deep Learning for the Layman

I’ve included this book because, as the title suggests, it is written for a general audience.

Deep Learning for the layman starts off with an introduction to Deep Learning, specifically, what it is and why it’s needed.

The next part of the book explains the differences between supervised learning, unsupervised learning and reinforcement learning and also introduces topics such as classification and clustering.

Later on in the book, Artificial Neural Networks are discussed including how they are constructed and the parts that make up each layer in the network.

Finally Deep Learning is discussed including Convolutional Neural Networks which form part of many computer vision algorithms that are in use today.

I see this book really as an introduction to Deep Learning and to get an idea of the concepts involved. Practically though, I’m not sure this book will be of benefit, but if you want a plain English guide which at the same time cuts through the hype, then this book could be for you.

Make Your Own Neural Network

This is not strictly a ‘Deep Learning’ book but this book will take you on a journey to fully understanding neural networks and how they work, which should aid your understanding of deep neural networks.

In this book, you’ll be guided through the mathematics of neural networks and will enable a complete beginner to fully understand how neural networks work.

Not only are you guided through how they work, you’ll actually implement two examples of neural networks in Python which will help cement your understanding of the subject.

The book starts off with a high level overview of machine learning and then drills down further into the the specifics of a neural network.

The maths involved doesn’t go much beyond secondary school level but does include a slight introduction to calculus which is explained in a way that is accessible to as many people as possible.

There are two parts to make your own neural network, the first part is all about the ideas and the theory whilst the second part is more practical.

In the second part, you’ll learn the Python programming language and gradually build up your own neural network that is capable of recognising hand-written numbers.

As a bonus, you’ll also learn how to get your neural network running on a Raspberry Pi!

This is a fantastic book for those looking to learn the nitty gritty of basic neural networks and could be a great prerequisite to one of the other books on Deep Learning in this roundup.

Deep Learning for Beginners

Deep learning for beginners doesn’t focus so much on the mathematics of Deep Learning, but uses graphs to help you understand the basic concepts and algorithms of Deep Learning.

This book takes a different approach than many other books by providing simple examples of how Deep Learning algorithms work and then builds on those examples step-by-step and gradually introducing more complex parts of the algorithms.

The target audience for this book is quite varied, ranging from newbies in computer science, through to data science professionals and tutors looking to explain the subject to students in the simplest possible way.

In terms of the book structure, you’ll first learn the basics of artificial neural networks and learn the differences between machine learning and Deep Learning.

Following on from this you’ll learn all about the Multilayer Perceptron (MLP) before progressing onto Convolutional Neural Networks (CNN) and other Deep Learning algorithms.

This is a great beginners book that explains the concepts well, but if you’re looking for something that is more practical, then you should probably look to the other books in this roundup.

Neural Networks and Deep Learning: Deep Learning explained to your granny

A book that explains things so simply that your granny can understand deserves a place on any list in my opinion!

Neural Networks and Deep Learning takes you on a step-by-step journey through the basics of neural networks and Deep Learning and is a great book for those that want to understand the topic but don’t necessarily want to get into all the maths behind it.

So, after a brief introduction to machine learning, you’ll learn about supervised and unsupervised learning and then delve into things like neurons, activation functions and different types of network architectures.

Finally you’ll learn how Deep Learning actually works, what the main types of deep neural networks are (including convolutional neural networks), how to give neural networks memory and it also discusses the various frameworks and libraries that are available.

Fundamentals of Deep Learning: Designing Next-Generation Machine Intelligence Algorithms

This book by Nikhil Buduma and contributions from Nicholas Locascio is designed to get you started with Deep Learning but is aimed at those that are familiar with Python and have a background in calculus.

Despite this, Fundamentals of Deep Learning does cover the foundations of machine learning and neural networks and teaches you how to train feed-forward neural networks.

One of the highlights of this book in my opinion is that it makes heavy use of Tensorflow, which is Google’s API for building neural networks. In fact there’s a whole chapter dedicated to it, which is a massive plus point in my opinion.

In terms of the rest of the book, it goes into some quite advanced features such as the problems with gradient descent, convolutional filters, deep reinforcement learning and more.

However, the book does have some excellent diagrams, the maths is kept to a minimum and there are some excellent explanations in here.

Learning TensorFlow: A Guide to Building Deep Learning Systems

Next up is a book that focuses entirely on Tensorflow – an end-to-end guide if you will.

The book provides a practical hands-on approach to Tensorflow and is written for a broad technical audience ranging from data scientists through to engineers, students and reserarchers.

The book starts out slowly by providing some basic examples in Tensorflow but then moves onto more in-depth topics such as neural network architectures like convolutional neural networks, how to work with text and sequences, TensorBoard visualization, TensorFlow abstraction libraries, and multi-threaded input pipelines.

The ultimate goal of Learning TensorFlow is to teach you how to build and deploy production-ready Deep Learning systems in Tensorflow by saving and exporting your models and how to use the Tensorflow Serving API.

Deep Learning with Python

Deep learning with python as the title suggests introduces Deep Learning using the Python programming language and the open-source Keras library which allows for easy and fast prototyping.

The great thing about this book is that the author is very engaging which makes the book very readable. As such some of the more challenging aspects of AI and Deep Learning are laid out simply which makes it easy to understand.

The book also avoids mathematical notations and instead focuses on explaining concepts via code snippets (of which there are over 30 of them).

Inside deep learning with python you’ll learn about Deep Learning from the very beginning, you learn all about image classification models, how to use Deep Learning for text and sequences and you’ll even learn how to use neural networks to generate text and images.

The book is written for those that have intermediate Python skills but you don’t have to have any previous experience in machine learning, Tensorflow or Keras.

Oh and you don’t need an advanced maths background either, just basic high school level maths should allow you to follow along and understand the core ideas.

Deep Learning: A Practitioner’s Approach

Number ten on my list is Deep Learning: A Practitioner’s Approach.

Unlike the other books in this roundup, this book focuses on Deep Learning For Java (DL4J) which is a Java framework/library for training and implementing deep neural networks.

Now most AI research is carried out in Python because it’s generally quicker to do rapid prototyping, but as more organizations (many of which use Java) embrace AI, we’re probably going to see more AI algorithms shift to Java like DL4J.

The book is first and foremost a beginners book on Deep Learning, but if you already have experience in Java or Deep Learning, then you can head straight over to look at the examples.

If you have no experience in Deep Learning, but strong Java experience, then you should read it from cover to cover.

If you don’t know Java at all, then I highly recommend reading one of these Java beginners books.

By reading this book you will learn about machine learning concepts in general, with a particular focus on Deep Learning.

You’ll learn how deep neural networks have evolved from basic neural networks and you’ll also look at some deep network architectures such as Convolutional and Recurrent neural networks.

If you’re familiar with Hadoop and Spark, then you’ll be able to learn how you can use these technologies natively with DL4J.

Pro Deep Learning with TensorFlow

This book will teach you Tensorflow in a hands-on, practical manner enabling you to learn Deep Learning from scratch, get up to speed quickly with the Tensorflow API and learn how to optimize the various Deep Learning network architectures.

Pro Deep Learning will help you develop the mathematical knowledge and the intuition required to tweak existing neural network architectures or even invent completely new architectures that could challenge the state-of-the-art.

All the code in this book is available in the form of iPython notebooks, and having used Tensorflow in the past, I found it very useful to use the iPython notebooks during development.

The book is aimed at Data scientists and machine learning professionals, software developers, graduate students, and open source enthusiasts and will give you the mathematical foundation and the machine learning principles to enable you to carry out research and also deploy Deep Learning solutions into production.

TensorFlow for Deep Learning

At the time of writing, TensorFlow for Deep Learning has not yet been released but is available for pre-order.

The book will teach you the concepts of Deep Learning through practical examples from the ground up and is designed for developers experienced in building software systems but with no experience of Deep Learning architectures.

So this book will show you how to design systems that can perform object detection, translate human speech, analyze video and even predict the properities of potential medicines!

You’ll gain in-depth knowledge of the Tensorflow API, how to train neural networks on large datasets and how to use TensorFlow with convolutional networks, recurrent networks, LSTMs, and reinforcement learning.

The book does assume some background in basic linear algebra and calculus, but this is a practical book designed to teach you how to create systems that can learn.

Wrapping up

So that’s it guys, the best Deep Learning books out there at the moment.

Artificial Intelligence, particularly Deep Learning, has been very effective and extraordinary things have been already been achieved with this technology. However, it is still in its infancy and many organizations have yet to embrace it.

But this provides opportunity, and an opportunity for those that are willing to learn the subject.

Deep Learning has the power to transform many industries and there’s many ideas for startups that haven’t been dreamt up yet. I feel we’re just at the beginning of a revolution.

As a Java developer, I have had some experience of Deep Learning, but I know many of my colleagues have yet to learn the subject.

So why not take this opportunity to stand out from the crowd and learn all you can about Deep Learning and maybe you could bring the next big AI startup to Silicon Valley?

Even if you don’t create a startup, it’s a fantastic addition to any Resume.

Node.js在币圈也同样流行

$
0
0

Node.js在币圈也同样流行

Github自带搜索

我们使用Github自带的搜索工具, 在搜索框内输入下面的内容:

bitcoin stars:>100 forks:>50

结果如下:

github-search-bitcoin-result

使用更加复杂的查询条件,比如:

bitcoin OR wallet stars:>100 forks:>50 in:file extension:md

意思是:查询在文件扩展名为.md的文件中,包含关键字bitcoin或wallet,星100以上,fork50以上的全部项目库

其他情况,请自己试验。

自制查询工具

程序员天生就是懒人,为了一劳永逸的获得想要的结果,我专为本文配套设计了一个小工具,看看它给我们的效果吧。

上面两个查询的对应结果如下:

(1)柱状图

查询bitcoin关键字,获得如下柱状图

sacdl-bitcoin-bar

查询wallet关键字(不一定是加密货币钱包),获得如下柱状图

sacdl-wallet-bar

(2)树形矩阵

查询bitcoin关键字,获得如下矩阵图

sacdl-bitcoin-treemap

(3)更复杂的查询

请自己去体验吧,地址:https://imfly.github.io/sacdl-project

前10个应用简介

我们使用github的搜索功能,并选择forks数量倒序排列,查询:

bitcoin language:JavaScript

注意:每一个fork背后可能就是一个全新的产品,forks代表了程序被二次开发的情况,个人觉得对于技术选型相对更有说服力。

前10个应用如下:

1. bitpay/bitcore 1656颗星,429个分支

源码网址: https://github.com/bitpay/bitcore

第一位,这是bitpay团队的产品,号称下一代PayPal。这算是一个成功案例,足见Node.js开发加密货币的可行性。巴比特有专栏介绍。

2. startup-class/bitstarter-leaderboard 295颗星,386个分支

源码网址:https://github.com/startup-class/bitstarter-leaderboard

第二位,这是一个基于比特币开发众筹网站的模板程序。巴比特在做众筹,很多人也想进入这个领域,可以参考学习。

3. bitcoinjs/bitcoinjs-lib 980颗星,305个分支

源码网址:https://github.com/bitcoinjs/bitcoinjs-lib

第三位,这是个比特币web钱包开发包,几乎当前市面上所有的基于网站的钱包都在用,牛x吧。

4. askmike/gekko 866颗星,300个分支

源码网址:https://github.com/askmike/gekko

第四位,你也想推出一个像时代、okcoin那样的基于网页的交易市场吗,这个代码不容错过。不过,我个人觉得交易市场不仅仅是技术问题,Gekko也提醒您要自担风险。

5. bitpay/insight-ui 354颗星,267个分支

源码网址:https://github.com/bitpay/insight-ui

第五位,这是bitpay放出的一个开发web钱包的UI包(要基于bitcoin-node),看来当前开发钱包的需求还是比较大的。可以与排行第7位的bitpay/insight-api配合开发。

6. kyledrake/coinpunk 733颗星,249个分支

第六位,该项目是一个本地化的钱包服务程序,已经停止维护,取而代之的就是第3位的bitcoinjs-lib。

7. bitpay/insight-api(略)

8. cjb/GitTorrent 3065颗星,133个分支

源码网址:https://github.com/cjb/GitTorrent

第八位,不过它的好评3065颗星却是最高的。这是一个去中心化的Github,作者写了一篇博客详细解释了为什么Git也要去中心化。我本人觉得,这项目确实有意思,为我们开发去中心化的产品扩展了视野。基于这个项目思路,可以设想很多有价值的应用。

9. bitcoinjs/bitcoinjs-server

源码网址:https://github.com/bitcoinjs/bitcoinjs-server

第九位,已经放弃维护了。

10. untitled-dice/untitled-dice.github.io 26颗星,114个分支

源码网址:https://github.com/untitled-dice/untitled-dice.github.io   第十位,一个基于比特币的赌博网站源码。有意思的是,用户评价26颗星,很低,说明人们的价值观还是不喜欢赌博的。但是拷贝的分支却很多,对于开发者来说,这也算是比特币的一个落地应用。

其实,还有很多应用,没有开源,或半开源,被关注的不多,鲜为人知。

结论

仅就上述数据分析,我们可以得出如下结论:

  • 在整个开源社区,Node.js当之无愧是最流行的开发平台之一;
  • 在钱包、交易市场等客户端应用领域,Node.js的应用较为广泛;
  • 在加密货币核心代码开发上,Node.js的应用较少,远不如pythonjava,c/c++等开发语言的使用。

不过,由于javascript有着众多的用户群,随着加密货币的发展和普及,会有更多的Node.js开发者加入。选择Node.js,就像最初选择了bitcoin,作为第一批实践的用户,我们已经站在时代潮头。

说明

本文数据收集面仍然狭窄,无法完整呈现币圈全貌,仅供参考。后续,如果发现更多更好的应用,我会持续更新,您可以关注本文的电子书形式进行跟踪。

这是一篇软文,写作不难,真正的工作量在于数据统计分析,而这也因为Node.js变的轻松加愉快。

想知道上述数据和图表怎么来吗?请看下一篇:《Node.js开发加密货币》之二:Node.js让前端开发像子弹飞一样,将简单介绍Node.js的基本使用,教您一个数据挖掘、统计分析的小技巧,并尝试去理解那些交易市场、在线钱包等实时应用的开发过程。

链接

项目源码: https://github.com/imfly/sacdl-project

试用地址:https://imfly.github.io/sacdl-project

本文源地址: https://github.com/imfly/bitcoin-on-nodejs

电子书阅读: http://bitcoin-on-nodejs.ebookchain.org/

参考

node-in-debugging

$
0
0

node-in-debugging

《Node.js 调试指南》是本人整理的从事 Node.js 开发这几年的一些调试经验和思路,希望授人以鱼也能授人以渔。

开发环境

  • MacOS|Linux(Ubuntu@16.04 64位)
  • Node.js@8.9.4

目录


由全面接触转向全面围堵 中美关系将何去何从

$
0
0

由全面接触转向全面围堵 中美关系将何去何从

(2018-03-06 11:44:43)

文/感悟生活

  本号主按:前天写了一篇分析中美关系走向的长文章,从晚上6点一口气写到第二天凌晨2点。昨天早上请了三位朋友帮忙校对,然后上传到微信公众号“shsp_888”上,但改了多次无论如何无法通过审核,只好拆分成几篇文章分别发表,能发出来多少是多少。昨天成功发出来的第一篇(微信公众号每天只能发一篇文章)。文章发出来后,得到了许多朋友的热情鼓励和赞赏(二维码打赏金额超过6800元,另获得同等金额的广告收入),在此表示由衷的感谢。现在这个是分拆出来的第二篇。

由全面接触转向全面围堵 中美关系将何去何从

我在上篇文章中,分析了中美关系发生困难的主要原因,以及中美对抗中双方各自的底牌与底线,这篇分析何以判断中美关系发生了重大转折,美国敢不敢跟中国全面对抗,以及未来中美关系将如何演变,对普通人的生活会产生怎样的影响。

 (一)美对华政策由全面接触转为全面围堵

由于美国对中国全面接触并诱导中国和平演变的图谋彻底破产,中国强势崛起不但吓尿了美帝,而且吓尿了日本、印度、澳大利亚、东南亚和欧洲各国,台湾民进党当局则每年吓昏过好几回;在成人纸尿片全球脱销之后,为确保婴儿纸尿片有充足供应,以美国为首的西方敌对势力,现在转而公开推行对中国全面围堵的战略。

从奥巴马第二个任期希拉里提出亚太再平衡战略,到特朗普联大演讲不指明批评中国,再到《美国国家安全战略报告》和《美国国防战略报告》明确把中国列为超越恐怖主义的对美最大威胁,并清晰地规划出对中国从政治、军事、经济各方面进行全面围堵的战略,以及美国国会最近两年连续推出一系列突破“一中”底线的法律、法案,标志着美国朝野在对华政策由全面接触转向全面围堵上达成了高度一致。任何人若对此心存幻想,必是自欺欺人。惟有未雨绸缪,沉着应对,方为上策。

显然,高层意识到了中美关系发生了重大问题,因此在不到一个月时间内,中国两位中央政治局委员应邀访美,特别是作为中国高层核心决策层的刘鹤同志,在全国“两会”前应美国政府邀请访美5天,正如我在新华社发布此消息后第一时间分析的那样,传达出的信息确实非同小可——在我发出这篇文章几个小时后,人民日报的一篇文章做了同样判断。可惜,也正如我事先预料的那样,中美双方终于还是未能就巨大分歧达成共识,特朗普非但没有会见刘鹤同志,而且还发出了清晰的极不友好声音,扬言要跟中国打贸易战。

新华社前天发布的新闻稿说双方确定尽快在北京开始下一轮会谈,但今天美国总统府公开表示,双方没有达成这样的共识,美方也拒绝启动去年4月两国领导人高峰会确定的四个战略对话。据接近特朗普的人士透露,特朗普认为去年进行的这些对话双方全是各说各话,根本不能达成实质成果,纯粹就是浪费时间。

山雨欲来风满楼。随着美国对华政策的重大转变,中美两国由过去双方刻意忽略价值观的差异追求商业上的合作,必然转向政治上的公开对立和经济上的互不相让,或者说中美关系结束过去四十年政治上的求同存异、经济上的友好合作,转向全面的冷对抗,甚至不排除在台湾问题上,中美两国进行直接的军事对抗。

 (二)美国敢不敢跟中国全面对抗

这个问题非常重要,因此我必须重复前天在《中美贸易战一触即发 看吓尿的特朗普如何疯言疯语》一文中提到的一些基本观点和基本事实。

我们的贸易官员、主流媒体和专家们一直告诉我们,中美关系互为依重,你中有我,我中有你,谁也离开不了谁,甚至说中美关系事关世界稳定,事关全世界人民的幸福,当然首先是美国人民的温饱与幸福。

一些爱国者甚至认为,没有中国购买美国国债,美国早已破产;没有中国购买美国飞机,波音公司立马就得关门;没有中国为美国提供便宜商品,美国人民全都饥寒交迫。中国一生气,美国总统就吓尿。

中国著名学者、清华大学国情研究院院长胡鞍钢教授声称,通过他的团队科学严谨的研究,中国几年前就在综合国力、经济、科技、军事等各方面全面超越了美国,而且最近几年这个差距还在迅速扩大。也就是说,一旦发生中美对抗,无论是贸易战还是军事对抗,美国注定将一败涂地。

军事上的事,我不敢胡言乱语,绝对相信中国战无不胜。单纯就经济而言,中国主流媒体和专家们从来不说,如果中美彻底翻脸,没有美国每年提供的3500亿美元贸易顺差,人民币立马跌成卢布;如果停止每年出口美国4500多亿美元商品,有几千万人要失业;如果美国人关掉互联网根服务器,中国互联网大部分用户将立马崩溃;如果手机的安卓系统、IOS停止对中国手机授权使用,中国智能手机全得换成20年前的老式按键电话;如果小日本跟着美国与中国叫板,美日停止对中国出口高科技产品和元器件,中国银行、高铁、飞机的控制系统全得死机,大部分先进的医疗电气设备都将成为废铁……

中国主流媒体和专家们也从来不告诉国人:中国之所以大量购买美国国债,是因为美债是全球流动性最好、收益最稳定的投资标的,没有之一,且中国购买的国债总量不到美债发行总量的10%,中国可以随时抛光所持的全部美债,美国政府不会因此损失一分钱;即使中国不购买一架波音飞机,该公司的订单也排到5年之后;中国断绝对美出口全部商品,理论上最多给每个美国家庭增加200多美元的负担,而美国家庭平均年收入约6万美元,如何让所有美国人陷入生活困境……实际上,美国没有跟中国建交之前,早就成了世界上最强大、最富裕的国家;而中国只是在改革开放之后,才让绝大多数国人吃饱了饭,也正是美国把中国带入WTO之后,中国才成为世界工厂,才成了世界上最大的暴发户。

此外,中国主流媒体和专家们常常会说,中国是安理会常任理事国,美国不敢跟中国翻脸,否则中国在联合国安理会上处处跟美国唱反调,美国将在许多重大国际问题上一筹莫展。这个或许能吓着奥巴马这样的书呆子,但真吓不着特朗普这样的强人。实际上,特朗普一上台,就纷纷退出好多个国际多边合作组织,如退出TPP、退出巴黎气候协定、退出全球移民公约、退出联合国科教文组织,不顾国际社会强烈反对承认耶路撒冷为以色列首都……特朗普这些所作所为,哪一样不是惊世骇俗?何况,特朗普就曾猛烈批评联合国成了一个夸夸其谈的俱乐部,甚至扬言要退出联合国。再说,当年古巴导弹危机,美国准备与苏联大打出手,又何曾顾虑苏联拥有安理会常任理事国的地位?

因此,在我看来,美国不怕跟中国打贸易战,也不怕跟中国军事对抗。特朗普最近推文中所威胁的贸易战绝非虚言恫吓,而是很快面临的威胁。

 (三)中美对抗的三种可能或三个阶段

按照中美两国的对抗程度,又分为三种可能或三个阶段:

第一个可能或第一个阶段,中国在经贸问题上对美国做出实质性的重大让步,中美避免了即将发生的贸易战;同时中国主动在其他非经贸问题上降低与美国的对抗,从而避免中美关系急剧恶化对中国社会、经济造成巨大冲击。但即使中国做出巨大让步,美国仍将利用301条款、201条款、232条款一系列组合拳,来不断敲打中国;同时中国也会像前些年那样,做出一些不痛不痒的回击,来体现主权对等与国家尊严。

第二个可能或第二个阶段,中国在减少贸易不平衡问题上对美做出的重大让步最终没有完全兑现,或者没有达到特朗普政府认为的满意效果,同时中美在非经贸问题上的对抗有增无减,导致特朗普宣布对中国实行严厉的报复措施,中美爆发贸易战,最终造成两国贸易额急剧萎缩。这将对中国经济带来严重的负面影响。但即使如此,中美贸易关系也不会完全断绝,除了失业人数会显著增加,其他人生活不会受到太大影响。

第三个可能或第三个阶段,由于中美关系恶化,失去美国每年3500亿美元贸易顺差导致中国外汇急剧减少引发金融体系不稳定,同时对美国、日本等西方发达国家的出口大幅萎缩导致中国失业率急剧上升,为凝集国内民心,促进社会稳定,中国发起武力统一台湾的军事行动,导致中美直接发生军事对抗,因此中国遭受全世界封锁。不过,以中国的强大实力,我们有信心、有能力打败一切敌对势力——到时一定不是全世界孤立中国,而是中国孤立全世界一切敌对势力。

就目前看来,第一个可能性最大,最三种可能性最少,第二种可能性介于两者之间;但鉴于一方面美国主流民意和两大政党的对华政策都发生了根本性改变,另一方面任何敌对势力都无法阻挡中国的强势崛起,中国也绝不可能在损害国家重大利益的问题上做出任何实质性的重大让步,因此,随着时间的推移,第三种可能性将变得越来越大。

中国现在能做的最佳选择,就是在坚持原则的前提下,改变策略,放低姿态,争取更多的时间,累积更强的实力,以便在将来中美对抗中,永远立于不败之地。当然,按照国内主流媒体和专家们的满满自信,美国压根就不敢跟中国叫板,即使美帝发出挑衅,也是兵来将挡,水来土掩,打得它屁滚尿流,服服帖帖,永远不得翻身。

 

Start with Solidity

$
0
0

Start with Solidity

Ethereum and Solidity环境配置

作者:孔令坤,转载请注明出处

由于Remix版本的更新,Metamask的更新已经Ethereum rinkeby network对Github账号申请eth的限制,我发现原来的配置教程其实并不太适用于当前的版本了,所以在这里我简单的介绍一下开发的一些基本配置。在接下来的配置内容中,我借鉴了许多来自IC3 Ethereum/Cornell Bootcamp的内容,主要对其中Github部分的内容做了更新。

Requirements:

Introduction of Things:

Ethereum

Ethereum is an open-source, public, blockchain-based distributed computing platform featuring smart contract (scripting) functionality.

Metamask

MetaMask is a bridge between Google Chrome and the Ethereum blockchain. It allows you to run Ethereum Dapps in your browser without running a full Ethereum node. MetaMask includes a secure identity vault, providing a user interface to manage your identities on different sites and sign blockchain transactions.

Solidity

Solidity is a programming language used to code smart contracts that are compatible with Ethereum. The documentation for Solidity is located here. We will be using Remix when developing our smart contracts. Remix is an online development environment that allows you to code, deploy, and test smart contracts on the public Ethereum networks and test Ethereum networks.

Rinkeby

Rinkeby is a public Ethereum test network that is used to deploy and test smart contracts for free. In order to receive Rinkeby ether coins, you will need to visit https://www.rinkeby.io/ once you have your Metamask client installed.

Start with Ethereum and Solidity:

a. Setting up Metamask

  1. Install the Metamask Chrome plugin.
  2. Open Metamask (there should be an orange fox icon in your browser toolbar).
  3. Click through the license agreements.
  4. Create a new “den” which will house your Ethereum account.
  5. COPY THE 12 WORDS SOMEWHERE SAFE.
  6. Click the network selection button on the top left part of the Metmask app. It should say “Ethereum Mainnet” or “Ropsten”. Change that to Rinkeby.
  7. Copy your Ethereum account address by clicking the “Copy” icon above the “Buy” and “Send” buttons. Mouse over the icons to reveal their label.

b. Get Rinkeby Testnet Ether

  1. Login into your Twitter account.
  2. Paste your Ethereum address you copied in step a.7 into the “What’s happening?” content boxs to make a new tweet. The Ethereum address should be a jumble of letters and numbers like this: 0x9bcd107A7De7C3cee1be15dFa06B5586672912e9
  3. Click “Tweet” to gennerate a new Tweet.
  4. Copy the URL of the Tweet. Click the button in the upper right of your tweet and select the option of “Copy link to Tweet”. The link should be similar to this:https://twitter.com/316980786Kong/status/946989538890588161
  5. Visit the Rinkeby website and click “Crypto Faucet”.
  6. Paste your Tweet URL in the box provided and click “Give me Ether – 3 ethers/8 hours”.
  7. A box should pop up with with your Twitter icon indicating that your request for testnet ether is being processed.
  8. Wait 10 seconds.
  9. Look at your Metamask client and verify that you received 3 Rinkeby testnet ether.

c. Writing your first smart contract.

  1. Go to the Learning Solidity Part 2: Commit-Reveal Voting.
  2. Walk through the blog and write your first smart contract.

非名校出身的我,是如何拿到Facebook、谷歌、微软、亚马逊和Twitter的Offer的?

$
0
0

非名校出身的我,是如何拿到Facebook、谷歌、微软、亚马逊和Twitter的Offer的?

达达 • 刚刚 • 职场漫谈
非名校出身,也没有知名科技公司的工作经验,他竟同时拿到了美国5家顶尖科技公司的Offer。他究竟是如何做到的?
非名校出身的我,是如何拿到Facebook、谷歌、微软、亚马逊和Twitter的Offer的?

这篇文章是专门为那些即将开始找工作的人写的。很多正在找工作的人可能会担心因为自己不是毕业于常青藤名校而无法在顶尖科技公司找到一份理想的工作。还有可能其他人会告诉你说因为你不够优秀而无法在微软或Facebook找到一份工作。但是我想告诉你的是,即使你不是出身名校,你依然可以在全球顶尖的科技公司找到一份你理想中的工作。下面我分享一下我是如何找到我梦寐以求的工作的。

这篇文章将主要包含以下几部分内容:

(1)我的个人背景。

(2)我是如何获得众多全球顶尖科技公司的面试机会的,这些公司包括Facebook、Amazon、LinkedIn、微软、Twitter、Pinterest、Snapchat和其他公司。

(3)我是如何拿到几家顶尖科技公司的软件工程师职位的Offer的。

(4)我从面试经历中学到的经验。

我的个人背景

我并非毕业于常青藤名校(常青藤联盟成员包括哈佛大学、耶鲁大学、宾夕法尼亚大学、普林斯顿大学、哥伦比亚大学、布朗大学、达特茅斯学院、康奈尔大学)。我在爱达荷州的一所社区大学读了两年书,然后在一所小型天主教大学拿到了计算机科学学位。

我是在大三的时候就开始学习计算机科学的,因为当时我觉得这门学科听起来非常有趣。在我成长的过程中,我拥有的的唯一一件类似电脑的产品就是超级任天堂的中国山寨版。甚至在当时,每次我放一盘磁带进去的时候,它都会崩溃。

为了在大学期间能够自力更生养活自己,我做了很多份的兼职。当我毕业的时候,我并没能很快就找到一份工作。我申请了尽可能多的大型科技公司的职位,并有幸获得了几次电话面试的机会。

当时我对technical screen电话面试没有任何概念,所以也就不知道该如何为这种面试做准备。我参加这些面试之前想当然地认为面试官可能会问我链表或者二叉树是什么这类面试问题。

在参加的所有几个电话面试中,我都没有通过。

勇往直前

我没有过多地探究自己是否优秀。我知道我的学习能力非常强。我需要的只是一个机会。正如大家所说的那样,要广撒网。而这正是我做的。

我接下来做了一件让我特别引以为傲的事情。我写了一个简单的Python脚本,它在Craigslist上抓取了一些含有一些关键字的职位列表,并在电子表格中收集这些职位的电子邮件联系方式。这并不是最聪明的解决办法,但在Craigslist上发帖的人对他们所要招聘职位的描述出奇地准确。然而,Craigslist并不喜欢人们抓取他们网站上的内容。为了解决这个问题,我通过一个VPN运行我的脚本,并有一个计时器,每隔几分钟就会暂停脚本。虽然它兵不完美,但却运行得很好。最后,我搜集了来自旧金山、波特兰、斯波坎和西雅图的公司的大约500封招聘电子邮件。我根据这些职位的具体发布时间和其它信息对结果进行了过滤,并通过添加越来越多的特性来改进它。后来我发现已经有一些机器人在爬Craigslist上的信息并发送自动电子邮件。这些公司大多是海外公司,它们希望将自己的公司推销给美国市场。

我采用的一个变通方法是,我精心制作了电子邮件,我在邮件标题里使用了那些公司发布的招聘信息里的一些关键词。然后,我在邮件正文部分添加了更多的细节信息,让邮件内容看起来更个性化。我做了一个快速的A/B测试,就这样,我收到的应聘公司的回复率从2-3%增加到了10%。

在发送的大约500封应聘电子邮件中,我收到了大约50份回复,其中一小部分给了我电话面试的机会。我之所以只发500封电子邮件,这是因为我时间不够,需要尽快找到一份工作。我会尽可能提高面试通过率,而不是获得尽可能多的面试机会。

幸运的是,我最终在西雅图的一家创业公司找到了一份初级软件工程师的工作。这家创业公司当时位于Kirkland,所以我必须坐45分钟的巴士才能赶上面试的时间。

在接下来的3年半的时间里,我一直在这家公司工作。我在那里学到了很多东西,比如亚马逊AWS、EC2、DynamoDB、SQS和Docker。我在这段时间里成长了很多。我学习了如何编写模块化的、可维护的代码,我学会了如何对软件设计进行推理,我也学会了如何处理人事方面的问题。

我周围全是一群聪明的人,他们有的在微软工作,有的在Amazon工作,有的在LinkedIn工作,我努力成为这群人中的一块“海绵”,我尽可能多地从他们身上进行学习,这对我的职业生涯产生了非常巨大的影响。

在创业公司工作的日子

我在加入的第一家创业公司工作期间,我做的几乎全部都是后台开发方面的工作,中间会涉及一些开发运维。我开始编写一些函数来添加或修改一个影响范围很小的特性,不过这是一个了解代码库并进行一些代码审查的好机会。一年之后,我开始负责代码库的一部分,然后我的任务是将一组特性转换为服务。这是这家创业公司SOA阶段的开始。我们开始将站点的各种组件转换为服务,我就是在这个过程中学习更多有关RESTful服务、身份验证、AWS服务、发布-订阅、分布式系统等方面的知识的。

有趣的是,我并不是通过书本或正规的教育来学习这些知识的。相反,是因为我在实际工作中需要开发完成一系列功能部件,但我在这方面存在知识瓶颈。所以我想,那就边学边做吧。很多时候,我都陷入了分析瘫痪状态,在这种状态下,我过度分析了各种情形场景,最终无法取得进展。

那些艰难的时刻其实是最好的学习机会。我开始学习功能范围、监视、警报和文档方面的知识。这个过程的每一步都揭示出我需要学习更多的东西。在过去的2-3年时间里,我成长地最快,无论是作为一个个人还是作为软件工程师都是如此。

我是如何准备面试的?

在经历了第一次求职面试中的各种艰难曲折后,我告诉自己,在未来的求职面试中我必须做好充足地准备。

我开始通过对我擅长的、不擅长的以及我可以改进的地方进行概述,从而为未来的面试做好充分准备。我将它分为三个类别:数据结构、算法和系统设计

我在自己的正式职业生涯中基本都是在PHP领域工作,在大学里也学过C++,所以我想尝试一些更简单、更不繁琐的面试。因为这个原因,我选择了Python。这是一门用来学习的非常好的语言,它很容易学习,支持许多开箱即用的数据结构,并且可以在白板上快速书写。我是通过Youtube上的一些视频教程学习Python的,并阅读了教学文档。另外,我选择学习Python的另一个原因是,它具有很高的可读性,而且在白板上书写很容易。这是C++和Python之间的一个简单的比较:

下面是用C++语言写的降序排序:

非名校出身的我,是如何拿到Facebook、谷歌、微软、亚马逊和Twitter的Offer的?

下面是用Python写的版本:

非名校出身的我,是如何拿到Facebook、谷歌、微软、亚马逊和Twitter的Offer的?

我积累的经验的是,很多应聘者在面试过程中会在简洁方面犯错。在45分钟的面试中,你需要用大部分的时间来解决实际问题。

黄金小建议:选择一种不那么冗长的语言,这样你就可以在白板上更快地写代码了。

面试准备模式

我花了大约一个星期的时间在LeetCode、HackerRank和Project Euler中做了一些简单的测试挑战,以便熟悉它们的接口,并让自己开始习惯用Python编写代码。

第一周我了解了我在某些编程语言方面的能力水平。我又花了一周时间来进行一些设计上的挑战,并尽可能做到深入和广泛。

这对我来说是非常有趣的,因为我经常查看iOS应用,并试图弄清楚它们是如何做到的。例如,你如何从头开始重新开发Instagram?(我在Facebook面试时曾被问到这个问题)。我的专业背景是API设计和服务导向式架构。因此,我借此机会展示了我将如何设计我自己的Instagram版本。因为我在一些业余项目中积累了一点iOS应用编程经验,所以我在回答这个面试问题时可以稍微讲一下回调函数等方面的内容。我一开始讲的是我想在我自己的Instagram版本中加入的一些功能:赞、上传照片和简单的时间线。功能范围使我能够构建一个非常可靠的API,因为我非常了解这些场景。然后我画了一些概要设计图片,介绍了客户端机如何与后端交互,以及后端如何存储数据。

我从小处着手,然后在需要的地方添加更多的组件,并主动寻找瓶颈所在。我做了一些有根据的猜测(而非盲目的猜测),以及每一项技术是如何融入进去的的。同样重要的是,什么技术无法很好地融合进去。例如,为什么要使用Cassandra而非MySQL来存储某些信息,为什么要使用OAuth而不是通过简单的认证,是使用Cassandra还是Memcached来缓存数据,是使用流媒体还是批处理处理等等。

在这里,你需要探索的领域还有很多。因此仅仅通过一个小时的沟通是不够的。为了能够更好地回答这类面试问题,你必须阅读并学会权衡取舍。一个行业的技术优势和劣势是什么。为此,我推荐一个网站:HighScalability。

回答这类面试问题时,要做到就像和同事进行一次典型的头脑风暴一样,做尽可能广泛和深入地探索。你要知道,这些设计面试的目的是要了解你的知识面有多广,以及你了解的有多深入,这是一个让你脱颖而出的机会,这一点很重要。我在Youtube上看了一段关于如何解决设计问题的视频,它给了我深刻的洞察力,为我在回答设计类面试题中提供了巨大的帮助。我从中学到的两个主要经验是:推动设计对话、展示你所知道的。

我列出了自己在下面这些领域里的能力水平:数据结构(链表、散列映射、二进制树、二进制搜索树、堆、数组)、算法(二进制搜索、哈希、动态规划、排序)和特定语言的语法和库(例如,Python的lambda、附加和索引)

我选择了我最不擅长的领域,并开始研究它:算法。算法从来都不是我的强项。我大学毕业已经有一段时间了,在我的日常职业生涯中,我没有花太多时间在二进位搜索上。我对每个算法的运行原理在使用场景一个初步的了解,但我无法在10分钟内写出二分查找程序,不管是在白板上还是在面试官面前都是如此。

我买了一堆精美的细马克笔,效果非常好。但在面试室里的马克笔通常都不好用,我通常在面试室里会花2-3分钟找一支能用的笔,而这2-3分钟是你浪费不起的。另外,细马克笔允许你在一个典型的白板上写5-8行代码。

黄金小建议:自己准备一盒马克笔。

我从Costco花了50美元买了一块白板,从亚马逊买了一些相关书籍,然后开始了我的编程实践。我确保我在二分查找、递归、动态规划、BFS和DFS上做了专门的提升练习。很多的面试问题都是围绕递归和二分查找展开的。我所见过的最好的面试问题是那些有很多不同解决方案的面试问题。

在参加Google的面试中,我曾被问到一个与文件系统目录有关的问题,以及如何遍历这些目录(提示:递归)。我很快就解决了这个问题,然后面试官问了如何在那个目录中找出一个丢失的文件。这个问题相对更难一点,但是我还是解决了。然后我们讨论了如何重建目录,如何对它进行序列化和反序列化,我们花了大量的时间讨论文件目录在底层是如何运行的。对我来说,这是一次非常愉快的面试。

参加顶尖科技公司的面试

可以这么说,参加这类面试是一次令人神经崩溃的经历,给人的感觉如同做过山车。

我是根据下面这个方式来分配我的时间的:20%的时间用于简历制作,20%的时间用于调查研究,60%的时间用于面试准备。

我将自己20%的时间都用在整理自己的简历上了,而我的简历至少有三年时间都没有更新过了。我仔细研究了我过去做过的所有事情,并选择了一些我从头负责到底至的项目,不用考虑项目的复杂性如何。

我之所以会这么做,主要有两个方面的原因。从头到尾负责一个项目需要纪律和领导能力,这是我想向面试官重点突出的两个能力。其次,对于那些我从头至尾负责的项目,我可以向面试官深入且广泛地描述项目的各个方面。这一点在我参加Twitter的面试时回答有关设计的面试问题时发挥了重要作用,在Twitter的面试中,面试官不仅对我负责的项目的设计工作进行了严格的考察,而且还对背后的决策进行了考察。

我会将20%的时间用于调查研究。这里说的调查研究是指对我感兴趣的公司进行尽职调查,并寻求内部推荐的机会。通过内部推荐的方式能够大大提高求职信的回复率。根据我自己的实际经验,我向20多家创业公司和中等规模的公司发送了求职cold message,只有少数几家公司回复了。但是如果得到对方公司内部员工推荐的话,那么对方公司几乎都会在一周时间内内给我回复信息。

我并不善于交际,我认识的能将引荐给我感兴趣的公司的人其实并不多。为了解决这个问题,我会经常使用LinkedIn。LinkedIn里有一个搜索功能,我经常用它来搜索1 度联系人和2度联系人。所谓1度联系人,就是通过接受邀请直接建立联系的会员。你可以查看他们的个人档案和人脉信息,不受限制地向对方发送站内信,还可以在你的个人首页看到对方在领英的动态消息。所谓2度联系人,就是已经与你的1 度联系人建立联系的会员。通俗理解就是你好友的好友,一般是没有建立直接联系,但和你可能有交点的人群。免费账户可以看到2度人脉的个人档案,可以看到和对方的共同联系人,但不可以直接发站内信。

非名校出身的我,是如何拿到Facebook、谷歌、微软、亚马逊和Twitter的Offer的?

LinkedIn的搜索功能

这是非常重要的,因为给一个人你不认识的人直接打求职电话是非常困难的。当接到不请自来的陌生人打来的电话时,人们通常都非常谨慎,通过这种方式很难很快建立信任关系。LinkedIn在我调查研究阶段对我的帮助非常大。

回顾我面试过的所有公司,以下是我对每一家公司的看法:

  • Facebook/Google:很机械化。标准的面试流程,我和这些公司无法建立任何情感连接。
  • Pinterest:在这家公司的面试体验并不是最好的,但这家公司是一个很酷的公司,产品也是很酷的产品。
  • 微软:我非常喜欢我所面试的团队,尤其是团队经理。标准的面试问题,但是非常个性化。是我的第二选择,当然这个因人而异,微软每个团队的面试风格是各不相同的。
  • Amazon:标准的面试流程。大概有50%的人会喜欢这种面试风格,也有大概50%不喜欢这种面试风格。
  • Twitter:面试流程非常有趣和个性化。我个人非常喜欢它的面试流程,非常重视个人和我过去做过的事情。
  • Snapchat:在洛杉矶有非常酷的办公室,有很多人都决定在创业的大潮中加入其中。
  • Lyft:离我住的地方不远,办公室很不过,标准的面试流程,我对这家公司没有太强烈的感觉。

下面分享一下我最喜欢的一家公司及其面试流程

从很多方面来说,我认为要通过Twitter的面试都是非常困难的。但与此同时,Twitter的面试流程比我面试过的其他任何公司都更有趣、也更个性化。

Twitter的面试流程大概是这样的:与一个工程经理进行简单的介绍性电话面试。接下来是一到两轮的技术电话面试,这取决于你的表现。如果通过电话面试,他们会把安排你到应聘工作地点进行现场面试,我是在西雅图参加的现场面试。一共有3轮1小时15分钟的现场面试,每场面试都有两个面试官。

最开始的两轮电话技术面试都是标准化面试,你需要在一个共享的编码文档中通过编程来解决实际的问题。

现场面试更像是一种双方的互动交谈,也不会让人感到太害怕恐惧。面试官会问你一些关于你过去参与过的项目的深度问题,他们会询问你过去做过的事情。如果你过去曾负责过一个项目,那么面试官就会问一些有关这个项目的问题。面试官鼓励你用这些项目作为参考,并从中来试探你的想法。

其它公司的面试感受

相比之下,我觉得Facebook和Google的面试更加机械化。他们有1-2轮的技术电话面试,5到6轮的现场编码考核。每一轮面试都需要你在白板上进行编码,还要要求你在一个相对合理的时间内完成一个近乎完美的解决方案。

Facebook有两轮编码面试,一个设计面试,一轮行为面试。在一天面试快要结束的时候,我又参加了一轮shadow面试((即老员工面试,自己旁听),这部分面试并没有计入我的面试总分。

Google有5轮编码面试,没有一轮有关设计的面试,期间没有一位面试官问我之前做过的项目。虽然我并不认为这是一种糟糕的面试方法,但这种面试让我感觉太机械化了,并没有给工程师提供多少机会来展示他们的能力。有些人在这种面试中表现得非常好,就像有些学生在考试中表现优异一样。

我并不是喜欢在Pinterest的面试体验。我认为Pinterest这款产品本身非常有意思,他们的工程技术团队似乎也在解决一些非常酷的技术问题。但是我在Pinterest的面试体验却是非常糟糕的。

Pinterest有三轮编程面试、一轮设计面试。在这4轮面试中,设计面试是最让我失望的。为什么这么说呢?面试官迟到了,他花了几分钟时间在我浏览了一下我的简历,然后开始在白板上画一些API。他简短地描述了他期望API做什么,并问我该如何解决这个问题。我们阐明了API的特性,然后我开始使用白板描述我的解决方案,大概5分钟后,我转过头发现他竟然睡着了。这次面试体验太糟糕了。我在一项调研问卷中向招聘人员反馈了这个问题,但是没有收到任何回复。

我就不详细和大家分享我在面试中被问到的所有问题的细节了,不过我想和大家分享我在准备面试的过程中学到的一些经验和有用的技巧。

我学到的东西:

(1)简历内容一定要做到实事求是。大多数公司的面试官会问你一些关于你的简历上的内容的问题,面试官通常能够根据你的回答很容易判断你是否在简历内容上作假了。此外,对一个项目做到100%的了解要比对10个不同项目有10%的了解要好得多。

(2)简历最好只用一页。对于科技公司来说尤其如此,因为科技领域有一个普遍的共识,只有当你有博士后的研究经历或者亲自深度负责过很多项目,这时你的简历有2页或更多页才是合理的,否则最好用一页。

(3)多出去社交并建立一个自己的人脉网络。软件工程师职位的竞争非常激烈,这些顶尖的科技公司每天要筛选成千上万份简历。如果你应聘的公司内部有员工帮你引荐,那么你的简历被关注的可能性会更高。

(4)精心准备面试内容。每一个对你感兴趣的公司都想知道你为什么对他们感兴趣。一个糟糕的回答是:我现在急需找到一份工作帮赚钱支付账单。一个不那么糟糕的回答是:我在网上浏览,发现了你们公司,好像你们在做一款非常有趣的产品。一个很好的回答是:我知道你们公司在X领域做了一些有趣的工作来实现Y。我在过去做过一些工作,这是我学过的关于A、B、C的知识,这些知识可能与X领域有关。我对Y非常感兴趣,因为……(不要将这当作一个固定的模板。相反,你应该从中找到模式,——做充分的调查研究,向你应聘的公司展示为什么你和这家公司是非常匹配的。)

其它一些建议

技术面试是非常困难的。然而,最好的机会是留给那些准备好的人。

(1)早做准备,而且要做充分地准备。每个人都知道他们应该为面试做准备,但大多数人都不知道如何才能真正做好准备。就像任何值得做的事情一样,需要刻意练习才能在某件事上有出色得表现。而刻意练习意味着你需要有一套系统。

(2)建立一套用来练习技术技能的系统。我会根据1-10分的评分方式对自己的表现进行评分,并努力提升我自己最不擅长的领域。我花了好几天时间研究不同类型的面试问题,直到我完全掌握了每个概念。我每天都在Evernote上做笔记,笔记内容包括编程技巧、常见错误和误解、用于解决特定问题的框架等等。

非名校出身的我,是如何拿到Facebook、谷歌、微软、亚马逊和Twitter的Offer的?

我的Notebook

(3)将你掌握和学会的知识记在本子上。我同时使用Evernote和OneNote来记录和追踪事情。我用OneNote来记录技术方面的内容或代码,因为我可以按照我喜欢的方式来对这些笔记进行格式化。我用Evernote主要写一些文章或感想。上面的图片显示的是我在架构和系统设计上的一些想法。

非名校出身的我,是如何拿到Facebook、谷歌、微软、亚马逊和Twitter的Offer的?

Evernote主要用于记录想法/技巧

(4)把所有的事情都记录下来,即使你认为你不会用到它也要记录下来。我非常健忘,所以我会将我学会的任何东西都记录下来,包括shell命令。我会时不时地阅读技术博客,如果我发现任何有趣的东西,我都会立刻在Evernote上将其记录下来。我会每星期或每月对记录过的内容做一次整理优化。这个习惯在我的职业生涯中对我的帮助很大。

(5)模拟面试。这绝对是非常有价值的,我极力推荐大家这样做。我会和朋友一起进行模拟面试,并尽可能多地练习。如果你找不到朋友一起练习模拟面试,那么我推荐你使用Refdash,这是一款“面试即服务”的产品。这个平台上有一群在Google、Facebook和微软等大型科技公司工作的面试官。这些面试官会评估你的编码和设计技能。最重要的是,在每次模拟面试后它都会给你打出一个分数,并给出一些具体可行的改进方法。

(6)允许自己失败。在我整个应聘过程中,我经历过很多次的失败。有时失败只是因为你运气不好。即使你面试失败了,这对你来说也不是世界末日。公司在招聘的过程中倾向于说“不”,因为这对他们来说风险更低。从长远来看,犯假阳性的错误比假阴性的错误的成本更高。最初的几次拒绝给人造成的打击最大。当我刚开始面试的时候,我几次电话面试都没有通过,我的自信心也受到了严重打击。我对自己的能力也开始心存怀疑,并开始担心自己的技能在当今的就业市场中已经不受待见了。然而,我给自己支了一招:如果你失败了10次,那么再多尝试10次。你所需要的只是一次成功,这种安慰给了我很大的信心,让我能够不断尝试,当我拿到第一个Offer之后,后来的其它Offer来得就会容易很多。

我花了大约两个月的时间来为我的面试做准备和并做各种模拟练习。我每周大概会在这方面花20个小时,或者每个月花80小时,在全职工作之余进行学习和记笔记。

为了充实我的简历,我花了3年半的时间去专心刻意地工作。在日常工作中,我会有意识地选择那些困难棘手的工作,这样我就能比其他人学到更多东西。尽管我并非毕业于常青藤名校,之前也没有在顶尖科技公司工作的经验,但我对我所负责过的项目有一个清晰透彻的理解,并在简历中体现出这一点,从而让自己在面试中能脱颖而出。这是有可能做到的,因为我做了很多研究,并将我学到的所有东西都记录了下来,并建立一个用来练习技术技能的系统。

要记住:坚强的人能够生存,坚韧的人能够茁壮成长。

小结:不要放弃,为机会而时刻准备着,多练习,并始终怀有希望。专注于过程,并在整个过程中采用严格、专门的方法。

我推荐的书籍和工具:

  • 书籍《Elements of Programming Interviews: The Insiders’ Guide》 :对解决那些非常难的编程问题非常有帮助。
  • 书籍《Cracking the Coding Interview: 189 Programming Questions and Solutions》:很好地覆盖了基本的CS知识。
  • OneNote:我使用这款工具来存储所有的代码片段。
  • Evernote:我使用这款工具来记录存储其它所有东西。
  • CodeRunner:我非常喜欢这款Mac应用,我曾多次使用它来运行特定的Python脚本和函数,而且效果非常好。
  • Jobscan:我听说过很多关于它的很酷的事情,建议你试试它的简历筛选工具。
  • Refdash:由一群前Google员工运营的产品。用这款产品来模拟面试的效果非常赞。我在Refdash上碰到的面试官曾在Google工作过,他为我指出了很多我应该关注的地方,以及Google面试的主要评分依据。我强烈建议你尝试一下。
  • CodePath:一个帮助人们进入科技行业工作做准备的非盈利组织。公司的两位负责人Tim和Nathan都是很棒的人,我从他们那里学到了很多。这个社区非常有帮助,每个人都愿意伸出援手。

编译组出品。编辑:郝鹏程。

原文链接:https://medium.freecodecamp.org/how-i-landed-offers-from-microsoft-amazon-and-twitter-without-an-ivy-league-degree-d62cfe286eb8

EthOS

$
0
0

EthOS/eth.txt

#echo -n “http://vi.zenithnet.org/ETH.txt” > /home/ethos/remote.conf && putconf && r

#disallow && minestop && sleep 1 && ethos-update && sleep 5 && allow && r
#echo ‘-allpools 1’ >> /home/ethos/claymore.stub.conf
#echo ‘-esm 3’ >> /home/ethos/claymore.stub.conf

custompanel virosa420137

#autoreboot false

#globalbranch development
#branch eb19aa development

## Claymore ETH NH
#claymore=proxypool1 daggerhashimoto.usa.nicehash.com:3353
#claymore=proxypool2 daggerhashimoto.eu.nicehash.com:3353
#claymore=proxywallet 15qpQXHz9mVcJmnzd5YEsxKz9JkdNQSLJQ
#claymore=poolpass1 x
#claymore=poolpass2 x
#stratumproxy nicehash

## Claymore ETC NANO
#claymore=proxypool1 etc-us-east1.nanopool.org:19999
#claymore=proxypool2 etc-us-west1.nanopool.org:19999
#claymore=proxywallet 0x5844e06306ccaeefbe3a832d540e3bab64a0083b
#claymore=poolpass1 x
#claymore=poolpass2 x

## Claymore ETH NANO
claymore=proxypool1 eth-us-east1.nanopool.org:9999
claymore=proxypool2 eth-us-west1.nanopool.org:9999
claymore=proxywallet 0x5a9fc9284b91a22780d796ff385cde69666c5d85
claymore=poolpass1 x
claymore=poolpass2 x

## ethminer ETH NANO
#ethminer=proxypool1 eth-us-east1.nanopool.org:9999
#ethminer=proxypool2 eth-us-west1.nanopool.org:9999
#ethminer=proxywallet 0x5a9fc9284b91a22780d796ff385cde69666c5d85
#ethminer=poolpass1 x
#ethminer=poolpass2 x
#stratumproxy miner

## sgminer-gm ETC NANO
#sgminer-gm=proxypool1 etc-us-east1.nanopool.org:19999
#sgminer-gm=proxypool2 etc-us-west1.nanopool.org:19999
#sgminer-gm=proxywallet 0x5844e06306ccaeefbe3a832d540e3bab64a0083b
#sgminer-gm=poolpass1 x
#sgminer-gm=poolpass2 x

## sgminer-gm ETH NANO
sgminer-gm=proxypool1 eth-us-east1.nanopool.org:9999
sgminer-gm=proxypool2 eth-us-west1.nanopool.org:9999
sgminer-gm=proxywallet 0x5a9fc9284b91a22780d796ff385cde69666c5d85
sgminer-gm=poolpass1 x
sgminer-gm=poolpass2 x

globalfan 70
maxgputemp 92

#101 280x x5@ 180W/ea + 280 x1@ 160W // GPU1 UV seem, prone to crashing under heat
cor 194107 1025 1000 1020 1045 1050 1000
mem 194107 1500 1500 1500 1500 1500 1250
#fan 194107 0 90 0 0 0 0
pwr 194107 20 20 20 20 20 20
loc 194107 101
miner 194107 claymore

#102
cor 193fae 1125 1140 1000 1000 1000 1000
mem 193fae 1625 1625 1250 1250 1250 1250
#fan 193fae 78 78 78 78 87 95
loc 193fae 102
miner 193fae claymore

#104
cor 874af0 1180 1180 1180 1180 1180 1180
mem 874af0 2150 2140 2170 2170 2180 2180
fan 874af0 50 50 50 50 50 50
pwr 874af0 7 7 7 7 7 7
driver 874af0 amdgpu
miner 874af0 claymore
loc 874af0 104

#110
cor eb19aa 900
mem eb19aa 1500
#fan eb19aa 40
pwr eb19aa 4
loc eb19aa 110
#driver eb19aa amdgpu
miner eb19aa claymore

#201
cor 1946a2 1150 1150 1150 1150 1150 1150
mem 1946a2 1600 1600 1600 1600 1600 1600
#fan 1946a2 80 80 80 80 80 80
loc 1946a2 201
driver 1946a2 fglrx
miner 1946a2 ethminer

#202 760W on 750G2
cor fb200f 1100 1125 1110 1100 1135 1125
mem fb200f 1625 1600 1550 1500 1600 1600
#fan fb200f 80 80 80 80 80 80
#mxt fb200f 54 54 54 54 55 55
loc fb200f 202
miner fb200f claymore

#203
cor 302e95 1180 1140 1180
mem 302e95 2180 2090 2190
pwr 302e95 7 7 7
#fan 302e95 75 75 75
loc 302e95 203
miner 302e95 sgminer-gm

#204 480 RIG
cor e3c61b 1180 1180 1180 1180 1180 1180
mem e3c61b 2180 2180 2180 2180 2180 2180
pwr e3c61b 7 7 7 7 7 7
#fan e3c61b 80 80 80 80 80 80
#sel e3c61b 0 2 3 4 5
loc e3c61b 204
driver e3c61b amdgpu
miner e3c61b claymore

#205 480 RIG
cor 36eb44 1180 1180 1180 1180 1180 1180
mem 36eb44 2175 2170 2190 2170 2190 2190
pwr 36eb44 7 7 7 7 7 7
#fan 36eb44 80 80 80 80 80 80
loc 36eb44 205
driver 36eb44 amdgpu
miner 36eb44 claymore

#206
cor 98b98b 1180 1165 1180 1180 1180 1180
mem 98b98b 2140 2140 2180 2180 2180 2180
pwr 98b98b 7 7 7 7 7 7
#fan 98b98b 79 79 79 79 79 79
loc 98b98b 206
miner 98b98b claymore

#207 380x/380
cor 9de955 890 890 890 890 890 890
mem 9de955 1575 1575 1575 1575 1575 1575
#fan 9de955 80 80 80 80 80 80
loc 9de955 207
#driver 9de955 fglrx
miner 9de955 claymore

#208
#cor 0ce6ca 1125 1000 1000 1125 1000 850
#mem 0ce6ca 1600 1500 1250 1650 1500 1500
fan 0ce6ca 70 70 50 50 70 70
sel 0ce6ca 0 1 2 3
loc 0ce6ca 208
miner 0ce6ca claymore

#209 125.6~ before 1140 OC 290
cor fb20c3 1100 1100 1100
mem fb20c3 1250 1500 1500
fan fb20c3 75 75 65 65 75 75
pwr fb20c3 20 50 50 50
loc fb20c3 209
miner fb20c3 claymore

#210
cor 047b3b 1180 1180 1180 1140 1180 1180
mem 047b3b 2150 2180 2150 2090 2170 2180
pwr 047b3b 7 7 7 7 7 7
loc 047b3b 210
miner 047b3b sgminer-gm

#211
cor 9dd995 1150 1150 1150 1150 1150 1150
mem 9dd995 2100 2100 2100 2100 2100 2100
pwr 9dd995 7 7 7 7 7 7
loc 9dd995 211
miner 9dd995 claymore

EthOS/zec.txt

#echo -n “https://raw.githubusercontent.com/Virosa/EthOS/master/zec.txt” > /home/ethos/remote.conf && r
#disallow && minestop && sleep 1 && ethos-update && sleep 5 && allow && r

custompanel virosa420137

autoreboot 2

#globalbranch development
#branch eb19aa development

#NICEHASH
#stratumproxy nicehash
#proxywallet 15qpQXHz9mVcJmnzd5YEsxKz9JkdNQSLJQ
#proxypool1 equihash.usa.nicehash.com:3357
#proxypool2 equihash.eu.nicehash.com:3357

#ZCASH
proxywallet t1e2Ev2vnRWGFgXc8362g2ijpoaLdpUDPjz
proxypool1 us1-zcash.flypool.org:3333
proxypool2 eu1-zcash.flypool.org:3333

#globalminer optiminer-zcash

## Claymore ETH NH
#claymore=proxypool1 stratum+tcp://daggerhashimoto.usa.nicehash.com:3353
#claymore=proxypool2 stratum+tcp://daggerhashimoto.eu.nicehash.com:3353
#claymore=proxywallet 15qpQXHz9mVcJmnzd5YEsxKz9JkdNQSLJQ
#claymore=poolpass1 x
#claymore=poolpass2 x

 

## Claymore ETH ethpool
claymore=proxypool1 us1.ethpool.org:3333
claymore=proxypool2 us2.ethpool.org:3333
claymore=proxywallet 0x5a9fc9284b91a22780d796ff385cde69666c5d85
claymore=poolpass1 x
claymore=poolpass2 x

globalfan 90
maxgputemp 89
flags –cl-local-work 256 –cl-global-work 8192 –farm-recheck 1000

#101 280x x5@ 180W/ea + 280 x1@ 160W // GPU1 UV seem, prone to crashing under heat
cor 194107 1025 1000 1020 1045 1050 975
mem 194107 1500 1500 1500 1500 1500 1250
fan 194107 80 85 92 80 80 80
pwr 194107 20 20 20 20 20 20
loc 194107 101
miner 194107 optiminer-zcash

#102
cor 193fae 1000 1000 975 975 975 975
mem 193fae 1500 1500 1250 1250 1250 1250
fan 193fae 0 0 90 0 0 0
loc 193fae 102
miner 193fae optiminer-zcash

#103
cor 047c5f 1100 1100 1100 1100
mem 047c5f 1500 1500 1500 1500 1500 1500
#fan 047c5f 85 95 85 85 85 85
loc 047c5f 103
miner 047c5f optiminer-zcash

#104 480NT
cor 874af0 1170 1190 1190 1190 1180 1190
mem 874af0 2100 2100 2100 2100 2100 2100
#fan 874af0 75 75 75 75 75 75
#flg 874af0 –cl-global-work 16384 –farm-recheck 1000
pwr 874af0 7 7 7 7 7 7
loc 874af0 104
driver 874af0 amdgpu
miner 874af0 optiminer-zcash

#110
#cor eb19aa 1200
#mem eb19aa 2100
fan eb19aa 40
#pwr eb19aa 4
3flg eb19aa –cl-local-work 256 –cl-global-work 16384 –farm-recheck 1000
loc eb19aa 110
#driver eb19aa amdgpu
miner eb19aa optiminer-zcash

#201
cor 1946a2 1110 1120 1075 1120 1120 1120
mem 1946a2 1550 1575 1525 1575 1575 1575
#fan 1946a2 80 80 80 80 80 80
loc 1946a2 201
driver 1946a2 fglrx
miner 1946a2 optiminer-zcash

#202 760W on 750G2
cor fb200f 1100 1100 1100 1100 1100 1100
mem fb200f 1550 1550 1550 1550 1550 1550
fan fb200f 0 0 0 0 0 80
loc fb200f 202
miner fb200f optiminer-zcash

#203
cor 302e95 1075 1080 1055
mem 302e95 1250 1250 1250
#fan 302e95 60 60 60
pwr 302e95 50 50 50
loc 302e95 203
miner 302e95 optiminer-zcash

#204 480 RIG
cor 9dd995 1170 1190 1240 1240 1142 1200
mem 9dd995 2000 2000 2000 2000 2000 2000
pwr 9dd995 7 7 7 7 7 7
#fan 9dd995 80 80 80 80 80 80
flg 9dd995 –cl-global-work 16384 –farm-recheck 1000
#mxt 9dd995 46 48 47 48 49 56
loc 9dd995 204
driver 9dd995 amdgpu
miner 9dd995 optiminer-zcash

#205 480 RIG
cor 36eb44 1160 1190 1180 1180 1170 1190
mem 36eb44 2000 2000 2000 2000 2000 2000
pwr 36eb44 7 7 7 7 7 7
#fan 36eb44 60 60 60 60 80 80
loc 36eb44 205
driver 36eb44 amdgpu
miner 36eb44 optiminer-zcash

#206 480 RIG
cor 98b98b 1190 1180 1160 1160 1170 1190
mem 98b98b 1600 1600 1600 1600 1600 1600
pwr 98b98b 7 7 7 7 7 7
#fan 98b98b 70 70 70 70 70 70
loc 98b98b 206
miner 98b98b optiminer-zcash
driver 98b98b amdgpu
#driverless 98b98b enabled

#207 380x/380
cor 9de955 880 880 880 880 880 880
mem 9de955 1575 1575 1575 1575 1575 1575
#fan 9de955 0 0 0 0 0 0
flg 9de955 –cl-local-work 256 –cl-global-work 8192 –farm-recheck 1000
loc 9de955 207
#driver 9de955 fglrx
miner 9de955 optiminer-zcash

#208
cor 0ce6ca 0 0 1000 1000 0 900
mem 0ce6ca 1600 1500 1250 1250 1500 1500
#fan 0ce6ca 70 50 50 70 70 100
#flg
loc 0ce6ca 208
miner 0ce6ca optiminer-zcash

#209
cor fb20c3 1000 1000 1000 1000 1000 1000
mem fb20c3 1500 1500 1500 1500 1500 1250
#fan fb20c3 55 45 0
#flg fb20c3 –cl-local-work 256 –cl-global-work 8192 –farm-recheck 1000
loc fb20c3 209
miner fb20c3 optiminer-zcash

PingWest:庄家杜均

$
0
0

PingWest:庄家杜均

01 现身

如果不是区块链和加密货币(crypto-currency)的概念一夜之间炙手可热,“币圈”的庄家们可能还在过着闷声发大财的逍遥日子。

但现在这种平衡被打破了。最近一年,数字货币和替代性加密货币的价格暴涨,各种版本的炒币暴富神话在网络上流传。2017年9月,中国的监管机构下令禁止境内的ICO(首次代币发行,是用区块链把使用权和加密货币合二为一,来为开发、维护、交换相关产品或者服务的项目进融资的方式。来源:维基百科)交易,并陆续屏蔽境外ICO交易平台的域名。这非但未能消灭“圈外人”的入场热情,反而激发了公众的窥探欲,更引发了传统风险投资界的焦虑和参与。

2018年除夕,一系列名为“三点钟无眠区块链”的微信群横空出世,在各种区块链微信群里呼风唤雨的,是薛蛮子、徐小平、蔡文胜和王峰这样的传统天使风险投资人。大佬们坐而论道,谈区块链技术的未来和区块链的应用场景,号召人们关注区块链,拥抱区块链的未来。无独有偶的是,他们在微信群里的每一次“私密分享”,都会成为广为流传的微信朋友圈素材和媒体报道的来源,更是把“全民区块链”的热情推向高潮。甚至区块链之外的互联网产业都被戏称为“古典互联网”,现有的私募股权投资模式也被调侃为“古典互联网投资”。

传统互联网的苍天死了,区块链的黄天立了。有意思的是,这些突然闯入的“前古典投资大佬”表现出对区块链异乎寻常的兴趣,却绝口不谈比特币和其它加密代币,或者干脆直接与“炒币的”划清界限。但微信群里的信徒们和所有关注他们言论的看客们,几乎无一不试图从他们的言论和态度中,寻找、坐实并放大币的交易价值。

也并没有人真正清楚这些大佬们炒不炒币,持有多少币,赚了多少钱。

这些群里也有一些几乎从不发言,但闷声发财的人。这些人不求虚名,比活跃的新晋区块链意见领袖们,赚到了更多的钱。

他们是区块链加密货币交易世界的庄家。

2017年底,一个名为IOST(Internet of Service Token)的区块链项目正在筹划ICO,募资数额巨大。在ICO之前的私募阶段,该团队宣传称其背后的投资方有真格基金、红杉中国和险峰长青等知名风投机构。阵容可谓豪华。随即有媒体发现,“IOST”项目团队与真格基金投资的“多拉打印”团队在人员上高度重合,质疑项目是”多拉打印”的融资马甲,猜测IOST只是一个“空气币”(即背后没有真正运营的项目支撑,单纯以发行加密货币为目的吸引人们认购)项目。

此事后来不了了之,但一个叫“杜均”的名字浮出水面——

“IOST”是由火币网旗下Huobi Labs孵化的项目。火币网是其主要投资方,也是联合首发的交易所,而杜均是火币网的联合创始人、独立董事和股东。

除火币网和真格基金之外,“IOST”和另一个项目“DATA”的共同投资方还有一家叫“节点资本”的机构,该机构专注区块链领域投资,杜均也是节点资本的创始合伙人。

与此同时,“IOST”在一家区块链垂直媒体——“金色财经”上,曾被积极推荐,而“金色财经”的实际控制人,又是杜均。

利益交叉复杂,线索却再清晰不过。从项目孵化开始,到登陆交易所公开流通,再到垂直媒体的配合炒作,一场ICO的每一个环节,杜均都深涉其中。

PingWest品玩发现,自2013年与李林等人一起创办“火币网”起,杜均渐次在“币圈”里建立起了自己的产业链,时至今日,他已然坐拥私募股权投资、垂直行业媒体和数字货币交易所三大核心资源。而这三大资源平台,恰恰又是一场ICO最依赖的部分,也是各种内幕交易和暗箱操作的温床。

如果以股票市场作比,杜均是一个身兼承销商、证券媒体以及坐市商三大角色于一体的“超级庄家”。

数字货币和各类代币虽脱胎于“去中心化”的美好愿景,但在实际运行过程中,由于被大量“中心化”的机构垄断资源,项目发行“空气币”涉嫌欺诈融资、私募代投和操纵币价的乱象盛行,已经发展到不能忽视的程度。

“超级庄家”杜均和他背后的产业链,可谓是展示当下整个数字货币交易市场坐庄手法的一个样本案例。

02 杜均其人

杜均,重庆开县人,1986年出生。

媒体鲜有关于杜均的报道,零星的信息大多来自2017年9月之前他集中接受的一些媒体专访。但这些足以让我们了解到他的发迹史:

杜均有很强的赚钱意识,这源于他的成长经历。杜均父亲在其幼年做生意经常赔钱,从小的耳濡目染,使得“赚钱”从那时开始便成了他最重要的人生目标;

初中期间,杜均接触到了刚刚在中国兴起的互联网。他曾靠打游戏卖装备、建站赚广告费谋生,是早年间国内互联网野蛮生长时代孕育的无数个人站长之一。以此为契机,杜均接触到了与实体经济截然不同的虚拟经济;

他没有完成大专学业就毅然辍学北上,一度沦在餐厅打工。但凭借常年混迹互联网圈积累的经验和圈子,杜均成功进入知名企业家和天使投资人戴志康创立的康盛创想,在旗下Discuz!担任产品设计相关职务。康盛创想于2010年被腾讯全资收购,只有高中文凭的杜均得以进入中国最大的互联网公司工作。

据说,杜均私下曾跟人宣称,自己22岁就已经实现了财务自由。这一说法的真实性无从考证,但有一点却是事实:杜均年轻时确实靠倒卖域名掘到了第一桶金。

在频繁触网的那段时间,杜均知道了“蔡文胜”这个名字,后者倒卖域名发家致富的经历深深地刺激了他。他依样画瓢,不停买入有升值潜力的域名,等其升值后卖出。多处关于杜均的报道中都提到,他在团购领域“千团大战”时靠囤积带有“团”字的域名发了一笔不小的财。在一篇由杜均自述构成的报道中,他罗列了自己在2006年到2013年之前每一年的域名买卖情况,每一笔交易的投入和回报都有详细记录。

这时候,比域名更刺激的“比特币”出现在他眼前。

2013年下半年,杜均从腾讯辞职,与李林等人联合创立数字货币交易所——火币网。昔日的领导戴志康则成了火币网的天使投资人。

后来的事实告诉我们,这绝对是一次回报极高的投资。

杜均的职务是火币网首席营销官(CMO)。火币网在2013年底上线,立即打出了“免交易手续费”的旗号,狠狠戳中当时交易所收取交易费的软肋。再加上杜均在站长时期积累的运营经验,平台很快一跃而起。只不过,等到火币网发展壮大、杜均退出直接管理隐居幕后时,它随即连同国内几大交易所重新开始收取手续费,甚至开始向项目收取巨额的ICO“上币费”,这些都是后话了。但无论如何,周鸿祎在中国互联网行业将“免费”逻辑发扬光大,杜均是这一方法论在币圈的早期践行者。

这时,他的人生高潮刚刚开始。

现在看来,他的确对低买高卖有着很好的感觉,先是域名,后来是数字货币,两者都是极具潜力的投资标的和炒作素材。

其实杜均并不算是站在大潮最前沿的那个人。当他开始倒卖域名,跟当时的个人站长们打成一片时,蔡文胜早已靠此起家,还被人称作“个人网站教父”;他接触到比特币投资虽然比行内大多数人早,可也不过是2013年左右的事情,很难确定他对加密货币和背后的区块链技术有什么积累和信仰;当他辞职参与创办火币网时,距离交易额一度占到比特币总额80%、圈内人戏称为“马桶盖”的Mt. Gox上线已过去了好几年,国内市场也诞生了“比特币中国”这样的交易所先驱。

但他有着比别人更强的行动力,以及赚钱的欲望。

火币网上线一年多之后,杜均退出火币网管理层,创办了区块链代币媒体“金色财经”,又顺势募集了自己的基金”节点资本”。从某种意义上说,金色财经和节点资本相当于火币网的衍生产品,三者共同织就了一张覆盖整个ICO链条的网络。

随着这张网络的铺开,杜均个人在圈内的影响力也日益强大。当他再次低调亮相时,已然身兼“节点资本创始合伙人”、“金色财经创始人”和“火币网联合创始人”三个头衔。

在很多没有参与过传统股票交易市场的“币圈人”眼里,杜均这是在“布局产业链上下游”,但倘若以金融市场的角度看待数字货币交易,他的角色简直不可思议。

数字货币的本质是金融产品,各类数字货币在交易所内和场外的币币买卖已经构成事实上的类证券交易行为。而杜均所谓的“产业布局”,实际上相当于将券商、交易所和媒体,由一人或者同一利益方全权掌握。三个市场角色之间没有任何隔离和第三方监督,同时又因为数字货币没有被承认为法定货币,或不适用于现有金融监管条例,这使得杜均和他的“产业布局”,在操纵项目ICO全程,以及“上市”后的币价走势上,简直轻而易举。

事实上杜均的确也这么做了。

03 超级庄家

相信很多人都曾看到过下面这张图:

在这副所谓的“币圈大佬扑克牌”中,杜均被排在一个不起眼的位置。不必说与比特币发明者中本聪、以太坊创始人Vitalik Buterin或是中国比特币第一人李笑来相比,杜均在圈内稍有名望的大佬中也排不上号。他的人物介绍是:“金色财经创始人”。

这其实不符合金色财经这家媒体在币圈的影响力,也不符合杜均的江湖地位。

金色财经是币圈最早、也是流量最大的“媒体”之一。除了针对国内读者的中文站,另有英文、韩文、日文和俄文分站,分别面向全球数字货币交易最热门的几个国家:中国、美国、新加坡、韩国、日本和俄罗斯。在这里你可以看到币圈发生的一切——币价行情、最新消息、知识普及和观点评论等等。当然,其中还掺杂着大量区块链项目的推广软文,以及各类ICO的促销广告。

币圈人对金色财经褒贬不一。有人视其为币圈的风向标,“金色财经说什么就是什么”;有人则怒斥它经常对外放捕风捉影的消息,操纵币价。但多数人都承认一点,金色财经在币圈有着很大影响力,是这个圈子里少有的掷地有声的大媒体之一。

众所周知,无论是传统的证券市场还是数字资产交易市场,新闻媒体都是买卖双方最主要的信息来源。在价值投资缺位的币圈,消息左右币价的能力更加强大。

但证券市场有着充分的监管限制和信息披露,这是各类ICO项目和数字货币交易所不具备的。既然数字货币不适用于现有的证券法律法规,那么作为“币圈证券媒体”而存在的金色财经无论发布什么信息,其内容倾向如何,理论上也都不受制约。

根据天眼查披露的企业工商信息,杜均为金色财经背后的企业主体“北京财到信息技术有限公司”最大单一个人股东,持股52.27%,为实际控制人。

金色财经构成了杜均坐庄网络上的第一个关键节点:控制消息发布。

继续沿着此线索追溯,可以发现:杜均虽然已经从火币网离职,但其实藕断丝连。在火币网的国内企业主体之一“北京火币天下网络技术有限公司”中,杜均仍持有4.22%的股份,同时还担任着该公司的独立董事。而“北京火币天下网络技术有限公司”也参股了“北京财到信息技术有限公司”。

也就是说,火币网也是金色财经的股东。这也就不难解释为什么金色财经上存在着大量火币网的利好消息了。

值得多提一句的是火币网的股权结构。火币网总部位于新加坡,在全球各地都有团队,所以中国境内的“北京火币天下网络科技有限公司”只是其企业实体之一。在国内的工商信息中可以查询到,一家注册在香港的Huobi Universal (HK) Limited公司与火币网及关联公司有着诸多交叉持股关系。

不过,火币网官方网站上显示的戴志康、真格基金、红杉中国等投资方与火币网的持股关系,在国内的工商信息系统中,并没有得到完整的体现。

这意味着火币网有着周密的股权安排,国内这家公司只是冰山一角。火币网的公司实体和真实股东分布在多个国家,其完整结构难以彻底查清。

即便如此,至少有一点可以确认,即杜均、火币网和金色财经之间为交叉持股关系,在公司层面是典型的利益关联方。

这构成了杜均庄网上的第二个关键节点:持有交易所股份,分享操盘收益。

与证券交易所不同,数字资产交易所完全是私人企业,不需要承担社会责任,可以参与到前期发币和上市后炒币的任意一个环节中。圈内人都清楚,这是一门稳赚不赔的生意:每个ICO项目想要登陆交易所都要缴纳价值上千万人民币的上币费用,以法币、以太坊、代币的形式缴纳,或三者混合;无论币价涨跌,任何买卖交易交易所都能从中收取手续费,杠杆交易中交易所还能收取高额的借币利息;交易所可以利用沉淀在交易所里的用户资产操盘炒股,甚至无需动用本金制造虚拟交易……可谓无所不能。

根据全球虚拟货币和交易所统计网站CoinMarketCap的实时数据,火币网在24小时交易量中一直稳居全球交易所前五名,经常挤进前三。

理论上只要掌握交易所这一核心资源就可以坐庄。但杜均的圈子胃口不仅限于此。

杜均的最后一重身份是“节点资本”创始合伙人。这是一家私募投资基金,也是杜均庄网上的最后一个关键节点。

像大多数专门投资区块链及数字货币项目的私募投资机构一样,节点资本很年轻,2015年才正式成立。这类机构的投资模式与传统私募股权投资不同,通常使用数字货币和法币结合的方式投资项目,行为发生得极为隐蔽。

在节点资本的官方网站上我们可以看到,节点资本也是火币网和金色财经的投资方。换句话说,杜均不但自己参股了火币网,其控制的节点资本也是火币网的股东之一,这说明杜均在火币网中的持股并非只有4.22%。

初步统计,节点资本的投资组合里,其中有一半项目完成了ICO,而这些ICO大多是在最近几个月时间里完成的,这其中就包括炒币者们耳熟能详的Gerano Network、IOST、YEE和aelf等项目。

基于杜均的“三重身份”,他可以用“节点资本”投资早期项目,项目ICO后登陆自己持股的交易所,手上的媒体资源又可以为项目“保驾护航”。这是一个完整的生财体系。

这在传统二级市场完全不可想象。待上市企业、证券媒体、证券公司和交易所,它们分别是独立的存在,每一部分的行为都在证券法规的严格控制之下。这样做的目地是让二级市场的交易运作透明、规则公平,消除公共投资者的信息不对称,是全球通行的基本法则。但在币圈,它们之间非但没有隔离,甚至可以是同一个人在幕后操盘,坐享ICO每一个节点上的巨额利润。

比起一些仅参与了部分ICO链条的币圈名人,杜均某种程度上掌握着比他们更大的话语权,是名副其实的“隐形大佬”。

条件皆已具备。随着全球范围内数字货币交易逐渐升温,ICO井喷,坐庄的机会自己就找上门来。

04 诡异的乌龙

炒币者们可能永远都忘不了2017年12月代币“WAX”登录“火币Pro”交易所后,狂跌99%的惨烈景象。

2017年9月4日,有关部门对ICO的监管禁令出台,中国内地原有的交易所格局发生了一场戏剧性的变化:比特币中国直接宣布当月底停止交易,后来市场上传出其被香港投资基金收购的消息,但没有对外披露任何交易细节。原本默默无闻的小交易所“币安”立即行动,将平台迁至海外,项目也趋之若鹜,币安也一跃成为交易额最大的交易所之一;火币网则将交易平台整体迁至海外,并改名为“火币Pro”,同时还上线了多个语种的交易平台。

而戏剧性的是,各类代币ICO井喷的时间点,都发生于2017年9月4日ICO禁令之后。

据不完全统计,2017年11月至12月的短短两个月时间里,“火币Pro”上币数量达到近40个,2018年前两个月的数量高达45个。换句话说,超过80%的币种,都是集中在最近四个月时间里登录火币Pro的。

火币网正式将所有币种的交易迁至火币Pro之后,开始的两个多月,项目上币是不收取费用的。直到“WAX”的ICO事件。

2017年12月,一家叫做OPSkins的游戏虚拟资产交易平台宣布ICO,公开发行自己的代币WAX(Worldwide Asset Exchange)。按照原定计划,WAX将在2017年12月20日在火币Pro上线交易。

然而就在正式上币的2天前,WAX项目团队突然在Twitter和Medium等社交网络上发出通知:将代币数量拆分,增发至原有10倍,币价瞬间贬值至原价的一成。但火币Pro在20日却仍以原价格上线WAX,这使许多没有看到通知的散户投资者,在不知情的状况下以原价买入。不出所料,WAX上线后币价旋即跌去99%,大量投资者被套牢。

WAX乌龙事件震惊币圈。6天后,也即12月27日,火币网就此事件召开发布会,CEO李林出面解释事件原委。李林称:此事并非WAX团队恶意增发,而是因为双方商务团队没有及时沟通所致。火币网随后出台了一项赔偿计划,称会拿出1亿元全额赔付用户,并承诺在2018年1月31日前赔付完毕。

与赔偿计划一起,火币Pro宣布立即停止免费上币服务,对项目ICO收取上币费用,并进行资质审核(火币网称审核基础为自主研发的SMARTChain评估模型)。

现在看来,WAX事件仍存在重重疑点:

第一,WAX在上线前至少2-3天即在Twitter上宣布增发,并于12月19日在Medium上发表公告宣布此事。而作为WAX唯一且首发的交易所,火币Pro称对此完全不知情,团队在上币前两天与项目方没有任何信息沟通。

第二,WAX是由OPSkins这一项目的团队发行的,该项目上线于2016年,自称全球领先的虚拟游戏装备交易平台。但Google、维基百科、Steam社区以及各种公开资料中,这个交易平台的信息甚少。

第三,节点资本恰好是WAX的投资者。WAX是OPSkins团队的代币项目,杜均进入WAX的方式很可能只是公开交易前的私募阶段。火币网的独立董事及股东之一杜均,作为项目的私募投资方,竟然也不知道WAX要1:10拆币的消息,或者是知情,但没有跟火币网的任何人进行沟通。三者之中没有在两天的时间里互通信息,本身就非常不合常理——毕竟,这次事件的赔偿金高达1亿元人民币,而它又是由一个如此荒谬的原因造成的。

最后,无论是火币网官方还是李林的澄清,都对火币网和WAX之间的关系只字不提。

更意味深长的是,WAX事件之后,金色财经上随即出现了几篇为该事件和火币网“澄清”的文章,它们也同时被群发在了各个网站渠道上。

现在没有确切的证据显示这是一场有预谋的欺诈事件,但火币网和WAX团队也的确没有针对以上的疑点作出符合常理的解释。

无论如何,从WAX事件开始,在火币Pro上币更难而且更贵了——目前,几家平台的上币费都暴涨至几千万人民币。另据一位试图在火币Pro上币的项目方透露,火币对他们只收现金作上币费。可这丝毫没有浇灭项目们的热情。

另一边,在此之后的两个月里,杜均和节点资本似乎完全没有受到WAX影响似的,出手的ICO项目更多、更频繁了。

05 庄技

庄家,通常指能够影响金融证券市场行情的大户投资者,在股市中常常是上市公司所有者、投机游资和基金机构。

以1990年12月上海证券交易所正式开业为起点,中国内地股市经历了单一庄家坐庄、金融集团坐庄和基金机构坐庄等几个时期。1995年到2005年的十年间,国内股市庄家横行,利用监管空白、信息不对称和资本优势狂洗股民。此后,随着上市企业增多、股票流通盘扩大,加上大量散户投资者涌入股市,庄家虽不复当年的辉煌,但仍然分散隐身于市场之中伺机而动。

另一边的散户们永远对庄家又爱又恨——跟着“小道消息”和庄家同进退,一直是散户投资者,准确地说是投机者的渴望。然而,历史证明,跟庄成功者少,被庄家玩弄者众。

《庄家之死》一书的作者陈斯文曾评价这一现象:直至今日,国内股市仍未摆脱“庄家炒作、民众投机”的怪圈。诚然,在后来2007年和2015年的两次大牛市中,大众的投机心理与此前混乱的十年并无不同。

中国股市的庄家史给当下的币圈提供了一个绝佳的参照系。

非主流代币(创新币)公开交易(ICO)后与上世纪90年代中国股市上的股票们并无二致,炒币者的潜在收益更大,面临的环境也更加混乱凶险。

与IPO(首次公开募股,即上市)类似,ICO有着一套独立的发币、私募、承销和公募流程。在项目的私募阶段,基石投资者、早鸟投资者以及其他早期投资者分别用一定折扣认购代币份额,拿到大份额的承销商则会向下分发,帮助散户代投赚取差价。另外,官方还会利用各种社群活动空投糖果,在币圈媒体作广告投放,或是直播空投等方式免费赠送一部分代币,刺激散户参与。

多数项目ICO时只有团队和白皮书,没有实体业务和资产,因此需要靠币圈大佬站台,知名人士作为顾问,以及私募投资者和承销商做销售背书,才能获得投资者的关注和信任,并认购份额。2018年初,币圈名人“宝二爷”(郭宏才)在一次行业分享中说:自己为项目做顾问站台的收费标准是1%的待发代币,前不久在美国给几个项目“云站台”就净赚500万美元。行业中顾问们的暴利可想而知。

这其中隐含着一个事实:项目早期的股权投资人、创始团队和代币私募阶段拿到份额的大户投资者和顾问们,在公开交易前都通过认购或是被赠送的方式持有为数不少的代币,有着共同的利益诉求——希望自己手上的币升值。

这种扭曲的行业关系和“健康的ICO市场环境”,几乎背道而驰。

根据公开资料的不完全统计,在2017年11月至2018年2月的短短4个月时间里,节点资本投资的ICO项目至少有12个,几乎所有项目都得到了金色财经的推荐,其中还有不少联合火币Pro进行了首发促销活动。

一位业内人士对PingWest品玩透露:金色财经与其它大多数媒体不同的是其掌握的“交易所资源”(火币网),金色财经的商务方案,包括火币Pro的交易所作为资源打包提供给ICO项目。

杜均一手投资ICO,一手用金色财经帮这些项目摇旗呐喊,身兼运动员和啦啦队两个角色,各不耽误。

这还不是这场局中最精彩的部分——如果仔细观察这些代币ICO后在火币Pro上的走势你会发现,杜均还是裁判之一。

以下是杜均投资的部分项目在ICO后的盘面。在币币交易中,分析盘面的指标与股票市场基本一致,因此各类股票分析工具同样适用于于币价分析。

在此我们选择股票分析两个核心指标:“佳庆资金流量”和“成交量摆荡”。

佳庆资金指标(Chaikin Money Flow,简称CMF)为股票市场常用分析工具,它用于描述一支股票的强弱状态。这个指标与股价的关系是:CMF会随着股价缓缓上升,股价下跌CMF也会跟着下跌。当CMF指标大于0时,市场向好,反之则向坏。波动越大,买入/卖出的压力越大。在同一时间点,CMF如果与价格呈相反状态(如价格上涨CMF下跌),就意味着行情的转变。

成交量摆荡是一种用曲线方式展示交易量的工具,短期成交量高于长期平均成交量时曲线为正,反之则为负,用来描述交易量的短期变化。

将这两个经典指标与价格走向叠加之后,可以基本判断出主力资金的进出情况(因为创新币只能与BTC或ETH交易,所以该币与ETH和BTC其中一个在图形上有相关波动,即可视作庄家用的是这一币种操盘)。这个指标组合存在滞后,但描述清楚过去一段时间里大额资金的流动足够了。

根据几个指标的关系,

CMF和成交量摆荡同时拉高,在币价达到最高点之前达到顶点并出现向下信号,意味着行情反转,庄家开始出货;
CMF从0线以下向上抬升、成交量摆荡出现异常波动,但价格未有相应明显变化,说明庄家正在吸货;
CMF弱于0线、成交量摆荡波动小,同时价格也趋于平稳,说明此时市场上大额资金很少,主要是散户在博弈;
如果成交量摆荡大幅波动,CMF和币价却没有出现相应的大幅波动,说明市场上存在大量对敲交易(左手倒右手),这是典型的操纵价格现象。
在DTA、IOST、WAX和YEE等几个币种中,都出现了以上一种或几种大额资金的操盘痕迹(以上盘面图中已用红色竖线标出)。其中有几个币种在刚刚上线交易时有明显拉盘现象。

通过对一些“币圈”人士的采访,PingWest品玩了解到其中一部分事实:币圈的“控盘者”主要是项目团队本身、机构投资者和交易所三拨人。在证券市场中,释放消息拉盘砸盘、掌握筹码对倒操纵价格、震荡洗盘、拉升股价后高位抛货,这些一直是股市庄家们乐此不疲的坐庄伎俩。而在币圈,这些手法一样都没被庄家落下。

但不一样的是:同样是有着庄家存在,证券交易所的运行在国家的严格监管之下,庄家想要坐庄,必须具备大量本金,吸收大量筹码,而且多账户同时操作,才可能实现(局部)控盘;而在币圈,交易所在散户真正提币之前,一切的交易都是虚拟数字,前台运行的买卖手完全可以是自动运行的机器人程序,不需要真正的币币流动。

另有一个现象可以为庄家操盘提供侧面佐证。根据上文的表格,自2017年12月开始,每个币种登录火币Pro开始交易后,开放充值和提现的间隔时间越来越长——较早登录的项目通常当天即开放充值和提现,慢慢地,提现时间至少要间隔2天,甚至更久。这相当于交易所人为地设定了一段封仓时间,而很多代币在这段时间里,足以完成几轮操盘了。

实际上,许多散户投资者非常清楚有庄家和交易机器人的存在。在火币Pro官方Telegram群组和一些项目的官方讨论群中,有的散户甚至直接呼吁交易所和项目拉盘。他们一边在社群里骂骂咧咧,一边乐此不疲地参与其中。

炒币的投机本质暴露无遗。

最近发生的一起疑似交易所直接操盘事件来自2月25日ABT(ArcBlock)的ICO。2月26日上午,ABT在火币Pro上由于“技术问题”出现卡单(同时其它币种正常交易),许多挂出的高价单无法撤回,但页面显示仍有挂单在成交。卡单导致币价急剧下跌,投资者损失惨重。此事在火币Pro的官方Telegram群里引发大量用户投诉,火币客服则一直以“正在解决”和“汇报给领导”为由搪塞,没有对异常现象作出澄清说明,投资者们的质疑和谩骂也是置之不理。

整个“庄网”的做法大抵如此:节点资本投资并推动项目ICO,金色财经参与鼓吹,火币网上坐庄拉高价格出货或砸盘做空——无论这些行为是否由杜均亲力亲为,杜均都会以股东身份享有整个链条的巨额收益。

06 “圈外人”的掮客

庄网自然不止杜均这一张,掌握着核心资源的大佬也不止杜均一个。除了投资机构,各地还出现了不少利益捆绑的圈内联盟,大庄外围形成了不少小庄。积累了大量资本的庄家们织成了无数纵横交错的网络,或是联合投资,或是暗自较量,结果就是核心资源牢牢掌握在少数人手里。

如此明目张胆的坐庄行为,在证券交易市好比刀尖上舔血,在币圈的“圈内人”看来却是一种护盘的保证。

不止一位币圈散户投资者告诉PingWest品玩:圈外有什么负面消息和“黑幕”揭露,圈内人几乎没人在意——在他们眼里,无论有什么样的负面消息(他们统统看作“砸盘”)放出,跌到一定程度圈内大佬总会护盘,不会让所有人都血本无归。看起来,大家都把庄家们看作“善庄”了。

究其根本,无非是一种跟庄心态在作祟。私募阶段的投资者能以较低的折扣拿到代币,对于公募后的散户有着巨大的成本优势。ICO之前的低价份额掌握在庄家和大户投资者手里承销,为了拿到份额,中小投资者们往往默认让庄家赚大头,自己喝汤。

久而久之,圈内就形成了这样一种微妙的平衡——大家都想向各个庄家靠拢赚更多的钱。

这种平衡下的暴利势必会遭到圈外人的觊觎。新的投资者被金钱的味道吸引过来了,杜均的庄网也没放过这个机会,顺势当了一把掮客。

2017年年底,真格基金悄悄入场。

关于真格基金和区块链的关联,最有名的当属徐小平群内发言“泄露”事件。这一事件可谓正式引爆了整个互联网舆论对区块链和币圈的关注,“沾区块链和ICO就火”的现象由此愈演愈烈。

可圈内人都清楚,在徐小平发言泄露之前,真格基金参与的几个项目的ICO早已经在圈内炒得沸沸扬扬。公开资料显示,真格基金在2017年底密集参与了IOST、DATA、HOT和LINO至少四个项目的发币。目前,除了LINO之外,另外三个币种已经上所交易,LINO没有公开ICO。但LINO的Telegram群里每天都非常活跃,官方闷头投放糖果,投资者呼吁登录币所交易。

但代表真格基金在币圈活动的不是徐小平,而是合伙人戴雨森。

戴雨森,前聚美优品产品副总裁,于2017年7月离开聚美优品加入真格基金,担任合伙人职务。在戴雨森的LinkedIn页面上,最新的履历中清晰地写着自己目前担任IOST、DATA、LINO和HOT四个项目的顾问,这几个项目都是由真格基金投资的。这又是一处证明。

在2017年底一张由币圈媒体和交易所联合统计的“国内一线基金近期投资区块链项目一览图”里,除了几个新近成立的专门投资区块链的机构之外,传统风险投资机构中,只有真格基金一家参与颇深。

真格基金深度参与的这四个项目,节点资本都是联合投资方,最新上线火币Pro的EDU还完成了一整个链条的运作:节点投资、金色炒作和火币上币。

其中,IOST和DATA又是火币旗下Huobi Labs的孵化项目——考虑到真格基金同时是火币网的投资方,基本能判断这些项目都是由节点资本、火币网和真格基金联手投资和推动的。

可以说,带着真格入圈的掮客,正是杜均和他的庄网。

然而经过进一步调查,PingWest品玩发现:真格基金在币圈的作为似乎不止这些。在我们拿到的一份波场(TRON,代币TRX)ICO的私募材料中,首轮私募投资者中戴雨森也赫然在列。这些信息没有在波场的公开募资信息中披露,却在私募阶段悄悄地通过社群和私下传播,被派发到了无数早期投资者手里。

再后来,事情的走向开始有些失控。高潮在2018年除夕到来:“三点钟”系列微信群建立,陈伟星和朱啸虎之间爆发“区块链”和“古典”之争。一夜之间,50多家区块链或币圈媒体冒了出来,拥抱区块链成为风潮。

传统风险投资机构也纷纷按捺不住了,不再“与币隔绝”。“三点钟”的各个分支群里活跃着各种各样来自传统风投的合伙人和投资经理。

原有平衡已然被打破,但这个圈子是否能够包容得下更多野心和贪欲,形成新的平衡,还是个未知数。

07 危局

2018年春节过后的币圈,形势看起来一片大好。

可“圈内人”都感觉得到,利益再也无法平均分配,财富开始明显地向一些头部资源流动。最典型的现象就是,对于项目方来说,ICO的成本越来越高,却无法保证高额收益。

2月28日,火币Pro的HADAX平台第一期投票结束。HADAX平台是火币Pro推出的“投票上币”项目,旨在由投票来决定哪些新币可以登录火币Pro交易。第一期投票结束,有10个新币种得到了上币资格。

这可不是意味着火币Pro想试着将ICO从“核准制”向“注册制”过渡。在HADAX上每向一个项目投票,用户需要花费0.1个HT(HT是火币自己发行的代币)。有媒体测算,按照2月28日当天的HT汇率,第一名EGCC项目花费近4800万元人民币,这些都进了火币的腰包。这还只是一个项目的费用。

此举遭到了多数媒体和圈内人士的质疑,认为这是火币网变相涨上币费的手段,与竞价排名别无二致。迫于舆论压力,火币Pro迅速开通“退币”机制,承诺可以退还投票费用,并公开向用户征集第二期投票上币规则的完善意见。

有圈内人士直言:如今的项目方,完全就是在给交易所打工!

据说,在一次近期举行的闭门交流论坛上,有ICO项目的宣发人员诉苦:称目前金色财经的打包宣发费用已经达到几百万。3月3日,新媒体“铅笔道”发表的一篇文章称,币圈媒体推荐项目ICO的软文收费惊人,甚至达到了一篇文章收费10万元的程度,但点击数只有200多。业内人士称,金色财经所收取的广告费只会比这个数字更大。

帮着项目方算一笔账,顾问费、上币费和宣发费用,一场ICO下来,手上拿到的钱所剩无几,这剩下的一点钱当中,又有多少能用来做产品开发?莫不是真的在“开发”空气币?

另外一个疯狂且危险的信号触动着每个币圈人的神经。

ICO后狂涨的美好景象破碎,大量代币上线火币Pro后破发,而且有着愈演愈烈的趋势。有圈内人士私下询问币圈知名投资人、FBG Capital创始人周硕基对这件事的看法,后者只说了一句话“看项目背后的团队”便再不作声。讽刺的是,随着破发的ICO越来越多,圈内竟然出现了“破发险”的险种。

看似热闹的币圈,慢慢地变成了一个零和博弈的战场——财富在大户手头流动,靠着频繁的交易维持盘面的热闹。然而,越来越多的散户体会到了“上市即破发”的痛,越来越多的财富被尽情地收割。

3月3日,全国政协十三届一次会议开幕,中国进入“两会时期”。就在大会召开前的一天,两大数字货币交易所火币网和OKEx的微信公众帐号突然消失,前者被删除“火币网”,被迫改名“huobicom”;OKEx则直接被封号,屏蔽一切消息。

这被舆论视作币圈“大事发生”的前兆,谣言四起。至本文发表为止,火币网和OKEx官方没有对此发表公开声明解释,两大交易所业务一切照旧。

08 “是时候了”
去年开始业内即有传言,包括杜均在内,币圈主要人物已经被限制出境。有几位独立信源先后向PingWest品玩证实了这个消息。当我们试图联系到其中一位早在站长时代就与杜均相识的人想要谈一些关于他的事,对方婉拒了采访请求,称“现在谈他太敏感”,不愿多说。

一张在圈内流传的微信对话截图显示:央行将会在315期间“有动作”,并称火币CEO和COO已经被限制出境。甚至有人说,不排除采用叫停矿厂挖矿的严厉措施。

就在3月开始后的几天,节点资本的网站信息,没有任何征兆地由中文全部替换成了英文。

越来越多的信息显示,国内新一轮的措施就要到来。

但大佬们似乎没有受到影响似的,在三点钟群里谈笑风生,私下里筹划币圈的“下一件大事”。

2月27日晚,币圈很多有头有脸的人物出现在北京的一个酒吧。起初这只是一个少数人的小聚会,但随着消息在社交网络上传开,越来越多的人赶来现场,小小的酒吧瞬间被包场。

小局变成大局,大局中又套小局。在一个只有核心人物的小局上,几个大佬商量,由最近在舆论中倍受瞩目的陈伟星牵头成立一个新基金,名为“2100”。关于2100这个名字有几个说法,一说是入会的人起码得是2100个比特币以上的身价(相当于近1.5亿人民币),一说是这是陈伟星自己之前一个基金的名字,还有人说加入的人起码能搞定2100个比特币的资金。

当然,杜均也在其中。

文章写到结尾,我们与一位圈内人士确认关于“2100基金”和杜均的消息。对方得知的来意后,说了一句话:

“也是时候了。”

2018-02-13 用树莓派3搭建Storj实验节点

$
0
0

2018-02-13 用树莓派3搭建Storj实验节点

96
sggggy 
2018.02.13 14:58* 字数 502 阅读 179评论 0

总述

有不少爱好者希望提供树莓派搭建Storj节点的教程,在此梳理一篇。但一定注意树莓派天生低功耗与低内存的特性。树莓派的内存只能跑一个节点,而且可能性能还偏低,时不时还会有节点重启记录。

文章的要点,烧录好系统后,初始化所需软件,接着创建非root账号进行storj相关软件的安装,并且最终以非root账号启动storj。

PS:如果你的网络连通性不好,比如无法连接到github,在捣鼓的过程可能会遇到各种nodejs的报错。

物料

  • 树莓派3
  • TF卡 16G或以上,记得要有TF卡转USB写入的转换器
  • 树莓派外壳 可选,裸板直接跑也没啥大问题
  • 移动硬盘 上限8T,2.5寸移动硬盘可以靠树莓派供电,3.5寸的移动硬盘需要额外供电
  • 网线

准备阶段

本文档以CentOS7为例:

  • 首先下载镜像文件CentOS-Userland-7-armv7hl-Minimal-1708-RaspberryPi3.img.xz
  • 下载烧录软件etcher
  • 利用软件将镜像烧录到TF卡中
    烧录
  • 将TF卡插入树莓派,接上网线并通电
  • 去路由器后台查找树莓派的IP地址,默认情况下会通过路由器的DHCP服务,分配到IP地址
  • 通过ssh协议连接到树莓派,root的初始密码为centos:
###修改密码
[root@centos-rpi3 ~]# password 你的新密码

### 升级补丁并安装所需软件
[root@centos-rpi3 ~]# yum update -y
[root@centos-rpi3 ~]# yum -y install vim wget git epel-release htop git gcc-c++ make

### 创建非特权账号,root账号保留不使用
[root@centos-rpi3 ~]# useradd storj
[root@centos-rpi3 ~]# password storj

### 从root切换到storj账号进行后续操作
[root@centos-rpi3 ~]# su - storj
[storj@centos-rpi3 ~] wget -qO- https://raw.githubusercontent.com/creationix/nvm/v0.33.3/install.sh | bash
[storj@centos-rpi3 ~] nvm install --lts
[storj@centos-rpi3 ~] npm install --global storjshare-daemon -registry=https://registry.npm.taobao.org

Storj 节点配置

## 创建Storj节点,其中YOUR_STORJ_TOKEN_WALLET_ADRESS为你的myetherwallet收款钱包地址,storage后面跟着的是文件存储的路径
[storj@centos-rpi3 ~] storjshare create --storj=YOUR_STORJ_TOKEN_WALLET_ADRESS --storage=/mnt/storjmerge/storj.io/

范例如下,请把–storj=后面的内容替换成你自己的,不然赚取的货币就都送给我了

[storj@centos-rpi3 ~] storjshare-create --storj=0xa682270bC2045171873eB17bB195B2273Fea9066 --storage=/data/

Storj 节点启动

## 启动守护进程
[storj@centos-rpi3 ~] storjshare daemon

## 启动节点
[storj@centos-rpi3 ~] storjshare start --config /path/to/storjconfig/xxxx.json

范例如下:

[storj@centos-rpi3 ~] storjshare daemon

[storj@centos-rpi3 ~] storjshare start --config /root/.storjshare/configs/6666666666666666666666.json

Storj 节点验证

## 运行命令查看节点状态
[storj@centos-rpi3 ~] storjshare status
sample

调优

 "storageAllocation": "2GB",
  // Max size of shards that will be accepted and stored
  // Use this and make this lower if you don't have a strong internet connection
  "maxShardSize": "150MB",

React dApp (decentralized app) boilerplate using Ethereum’s blockchain.


基于Ngrok端口转发实现storjshare和siacoin farming

$
0
0

基于Ngrok端口转发实现storjshare和siacoin farming(上)

WHY?

在我们进行Siacoin、storj和burst的Hosting(或者叫HDD farming)时,都会遇到需要端口转发的问题,原因要么缺乏公网ip,要么所谓公网ip还是个大局域网,解决方法有:

  1. 让电信等服务商调整为真实的公网ip,进行路由器的端口转发,然后申请一个域名,实时绑定公网ip到DNS,比如No-ip;
  2. 进行内网穿透。

准备

服务器域名,阿里云需要在安全组策略开放端口4000-4002和9981-9982VULTR主机商相对便宜,可以使用支付宝,按小时计费并且可以摧毁服务器以更换ip,支持快照,可以很快完成服务器更换;软件需求:putty和SecureFXPortable。

ngrok

什么是ngrok?ngrok通过安全隧道暴露本地服务器(如你自己的电脑或内网服务器,处于NAT环境和防火墙内)至公共网络。网上教程很多(比如Sunny ngrok教程并不能成功,他应该是使用的github上面一个项目,叫做Lanproxy,https://github.com/ffay/lanproxy),大多没有附带依赖包,对于没有linux经验的朋友基本难以实现,但此处给出的都是具有依赖包,按顺序安装能够实现,CENTOS6、7,Ubuntu16.04、17.10和树莓派Jessie,服务端和客户端都已经测试,没有问题。

  • 添加域名解析,需要设置ngrok服务的域名和子域名都要添加解析,例如设置后面的ngrok.yourdomain.com,那么ngrok和*.ngrok的解析均需要添加A记录:
  • 根据自己主机平台下载对应的go安装包,使用putty登录后:
  • 配置go环境变量:
  • 下载ngrok源代码:
  • 这里说明一下自定义密钥的原因,文档中说明ngrok only makes TLS-encrypted connections,客户端的合法连接依靠证书体系来确定,可以认为服务端和客户端的二进制文件是一一对应的,不过服务端在运行时可以指定证书(server.crt)和私钥(server.key),如果不指定将会使用编译时的证书和私钥(位于assets/server),而rootCA.pem(根证书)编译进客户端是不能与我们的域名完成匹配的,所以我们继续有(下面代码,只用把ngrok.yourdomain.com替换成你自己的域名就可以了):

 

  • 此处该进行编译了,直接编译会报错,我们先执行一下,看看报什么错:
  • 上述问题是由于进行无法交叉编译,需要去掉$GOBIN的变量声明,解决方法如下:
  • 好了,开始进行服务端编译:
  • 编译客户端:
  • 全部编译完成,再在服务器内输入(端口可以根据需要任意修改,但是tunnelAddr 17543端口,客户端和服务端要保持一致):
  • 在使用SecureFXPortable登陆我们的主机,在文件夹ngrok/bin中,可以下载到对应用于运行storjshare和siacoin的服务器、树莓派或电脑的ngrok,下载后,在我们运行storjshare和siacoin的机器上,ngrok所在文件夹,还需要一个ngrok.conf文件,storjshare默认端口4000-4002,siacoin是9981-9982(不要开放9980,如果开放端口9980,其他节点可以偷取你的siacoin):
  • windows下使用.bat启动ngrok(ngrok.exe -config=ngrok.conf start-all),使用软件SecureFXPortable传输到非windows系统一定使用二进制方式传输ngrok程序,linux命令为(注意ngrok路径对不对):
  • 正常情况,应该呈现:

转载请注明出处,源自密币之家

基于Ngrok端口转发实现storjshare farming和siacoin farming(下)

前序

  1. 比较siacoin(sc)和storjshare(storj),密币之家曾经认为,具有自有区块链的sc会远胜于使用ERC20的storj,然而目前看来,这一切变得更微妙;
    SC优点
    对于存储空间需求方是几乎没有什么费用的,相当便宜的单价,需求方可以很容易在sc自有区块链找到持续时间26周、50sc/TB或者更便宜的合约;
    SC致命弱点
    对于存储空间需求方来说,最头疼的是同步日益扩大的钱包区块链数据,目前已经超过8个GB,这是个弊病,需求方本是属于自有存储空间很少,还让需求方首先同步几个GB的数据,并且这会越来越大;
    此外,对于存储空间提供商,不仅需要付出购买机器的成本、网费和2000sc的抵押金(collateral),提供商目前还不能获得任何来自合约的收益;
    同时密币之家也注意到,storj在discord上的社区用户活跃度日益减少,sc团队将大量时间用于矿机预售,并且传言说好赠送给购买矿机的用户的T-shirt也没有发货,整个矿机官网除了一种神秘感之外没有任何技术公开,密币之家发现其重大的一次更新仅仅是在原有矿机图片上Photoshop上去一些散热孔;
    sc钱包由于仅仅支持64位系统,对32位系统或ARM架构的IoT设备的支持力度不够;
    损耗,sc的区块链日益不断出现新的区块,自然会不断的周期性读取和写入数据,移动硬盘不到半年基本会罢工,机械硬盘不是红盘,损耗也会很大,这一点可以通过长期I/O读写日志数据来获得证实;
    关于SC在线存储空间提供商也近乎半年多没有任何增长,数据是通过Siahub进行统计,用户可以自行观察,当你的存储提供平台正常上线后,siahub都会显示你所提供的空间信息;
    最后,没有集成内网穿透功能,没有公网ip的用户在sc钱包host界面会显示(红叉)”host is unreachable“或者(黄叉)”host is inactive
    sc正在被很多交易所下架,例如http://www.cryptopia.co.nz,也有很多交易所不再考虑上架sc,例如okex.com
    storj优点
    对于存储空间需求方来说,较为便宜的单价,不需要任何区块链同步(依赖以太坊Ethereum的区块链),使用方便;
    可以使用API进行OSS和FTP存储,有心的用户还可以到Github上寻找一下,社区的一个用户开发了的存储空间需求方具有UI的程序,storj社区极为活跃,技术不断进步,目前提供商的版本也越来越流畅,加入Bridge之后,连接更加稳定;
    storjshare是没有抵押金的,选择硬盘即用,即使你所分享的数据被你丢失(类似于采样定理,只要保持网络节点的一定比例数据冗余率,所有数据都是可恢复的),存储空间需求用户也不会因此丢失数据,你也不会被扣费,快速再次上线即可;
    没有周期性读写硬盘,损耗相对sc减少非常多,即使频繁接收合约数据,一旦完成该合约数据同步,你的平台马上都会进入休眠;
    storjshare正被很多交易所上架,起初只有bittrex参与,后来Poloniex也上架了,更值得注意的是,okex.com最近也将storj上架了。
    storj蹩脚
    很遗憾地是,也因为没有自有区块链进行合约费用算法控制,对于存储空间提供商合约费用支付是通过社区每月中旬集体由storj团队手工发送(打工资?),但团队保证后期会引入mini fee payout算法机制,通过storjshare进行自动实时付费,这一功能将在后期storjshare版本中看到;
    和sc一样,不具有内网穿透功能,bridge的生效必须是你曾经与外网发生了链接,对于没有公网ip用户都会显示Tunnel
  2. 现在给出storj如何进行HDD farming硬盘出租(或许国内第一篇),并不是像百度“storj”出来内容中“简书”上的一个用户所说,storj只针对部分用户开放,而现在storj是对每个人开放的,大家都可以进行参与存储空间分享。
  3. By the way, Siacoin farming,在linux 64位和windows 64位系统中很容易实现,在官网获取具有GUI的钱包之后,完成钱包区块链同步,存入2000个sc,即刻开始分享存储空间或者存储内容到区块链,在IoT设备中,如树莓派,社区的一个用户基于GENtoo 64位linux写入了siacoin钱包,并命名为siaberry,大家有兴趣可以烧录到树莓派,实践一下,siacoin的介绍就到此,资料内容均可在上文找到。

步骤一、Check!

一定在进行下面步骤之前,保证用于storj的平台,已经进行内网穿透或者(拥有公网ip)路由端口转发,二者一定需要做一个,这非常重要,相关内容请看上篇

步骤二、系统

 

(最廉价)方案 1. 树莓派系统

 

storj支持很多系统与架构,甚至IoT设备,如对于树莓派,官方给出了详细的手把手教程,硬件选择也很简单,树莓派+装在硬盘盒子内的机械硬盘(推荐),或者是,树莓派+移动硬盘,长期读写的应用场景不适合使用移动硬盘,鉴于成本考虑,不建议使用SSD,没有必要像官方那样组装硬盘,直接使用硬盘盒子,请自行京东,下面以两块硬盘为例(再次重申,确保你已经进行了内网穿透或者拥有公网ip的用户进行了路由端口转发);

  • 创建硬盘挂载目录和设置访问权限,不能使用root用户,storjshare只能由非root用户使用,例如我们假如使用demo,demo用户拥有sudo权限
  • fdisk对两块硬盘分区之后(略),再进行格式化,命令如下
  • 安装用于聚合存储空间为一个挂载点的mergerfs
  • 使用sudo blkid命令查看机械硬盘UUID号后,修改fstab,使得硬盘能开机自动挂载,注意修改UUID为你自己的号码,以及注意fsname是合并存储空间的挂载点目录
  • 重启后,输入命令df -h能看到如下合并的空间就是正常的了
  • 使用demo用户输入以下命令
  • 上个命令完成后,退出这个命令输入终端Terminal,然后再开启一个新的命令输入终端Terminal,还是使用demo登入,输入以下命令
  • 上个命令完成后,退出这个命令输入终端Terminal,然后再开启一个新的命令输入终端Terminal,还是使用demo登入,输入以下命令
  • npm install命令可能会运行很久,喝一杯咖啡,然后看到结果中有很多黄色ip地址加@的节点信息就证明已经安装成功,下面我们需要使用你自己的storj地址,okex.com上或者myetherwallet可以获得,不能使用其他没有上架storj的交易所或者不支持ERC20的以太坊地址
  • 会得到以下的结果
  • 上句命令也是启动命令,但是我们需要先等等,修改一下配置文件再启动,47cc82204e418626993257eb4c19c6031eb5e569即是你的节点号码nodeID,我们先看看配置文件,别被吓到,其实大部分是解释内容,实际填写很简单
  • 更改一下目录权限,正式进行storjshare运行时这个目录/home/demo/.config/storjshare里面会有三个文件,分别是configs、shares和logs
  • 启动storjshare
  • 常见问题是当输入storjshare start时提示daemon没有启动,但当再次启动daemon又说daemon已经运行,此时通常是由于运行storjshare的用户没有目录权限或者daemon没有存储目录/mnt/s的读写权限造成的,其他问题可以查看日志,正常情况下,你已经可以观看当前状态,命令为storjshare status,下图是二十多个小时后的状态

  • storjshare的常用控制命令有如下,更多命令可以使用help命令发现

(最具扩展性) 方案 2. Linux64位系统

 

密币之家通过多次实践和尝试后,使用了该种方案,树莓派虽然很优秀,但是性能上还是有所欠缺,特别是要进行搭建多项服务时,资源局限性更会凸显

密币之家安装的linux系统为64位ubuntu 16.04LTS版本,上述步骤,完全可以适用,除了挂载硬盘时所用mergerfs聚合硬盘不同,具体可以参看github页面mergerfs,命令为

然后按照方案1的方法成功设置后,输入storjshare status,可以看到

 

由于之前密币之家重装系统,所以时间上只有10天,其实密币之家参与storjshare已经数月有余,上月获得了17个多一点的storj,每月可以到storj社区查看自己storj地址收入多少storj币,社区访问不需要VPN,但是他们的payouts表格是通过google表格进行分享,所以你需要VPN才能访问payouts表格,然后Ctrl+F,查找自己的地址,结算日期为上月1日至上月最后一天,每月中旬进行结算,具体请常常访问社区,如下

 

(最简单) 方案 3. windows系统

 

一般都作为日常工作娱乐的平台,很少会让其24小时开机,所以windows系统方案作为最后推出,但是实现很简单

  • 首先到storj官网(storj.io)下载新版钱包,我们选择win64.exe

  • 安装完成后,需要net time辅助时间同步,微软自带时间同步工具无法满足storjshare的应用,时间同步后在启动storjshare,第一步填地址

  • 选择存储目录后,设置分享的存储空间大小,再选择你的端口,密币之家提前做了内网穿透,然后需要勾选reachable,下步填写你的内网穿透所用域名即可,对于有公网ip用户,填路由所转发的端口,没有绑定公网ip至域名则填写你的公网ip

  • 大功告成!

验证:

需要注意的是:如果你的节点一切正常,但就是没有获得任何Allocs或者Shared,那么首先去https://api.storj.io/contacts/Nodeid,nodeid换成你自己的,本文是47cc82204e418626993257eb4c19c6031eb5e569(非本文作者真实nodeid,仅为举例),那么https://api.storj.io/contacts/47cc82204e418626993257eb4c19c6031eb5e569,点开该链接会获得一个节点信息,里面必须有一项参数response time ,响应时间,如果不存在该项参数,只能回到步骤storjshare create –storj=填写你自己的storj地址 –storage=/mnt/s ,再次重新创建,直到成功为止,这是官方BUG,目前没有修复,这也是Storj官方给出的解决办法,亲测有效。

步骤三、运维

  • 官方推荐了grafana,监控节点的网络数据,其实有更接地气的面板,宝塔面板,bt.cn,Ubuntu/Deepin系统安装命令为

 

 

 

  • 打开数据监控之后,隔几天就能看到有意思的数据出现

步骤四、整合

有了宝塔面板,该平台不仅可以用于storjshare,大家还可以考虑安装一个nextcloud/owncloud在上面,nextcloud为免费使用,有PC平台/手机平台,其他后续内容将在未来公布。

BUILD YOUR OWN ETHEREUM MINING RIG

$
0
0

BUILD YOUR OWN ETHEREUM MINING RIG, PART 1: HARDWARE

Ethereum GPU mining rig testbed.

It’s finally time for an update to my popular 2013 Litecoin mining guide! It’s four years later, and Ethereum mining is where it’s at for GPU miners, so that’s what I’ve focused on. I’ve kept the same format and detail level as my old guide, so if you were around back then, you’ll know what to expect.

If you’re new to the world of crytocurrency mining, this guide should give even an absolute beginner all of the knowledge needed to put together an efficient Ethereum (or other GPU-minable altcoin) mining rig using readily-available consumer hardware.

This guide will be broken into several parts, each focusing on a different aspect of building your first mining rig. First, let’s take a look at what you’ll need in terms of hardware to put a respectable Ethereum miner together.

Build your own Ethereum Mining Rig, part 1:  Hardware

Here is the list of hardware that I recommend. Don’t worry if you’re not able to get exactly what’s on this list, I provide some excellent alternatives below the table.

Motherboard 1 x Asus B250 Mining Expert $180
Processor 1 x Intel Celeron G3900 CPU $45
Memory 1 x 4GB DDR4 DIMM $40
Power Supply 1 x 1200w Platinum PSU $260
GPUs 3+ Radeon RX 570 video cards (*see below) ~$200 each
Boot Device 1 x 60GB SSD -or- USB stick (Linux) $5 – $35
Case 1 x build your own (see bottom) -or- open frame case $30 – $200

Some explanations and alternatives for each item:

Motherboard

Generally, any motherboard with PCIe slots on it is suitable for mining—typically one GPU per PCIe slot. The PCIe slots don’t need to be full-length, as we can attach GPUs to 1x slots with the help of risers. With that said, there are potentially some limitations when you start to pack a large number (4+) of GPUs onto one motherboard, even if that board has enough PCIe slots to physically accommodate them. That’s why picking a suitable motherboard is probably your biggest hardware headache if you want to run as many GPUs as possible in your rig.

My top choice is currently the Asus B250 Mining Expert board. It’s literally made for mining, with support for up to 19 (!) GPUs and 3 power supplies right out of the box. Even if you don’t intend to initially run more than a few GPUs, the included mining-centric diagnostic features and ability to expand later probably make the price premium over less-robust boards worth it.

The ASRock H110 Pro BTC+ is another excellent choice for mining, with support for up to 13 GPUs. However, it currently costs about the same as Asus’s mining board, and for the money I’d rather stick with Asus. If you know that you’ll definitely stick to a single PSU and a small handful of GPUs (e.g.: the majority of us), this is a fine choice, especially if you find a deal on it.

Finally, the Biostar TB250-BTC is also aimed at miners, and costs considerably less than the Asus and ASRock offerings. The Biostar board “only” supports 6 GPUs, but that’s likely all that the majority of us need. If price is your primary consideration, the TB250-BTC should be at the top of your list for 6 GPU rig builds.

If you only want to use 3-4 GPUs in your rig, then you’ll have a much easier time. Most boards with up to four PCIe slots should accommodate a GPU in each. Keep in mind that you can use old hardware that you have sitting around—the board doesn’t have to be recent. I dug out an old ASRock 970 Extreme4 that I used four years ago for litecoin mining, and it still works fine today for up to 4 GPUs (5 is possible with some work). So it’s possible to pick up an ancient board on eBay/Craigslist for nearly nothing and mine with less than 6 video cards.

CPU / Processor

This one is easy: buy the cheapest CPU that works with whatever motherboard you pick. When it comes to mining, the GPUs do all the work. Your CPU will essentially sit idle, so there is no reason to waste money on anything other than the bare minimum.

All of the motherboards that I recommended based on Intel’s LGA 1151 socket, so that means the Celeron G3900is probably the best choice.

If you go with an AMD motherboard, a Sempron CPU will do nicely.

Memory

4GB is fine. Overkill really, at least for Linux. If you have an old 2GB stick (or even 1GB!) sitting around and plan to run Linux, you’re good to go. If you want to run Windows, then 4GB is probably a realistic minimum.

While Ethereum mining is pretty memory-intensive, everything happens on the GPUs. System memory will be pretty much unused, so there is no reason to spend money here, especially with DDR4 prices so high.

PSU / Power Supply

The power supply is extremely important—don’t skimp on it! A good, efficient PSU will keep your electricity costs to a minimum and more than pay for itself over the long run. Seasonic, EVGA, and Corsair are all generally top brand choices. The 1200W unit that I’ve linked may seem like overkill, but power supplies are most efficient when they’re not running near their rated maximum load. A 6 GPU rig will draw about 750 watts (assuming 6x RX 570 cards, properly optimized), which means a 1200W PSU will have sufficient headroom to perform efficiently.

If you’re planning on running only 3-4 GPUs, you can save a bit of money and go for their 850 watt model instead.

GPUs / Video Cards

The top Ethereum mining choice is currently the Radeon RX 570 / RX 580 line*. The RX 570 delivers nearly the same performance as the RX 580 (within 4-7% or so) for a bit less power consumption—they’re essentially equal from an efficiency standpoint. The RX 570 is usually significantly cheaper than the 580, so generally the 570 is the best choice.

Which model to pick, though? While literally any RX 570/580 card will do, the most important thing to look for is memory speed if you want the best performance. Cards with a higher memory clock speed will generally perform a bit better while mining ETH (and can generally be overclocked more). Memory capacity isn’t really important beyond 4GB, so all other things being equal, there is no reason to shell out extra cash for the 8GB version of a card. It’s true that every GPU needs to be able to hold Ethereum’s DAG file in memory, and that file is slowly increasing in size—but it won’t surpass 4GB until late 2019 (and ETH’s switch to PoS will likely occur before then, anyway).

With all of that said, the 8GB versions of the cards tend to have faster-clocked memory than most of the 4GB cards, so if the price difference isn’t too large, spring for whatever is the fastest. Most of the cards fall between 1650 Mhz (6600 Mbps effective) to 2000 Mhz (8000 Mbps effective). The slower 1650 Mhz memory GPUs will hash at 21-23 Mh/s, and the fastest 2000 Mhz ones will do 25-28 Mh/s (both can potentially be pushed higher with BIOS mods and good luck).

The best advice is usually to just pick up whichever 570/580 card you can get your hands on for the least money, as mining speed differences between brands/models are pretty small after optimization. These 8GB MSI RX 570 cards are $220 each as of 11/29/2017, and I’m running mine at 28 Mh/sec without pushing them too hard.

If you can still find old RX 470/480 cards on the secondary market, they’re just as good the RX 570/580 cards that replaced them.

*While my guides deal with setting up and optimizing AMD’s GPUs, nVidia’s 1060 / 1070 video cards are also excellent for mining. Generally these days I tend to recommend whichever is cheaper (and right now, that’s AMD). But if you find a deal on some nVidia 1070 GPUs, don’t hesitate to grab them—they perform just as well as AMD’s offerings, and are arguably easier to set up (just remember to install nVidia drivers instead of AMD’s if you follow the rest of my guide!).

Boot Device

If you plan to run Linux, you can use pretty much anything, including a ~$5 16GB USB stick (we’ll be using Claymore miner, which doesn’t write Ethereum’s DAG file to disk, so we don’t need to worry about wearing a USB stick out due to constantly writing to it, like with the stock ethminer). With that said, SSDs are pretty cheap nowadays and it might be nice to have one in case you want to try Windows at some point.

If you plan to run Windows, then a cheap 60GB+ SSD is your best bet. If you have an old mechanical hard drive laying around, that’ll work fine too.

The Case

I highly recommend against trying to cram a bunch of GPUs into a conventional PC case. You have two realistic options here: buy a purpose-built mining frame, or build something yourself.

The first option is straightforward, if not a bit more expensive. Here is an example of an open-air frame that will accommodate up to 6 GPUs. Here’s another option. You’ll pay a premium going this route, but it’ll save you some time and effort.

Building your own is much cheaper, and (arguably) more fun! If you’re handy, you can put together a simple aluminium frame yourself for a fraction of the cost of buying one. If you don’t have the necessary skills or tools for that, I popularized building mining rigs inside plastic crates back in 2013, and that still works fine today (for up to 4 GPUs or so, anyway). At the bottom of this post, you’ll find instructions on how to build a plastic crate “case”.

Risers & Miscellaneous Stuff

If you’re building your own case (whether it’s from a plastic crate, or aluminium, or something else), you’ll need risers to connect your GPUs to your motherboard. If you’re buying a mining frame, most include risers. Risers tend to be pretty misunderstood among new miners, so here is what you need to know:

  1. Risers can be powered or unpowered. A riser is unpowered if it simply connects a GPU to a motherboard PCIe slot. A riser is powered if it additionally accepts power from the PSU (generally via a molex-type connector). Unpowered risers allow GPUs to receive up to 75 watts of power through the motherboard’s PCIe bus, just as if they were plugged in directly. Powered risers will take that additional power directly from the PSU instead, bypassing the motherboard.
  2. You may mix unpowered and powered risers, but the total number of unpowered risers should not exceed two (this includes GPUs plugged directly into the motherboard)! Motherboards are generally not designed to deliver more than 150 watts of total power through the PCIe bus, so two GPUs on unpowered risers is the safe maximum (2 x 75 watts).
  3. The newer USB-style powered risers often include SATA-to-molex power adapters. Throw these adapters away! SATA plugs are not designed to deliver 75 watts safely, and these can get hot enough to potentially be a fire risk (admittedly, 99% of the time you’ll be fine, but it’s not worth the risk). Instead, connect the molex plugs on the riser directly to your PSU (no more than two risers per PSU plug). Newer versions of these USB risers forego the molex adapter and instead use a PCIe connector for power.

The different PCIe riser types.

I do think the newer USB-style risers are the way to go—they’re longer and easier to work with than the old ribbon-style cables. Here is a 6-pack of USB risers with the newest (and safest) PCIe connectors. It’s always smart to buy an extra or two, as defects are relatively common. If you have older ribbon-type risers laying around, or can get them cheaply, they’ll work just fine.

If you’re building or buying a large frame, you might need extenders for some of your molex plugs and PCIe power plugs.

You’ll also need a power button, unless your motherboard has one built in (which is fairly rare). This will do the trick, or you can build one into your plastic crate if you plan to go that route (see below).

Some people have reported that their rigs won’t boot unless they have a monitor connected, although this seems to be fairly rare (my own rig boots fine without a display attached). If this happens to you, you’ll need a dummy plug.

Building your Mining Rig “Case” from plastic milk crates

(I’ve copied the instructions from my original 2013 guide here and updated them slightly.)

Here is what you’ll need to create a simple DIY plastic crate housing for your miner:

Plastic milk crate (can stack two and put your PSU in the lower one) $10 each
Plastic stand-offs $3
6 x #4 3/8″ wood or metal screws $1
Brace to rest GPUs on (1″ PVC pipe works great!) $2
a few cable ties (8″ or so) $2
power switch & LED (optional) $5

You can get plastic crates in most home improvement stores if you don’t want to ship it from Amazon (it’ll be cheaper, too!). I picked mine up at Lowe’s for under $5 each. You should be able to get everything else on the list at Lowe’s if you happen to have one near you, too. As far as tools go, you’ll need a drill and a knife capable of cutting into whatever plastic crate you buy.

 Assembly Steps:

First, attach your CPU & heatsink/fan to your motherboard, and place your RAM into the memory slot(s). Then follow the general steps below to mount everything into your plastic crate.

Click the images for a close-up look at each step.

  1. Step 1Place plastic standoffs on the bottom of your plastic crate, and rest your motherboard on top of them. Make sure that all of the essential ports are accessible (SATA, USB, keyboard, mouse, etc). Use your knife to cut away pieces of the crate if necessary so that all ports you plan to use are exposed. Then plug your riser cables into the PCI-E slots of your motherboard.
  2. Step 2Place your brace (1″ PVC pipe is really ideal and won’t flex over time) so that it is sitting above the motherboard, high enough for your GPUs to rest on. Cut the brace so that an inch or two sticks out on either end of the crate.
  3. Step 3Drill holes in your brace so that you can secure it with cable ties (see image). Do not simply rest the brace on the crate! An accidental bump can cause it to fall into the crate, along with ~$1000 worth of GPUs if you do that!
  4. Step 4Connect each GPU to it’s corresponding riser cable, resting the bracket end on the lip of the crate and the other end on your brace.
  5. Step 5Screw each GPU down into the lip of the crate. If you drill small pilot holes ahead of time (mark where to drill with a sharpie), this is much easier.
  6. Step 6If you have a power switch and LED, mount them into one of the crate’s corners. I was pretty sloppy with mine, but it’s functional.

 

You’re done! Simply connect everything to your power supply and you should be ready to power your rig on for the first time. If you have a second crate, you can put your power supply in there (along with your harddrive if you’re using Windows), and stack it under your main crate to save some space.

BUILD YOUR OWN ETHEREUM MINING RIG, PART 2: LINUX SETUP

In this second installment of our DIY Ethereum mining guide, we’ll look at how to install and configure Linux to setup your rig as an automated, remotely-manageable appliance. Don’t be dissuaded if you’ve never used Linux before—our step-by-step guide makes it simple!

Why Linux over Windows? First, it’s free—and saving ~$100 on the operating system is a big plus when you’re trying to maximize profitability. Other reasons include lesser hardware requirements (Linux is perfectly happy running from a USB stick plugged into ancient hardware!), simpler remote administration capabilities, and oftentimes better stability. The downside of running Linux is that video driver support isn’t on the same level as Windows, and things like GPU undervolting are trickier (but still possible via BIOS mods).

If you missed the hardware portion of our guide, make sure to check it out first. Otherwise, read on.

Build an Ethereum Mining Rig, part 2:  Linux Setup

The following is heavily adapted from my original 2013 Litecoin mining guide, updated for the latest Xubuntu LTS version, the new AMDGPU-PRO drivers, and necessary ethereum mining software (all up-to-date as of 11/29/2017). If you’re a bit nervous because you’ve a complete Linux newbie, don’t be. Simply follow the step-by-step instructions exactly as they’re written, and you’ll be fine. Even if you’ve never done anything like this before, you should be up and running in roughly an hour.

Step 1: Configure BIOS settings

Before we even get to Linux, let’s take a minute to make sure that your mining computer’s BIOS settings are in order. Power on your computer, and press the “delete” key a few times immediately after power on. You should end up in the BIOS configuration area. Do the following, then save & exit:

  • Change power options so that the computer automatically turns itself on whenever power is restored. The reason for this is two-fold: first, it’ll make sure that your miner automatically starts up after a power outage. Second, it makes powering the computer on much easier if you don’t happen to have a power switch connected to the motherboard.
  • Make sure that your USB stick is first in the boot-up order (you may need to have a USB stick attached).
  • Disable all components that you don’t plan to use. This may save a little bit of power, and since your miner will likely be running 24/7, it’ll add up. For me, that meant disabling onboard audio, one of the SATA controllers, the USB 3.0 ports (I only had a 2.0 USB stick), the Firewire port, and the serial port.
  • If you’re running a lot of GPUs (4+), additional tweaks might be necessary to ensure that they’re all recognized by the OS. Exact tweaks vary by motherboard, but setting the PCIe speed to Gen1 is usually a good place to start. No need to change anything now, but make a mental note that you may need to come back and play around a bit if all of your GPUs don’t show up in the OS later.

Step 2: Install Xubuntu Desktop on your miner

Xubuntu is a lightweight version of Ubuntu, a popular Linux distribution. Most other distros should work just fine, but be aware that the GPU drivers require the presence of Xorg, which means server distros that don’t have a GUI will not work properly.

  • Xubuntu 16.04.3 is the latest LTS release at the time of this guide, so that is what I recommend you use. You can download it here.
  • You’ll need to either write the installation ISO image to a USB stick (highly recommended), or burn it to a DVD. If you use a DVD, you’ll need to temporarily hook up a DVD drive to your mining rig for the installation (make sure you temporarily enable your SATA controller if you disabled it in step 1!).
  • Once you have the installation media prepared, you’re ready to install Xubuntu to your miner’s boot device (whether it’s an SSD, mechanical harddrive, or another blank USB stick). Boot using your new installation media (make sure it’s first in your miner’s BIOS boot order list). The Xubuntu installer should appear.
  • Follow the prompts, and make sure to click the “auto-login” box on the last step of the installer (otherwise, all of the default options are fine).
  • When the installation is complete, you should automatically boot into the Xubuntu desktop. Make sure to remove your installation media.

Step 3: Install SSH and package updates

At the Xubuntu desktop, press CTRL+ALT+T to open a terminal window.

  • Install SSH by typing:
    sudo apt-get install openssh-server

With SSH installed, you can unplug the keyboard/mouse/monitor from your miner, and complete the rest of the installation from your desktop computer. Simply download Putty onto your desktop, run it, and enter the IP address of your mining rig (type ifconfig at the Xubuntu terminal to find your miner’s address if you don’t know it—it will probably look like 192.168.0.x). That should bring up a remote terminal session to your miner, which is more or less just like sitting at the keyboard in front of it.

If you plan to manage your mining rig remotely over the internet, you’ll need to forward port 22 on your router to your miner. Make sure that you use a strong Xubuntu password!

Setup should be pretty quick from this point, as now you can simply copy text from this webpage (highlight it and press CTRL+C) and then paste it into your Putty session by simply right-clicking anywhere inside the Putty window. I highly recommend that you complete the remainder of the guide in this manner, as it eliminates the risk of typos!

  • Install package updates by typing (or copying & pasting via right-click into Putty) the following command:
    sudo apt-get dist-upgrade

Step 4: Install AMDGPU-PRO drivers

Next up, we’ll install AMD’s video drivers. AMD has special blockchain compute drivers available for mining that give far superior performance compared to their standard drivers, so that’s what we’ll be using (version 17.40, which is the latest as of 11/29/2017).

  • Type the following commands (press “enter” and wait for the operation to complete at the end of each line):
    cd ~/Downloads
    wget --referer=http://support.amd.com https://www2.ati.com/drivers/linux/beta/ubuntu/amdgpu-pro-17.40-483984.tar.xz
    tar -Jxvf amdgpu-pro-17.40-483984.tar.xz
    cd amdgpu-pro-17.40-483984
    ./amdgpu-pro-install -y
  • Some of these steps may take a minute or two to complete. When the installation is complete, type the following:
    sudo usermod -a -G video $LOGNAME
  • Next we need to install and configure the ROCm component:
    sudo apt install -y rocm-amdgpu-pro
    echo 'export LLVM_BIN=/opt/amdgpu-pro/bin' | sudo tee /etc/profile.d/amdgpu-pro.sh
  • Finally we need to enable large page support, which will dramatically improve mining performance. Type the following to open your grub file in nano for editing:
    sudo nano /etc/default/grub
  • Find the line that reads GRUB_CMDLINE_LINUX_DEFAULT=”quiet splash”. Modify it to:
    GRUB_CMDLINE_LINUX_DEFAULT="quiet splash amdgpu.vm_fragment_size=9"
  • Save the file and quit nano by pressing CTRL+X and then answering (Y)es to save the changes. When you’re finished, update grub and reboot:
    sudo update-grub
    sudo reboot

The final command will reboot your rig, which will cause you to immediately lose your SSH (Putty) connection. Wait a few seconds to give the computer a chance to boot, and then re-establish a new connection via Putty, and re-login.

Step 5: Install Ethereum software

(Note: you may skip step 5 entirely if you already have an ethereum wallet address that you intend to use!)

Next up, we’ll install the Ethereum software that will let us create a new wallet address. We’ll need this to store the coins we receive from mining.

  • Type the following to install the necessary ethereum packages:
    sudo add-apt-repository ppa:ethereum/ethereum
    sudo apt-get update
    sudo apt-get install ethereum geth
    
  • Now it’s time to create your Ethereum wallet address:
    geth account new

You’ll be prompted to enter a password, and then to confirm it (use a strong password!). The output will be a long string between two curly braces { }. That’s your new wallet address—make a note of it (highlight it within Putty to copy it to your clipboard).

Important: The combination of the password you just used to create this address *and* the associated encrypted key file is what gives you control over your new wallet address. If you lose either of these, you’ve also lost control of your wallet and all of the coins associated with it—and there is literally nothing that anyone will be able to do to help you. Remember your password, and keep multiple backups of your key file(s)!

Your key file(s) are stored in the ~/.ethereum/keystore directory. Copy the entire /keystore folder someplace safe to backup your wallet (backups are covered in more detail heredon’t forget to make multiple backups and keep them in a secure offline location!).

If you forget your wallet address, you can type geth account list to see your addresses and the location of their key files.

Step 6: Install Claymore’s Ethereum miner

There are several options as far as mining software, and I’ve experimented with all of the popular ones. I think Claymore’s miner is the best option, even if it does have two fairly significant downsides: it’s closed-source, and it’s not free (~1% of your mining time benefits the creator of the miner).

Two alternatives are the stock ethereum miner (ethminer) and Genoil’s fork of the stock miner. They’re both open-source and free, but they have pretty crippling downsides.

The stock ethminer is much slower than Claymore’s miner (by a margin of over 5% on my test rig). In addition, ethminer creates the Ethereum DAG file on disk instead of in GPU memory, which is slow and uses a lot of space (and if you’re running off a USB stick, all those writes may eventually wear it out).

Genoil’s fork seems to be nearly as fast as Claymore’s, and it doesn’t use physical disk space for the DAG, but it’s not stable (at least not for me). It often crashes, especially on startup (whereas I have yet to see a single crash on Claymore’s miner after nearly a week of full-time mining). The author abandoned development months ago, so improvements are unlikely.

So, explanation aside, here is how to setup Claymore’s miner:

  • First return to your downloads directory and grab the latest version (10.2 as of 11/29/2017). I’m pulling the file directly from the author’s Google Drive repository, if the link is broken check here for a newer release or updated link):
    cd ~/Downloads
    sudo apt install curl
    curl -L -o claymore_10.2_miner.tar.gz https://drive.google.com/uc?id=1t25SK0lk2osr32GH623rR8aG2_qvZds9
    
  • Then create a new directory for it, and unpack it there:
    sudo mkdir /usr/local/claymore10.2
    sudo tar -xvf claymore_10.2_miner.tar.gz -C /usr/local/claymore10.2
    
  • Then let’s head over to the installation directory and create a startup script. Note that commands 2-5 below just clean up the installation directory a bit by removing an intermediary directory that was included in the original tar archive:
    cd /usr/local/claymore10.2
    cd Clay*
    sudo mv * /usr/local/claymore10.2
    cd ..
    sudo rm -r Clay*
    sudo chown root:root ethdcrminer64
    sudo chmod 755 ethdcrminer64
    sudo chmod u+s ethdcrminer64
    sudo nano mine.sh
    
  • Nano will open a new blank text file; enter the following into it:
    #!/bin/sh
    export GPU_MAX_ALLOC_PERCENT=100
    ./ethdcrminer64 -epool eth-us-east1.nanopool.org:9999 -ewal YOUR_WALLET_ADDRESS/Miner01 -epsw x -mode 1 -allpools 1 -tt 68
    

    Where it says YOUR_WALLET_ADDRESS, use the address you created in step 5 (you’ll need to put “0x” in front of it). The “Miner01” following your address can be changed to any friendly label that you want to give your miner (only important if you plan to run multiple rigs). It’s easiest to copy the last line from my guide into something like notepad, then replace YOUR_WALLET_ADDRESS with your actual address there, and then copy the finished line into putty via right-click to get everything into nano without typos.

  • Save the file and quit nano by pressing CTRL+X and then answering (Y)es to save the changes, then enter the following to give your new script execute permission:
    sudo chmod +x mine.sh

Note that I’m using nanopool.org as the mining pool here. I’ve tried a few, and it seems to be a top pick, but feel free to pick your own pool. Most don’t require registration, and simply payout to whatever wallet address you supply whenever a certain threshold is met (usually whenever you accumulate 1+ ETH). Assuming you stick with Nanopool, you’ll be able to check on your miner’s status by going to this URL after you start mining: https://eth.nanopool.org/account/%5BYOUR WALLET ADDRESS]

  • Now is a good time to test things. You can fire up your miner by typing:
    ./mine.sh

You should see the Claymore miner start up. It’ll take a minute or two before it actually starts mining, but it should get there eventually. When you see a scrolling log of outputs that includes non-zero hashrates (expect hashrates in the low to mid 20s for unoptimized GPUs), you’re good to go. If the script fails to start, or you see errors, make sure that you’ve created the script exactly as outlined in the guide.

Press CTRL+C to exit the miner when you’re satisfied that it’s working.

Step 7: Create auto-start scripts

We’re almost done! We want to set up our rigs automatically start mining whenever the rig is powered on. That way, we keep mining losses to a minimum whenever a power outage occurs, and we don’t have to worry about manually starting it back up in other situations.

  • First, install screen:
    sudo apt install screen
  • Then type the following to create a new script in your home directory and open it in nano:
    cd ~
    sudo nano miner_launcher.sh
  • Enter the following text into the editor (substitute your actual Xubuntu username for YOUR_XUBUNTU_USERNAME where necessary!):
    #!/bin/bash
    DEFAULT_DELAY=0
    if [ "x$1" = "x" -o "x$1" = "xnone" ]; then
       DELAY=$DEFAULT_DELAY
    else
       DELAY=$1
    fi
    sleep $DELAY
    cd /usr/local/claymore10.2
    su YOUR_XUBUNTU_USERNAME -c "screen -dmS ethm ./mine.sh"
  • Save and quit nano (CTRL+X), and then type:
    sudo chmod +x miner_launcher.sh
  • Now we need to call our new script during startup; we do that by adding it to /etc/rc.local. Type the following to open /etc/rc.local in nano:
    sudo nano /etc/rc.local
  • Add the following text, right above the line that reads “exit 0” (substitute your own username!):
    /home/YOUR_XUBUNTU_USERNAME/miner_launcher.sh 15 &

Then save and quit out of nano (CTRL+X).

Step 8: Create an alias to easily check on the Claymore miner process

We’re essentially done at this point, but you’ll probably want to manually SSH into your miner from time to time to manually check on your hashrates & GPU temperatures, etc. Creating an alias will make that easy.

  • Type:
    sudo nano .bashrc
  • Scroll to the end of the file, and then add this text above the line that reads “# enable programmable completion…”
    alias miner='screen -x ethm'
  • Save and quit out of nano.

That’s it—you’re done! You’ll probably want to run a full test now. The easiest way to do that is to close your Putty session and power down your miner. Turn it back on and the following should happen:

  1. Your miner should boot into Xubuntu. This may take up to a minute, depending on the speed of your boot device (it’ll be much faster on an SSD).
  2. 15 seconds after Xubuntu has loaded, the Claymore miner will automatically start and begin mining. You might notice the fans on your GPUs spin up a bit when this happens.
  3. You should be able to SSH into your miner at any time and type miner to monitor the miner’s process. To close the screen (but keep the miner running), press CTRL+A, then CTRL+D.
  4. If you ever need to start the Claymore miner manually (because you quit out of it, or kill it, etc), simply type ~/miner_launcher.sh

(update 1/15/2018: **IMPORTANT** please read this if your hashrate is lower than expected!)

Congratulations—you have your own headless linux ethereum miner!

The next section of this guide covers setup under Windows, and then we’ll take a look at optimizing miner settings for better performance.

BUILD YOUR OWN ETHEREUM MINING RIG, PART 3: WINDOWS SETUP

Ethereum & WindowsNo doubt some of you saw the Ethereum mining guide for Linux that I published last week and balked at all of that “command-line nonsense”. Linux isn’t everyone’s thing, and that’s ok—if Windows is your OS of choice, then this guide is for you!

While Linux offers some significant advantages when it comes to GPU mining, Windows does have one potentially important edge: undervolting your GPUs currently requires quite a bit less effort under Windows. If you want your mining rig to run at its maximum efficiency, you’ll want to keep power consumption to a minimum, and with Linux that generally requires flashing a custom BIOS to each GPU—whereas in Windows you can usually accomplish this at the driver level with a simple software setting.

The bad news is that if you want maximum performance out of your rig, you’ll probably eventually want to flash your GPU BIOS under either operating system, but we’ll get into that in part 4 of this guide. But if you already know that overwriting your GPU BIOS with a custom replacement is outside of your comfort zone, then sticking with Windows will at least allow you to undervolt.

So with all of that in mind, if Windows sounds like the best option for you, read on for our setup guide!

Build an Ethereum Mining Rig, part 3: Windows Setup

I won’t go into quite the same excruciating level of detail as I did with my Linux guide, as it’s probably a safe assumption that anyone reading a guide about building a custom cryptocurrency mining rig is already quite comfortable with basic Windows tasks. The steps outlined below should be more than adequate for the average Windows user, but feel free to leave comments if anything is unclear!

Step 1: Configure BIOS Settings

Before we even get to Windows, make sure your mining computer’s BIOS settings are in order. Power on your computer, and press the “delete” key a few times immediately after power on. You should end up in the BIOS configuration area. Do the following, then save & exit:

  • Change power options so that the computer automatically turns itself on whenever power is restored. The reason for this is two-fold: first, it’ll make sure that your miner automatically starts up after a power outage. Second, it makes powering the computer on much easier if you don’t happen to have a power switch connected to the motherboard.
  • Disable all components that you don’t plan to use. This might save a little bit of power, and since your miner will likely be running 24/7, it’ll add up. For me, that meant disabling onboard audio, the USB 3.0 ports, one of the SATA controllers, the Firewire port, and the serial port.
  • If you’re running a lot of GPUs (4+), additional tweaks might be necessary to ensure that they’re all recognized by the OS. Exact tweaks vary by motherboard, but setting the PCIe speed to Gen1 is usually a good place to start. No need to change anything now, but make a mental note that you may need to come back and play around a bit if all of your GPUs don’t show up in the OS later.

Step 2: Install Windows 10

Any 64-bit edition of Windows 10 should work fine (a 32-bit OS is not capable of running the Ethereum mining software). Windows 7 and 8 will work as well (as long as they’re 64-bit versions), although you may need to do a bit of extra work to recognize all of your GPUs if you’re running more than 4. The guide is written assuming that you have Windows 10, but the steps for 7/8 should be pretty similar.

I’m going to assume that everyone reading this is capable of installing a fresh copy of Windows. Complete the installation and boot into the Windows desktop before proceeding to the next step. If necessary, also install the LAN/Ethernet driver that came with your motherboard so that you can get online.

Step 3: Configure automatic login

If you’re building a dedicated mining rig, then you probably want your mining rig to boot up and start mining automatically, without any user intervention. We’ll need to enable auto-login for that to be possible.

  • Right-click on the Start Menu and select “Run”. Type “netplwiz” (without the quotes) at the prompt, and click “ok”.
  • Uncheck the box that says “Users must enter a user name and password to use this computer”.
  • Click “Apply”. You’ll be prompted to enter your password to confirm the change.

Step 4: Change power settings to prevent sleep

By default, Windows will go to sleep after 30 minutes without user interaction. Obviously, we don’t want that behavior on our mining rigs. To disable it:

  • Right-click the Start Menu -> Control Panel -> System & Security -> Power Options.
  • “Balanced” should be selected. Click on “Change plan settings” next to it.
  • Change “Put the computer to sleep” to “Never”, then click “Save changes”.

Step 5: Minimize unscheduled reboots due to Windows Updates

Windows 10 introduced forced updates as a pretty controversial “feature”, and not having control over when your mining rig is rebooted to install OS patches could be frustrating. We’ll be setting things up so that your mining rig automatically begins mining any time Windows boots, so leaving automatic updates in place certainly wouldn’t be disastrous if you want to skip this section. But if you’d prefer to retain control over downtime, here are some workarounds:

Keep in mind that if this is a fresh install of Windows, it’s a good idea to let the OS install any available updates first (right-click start -> settings -> windows update -> check for updates).

Step 6: Allocate at least 16GB of virtual memory

The author of the mining software that we’ll be using recommends this step, although I’ve never encountered issues with a smaller pagefile (edit 4/19/17: I tried mining on a machine with only 4GB of physical RAM and got terrible performance until I increased my pagefile to 16GB). Here’s what you need to do:

  • Right-click the Start Menu -> System -> click “change settings” on the right side of the window (if you don’t see “change settings”, click “system info” first)
  • Click on the “Advanced” tab, then in the “Performance” area, click “Settings”
  • Click the “Advanced” tab, then click “Change” in the area labeled “Virtual Memory”
  • Uncheck the box at the top that says “Automatically manage paging file size for all drives”, then click on the “Custom Size” radio button.
  • Enter “16384” (without the quotes) in both the Initial and Maximum size fields, then click “Set”. You’ll need to reboot for the change to take effect.

Step 7: Disable unnecessary Windows visual effects

On systems with borderline hardware, this may increase performance a bit and help keep the OS a bit more responsive during mining:

  • Right-click the Start Menu -> System -> click “change settings” on the right side of the window (if you don’t see “change settings”, click “system info” first)
  • Click on the “Advanced” tab, then in the “Performance” area, click “Settings”
  • On the “Visual Effects” tab (which should be open by default), click on the radio button labeled “Adjust for best performance”, then click “Apply”

Step 8: Install AMD GPU drivers

AMD offers special mining-specific “blockchain compute” drivers that deliver considerably more performance than their standard drivers, so that’s what we’ll be using. If the computer that you’re installing to will not be a dedicated mining rig (eg: you plan to also play games on it, etc), you may prefer to use the latest available standard driver.

It’s ok to simply pick all of the default options during installation. Skip including ReLive when asked, as we don’t need it.

Reboot after the driver installation is complete.

Step 9: Generate a wallet address

You can skip this section if you already have an Ethereum wallet address. Otherwise, you’ll need to create one to mine with. There are many ways to generate your own wallet address, but I’ll show you how to do it using the official open-source Ethereum software. Be wary about trusting other methods, as some online creation tools are potentially scams designed to later steal your coins.

  • Download the latest release of Geth for Windows here.
  • When the download is finished, run the installer and select all of the default options.
  • Open a command prompt window (right-click the Start Menu -> Command Prompt).
  • Type the following to switch to the Geth installation directory (assuming you installed it in the default location):
    cd \Program Files\Geth
  • Type the following to create a new wallet address:
    geth account new

If you see a warning about starting the Ledger hub here, you can ignore it. You’ll be prompted to enter a password, and then to confirm it (use a strong password that you won’t forget!). The output will be a long string between two curly braces { }. That’s your new wallet address—make a note of it. You can easily copy it by right-clicking anywhere in the command prompt window, selecting “Mark”, highlighting your new address by holding left-click and dragging the mouse over the entire address, and then right-clicking again to copy to your clipboard. From there, you can paste your address anywhere using standard Windows shortcuts (CTRL+V).

Important: The combination of the password you just used to create this address *and* the associated encrypted key file is what gives you control over your new wallet address. If you lose either of these, you’ve also lost control of your wallet and all of the coins associated with it—and there is literally nothing that anyone will be able to do to help you. Remember your password, and keep multiple backups of your key file(s)!

Your key file(s) are stored in the %APPDATA%\Ethereum directory. For a fresh Windows 10 install, that means the C:\Users\[YOUR WINDOWS USERNAME]\AppData\Roaming\Ethereum\keystore folder (note that the AppData folder is hidden by default). Copy the entire keystore folder someplace safe to backup your wallet.

If you ever forget your wallet address, you can open a command prompt, return to your Geth installation folder, and type geth account list to see your addresses and the location of their key files.

Step 10: Install Claymore’s Ethereum miner

I talked about my reasons for selecting Claymore’s miner over other alternatives in my Linux guide, but to sum up: it’s currently the fastest, most stable Ethereum miner that’s still under active development. The downside is that it’s not free—about 1% of your mining time will benefit the creator of the software instead of you. However, even after the usage fee, you’ll come out ahead compared to the alternatives.

  • Download the latest version of Claymore’s ETH miner (v10.2 at the time of this post). Make sure to get the .zip file and not the Linux tar (also check here for newer releases)!
  • Extract the downloaded archive into a folder on your mining computer.
  • Open the folder where you extracted the miner, and create a new text file called “mine.bat” (you can use notepad for this).
  • Enter the following text into your mine.bat file exactly as written (but do make sure to substitute your own wallet address—see note below):
    timeout /t 15
    setx GPU_FORCE_64BIT_PTR 0
    setx GPU_MAX_HEAP_SIZE 100
    setx GPU_USE_SYNC_OBJECTS 1
    setx GPU_MAX_ALLOC_PERCENT 100
    setx GPU_SINGLE_ALLOC_PERCENT 100
    ethdcrminer64.exe -epool eth-us-east1.nanopool.org:9999 -ewal YOUR_WALLET_ADDRESS/Miner01 -epsw x -mode 1 -allpools 1

    pause

Where it says YOUR_WALLET_ADDRESS, use the address you created in step 9 (you’ll need to put “0x” in front of it). The “Miner01” following your address can be changed to any friendly label that you want to give your miner (only important if you plan to run multiple rigs).

Note that I’m using nanopool.org as the mining pool here. It’s a fairly typical ETH pool that seems to have good reliability, but feel free to pick your own pool. Most don’t require registration, and simply payout to whatever wallet address you supply whenever a certain threshold is met (usually whenever you accumulate 1+ ETH). Assuming you stick with Nanopool, you’ll be able to check on your miner’s status by going to this URL after you start mining: https://eth.nanopool.org/account/%5BYOUR WALLET ADDRESS]

Save and close notepad when you’re done.

Now is a good time to perform a quick test. Simply double-click your mine.bat file to launch the miner. It’ll take a minute or two before it actually starts mining, but it should get there eventually. When you see a scrolling log of outputs that includes non-zero hashrates (expect hashrates in the low to mid 20s for unoptimized GPUs), you’re good to go. If the script fails to start, or you see errors, make sure that you’ve created the script exactly as outlined in the guide.

Press CTRL+C to exit the miner when you’re satisfied that it’s working.

Step 11: Configure your miner to start automatically

We want our rig to automatically start mining whenever it’s powered on or rebooted. That way, we keep mining losses to a minimum whenever a power outage occurs, and we don’t have to worry about manually starting it back up in other situations.

  • Open Windows Explorer and navigate to the folder where you created “mine.bat” in the previous step.
  • Right-click on your mine.bat file, and pick “Copy”.
  • Now, navigate to %AppData%\Microsoft\Windows\Start Menu\Programs\Startup (should be something like C:\Users\[YOUR WINDOWS USERNAME]\AppData\Roaming\Microsoft\Windows\Start Menu\Programs\Startup).
  • Right-click anywhere on the empty background of the Startup folder and select “Paste shortcut”.

You should see a shortcut to your mine.bat file appear in the startup folder. Windows should automatically execute it upon bootup.

At this point, we’re done with the essentials. If you’ve done everything correctly, you should be able to reboot and watch your rig automatically start mining shortly after the Windows desktop loads. There are a couple more steps that may be important to you, though.

Step 12 (optional): Optimize clock speeds and undervolt (basic)

We’ll get into more advanced optimization in the next section of this guide, but as long as we’re on Windows, it doesn’t hurt to see what we can accomplish via some basic driver setting adjustments. We should be able to squeeze out some extra performance on most RX 470/480 cards and save a bit of power without venturing into the realm of BIOS mods.

  • Open the Radeon Settings app. There should be an icon for it in your system tray. If not, it’s located here: C:\Program Files\AMD\CNext\CNext\RadeonSettings.exe
  • Click on the “Gaming” tab at the top left.
  • Click on the “Add” button near the top right, then click “Browse”.
  • Navigate to the folder where you installed Claymore’s miner, select “EthDcrMiner64.exe”, and then click “Open”.
  • You should see a new profile appear on the Radeon Settings App window labeled “EthDcrMiner64”. Go ahead and click it.
  • Click on the “Profile OverDrive” tab.

AMD's WattMan

You should see something that looks like the image on the left (click for full-size). I’ve cropped in on the two areas that we’re interested in (they’re labeled “GPU” and “Memory”). Find them and start by setting the Frequency to “Dynamic” and the Voltage Control to “Manual” in both areas.

Before we go any further, I’ll just throw out this disclaimer: changing the factory voltage settings on your GPU can result in system instability, crashes, and/or damage. Proceed at your own risk! Honestly, the risk here is tiny—we’re still constrained to basically safe values by AMD’s software, and in the case of a crash we’ll just reboot and be back to factory settings (where we can try again with less-aggressive values).

We’re aiming to accomplish three things here:

  1. We want to lower the core clock speed as low as possible without impacting performance.
  2. We want to increase the memory clock speed as high as possible without impacting stability.
  3. We want to lower both the core and memory voltage as low as possible without impacting stability.

Before we go changing any values, if you haven’t run your miner at stock settings already for a few minutes to get a decent idea of its baseline performance, now is a good time to do that. Look for output along the lines of “ETH: GPU0 XX.XXX Mh/s” while Claymore’s miner is running. There will be some variance from line to line, but that XX.XXX number is the hash rate for that individual GPU. When you have a good idea of your average hash rate, close the miner—it’s time to start making some changes!

  • Start by decreasing your core clock speed to 1000 mhz from whatever the factory setting was (in the “GPU” area, change the values for state 6 and 7 to 1000 on the Frequency row). Click “Apply” (at the top right). Restart your miner and see how performance looks. There is a good chance that it’s unchanged. If that’s the case, repeat the process, but decrease the core clock speed by another 50 mhz or so. Keep moving down in 50 mhz increments until you notice mining performance drop. When that happens, bump the core clock back up to the previous value—that’s the sweet spot.
  • We’re going to basically do the reverse with the memory clock speed, but there are some important things to know. If you have a GPU that is factory-clocked at 1750 mhz or less (virtually every 4GB RX 470/480 GPU, and most RX 470 8GB GPUs as well—the Sapphire Nitro being the notable exception—then 1750 mhz is going to probably be your limit via this method. Increasing the memory clock beyond 1750 mhz will likely result in a change to less-aggressive memory timings that will result in a loss of performance, and there is no way to prevent this outside of BIOS modifications. So if you have a card clocked at under 1750 mhz, bump it up to exactly 1750 mhz, which will give you a decent performance boost. If you have a 2000 mhz card, you can increase it incrementally, like the reverse of what we did with the core clock. Eventually you’ll experience system instability: artifacts on the screen, a GPU crash, bluescreen, etc. When that happens, back down a bit until things are stable.
  • When you’re satisfied that you’ve found the sweet spot for both clock speeds, it’s time to lower voltages. This is pretty straightforward: drop values 25 mV at a time until you experience instability, then bump it back up to last stable value. You should be able to reduce your power consumption a fair bit this way without impacting performance at all (these are great if you want to measure your electricity usage at the wall).

While more significant performance gains are possible by flashing a custom GPU BIOS (which I’ll cover in the next part of this guide), you should at least be able to realize some significant power savings (which has the added benefit of lowering GPU temperatures as well).

The screenshot in this section is from a factory-clocked 1650 mhz 4GB RX 470 GPU. Feel free to use the settings pictured as your starting point if you have a 4GB GPU, I haven’t found any cards that aren’t stable at these settings yet; most go a bit lower on the voltages.

 Step 13 (optional): Configure remote administration

Configuring remote administration will allow you to disconnect the monitor, keyboard, and mouse from your mining rig and manage it from another computer—even over the internet, if you wish. Windows 10 Professional and up have the built-in option to use Remote Desktop, although it’s disabled by default and must be configured. It’s a fine option if you’re looking for something basic and don’t want to install additional software.

There are a host of other options available, if you’re on a Home edition of Windows and/or want something a bit more robust. I recommend TightVNC: it’s lightweight, simple, cross-platform, and free. Here are the basic setup instructions for TightVNC:

  • Download TightVNC.
  • Install TightVNC on your mining rig. Choose a custom installation and make only the server portion of the application available.
  • Now install TightVNC on the other computer(s) that you plan to manage your rig with. Choose a custom installation and make only the client portion of the application available.
  • If you plan to manage your miner across the internet, forward port 5900 on your router to your mining rig (make sure you choose a strong password if you do this!).

That’s it—you’re done! You’ll probably want to test everything now. The easiest way to do that is to power down your miner. Turn it back on and the following should happen:

  1. Windows should boot up as usual.
  2. You should see a 15 second countdown to the Claymore miner’s launch shortly after the Windows desktop appears.
  3. After the countdown, the miner will start, and your GPUs should start mining.
  4. You should be able to VNC into your rig at any point after the desktop loads to monitor your miner’s progress and GPU temperatures.
  5. If you ever need to start the Claymore miner manually (because you quit out of it, or it crashed, etc), simply double-click your mine.bat file, located in your Claymore miner installation folder.

Congratulations—you have your own headless windows Ethereum miner!

The screenshot above shows a single 4GB RX 470 mining at the settings pictured in section 12. I was able to get about a 10% performance gain over factory settings while reducing power consumption at the same time. That’s good, but we can do better (sometimes much better!) if we’re willing to venture into the world of GPU BIOS mods—and I’ll show you how to do exactly that in the next section of my guide.

BUILD YOUR OWN ETHEREUM MINING RIG, PART 4: OPTIMIZATION

This fourth installment of our Ethereum mining guide will focus on optimizing your rig’s performance via GPU clock speed and voltage setting tweaks to achieve maximum efficiency.

The tweaks that I outline in this article are applicable whether you’re using Linux or Windows. If you’re using the hardware that was recommended in the first part of this guide (or very similar hardware), you should expect to achieve Ether mining performance gains of 20-25%, compared to stock settings! At the same time, you’ll reduce power consumption by 10-15% (and consequently, lower GPU temperature and fan noise).

More speed for less power—how is that possible? Click “read more” to find out, in our mining performance optimization guide!

 Build an Ethereum Mining Rig, part 4: Optimization

Let’s get the bad news out of the way up front: achieving these levels of performance gain require flashing your GPU BIOS with custom replacements. Doing this incorrectly may leave you with a non-working GPU that can be difficult or (sometimes) impossible to restore to factory settings. The steps that I outline in my guide will show you how to minimize the risk that you end up with a bricked GPU, but always remember that messing around with BIOS settings can potentially result in unstable hardware.

Disclaimer: Installing a custom BIOS and/or changing factory clock speed & voltage settings on your graphics card(s) may cause system instability, may harm your hardware, and probably invalidates your warranty. I assume no responsibility for hardware damage if you choose to follow this guide!

With that said, I’ve flashed probably close to a hundred GPUs, and I haven’t destroyed any hardware yet. =) If you proceed, just make sure to follow the steps in order, don’t take any shortcuts, and stop if there is anything that you’re confused or unsure about.

What you’ll need

There are ways to create and flash custom BIOS mods to your GPUs without some of these things, but I believe this method is by far the most user-friendly:

  • A computer running Windows
    You’ll flash your GPUs with this computer. My mining rigs run Linux, but I keep a small/cheap SSD loaded with Windows 10 handy for testing/BIOS flashing purposes (I simply swap the SATA connector between disks when I want to switch OSes). Any version of Windows 7, 8, or 10 will work fine (note that you don’t have to activate Windows to install it). Or, you can simply temporarily move your GPUs to another computer running Windows to flash them.
  • ATIFlash / ATIWinFlash
    You can download the latest version of ATIFlash here (v2.74 at the time of this article). We’ll use this to read and write BIOS files to our GPU hardware.
  • Polaris BIOS editor
    You can download the latest version of Polaris BIOS editor here (v1.4.1 at the time of this article). We’ll use this to modify BIOS files.
  • ATI Pixel Clock Patcher
    You can download the latest version of ATI Pixel Clock Patcher here (v1.4.5 at the time of this article). We’ll need this to get AMD’s Windows driver to recognize a modded BIOS.
  • Kill-a-Watt electricity usage monitor (or similar device)
    Not strictly required, but I highly recommend this—it’ll pay for itself! I have two of these and consider them invaluable in dialing in the performance of my mining rigs. When doing optimization tests, I often find that the last few percentage points of speed gain come at a much larger cost in power consumption (and thus, a decrease in overall profitability)—having an electricity monitor allows me to find the efficiency sweet spot between raw speed and electricity usage.
  • Some baseline information on each of your GPU’s factory performance to compare your modifications against. If you haven’t already, let each GPU run for 5+ of mining and record its speed, temperature/fan speed, and power consumption at the wall (assuming you have a Kill-a-Watt). This will be immensely useful later when trying to figure out if your mods are beneficial or not.

From this point on, I’m going to assume that you’re following directions on a Windows computer with the above software available, ideally with a Kill-a-Watt connected for testing. I’m also going to assume that you have a single GPU installed. If you have multiple GPUs, I highly recommend that you disconnect all but one, and work on them one at a time. All of the software does support multiple GPUs, but you’ll keep confusion and the potential for mistakes to a minimum by only connecting one video card at a time. The times that I’ve made mistakes with BIOS flashing, it has always been because I flashed the wrong card due to having multiple GPUs connected!

Step 1: Make a backup of your factory GPU BIOS

Saving your GPU BIOS with ATIWinFlashBefore we start, open your Radeon Settings and disable any overclocking/undervolting that you have set up through WattMan (if you followed my Windows setup guide, you’ll need to temporarily disable the “EthDcrMiner64” profile that you created in step 12). After that:

  • Open ATIWinFlash (extract the .zip file you downloaded and double-click ATIWinflash.exe).
  • You should see your GPU detected at the top under “System Video Devices”. Again, I highly recommend that you have only a single GPU connected for this entire process!
  • Click “Save” to make a backup of your GPU’s BIOS data. Don’t lose this file!

Your computer might appear to freeze for a few seconds while your GPU BIOS data is being saved—this is normal. When ATIWinFlash is done, you can close it for now.

Step 2: Open your GPU’s factory BIOS with Polaris BIOS editor

Here is where we’re going to be making all of our modifications. Editing the BIOS data gives us access to a few values that we normally wouldn’t have any control over—most importantly, the memory timing values.

  • Open Polaris BIOS Editor (extract the .zip file you downloaded and double-click PolarisBiosEditor.exe).
  • Click “OPEN BIOS” in the top left, then browse to where you saved your GPU’s factory BIOS in step 1, and double-click it to open it.

You should see something like the image below (click for full-size). I’ve highlighted the areas that we’ll be modifying in blue—if you stick to these areas, you’ll generally be safe from getting yourself into too much trouble, as the GPU doesn’t enter these states until it’s mining or otherwise working hard. Note that the first entries in the “GPU” and “Memory” section are outside of the blue area and should never be touched unless you absolutely know what you’re doing. Likewise, the memory timings at 1500mhz and below should usually be left at default settings.

Factory BIOS in Polaris BIOS editor
My screenshot shows the default BIOS from an Asus 1650mhz factory-clocked RX 470 4GB GPU. If you have a 4GB RX 470, it should look pretty similar, although many of the values will likely differ by a small amount. At these factory settings, I get around 20 Mh/s in Claymore’s Ethereum miner, which isn’t spectacular.

If you don’t see memory timing values for your card, try this version of Polaris instead (click the “clone or download” button, then “Download ZIP”).

When you’re comfortable, let’s move on and start modifying some values.

Step 3: Modify BIOS memory timing values

At this point, you should still have Polaris BIOS editor open, with your GPU’s factory default BIOS loaded. We’re going to focus on the lower-right corner area containing memory timings.

If you have a RX 470/480 that has memory clocked at 1750mhz or less (eg: most 4GB cards), you may have noticed that it’s really easy to overclock past 1750mhz via the driver (in Windows, anyway). You probably also noticed that mining performance immediately tanks as soon as you do so: a 1751mhz overclock results in much slower performance than 1750mhz. You may have wondered why, and these memory timings are the answer. On most 4GB cards, the GPU switches over to less aggressive memory timings at clock speeds beyond 1750mhz, which results in slower performance even though the absolute clock speed is higher. We’re aiming to fix that.

This isn’t an exact science, and some experimentation may be necessary for you to achieve optimal results, but what follows is a good starting point and should work for 99% of you:

  • If you have a RX 470/480 that is factory clocked at 1750Mhz or less (eg: nearly all 4GB cards):
    Copy the value in the 1500Mhz field, and then paste it into all of the fields after it (1625mhz, 1750mhz, 2000mhz). The easiest way to do this is to click anywhere inside the 1500mhz value, then press CTRL+A to highlight the entire string, and then press CTRL+C to copy it. Then you can simply click into the remaining fields and press CTRL+A followed by CTRL+V to paste over the existing value.
  • If you have a RX 470/480 that is factory clocked at 2000Mhz or more (eg: nearly all 8GB cards):
    This is a bit trickier, but generally most cards will be most stable by simply copying the value in the 1750mhz field into the 2000mhz field. The easiest way to do this is to click anywhere inside the 1750mhz value, then press CTRL+A to highlight the entire string, and then press CTRL+C to copy it. Then you can simply click into the 2000mhz field and press CTRL+A followed by CTRL+V to paste over the existing value.

Once you’ve made the edit that is appropriate for your GPU, click on the “SAVE AS” button located at the top left. Save your modded BIOS with a new name (don’t overwrite your factory BIOS!), and then close the Polaris editor when you’re done.

Step 4: Flash your modified BIOS back to your GPU

Flashing your GPU BIOS with ATIWinFlashNow it’s time to write your custom BIOS back to your hardware. This can be a little scary if you’ve never attempted anything like this before, but generally if you’ve followed the steps as written, you shouldn’t have any issues. Again, there are no absolute guarantees, so proceed at your own risk!

  • Open ATIWinFlash back up.
  • Click on the “Load Image” button and select the modded BIOS that you created in step 3.
  • Click on the “Program” button to write the BIOS to your GPU. Your computer may appear to freeze for what might seem like a long time—this is normal.
  • You’ll be prompted to reboot when ATIWinFlash finishes. Don’t reboot yet—we have one more thing to do. Go ahead and close ATIWinFlash, though.
  • Unzip the ATI Pixel Clock Patcher utility that you downloaded and double-click atikmdag-patcher.exe. It should offer to apply a patch, let it. You only need to do this step once per GPU, even if you flash it multiple times. If you skip this step, when your computer reboots, the AMD display driver will refuse to load because it’ll detect that your GPU BIOS has been tampered with it.
  • Go ahead and reboot after the patch is applied.

If you’ve done everything correctly, your computer should boot normally, and you’ll arrive back at the Windows desktop, ready to test your changes.

Step 5: Test your modified GPU BIOS

Now is a great time to fire up your miner and see what kind of difference your changes made.

If you have a 4GB card, the timing change alone should be enough to get you from ~20 Mh/s to ~24 Mh/s. If you have a 8GB card, you likely went from ~24 Mh/s to ~28 Mh/s. We can do better, but that’s a pretty good start!

Power consumption will be unchanged (or even up slightly, due to the more aggressive timings), but we haven’t touched voltages yet.

Once you’ve recorded your GPU’s new metrics (speed, temperature/fan speed, power usage), we can move on.

Step 6: Find appropriate clock speed and voltage values for your GPU

Before we head back into Polaris BIOS editor to increase memory clock speed settings, it’s a good idea to have an idea of how high we can push them. It’s a lot easier (and faster) to make these tweaks in Windows via the driver (Radeon Settings/WattMan), and then once we’re confident on the proper values, write them to BIOS.

So if you haven’t already, read step 12 of my Windows guide to get an idea of the process around overclocking and undervolting via driver-level edits. If you’ve already gone through the process, you’ll need to repeat it, as your new more-aggressive memory timings invalidate all of your previous data—you won’t be able to push the memory clock speed as high as you previously could (but performance will be much better).

Using Radeon Settings/WattMan in the manner that I describe in my Windows guide:

  • Increase memory clock speed slowly until you see signs of system instability (incorrect share warnings in your miner, artifacts on screen, crashes)
  • Decrease core clock speed slowly until it starts to significantly negatively impact performance
  • Decrease memory voltage slowly until you see signs of instability (you may not be able to significantly lower memory voltage, depending on your card)
  • Decrease core voltage slowly until you see signs of instability

Don’t rush; make sure that your system is stable before moving on. It’s possible to reach speeds of nearly 29 Mh/s with 4GB cards, or over 31 Mh/s with 8GB cards, but watch out for power consumption and stability issues—it’s not always worth running at higher speeds. I’ve found that 25-26Mh/s for 4GB cards, and 27-29Mh/s for 8GB cards is right around the sweet spot for maximum efficiency and stability. When you feel confident that you have good clock speed and voltage values, then move on to the next step where we’ll write them to the BIOS.

Step 7: Write new clock speed and voltage values to GPU BIOS

Note that this step is not strictly necessary if you plan to use Windows for your miners long-term. You can certainly just dial in whatever values you found in the previous step at the driver/WattMan level and call it a day. I prefer to have everything done at the BIOS level, as then I don’t have to worry about software configuration, and can move GPUs between environments with ease.

If you’re running Linux, this is the only way (currently, at least) to overclock and undervolt.

  • Open Polaris BIOS Editor back up.
  • Load the modified BIOS that you created in step 3 (click “OPEN BIOS” in the top left and browse for your modded .rom file).
  • In the “Memory” area, carefully input your values for memory clock speed and voltage in the bottom row.
  • In the “GPU” area, carefully input your values for core clock speed and voltage in the bottom row. You’ll probably be overwriting a 65xxx value in the voltage column—that’s ok.
  • Still in the “GPU” area, fill in the table between the bottom row and the first row (but do not touch the first row!) with values that ramp up to whatever you entered in the bottom row. It isn’t super important to get these values “right”; you can look at the original table and see what percentage adjacent rows vary by, and just calculate new values that way.

Here is my finished, modded BIOS for my Asus RX 470 4GB (click for full size):

Factory BIOS in Polaris BIOS editor

The original factory BIOS is shown in step 2 for reference. Note that I’ve made absolutely no edits outside of the area I originally outlined in blue. I get over 25 Mh/s after the modifications (+25%), while using ~15% less power compared to stock. These changes are fairly conservative; I’m stable at nearly 27 Mh/s on this card with more aggressive settings, but the increase in power consumption isn’t worth it at my electricity rate.

If you’re looking for a good starting point, the settings pictured here should be stable in just about every 4GB card (in the timings section, just copy the 1500mhz value to every row below it).

When you’re done making your edits in Polaris, save your final BIOS (click “SAVE AS”) as a new file. Then open up ATIWinFlash and write the new .rom to your GPU (same as step 4). Reboot and test!

Step 8: Repeat steps 1-7 for each of your remaining GPUs

Yes, it’s a little tedious. But it goes quite a bit faster after your first one. Don’t be tempted to simply take the first BIOS that you create, and flash that to all of your other cards—every GPU is different, even between cards that are the same brand/model. It’s quite possible (likely, even, if you have a lot) that some of your cards will be capable of stable speeds 25+ mhz higher than others. Test them all; it’ll save you headaches later.

Analyzing the cost/benefit of different setups

If you’re stuck on whether or not an extra 1-2 Mh/s is worth 25 watts of additional power consumption, remember that you can use an online calculator to help simplify things. For example, here is a GPU hashing at 25 Mh/s @ 100 watts vs another GPU at 26 Mh/s @ 125 watts (assuming $0.15 per kWh, remember to plug in your own rate!). At the time that this was written, the slower GPU is slightly more profitable.

BIOS mods: before and after comparison

 

In the next and final installment of this Ethereum mining guide, I’ll post a mining FAQ and some other tidbits that didn’t quite fit anywhere else. Until then, thanks for reading, and feel free to leave questions or comments!

BUILD YOUR OWN ETHEREUM MINING RIG, PART 5: FAQ

In this fifth and final installment of our Ethereum mining rig guide, I answer some common questions about setting up your own rig, profit expectations, and mining in general. If you’ve read the rest of the guide and still have some unanswered questions, you might find what you’re looking for here.

Hit the “read more” button for the FAQ!

Build an Ethereum Mining Rig, part 5: FAQ

 General Questions

Technical Questions

Ethereum-specific Questions

Other

Answers

So how much money can I expect to make from mining, exactly?

This is the question that most people are interested in. The answer is fairly complicated, and changes daily.

Today, one ether is worth about $90. Last week, that same ether peaked at a value of nearly $100. A month before that, ether was trading at less than half its current value. The volatility in digital currency value is extreme—the price today could be very different than the price tomorrow.

On top of that, the difficulty involved with mining a coin is also changing constantly. Today, the rig depicted in our guide will produce nearly 5 ether per month. One month ago, it was producing at a rate of ~7 per month. As the popularity of mining increases (as it often does when the value of each coin increases), the time/computing power it takes to produce a coin increases.

You can answer the question for right now by using a calculator such as this one. If you’re building the exact rig outlined in the guide, then 150 MH/s is a good conservative estimate for speed, and 750 watts should be accurate for power usage if you undervolt and use an efficient PSU (make sure to plug in your own electricity rate, though). The calculator takes into account the current mining difficulty automatically.

At the time that I’m writing this FAQ, assuming you pay $0.10 per kWh for electricity, the calculator would tell you that you should expect to make nearly $400 per month from your mining rig. Remember to subtract 1-2 percent for your mining pool’s fee. Subtracting another couple percent for downtime and other unexpected issues is probably a good idea, too.

If the price of ether rises faster than the mining difficulty increases, then that profit figure will increase. If the mining difficulty outpaces the value growth of ether (and/or ether drops in value), then profit will decrease.

Since it is very difficult to predict the future, I’d strongly advise everyone reading this to treat mining as a hobby, and not a “get rich quick” scheme. Only invest what you’re comfortable losing, because losing is a very real possibility.

Why not just buy ether (or bitcoin, or litecoin, etc) directly, and then sell later at a profit?

If you believe that ETH is about to shoot up in value in the short-term, and you have a very high tolerance for risk, and you have some money that you won’t miss if it suddenly disappears, then this might be the best idea for you. Buying the digital currency directly enables you to get your hands on a bunch of it quickly, without having to wait for a mining rig to produce it for you. However, the “sell them later at a profit” part doesn’t always work out. =)

For most of us with a desire to jump into cryptocurrency, mining is probably the safer option (it’s more fun, too!). If you buy $1500 worth of ETH today, and tomorrow ether is suddenly worthless, then you’ve lost $1500. If you build a $1500 mining rig today, and tomorrow ETH is worthless, then you still have $1500 worth of hardware. You can sell it at a small loss, or re-purpose it (maybe try your luck at mining one of the other digital currencies, for example).

How noisy/hot are these rigs?

This is difficult to answer because it’s so subjective. An open-air mining rig with six RX 4xx/5xx GPUs in it will certainly not be silent. But a properly undervolted rig can be surprisingly quiet, especially compared to the previous generation of litecoin mining rigs (those old 7950 GPUs were noise & heat monsters!).

Using a free sound meter app on my phone, I measured the sound level of my test rig at 47 decibels (with the phone held about 2-3 inches away from the middle of the GPUs). From roughly 6 feet away, the sound level dropped to about 37 decibels, which I find to be completely acceptable. For reference, the sound level in an empty room that I subjectively consider to be completely quiet is 22 decibels, according to the app. If these numbers don’t mean much to you, this chart might be helpful.

My test rig contains a mix of four RX 470/480 GPUs running at a temperature target of 58C. The noise level could be reduced significantly by bumping the target up to 70C if desired (which would allow the fans to spin at a lower RPM), but it’s already more than quiet enough for me.

The heat that a rig produces may be more of an issue, depending on where you live. Most small consumer space heaters put out 1500 watts of heat. An undervolted 6-GPU rig will give off roughly half that, which is still a significant amount. It’s certainly possible to heat a small room with the heat from a single mining rig, but that extra heat can be a nuisance if you live in a warmer climate.

Ideally, you have someplace that you can tuck your rig(s) where they’re out of living spaces. Basements and garages are both good ideas if they’re relatively clean and temperatures don’t venture into extremes.

How do I convince my significant other that building a rig is a good idea?

You’re on your own with that one. Good luck! =) Anecdotally, I did convince my girlfriend to keep a litecoin mining rig in her apartment for most of 2013. She hated the noise (modern GPUs are much quieter), but she did make a tenfold return on her investment.

How do I turn my computer on without a case/power switch?!

So you didn’t opt to purchase a power switch, and now you’re sitting there staring at a bunch of assembled hardware, and wondering how the heck to turn the thing on for the first time. Don’t worry, you have a couple options.

First, check to see if there is a power button built right onto the motherboard. This is somewhat common nowadays, although many boards still don’t include them.

If you don’t have a power button on your motherboard, grab a flathead screwdriver. Now use the head of your screwdriver to temporarily short the two pins on the motherboard that the power switch would be connected to (if you had a power switch). Just touch the head of the screwdriver so that it makes contact with both pins for a brief moment. Your system should immediately power on (if it doesn’t, make sure that your PSU is plugged in, and the PSU power switch is in the “on” position”).

The first thing you should do at this point is enter the BIOS and change the power options to set your computer to automatically power on whenever power is restored. That way, you can use the switch on your power supply to turn it on and off going forward.

Why the Radeon RX 470 GPU? Why not a RX 480/570/580, or another video card entirely?

The Radeon RX 470 GPU is currently gives the best hashrate/watt ratio, and also has an excellent hashrate/purchase price ratio. It’s really the ideal GPU for mining, at least for now.

That said, the RX 470/480/570/580 are all very close performance-wise when properly clocked and undervolted via BIOS mods. In fact, the difference is so close that purchase price should probably be your primary consideration—buy whichever RX 4xx/5xx GPU you can get for the least money, as long as you plan to flash your GPU BIOS (I show you how in part 4 of my guide).

I generally don’t mention nVidia GPUs because they cost so much more than AMD cards. The GTX 1070 is a fine card for mining, with hashrate and power consumption numbers comparable to RX 4xx/5xx cards when properly configured. I don’t recommend it simply because it costs 2-3 times as much as an RX 470, and that has a tremendous negative impact, ROI-wise.

Can I mix different brands and/or models of GPUs in the same rig?

You can always mix different brands of the same model GPU in the same rig (for example, RX 470 GPUs made by MSI, Sapphire, and Asus).

You can additionally mix different models of cards together as long as whatever video driver you’ve installed in your OS supports all of them.

In Windows, you can mix RX 470 and RX 480 cards together with no issues, and you can also mix RX 570 and RX 580 cards. You’ll run into issues if you try to mix RX 4xx cards with RX 5xx cards, because they use different video drivers (it’s possible to make it work, but involves jumping through some extra hoops).

In Linux, I believe that all of the RX 4xx and RX 5xx cards share the same driver, so they should all coexist together without problems.

My own Linux rig runs a mix of different RX 470 and RX 480 cards, all different brands. I have an RX 570 GPU card running in another desktop that I haven’t tried dropping into the rig yet.

Why stop at 6 GPUs? Is it possible to pack more than that onto one motherboard?

Possible? Yes—I know some people have made 7, or even 8 GPUs work on a single motherboard.

I generally don’t recommend it unless you’re pretty savvy and willing to work through a lot of potential headaches, though. Generally, achieving 8 GPUs on a single motherboard is done via use of PCIe splitters (eg: something like this), and they don’t always work well.

7-8 GPUs also generally works best with two power supplies, and that ups complexity (and risk of hardware damage, if done improperly) a bit, as well. In addition, depending on which GPUs you use and how much you undervolt them, an 8 GPU rig may come quite close to the safe continuous load rating on a typical 15 amp household circuit (which is 80% of 1800 watts, or 1440 watts).

To me, 6 GPUs feels like the current sweet spot between maximizing GPU density and minimizing complexity/risk.

Don’t I need more than 4GB of RAM? A lot of other guides recommend more.

Nope—mining uses the memory on your GPUs, so you don’t need much system memory at all. You can get by just fine with 1-2GB of RAM in Linux, and 4GB is enough in Windows (you’ll need to bump your virtual memory settings up to at least 16GB though, covered in step 6 of my Windows guide).

I’m running with a single 1GB DIMM on my own Linux rig, and most of that memory is available while mining.

Why do I need a 1200 watt power supply if I’m undervolting? Won’t I only be using 700-800 watts with 6 GPUs? And is it worth paying so much for a high efficiency unit?

If you’re running six properly undervolted RX 470 GPUs, your “at the wall” power consumption should be around 750 watts. Which means that yes, it’s possible to run such a rig on a smaller PSU without issues.

The reason that I recommend a 1200 watt PSU is due to efficiency variance at different load levels. PSUs are generally most efficient when supplying about 50% of their rated maximum power (you can read a bit about ratings on Wikipedia here). So a platinum-rated 93% efficient unit may only reach that efficiency level when supplying ~40-60% of the unit’s maximum rated power. It’s not uncommon for PSUs rated at 90%+ efficiency to drop down to ~85% when operating near their limit (and also when delivering very little power).

Example time: let’s first assume that your rig needs 700 watts of power to operate (maybe 6x 110 watts for the GPUs, and 40 watts for the rest of the system—this is a fairly realistic number).

Now let’s first assume that you decided ~$250 for a platinum-rated 1200 watt PSU is ridiculous, so you opted for a $100 bronze-rated 850 watt PSU instead (which is still a fairly solid unit!). You’ll be pulling about 854 watts at the wall (700 watts / .82 efficient) with this setup.

Now let’s assume that you want to be as efficient as possible, but since you you know you don’t really need 1200 watts, you go for a $180 platinum-rated 850 watt unit—not realizing that its efficiency rating drops from 93% @ 50% load to 89% @ 100% load. That doesn’t sound like much, and at least it’s still significantly better than a bronze-rated unit, right? With this setup, you’ll end up pulling about 787 watts (700 watts / .89 efficient) at the wall.

Now let’s assume that you just followed my guide and bought the 1200 watt Seasonic that I recommend(platinum-rated units by EVGA, Corsair, and some others are all fine too—they’re likely rebadged OEM Seasonics anyway). Since you’re running the unit at only ~58% of it’s maximum, it should run very near its peak 93% efficiency. Which means this setup will pull about 753 watts (700 watts / .93 efficient) at the wall.

The difference between the first and last example is 101 watts at the wall. Assuming that you run your rig 24/7 and pay 15 cents per kWh, that’s a $133 difference in electricity costs every year! The “expensive” 1200 watt Seasonic pays for itself compared to the much “cheaper” $100 bronze unit in roughly one year of use (the Seasonic has a 7 year warranty, so the odds are that you’ll be using it for quite a long time).

If you want to measure your own “at the wall” power consumption numbers, I highly recommend that you shell out a few bucks for a kill-a-watt. They’re invaluable.

Can I utilize my mining rig for anything else while it’s mining?

It’ll make a great space heater in the winter. =) Oh, you mean application-wise.

The CPU, memory, and disk will mostly be unused while your rig is mining, but anything GUI-related will be pretty unresponsive. Applications that run in the background or over the network are good candidates, if you’re looking to get some extra use out of your rig. You should be able to run things like file servers and low-traffic web servers just fine without impacting mining performance.

How much of my internet bandwidth will my mining rig use?

Not much. Mine averages around 30 kb/sec when it’s mining at full speed, which is less than half of one percent of the average broadband speed in the US (~55 mb/sec). Bandwidth is basically a non-issue—you could run a mining rig off a dial-up connection (in terms of bandwidth, anyway—I absolutely recommend a wired ethernet connection for latency/reliability reasons).

My rig won’t boot properly unless a monitor is connected—what’s up with that?

I’m not sure why some people experience this (I did with my own LTC rig back in 2013, but not my newer ETH rigs), but if your rig won’t boot into the OS without a monitor attached, then you need a dummy plug (a device that plugs into your GPU, fooling the hardware into detecting a display). You can make you own for a few bucks by simply following these instructions (you can buy the resistors that you need on Amazon). Or you can buy pre-made HDMI plugs, although they’re more expensive (it shouldn’t matter if you use DVI or HDMI plugs). You should only need one plug attached to your primary video card, although some people use dummy plugs on all of their GPUs.

I’m getting fan speed errors using the latest version of Claymore’s miner—how do I fix them?

This “failed to set fan speed” issue seems to occur in later Claymore releases (10 and up), and requires a few extra commands to setup the Claymore executable with the permission it needs to control your GPU fans. I’ve incorporated these commands into the latest version of my Linux guide, but in case you followed an earlier version and recently upgraded Claymore to 10.x or later, simply enter these commands:

cd /usr/local/claymore10.2
sudo chown root:root ethdcrminer64
sudo chmod 755 ethdcrminer64
sudo chmod u+s ethdcrminer64

Note that if Claymore is located somewhere other than /usr/local/claymore10.2, you’ll need to substitute the proper location in the first command.

I rebooted and now my GPUs are hashing 20% lower than previously—what happened?
If you’ve just rebooted for the first time since January 9, 2018, you may find that your system has automatically updated to linux kernal 4.13.0-26. The update is designed to patch the Meltdown/Spectre vulnerabilities present on Intel CPUs, but it may also wreak havoc with your mining hashrates. If you’re seeing significantly lower hashrates compared to before the last time you rebooted, you can manually roll back the update by entering these commands:

sudo apt-get remove linux-image-4.13.0-26-generic && sudo apt autoremove -y
sudo update-grub

Reboot (sudo reboot now) and your hashrates should be back to normal.

To stop your system from performing automatic updates in the future, you can use one of the methods described here.

Isn’t Ethereum moving to proof-of-stake soon? Won’t that make our rigs obsolete?

Ethereum will eventually make the switch to PoS, which will make current methods of mining impossible. However, there isn’t currently a timeline for the switch in place, and one of Ethereum’s co-founders stated that an informal estimates of “late 2017” was “too rosy”. Most people close to Ethereum seem to feel that the second half of 2018 is a realistic target for the switch, which still leaves plenty of mining time.

When the switch does occur, it’ll be easy to transition our mining rigs to another coin (which you can then trade for ETH/BTC/LTC, if you don’t want to hold another altcoin).

I have an old video card with 2GB of memory laying around. Can I use it to mine ETH?

Unfortunately, no. Every individual GPU must be able to fit Ethereum’s DAG file into its own video memory to mine. The DAG file is slowly getting larger over time, and as of today, the DAG file is over 2GB, which means only cards with 3GB or more can mine ETH.

Sometime around April 2018, the DAG file will grow beyond 3GB.

The 4GB limit will be reached somewhere around September 2019, although it’s likely that Ethereum will have already moved to proof-of-stake by that point.

Other guides say that you shouldn’t run Linux off a USB drive if you plan to mine ETH, because constant DAG file writes will quickly wear the stick out. Your guide says that a USB stick is ok for a Linux-based ETH mining rig. What gives?

Any guide that cautions against installing Linux to a USB stick for ETH mining was probably written more than 6 months ago. The stock Ethereum miner (geth), writes the (very large) DAG file to disk fairly frequently, which can cause issues for media not rated for large numbers of writes (USB sticks, for example). Claymore’s miner (which we’re using) creates the DAG file in GPU memory, so we don’t have any excessive writes to worry about.

Just when I was about to reach 1 ETH at my mining pool, my balance went to zero! Did I get hacked?

Most mining pools (including ethermine.org, which I use in my guide’s setup examples) hold your earned balance until you reach a certain threshold (usually 1 ETH). When that threshold is reached, they transfer your balance to whatever wallet address you specified. If you’ve been watching your balance accumulate at your mining pool, and then it suddenly went to zero, most likely the pool just transferred your coins to your wallet. You can easily check the balance of your wallet address with a web-based blockchain explorer, such as this one.

How do I keep my ETH wallet safe?

Backup your wallet to multiple secure, offline devices (a few small USB sticks are great for this). If you created your wallet using my guide, then you’ll find your wallet file(s) on your mining rig at the following location:

Linux:   ~/.ethereum/keystore
Windows:   %APPDATA%\Ethereum\keystore

Just copy the entire keystore directory someplace safe. To access the ether held in your wallet addresses, you’ll need both these encrypted key files, and the password that you used to create them. So make sure that you can remember your password(s) as well! Keeping some sort of password “hint” document (that only you would understand) on the backup USB sticks containing your key files isn’t a bad idea. Keep at least one copy off-site (eg: with somebody you trust, or a bank deposit box, etc).

After you’ve made multiple backups of your wallet keys, it’s probably a good idea to remove the keys from your mining rig (simply delete the /keystore directory). It’s generally best to not store your keys long-term on any computer that is connected to the internet. If a hacker successfully gains access to your rig and finds your private keys, you’re going to lose all of the funds stored in the associated wallets. Be absolutely sure that you’ve verified your backups work (read the answer to the next question, and test out the process using your backed-up private keys) before deleting /keystore from your rig, of course.

So I’ve mined all this ether—how do I actually move/use it?

If you’re a masochist, you can move ether around right from the command line of your rig using geth. But I don’t recommend that as it’s tedious, confusing, and prone to mistakes.

A much better way is to download and install Mist (you can do this on any computer, it doesn’t have to be on your mining rig—do make sure that the computer is free from malware first, though!). Mist is essentially a GUI front-end for geth that hides all of the tedious command-line stuff from the user.

Once Mist is installed, you can simply import your wallet key files (see previous question if you don’t know where they’re located), and Mist will show the current balance of each. From there, you can simply click “Send” to move ether out of one of your own wallets to any other wallet address.

Important note: after you install Mist, it’s going to want to sync the blockchain to your computer. This can take anywhere from an hour to a day the first time you do it, depending on the speed of your internet connection (you’ll see a progress bar in the lower left corner). Until this finishes, the balance of all of your wallets will likely show up as zero. Don’t stress, this is normal. Once the sync is complete, all of your balances should show up properly.

I see that Claymore supports dual mining—what is that, and should I use it?

I wrote a dedicated blog post on this subject; you can read it here.

When it comes to buying/selling cryptocurrency, which exchange do you recommend?

There are so many exchanges, and frankly a lot of them are sketchy and operating in countries where regulation isn’t exactly tight. We’ll probably see another Mt. Gox at some point in the future because of this.

For now, I tend to recommend Coinbase. They’re based in San Francisco and seem to be doing all the right things with regard to regulation and insuring users’ funds.

As a general rule, don’t leave your currency in an exchange any longer than necessary (eg: don’t treat exchanges like banks!). Keep your funds in wallet addresses that you control, and move them to exchanges only when you want to trade.

Can I buy you a beer? Your mining guide has been a huge help!

Certainly! Well, virtually, anyway. I’d be happy to accept donations at the below wallet addresses:

Bitcoin: 1DpnANRtMDPe8jG3FXfkyczLFevM94Yjxv
Litecoin: LPuwBa3LbZZzcJaR3kEsGDBivAoc64fPUr
Ethereum: 0x32FD4a5DF96Af70b0D4644Cf4dce44cFc988BEE4

用树莓派做Bitcoin Unlimited全节点

$
0
0
用树莓派做Bitcoin Unlimited全节点
 github-kfty     2017-03-09 17:55:16

这是一个用树莓派做Bitcoin Unlimited全节点的示例。对于没用使用过全节点钱包,也不熟悉命令行操作的朋友,建议先看这篇教程,尝试在PC或Mac上安装和同步区块链,这样更容易理解这个示例。

为什么要用树莓派做全节点?

树莓派体积小,耗电小,无噪音,非常适合24小时工作。比特币节点对系统性能要求不高,专门24小时开着一台电脑,耗电和噪音都是很不环保的,且性能有极大的浪费。树莓派耗电仅和手机充电器相当,也没有风扇。你甚至不需要为树莓派安排地方,随便塞在哪里就行了,操作可以在其他的电脑上,通过SSH进行。用树莓派搭建节点,也可以学习到基本的Linux系统操作知识。搭建节点之后,树莓派上可以继续搭建其他服务,比如做个人云盘,BT挂机下载等等。

准备工作

需要准备如下几样东西。此例使用树莓派3B,这版有1GB内存,也有wifi,性能是目前树莓派家族最好的。512MB内存的树莓派2或者zero也是可以用的。清单如下:
– 树莓派 3B(配盒子,电源)
– 16GB的SD卡Class 10 microSDHC
– 外置硬盘或U盘
– 网线(可选,wifi也行,但用网线会更稳定一点)
– 键盘,鼠标,显示器,HDMI线(不用买,仅在安装时临时用一下,安装好以后可以远程SSH接入树莓派)

树莓派系统安装

下载Ubuntu系统镜像

树莓派原生的系统是Rasbian,出于个人偏好,此例使用Ubuntu-mate的ARM版。首先下载系统的镜像文件 Ubuntu Mate 16.04.2 LTS 的 RaspberryPi 版本 https://ubuntu-mate.org/raspberry-pi

把镜像文件导入SD卡

  • Windows系统:可以使用7-zip解压下载到的文件,用Win32 Disk Imager把img文件装载到SD卡里
  • Macbook:把下载的img文件解压到桌面;插上SD卡后,在Terminal里使用diskutil查看SD卡到情况

    diskutil list

    输出里可以看到/dev/disk0之类的盘,根据他们的大小,可以判断出来哪个是我们的SD卡。此例中是/dev/disk2,大小15G。用dd命令来把镜像文件写入(本例是ubuntu.img)

    sudo dd if=~/Desktop/ubuntu.img of=/dev/rdisk2 bs=1m

    这里/dev/disk2写成/dev/rdisk2,速度会较快。等待几分钟后显示完成。

给树莓派按照系统

下面,把做好的SD卡装到树莓派上,给树莓派连上显示器,键盘鼠标,接上电,应该就会看见树莓派启动,并开始安装UbuntuMate系统。和装其他系统一样,顺着引导一路next就行。这个阶段我们要做的是给Ubuntu设置好用户名和密码,打开SSH。用户名在此例中是pi,如果你设置的不一样,那么在接下来的一些指令中要把pi替换成你的用户名。如果你使用wifi,在这里把wifi连一下。
在Ubuntu里进入Terminal命令行,使用

  1. sudo raspi-config

sudo是以管理员身份运行的意思,接下来也是常用的。进入raspi-config界面后看到几个选项,我们要做的是:
1,改密码;
2,在BootOptions里把开机选项由Desktop GUI改为Text console,这样禁用了图形界面,节省系统资源,反正我们不打算接着显示器用树莓派,而SSH也不支持图形界面。
3,在Interfacing里面把SSH打开,
4,在AdvancedOption里面进行Expand Filesystem,
5,在AdvancedOption里面把Memory Split改为16,即只留16MB内存给显示。因为我们没有开图形界面,这样可以尽量多把内存给程序用。

设置完毕,重启树莓派。现在可以把键盘鼠标和显示器拔掉了,接下来的步骤,我们会通过SSH进行。

设置路由器

用电脑进入路由器的设置页面,此例中是https://192.168.1.1/。在这里,我们要做两件事,1,给树莓派固定一个内网ip,2,给树莓派设置端口映射
不同品牌的路由器设置方法大同小异,必要的话可以搜一下说明书。查看已经连接的设备,给树莓派设置一个固定的ip比如192.168.1.2。也许你需要重启路由器才能生效。找到端口映射的设置,外网端口范围8333到8333,内网端口一样,目标指向192.168.1.2 。端口映射的目的是叫外网向你的路由器8333端口发送请求的时候,路由器把数据转给树莓派,这样别人才能访问到你的节点。

设置成功后,即可通过SSH控制树莓派。Windows系统推荐Putty,Mac推荐vSSH,填上地址192.168.1.2,端口22,链接后输入用户名pi,密码,即进入远程命令行。

设置树莓派

mount 外置硬盘或U盘

我们在电脑上准备区块链数据。树莓派的性能不适合从头同步区块链,很容易在中途出错。推荐在电脑上把区块链同步好。如果运行裁剪节点,也先在电脑上完成裁剪。
区块链数据是如下这些目录和文件:

  1. banlist.dat
  2. blocks
  3. chainstate
  4. db.log
  5. debug.log
  6. fee_estimates.dat
  7. peers.dat
  8. wallet.dat

裁剪节点:prune模式可以删除旧的交易细节,仅保留交易结果(余额)。裁剪后,你的节点不能为网络提供旧的区块数据,仍然能帮助网络验证转发新的区块和交易。

在本例中,电脑是Win10系统,节点程序安装在c:\BitcoinUnlimted\bitcoin-qt.exe,区块链数据在c:\BlockData, 新建一个bitcoin-qt的快捷方式,右键进属性,在目标栏的bitcoin-qt.exe 后面加上

  1. -datadir=c:\BlockData -prune=3000

然后用这个快捷方式启动一次,即可看见c:\BlockData明显缩小了。prune=3000意思是保留3000MB的新区块。裁剪下来,体积大约是4G,因为里面还有旧区块的交易结果。将来继续带着prune=3000这个参数运行,区块链体积不会再明显增大。裁剪后的区块链数据,找一个U盘就可以装下了。你可以根据情况选择这个参数,最小是550,再低就失效了。

把外置硬盘(完整数据)或U盘(裁剪数据)格式化成FAT32格式,然后把电脑上已经准备好的区块链数据拷贝进来。

把外置硬盘或U盘插上树莓派,通过SSH运行

  1. sudo fdisk -l

可以根据容量判断,找到新插上的硬盘或U盘的代号,应该是/dev/sda1之类。

SSH进来的目录是/home/pi,我们在这里建一个文件夹blkdata来装载

  1. mkdir blkdata

把硬盘或U盘加载到这个目录里

  1. sudo mount /dev/sda1 /home/pi/blkdata

自动装载:
如上的装载,重启后要运行mount。我们可以通过fstab表来实现开机后自动装载。

  1. sudo blkid

可以看到设备的信息,这里我们需要知道的是UUID号,本例是AE7F-E97A。编辑fstab表:

  1. sudo nano /etc/fstab

在里面加上一行(中间是用Tab键分隔)

  1. UUID=AE7F-E97A /home/pi/blkdata vfat auto,user 0 0

然后ctrl+x退出nano编辑器,打Y确认保存。

装载成功的话,进入这个目录:

  1. cd blkdata

列出文件:

  1. ls -l

应该可以看到我们放进来的区块链数据。在用一次cd命令,退回到原来的目录里。

设置虚拟内存

我们要为树莓派布置一些虚拟内存
首先看一下内存的情况:

  1. free -h

看到有1GB内存(树莓派3),虚拟内存swap是0。建立一个swap 文件,此例中是swapfile,大小2GB。

  1. sudo dd if=/dev/zero of=/home/pi/swapfile bs=1m count=2000

稍等几分钟完成。
给swap文件设置一下属性

  1. sudo chmod 600 /home/pi/swapfile
  2. sudo mkswap /home/pi/swapfile

加载上虚拟内存

  1. sudo swapon /home/pi/swapfile

再试试

  1. free -h

现在应该显示有2G的虚拟内存了。同样,这个设置会在重启后失效,我们得把他加到fstab里自动加载才行。

  1. sudo nano /etc/fstab

加一行

  1. /home/pi/swap/swapfile none swap sw 0 0

安装节点

现在,我们开始安装节点(终于。。。)
先设置好BU的PPA服务器

  1. sudo apt-get install software-properties-common
  2. sudo add-apt-repository ppa:bitcoin-unlimited/bu-ppa

更新一下列表

  1. sudo apt-get update

开始安装

  1. sudo apt-get install bitcoind

bitcoin.conf的设置

启动节点以前,先写一个bitcoin.conf,作为参数的设置。

  1. nano bitcoin.conf

用nano编辑器写一些参数设置,本例中使用:

  1. prune = 3000
  2. checklevel = 0
  3. mempoolexpiry = 24
  4. disablewallet = 1
  5. maxconnections = 30
  6. maxmempool = 144
  7. minlimitertxfee = 1
  8. server=1
  9. rpcuser=C9dWYgs6
  10. rpcpassword=oXVZ4x2yQuxSGTqATiAkLPpsWCQBr
  11. rpcclienttimeout=60
  12. rpcport=8332
  13. rpcconnect=127.0.0.1

如果修剪的话,prune参数要和之前在电脑上设置的一样。如果是不修剪的节点,这里设置为0或不写。rpcuser 和 rpcpassword随便设。

终于,我们可以启动节点了。启动时要加上数据目录的位置,和conf文件的位置,还有-daemon让节点后台运行

  1. sudo bitcoind -daemon -datadir=/home/pi/blkdata -conf=/home/pi/bitcoin.conf

检查节点是不是在工作了

  1. bitcoin-cli getinfo

能看见version等信息就是OK了。再用电脑去bitnodes.21.co,下面Check Node那里填上自己的IP地址(自动识别填好了的),如果能Check出来你的节点版本那就是通了。

设置自动启动bitcoind

把自动启动的服务打开

  1. sudo systemctl enable rc-local.service

编辑/etc/rc.local

  1. sudo nano /etc/rc.local

exit 0 上方写:

  1. sleep 10
  2. sudo bitcoind -daemon -datadir=/home/pi/blkdata -conf=/home/pi/bitcoin.conf

一些可能出现的问题

想到什么写什么吧:

移动硬盘不稳定

树莓派都USB口供电不行,如果移动硬盘是不带电源的,可能会不稳定。解决方法:

  1. sudo nano /boot/config.txt

找到max_usb_current,设置为1,可以调高USB口的电流。

sudo每次都要打密码特别烦

进visudo

  1. sudo visudo

最底下加入一行

  1. pi ALL=(ALL) NOPASSWD: ALL

pi是用户名

How to Build a Bitcoin Full Node on a Raspberry Pi

$
0
0

How to Build a Bitcoin Full Node on a Raspberry Pi

Hello there!

Today, I’m going to show you how to build a Bitcoin full node on the Raspberry Pi. This is a great project for anyone who wants to support the Bitcoin network while validating their own transactions. As the Bitcoin network grows, it’s important that people maintain their full nodes. We need to constantly bring new nodes onto the network to keep it decentralized and healthy.

Glossary:

1. Setup the Rasfpberry Pi 3
2. Install the External Hard Drive
3. Increase the Swap File
4. Install the Bitcoin Core Dependencies
5. Install Bitcoin Core
6. Starting the Bitcoin Core Client
7. Download the Blockchain on another Machine (Optional)

 

What is a Bitcoin Full Node?

A Bitcoin full node is much simpler than it sounds. A full node is simply a computer that is running the Bitcoin Core Wallet. The Bitcoin Core Wallet, by default, downloads a full copy of the Blockchain.

Why do you need a full copy of the Blockchain?

Similar to BitTorrent and other peer to peer networks, you have to download the Blockchain from other people. If you’ve ever downloaded a torrent, you’ll notice that some of them have seeders while other don’t. These “seeders” are people who have already downloaded the file, and have opted to let you download part of the file from them. Without seeders, the BitTorrent network wouldn’t exist.

The Bitcoin network operates the same way. When people try to access their Bitcoin, they are using a wallet that has access to at least part of the network. If people didn’t have full nodes, we wouldn’t be able to verify transactions or see transactions from the past. You wouldn’t be able to access your Bitcoin because ultimately, without nodes, your Bitcoin wouldn’t exist.

How do you Build a Bitcoin Full Node?

We are going to use a Raspberry Pi 3. The Raspberry Pi is a small, inexpensive computer, that has just enough specifications to allow us to operate a full node. We are going to download the Blockchain on an external hard drive on a separate machine using the Bitcoin Core Wallet.

After we have downloaded a full copy of the blockchain, we are going to connect the external hard drive to the Raspberry Pi so that it can continue to build it.

It is possible to directly download the blockchain onto the Raspberry Pi, but it will take a lot of time.

Things we are going to Need:

 

Raspberry Pi 3

The Raspberry Pi is a phenemonal computer. What makes it so great is that it’s about the size of a credit card and it costs less than $40. The Raspberry Pi can run both Linux and Windows.

For our Bitcoin full node, we are going to use Linux. This is due to the fact that Linux is more lightweight and we are going to need all of the resources that the Raspberry Pi can offer.

Usually Raspberry Pi’s will come barebones. The kit that we purchased comes the Touchscreen, Case, SD Card (which will hold the operating system), and Heatsinks.

LCD Touchscreen

The LCD Touchscreen is an optional component for this project. The Raspberry Pi has a HDMI port built in which can be used to project on any monitor/tv that is HDMI capable. For my full node, I wanted to have a touch screen that displays the current price of Bitcoin.

Plus I plan on sending and receiving Bitcoin directly from my node, and having a designated screen would make this process much easier. Plus it looks cool.

Our kit will use a LCD Touchscreen that is compatible with the Raspberry Pi. It also fits perfectly in the case.

Raspberry Pi Case

The Raspberry Pi case once again is optional. I wanted something that would contain both my Raspberry Pi and LCD Touchscreen. The kit that I purchased provided one that was simple and lightweight. This is perfect since I want my Raspberry Pi to be simple yet stylish.

Raspberry Pi Wireless Keyboard

This little device is optional, but it makes operating the Raspberry Pi way easier. Without it, you will have to plug in a desktop USB and Mouse or SSH into the Pi.

I definitely recommend picking it up since its only $20 and it will make your life a lot easier.

1 TB Hard Drive


The 1TB Hard Drive is necessary for storing the Blockchain. At the time of writing this (08/13/17)  the Bitcoin blockchain is approximately 130GB. You can check the current size by clicking on this link.

Currently, the blockchain is growing at about 50GB a year. As Bitcoin gains popularity in the coming years, it is destined to grow at a much faster rate. For the sake of longevity, I strongly recommend that you purchase a hard drive that will last for years to come.

If a 1TB Hard Drive is too far out of your price range, you can always start smaller and upgrade once you outgrow it.

How to Build a Bitcoin Full Node on a Raspberry Pi


1. Setting up the Raspberry Pi

Setting up the Raspberry Pi is simple. If you purchased a Raspberry Pi kit that already has Raspbian installed, you simply need to put in the SD card and plug it in.

For those of you that need to install linux on a blank SD card, you can follow this guide on the RaspberryPi.org website.

Update the the Raspbian Software

sudo apt-get update

Update Raspbian Repositories

sudo apt-get upgrade

Update Raspberry Pi


2. Install the External Hard Drive

Now that we have Raspbian up and running, we are going to partition the hard and mount it.

First, let’s connect the external hard drive to the usb port on the Raspberry Pi.

After we have connected the external hard drive to the Raspberry Pi we are going to run a command to see if it was identified.

sudo fdisk -l

List External Hard Drive

As you can see, the hard drive is showing up at the bottom, and it’s labeled “/dev/sda”. We are now going to access the drive, format it, and partition it. Just as a warning, anything on the drive is going to be erased after this process. If you have anything important on it, I advise you to transfer off that information before doing this.

Type in the following command.

sudo fdisk /dev/sda

 

Now that we are in the drive, you should see this screen.

Enter “d” so that we can delete the partitions that are currently on the hard drive. Keep entering “d” until you receive a message telling you that there are no more partitions on the hard drive.

d

 

Now, it’s time to create our new partition. To do this, type in “n”.

n

 

You will be given the options to create a primary partition or an extended partition. Type in “p” to choose primary partition.

p

 

You will now be prompted to number the partition. Choose “1” so that your drive will be named “/dev/sda1”.

/dev/sda1

 

For the next two questions about the first and last sector, simply hit enter for both of them so that it chooses the default.

Now that you have created your new partition, it’s time to exit out of “fdisk” Type in “w” to exit fdisk.

w

 

Now it’s time tor format your new partition. We are going to partition it as “Fat 32”. By partitioning the system as Fat32, we ensure that the hard drive will be compatible with both Windows and Mac. This will come in handy if you decide to download the blockchain using one of those two operating systems.

sudo mkdosfs -F 32 -I /dev/sda1

After the command has finished, you will have a newly partitioned hard drive! Now it’s time to set the drive to automatically mount.

Before we edit the configuration file, let’s create the Bitcoin data directory.

mkdir .blockchain

Now it’s time to make modifications to the configuration file. Use the command below to access the configuration file.

sudo nano /etc/fstab

Once we are in this configuration file, we will add this line so that the hard drive is automatically mounted to our “.blockchain” folder. Remember to replace “pi” with whatever your Raspberry Pi’s username is.

/dev/sda1 /home/pi/.blockchain vfat umask=0002,gid=users 0 0

Hit Ctrl-x and then hit Y so that we can save the file. Now, restart the Raspberry Pi so that we can confirm that the Raspberry Pi is automatically mounting the external hard drive.

Run the command below so that we can see if the drive has be mounted under our folder “.blockchain”.

df -h

If you see your drive “/dev/sda1” mounted on “/home/pi/.blockchain” then you are ready to proceed!


3. Increase the Swap File

A swap file allows the Micro Sd Card in the Raspberry Pi to be used as ram. This step is important if you are going to download the whole blockchain using the Raspberry Pi. If you plan on downloading it on a separate device, this step isn’t necessary.

Let’s start by editing the file “/etc/dphys-swapfile”.

sudo nano /etc/dphys-swapfile

We are going to change the default size of the swap file from 100 to 1000.

Find the line:

CONF_SWAPSIZE=100

To:

CONF_SWAPSIZE=1000

Hit CTRL-X and then Y to save the file.

Run the commands below to initiate this new swap file.

sudo dphys-swapfile setup
sudo dphys-swapfile swapon


4. Install the Bitcoin Core Dependencies

Before we install the actual Bitcoin Core software, we need to download certain dependencies that the software relies on.


sudo apt-get install protobuf-compiler libminiupnpc-dev libevent-dev libtool libssl-dev libboost-all-dev qt4-dev-tools libprotobuf-dev libqrencode-dev autoconf

After those dependencies are installed, we are going to need to install git. Git is going to be used to access download the Bitcoin Core source code from the GitHub repository. In case you don’t know what that is, it’s a commonly accepted platform that distributes source code for all types of applications.

sudo apt-get install git -y

Bitcoin Core uses Berkeley Database for their wallet system. It specifically relies on version 4.8. Berkeley is created by Oracle, which is the same company that creates Java.

We are going to make a directory that we can download and install the database into.

mkdir ~/bin
cd ~/bin

Now that we are in the new directory that we have created, let’s download the tar for the Berkeley Database.

wget http://download.oracle.com/berkeley-db/db-4.8.30.NC.tar.gz

Download Berkeley Database

Now that you’ve downloaded the Berkeley database, you’ll use the following command to extract it.

tar -xzvf db-4.8.30.NC.tar.gz

Now that we have extracted the Berkeley Database, let’s go into the directory prepare the source code for installation. This process can take anywhere from 5 to 20 minutes.


cd db-4.8.30.NC/build_unix/
../dist/configure --enable-cxx
make

Once the command has finished, it’s time to install the Berkeley Database.


sudo make install

Excellent! Now that the Berkeley Database is installed, we are now ready to install the Bitcoin Core Client!


5. Insall the Bitcoin Software

The first thing we are going to do is go back into the bin directory. Once we are in the bin directory, we are going to down the Bitcoin Core source code into it.

The “git” command is going to pull the source code from the GitHub repository. Use “-b” to specify to the version/branch of the source code that you want to download.

You can visit: https://bitcoincore.org to find out which version of Bitcoin Core is most recent.

Note: This command will download the latest version of Bitcoin Core V.14. You will want to replace the 0.14 with the latest version that is currently out.


cd ~/bin

git clone -b 0.14 https://github.com/bitcoin/bitcoin.git

cd bitcoin/

 

Now that we have download the Bitcoin Core source code, it’s time to prepare it for installation. After you run the “make” command, be prepared to wait a few hours before you are ready to complete the installation.


./autogen.sh

./configure CPPFLAGS="-I/usr/local/BerkeleyDB.4.8/include -O2" LDFLAGS="-L/usr/local/BerkeleyDB.4.8/lib" --enable-upnp-default --with-gui

make

 

Bitcoin Core is now ready to be installed. Run the code below to finish the install.

sudo make install

Congratulations! Your Bitcoin Core client is now installed!

6. Starting the Bitcoin Core Client

Before you start your Bitcoin client, you have to open port 8333 on your router and point it to your Raspberry Pi. This is required so that your new full node can allow incoming connections.

To Start the Bitcoin Core Client, simply type in the command below. This will start the Bitcoin core client using our mounted hard drive “.blockchain”.

If you followed the section that explained how to mount your external hard drive then it should start downloading directly onto your hard drive.

This process can take a long time since the Raspberry Pi’s resources aren’t that of a full blown desktop. If you want to speed up this process, go to step 7 and download the Blockchain on another computer.

bitcoin-qt -datadir=/home/pi/.blockchain

After you have completely synced your Bitcoin Core Client with the Blockchain,  hover your mouse over the little icons at the bottom right of the client. A little display will pop up showing how many connections your client has. If you are showing more connections than 8, you have successfully configured your full node!


7. Download the Blockchain on a separate Computer (Optional)

To speed of the download of the blockchain, I recommend downloading it on your main machine. You can download Bitcoin Core on Windows, Mac, and Linux.  After you download Bitcoin Core, start it up and let the blockchain sync. This can take several days to complete, so make sure that whichever computer you use can withstand being run non-stop during that time.

Downloading the Blockchain on Ubuntu

It is just as simple to download the blockchain on Ubuntu as it is on the Raspbian OS. Once you have downloaded and installed Ubuntu on your main computer, open terminal.

Installing Bitcoin Core on Ubuntu

This first command will tell Linux where to download the Bitcoin Software. The second will update Linux’s information on which packages are available.

sudo add-apt-repository ppa:bitcoin/bitcoin
sudo apt update

This command will install both the Bitcoin Core command line and the Bitcoin Core GUI interface.

sudo apt install bitcoind bitcoin-qt

This command will update your Linux Distribution.

sudo apt upgrade

Mounting the External Hard Drive to your Ubuntu System

Create a new .blockchain directory

sudo mkdir ~/.blockchain

Find out the name of the external hard drive’s partition

sudo fdisk -l

Below you can spot out your hard drive usually in this area.

Mount the external hard drive

sudo mount /dev/sda1 ~/.blockchain

These two commands will give your user the permissions to access the external hard drive. This is necessary for the Bitcoin Core software to access the drive.

sudo chown pinode /home/ubuntu/.blockchain
sudo chgrp pinode /home/ubuntu/.blockchain

Now that we have installed Bitcoin Core and mounted the hard drive, it is time to start the Bitcoin Core Client!

bitcoin-qt -datadir=/home/pi/.blockchain

The GUI for Bitcoin Core should open following this command. It will show you a screen that has details regarding how many more blocks need to be downloaded, how long it will take, what time period of the blockchain you are downloading (This part is cool, it’s kind of like going back in time).

After the blockchain has completely downloaded, let’s unmount it and then mount it on the Raspberry Pi.

sudo umount /dev/sda1

Unplug the external hard drive from your main machine and then plug it into the Raspberry Pi.

Restart or turn on your Raspberry Pi, and run the Bitcoin Core Client.  After the Bitcoin Core Client starts up, check if the blockchain is fully downloaded by hovering your cursor over the checkmark at the bottom right of the client.

In Conclusion

Building a Bitcoin full node on a Raspberry Pi is much simpler than it seems. After you purchase all of the parts, it’s simply a matter of running the necessary commands and opening the port 8333 on your router.

A full node isn’t necessary to send and receive Bitcoin, but it’s necessary to keep the network healthy. By allowing incoming transactions to your node you are verifying transactions and allowing the blockchain to be downloaded. What makes Bitcoin so special is it’s ability to be maintained by the people who use it.

Let’s continue to keep Bitcoin alive and well by doing all that we can to let out voice be heard throughout the Bitcoin network.

If you have any questions or contributions to this guide, I’d love for you to either comment below or email me at Nick@BuildaMiningRig.com!

How to Build a Bitcoin Full Node on a Raspberry Pi

$
0
0

How to Build a Bitcoin Full Node on a Raspberry Pi

Hello there!

Today, I’m going to show you how to build a Bitcoin full node on the Raspberry Pi. This is a great project for anyone who wants to support the Bitcoin network while validating their own transactions. As the Bitcoin network grows, it’s important that people maintain their full nodes. We need to constantly bring new nodes onto the network to keep it decentralized and healthy.

Glossary:

1. Setup the Rasfpberry Pi 3
2. Install the External Hard Drive
3. Increase the Swap File
4. Install the Bitcoin Core Dependencies
5. Install Bitcoin Core
6. Starting the Bitcoin Core Client
7. Download the Blockchain on another Machine (Optional)

 

What is a Bitcoin Full Node?

A Bitcoin full node is much simpler than it sounds. A full node is simply a computer that is running the Bitcoin Core Wallet. The Bitcoin Core Wallet, by default, downloads a full copy of the Blockchain.

Why do you need a full copy of the Blockchain?

Similar to BitTorrent and other peer to peer networks, you have to download the Blockchain from other people. If you’ve ever downloaded a torrent, you’ll notice that some of them have seeders while other don’t. These “seeders” are people who have already downloaded the file, and have opted to let you download part of the file from them. Without seeders, the BitTorrent network wouldn’t exist.

The Bitcoin network operates the same way. When people try to access their Bitcoin, they are using a wallet that has access to at least part of the network. If people didn’t have full nodes, we wouldn’t be able to verify transactions or see transactions from the past. You wouldn’t be able to access your Bitcoin because ultimately, without nodes, your Bitcoin wouldn’t exist.

How do you Build a Bitcoin Full Node?

We are going to use a Raspberry Pi 3. The Raspberry Pi is a small, inexpensive computer, that has just enough specifications to allow us to operate a full node. We are going to download the Blockchain on an external hard drive on a separate machine using the Bitcoin Core Wallet.

After we have downloaded a full copy of the blockchain, we are going to connect the external hard drive to the Raspberry Pi so that it can continue to build it.

It is possible to directly download the blockchain onto the Raspberry Pi, but it will take a lot of time.

Things we are going to Need:

 

Raspberry Pi 3

The Raspberry Pi is a phenemonal computer. What makes it so great is that it’s about the size of a credit card and it costs less than $40. The Raspberry Pi can run both Linux and Windows.

For our Bitcoin full node, we are going to use Linux. This is due to the fact that Linux is more lightweight and we are going to need all of the resources that the Raspberry Pi can offer.

Usually Raspberry Pi’s will come barebones. The kit that we purchased comes the Touchscreen, Case, SD Card (which will hold the operating system), and Heatsinks.

LCD Touchscreen

The LCD Touchscreen is an optional component for this project. The Raspberry Pi has a HDMI port built in which can be used to project on any monitor/tv that is HDMI capable. For my full node, I wanted to have a touch screen that displays the current price of Bitcoin.

Plus I plan on sending and receiving Bitcoin directly from my node, and having a designated screen would make this process much easier. Plus it looks cool.

Our kit will use a LCD Touchscreen that is compatible with the Raspberry Pi. It also fits perfectly in the case.

Raspberry Pi Case

The Raspberry Pi case once again is optional. I wanted something that would contain both my Raspberry Pi and LCD Touchscreen. The kit that I purchased provided one that was simple and lightweight. This is perfect since I want my Raspberry Pi to be simple yet stylish.

Raspberry Pi Wireless Keyboard

This little device is optional, but it makes operating the Raspberry Pi way easier. Without it, you will have to plug in a desktop USB and Mouse or SSH into the Pi.

I definitely recommend picking it up since its only $20 and it will make your life a lot easier.

1 TB Hard Drive


The 1TB Hard Drive is necessary for storing the Blockchain. At the time of writing this (08/13/17)  the Bitcoin blockchain is approximately 130GB. You can check the current size by clicking on this link.

Currently, the blockchain is growing at about 50GB a year. As Bitcoin gains popularity in the coming years, it is destined to grow at a much faster rate. For the sake of longevity, I strongly recommend that you purchase a hard drive that will last for years to come.

If a 1TB Hard Drive is too far out of your price range, you can always start smaller and upgrade once you outgrow it.

How to Build a Bitcoin Full Node on a Raspberry Pi


1. Setting up the Raspberry Pi

Setting up the Raspberry Pi is simple. If you purchased a Raspberry Pi kit that already has Raspbian installed, you simply need to put in the SD card and plug it in.

For those of you that need to install linux on a blank SD card, you can follow this guide on the RaspberryPi.org website.

Update the the Raspbian Software

sudo apt-get update

Update Raspbian Repositories

sudo apt-get upgrade

Update Raspberry Pi


2. Install the External Hard Drive

Now that we have Raspbian up and running, we are going to partition the hard and mount it.

First, let’s connect the external hard drive to the usb port on the Raspberry Pi.

After we have connected the external hard drive to the Raspberry Pi we are going to run a command to see if it was identified.

sudo fdisk -l

List External Hard Drive

As you can see, the hard drive is showing up at the bottom, and it’s labeled “/dev/sda”. We are now going to access the drive, format it, and partition it. Just as a warning, anything on the drive is going to be erased after this process. If you have anything important on it, I advise you to transfer off that information before doing this.

Type in the following command.

sudo fdisk /dev/sda

 

Now that we are in the drive, you should see this screen.

Enter “d” so that we can delete the partitions that are currently on the hard drive. Keep entering “d” until you receive a message telling you that there are no more partitions on the hard drive.

d

 

Now, it’s time to create our new partition. To do this, type in “n”.

n

 

You will be given the options to create a primary partition or an extended partition. Type in “p” to choose primary partition.

p

 

You will now be prompted to number the partition. Choose “1” so that your drive will be named “/dev/sda1”.

/dev/sda1

 

For the next two questions about the first and last sector, simply hit enter for both of them so that it chooses the default.

Now that you have created your new partition, it’s time to exit out of “fdisk” Type in “w” to exit fdisk.

w

 

Now it’s time tor format your new partition. We are going to partition it as “Fat 32”. By partitioning the system as Fat32, we ensure that the hard drive will be compatible with both Windows and Mac. This will come in handy if you decide to download the blockchain using one of those two operating systems.

sudo mkdosfs -F 32 -I /dev/sda1

After the command has finished, you will have a newly partitioned hard drive! Now it’s time to set the drive to automatically mount.

Before we edit the configuration file, let’s create the Bitcoin data directory.

mkdir .blockchain

Now it’s time to make modifications to the configuration file. Use the command below to access the configuration file.

sudo nano /etc/fstab

Once we are in this configuration file, we will add this line so that the hard drive is automatically mounted to our “.blockchain” folder. Remember to replace “pi” with whatever your Raspberry Pi’s username is.

/dev/sda1 /home/pi/.blockchain vfat umask=0002,gid=users 0 0

Hit Ctrl-x and then hit Y so that we can save the file. Now, restart the Raspberry Pi so that we can confirm that the Raspberry Pi is automatically mounting the external hard drive.

Run the command below so that we can see if the drive has be mounted under our folder “.blockchain”.

df -h

If you see your drive “/dev/sda1” mounted on “/home/pi/.blockchain” then you are ready to proceed!


3. Increase the Swap File

A swap file allows the Micro Sd Card in the Raspberry Pi to be used as ram. This step is important if you are going to download the whole blockchain using the Raspberry Pi. If you plan on downloading it on a separate device, this step isn’t necessary.

Let’s start by editing the file “/etc/dphys-swapfile”.

sudo nano /etc/dphys-swapfile

We are going to change the default size of the swap file from 100 to 1000.

Find the line:

CONF_SWAPSIZE=100

To:

CONF_SWAPSIZE=1000

Hit CTRL-X and then Y to save the file.

Run the commands below to initiate this new swap file.

sudo dphys-swapfile setup
sudo dphys-swapfile swapon


4. Install the Bitcoin Core Dependencies

Before we install the actual Bitcoin Core software, we need to download certain dependencies that the software relies on.


sudo apt-get install protobuf-compiler libminiupnpc-dev libevent-dev libtool libssl-dev libboost-all-dev qt4-dev-tools libprotobuf-dev libqrencode-dev autoconf

After those dependencies are installed, we are going to need to install git. Git is going to be used to access download the Bitcoin Core source code from the GitHub repository. In case you don’t know what that is, it’s a commonly accepted platform that distributes source code for all types of applications.

sudo apt-get install git -y

Bitcoin Core uses Berkeley Database for their wallet system. It specifically relies on version 4.8. Berkeley is created by Oracle, which is the same company that creates Java.

We are going to make a directory that we can download and install the database into.

mkdir ~/bin
cd ~/bin

Now that we are in the new directory that we have created, let’s download the tar for the Berkeley Database.

wget http://download.oracle.com/berkeley-db/db-4.8.30.NC.tar.gz

Download Berkeley Database

Now that you’ve downloaded the Berkeley database, you’ll use the following command to extract it.

tar -xzvf db-4.8.30.NC.tar.gz

Now that we have extracted the Berkeley Database, let’s go into the directory prepare the source code for installation. This process can take anywhere from 5 to 20 minutes.


cd db-4.8.30.NC/build_unix/
../dist/configure --enable-cxx
make

Once the command has finished, it’s time to install the Berkeley Database.


sudo make install

Excellent! Now that the Berkeley Database is installed, we are now ready to install the Bitcoin Core Client!


5. Insall the Bitcoin Software

The first thing we are going to do is go back into the bin directory. Once we are in the bin directory, we are going to down the Bitcoin Core source code into it.

The “git” command is going to pull the source code from the GitHub repository. Use “-b” to specify to the version/branch of the source code that you want to download.

You can visit: https://bitcoincore.org to find out which version of Bitcoin Core is most recent.

Note: This command will download the latest version of Bitcoin Core V.14. You will want to replace the 0.14 with the latest version that is currently out.


cd ~/bin

git clone -b 0.14 https://github.com/bitcoin/bitcoin.git

cd bitcoin/

 

Now that we have download the Bitcoin Core source code, it’s time to prepare it for installation. After you run the “make” command, be prepared to wait a few hours before you are ready to complete the installation.


./autogen.sh

./configure CPPFLAGS="-I/usr/local/BerkeleyDB.4.8/include -O2" LDFLAGS="-L/usr/local/BerkeleyDB.4.8/lib" --enable-upnp-default --with-gui

make

 

Bitcoin Core is now ready to be installed. Run the code below to finish the install.

sudo make install

Congratulations! Your Bitcoin Core client is now installed!

6. Starting the Bitcoin Core Client

Before you start your Bitcoin client, you have to open port 8333 on your router and point it to your Raspberry Pi. This is required so that your new full node can allow incoming connections.

To Start the Bitcoin Core Client, simply type in the command below. This will start the Bitcoin core client using our mounted hard drive “.blockchain”.

If you followed the section that explained how to mount your external hard drive then it should start downloading directly onto your hard drive.

This process can take a long time since the Raspberry Pi’s resources aren’t that of a full blown desktop. If you want to speed up this process, go to step 7 and download the Blockchain on another computer.

bitcoin-qt -datadir=/home/pi/.blockchain

After you have completely synced your Bitcoin Core Client with the Blockchain,  hover your mouse over the little icons at the bottom right of the client. A little display will pop up showing how many connections your client has. If you are showing more connections than 8, you have successfully configured your full node!


7. Download the Blockchain on a separate Computer (Optional)

To speed of the download of the blockchain, I recommend downloading it on your main machine. You can download Bitcoin Core on Windows, Mac, and Linux.  After you download Bitcoin Core, start it up and let the blockchain sync. This can take several days to complete, so make sure that whichever computer you use can withstand being run non-stop during that time.

Downloading the Blockchain on Ubuntu

It is just as simple to download the blockchain on Ubuntu as it is on the Raspbian OS. Once you have downloaded and installed Ubuntu on your main computer, open terminal.

Installing Bitcoin Core on Ubuntu

This first command will tell Linux where to download the Bitcoin Software. The second will update Linux’s information on which packages are available.

sudo add-apt-repository ppa:bitcoin/bitcoin
sudo apt update

This command will install both the Bitcoin Core command line and the Bitcoin Core GUI interface.

sudo apt install bitcoind bitcoin-qt

This command will update your Linux Distribution.

sudo apt upgrade

Mounting the External Hard Drive to your Ubuntu System

Create a new .blockchain directory

sudo mkdir ~/.blockchain

Find out the name of the external hard drive’s partition

sudo fdisk -l

Below you can spot out your hard drive usually in this area.

Mount the external hard drive

sudo mount /dev/sda1 ~/.blockchain

These two commands will give your user the permissions to access the external hard drive. This is necessary for the Bitcoin Core software to access the drive.

sudo chown pinode /home/ubuntu/.blockchain
sudo chgrp pinode /home/ubuntu/.blockchain

Now that we have installed Bitcoin Core and mounted the hard drive, it is time to start the Bitcoin Core Client!

bitcoin-qt -datadir=/home/pi/.blockchain

The GUI for Bitcoin Core should open following this command. It will show you a screen that has details regarding how many more blocks need to be downloaded, how long it will take, what time period of the blockchain you are downloading (This part is cool, it’s kind of like going back in time).

After the blockchain has completely downloaded, let’s unmount it and then mount it on the Raspberry Pi.

sudo umount /dev/sda1

Unplug the external hard drive from your main machine and then plug it into the Raspberry Pi.

Restart or turn on your Raspberry Pi, and run the Bitcoin Core Client.  After the Bitcoin Core Client starts up, check if the blockchain is fully downloaded by hovering your cursor over the checkmark at the bottom right of the client.

In Conclusion

Building a Bitcoin full node on a Raspberry Pi is much simpler than it seems. After you purchase all of the parts, it’s simply a matter of running the necessary commands and opening the port 8333 on your router.

A full node isn’t necessary to send and receive Bitcoin, but it’s necessary to keep the network healthy. By allowing incoming transactions to your node you are verifying transactions and allowing the blockchain to be downloaded. What makes Bitcoin so special is it’s ability to be maintained by the people who use it.

Let’s continue to keep Bitcoin alive and well by doing all that we can to let out voice be heard throughout the Bitcoin network.

If you have any questions or contributions to this guide, I’d love for you to either comment below or email me at Nick@BuildaMiningRig.com!

Viewing all 764 articles
Browse latest View live