??xml version="1.0" encoding="utf-8" standalone="yes"?>亚洲黄色精品,日韩久久久久,日韩免费特黄一二三区http://www.aygfsteel.com/waterjava/category/55337.html我胡汉三又回来了zh-cnMon, 16 Mar 2020 05:57:35 GMTMon, 16 Mar 2020 05:57:35 GMT60IPFS参考网?/title><link>http://www.aygfsteel.com/waterjava/archive/2020/03/14/435258.html</link><dc:creator>狼爱上狸</dc:creator><author>狼爱上狸</author><pubDate>Sat, 14 Mar 2020 03:01:00 GMT</pubDate><guid>http://www.aygfsteel.com/waterjava/archive/2020/03/14/435258.html</guid><wfw:comment>http://www.aygfsteel.com/waterjava/comments/435258.html</wfw:comment><comments>http://www.aygfsteel.com/waterjava/archive/2020/03/14/435258.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.aygfsteel.com/waterjava/comments/commentRss/435258.html</wfw:commentRss><trackback:ping>http://www.aygfsteel.com/waterjava/services/trackbacks/435258.html</trackback:ping><description><![CDATA[<a >https://ipfs.github.io/public-gateway-checker/</a><img src ="http://www.aygfsteel.com/waterjava/aggbug/435258.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.aygfsteel.com/waterjava/" target="_blank">狼爱上狸</a> 2020-03-14 11:01 <a href="http://www.aygfsteel.com/waterjava/archive/2020/03/14/435258.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>安装node-canvas时win_delay_load_hook.c错误http://www.aygfsteel.com/waterjava/archive/2020/02/22/435150.html狼爱上狸狼爱上狸Sat, 22 Feb 2020 08:33:00 GMThttp://www.aygfsteel.com/waterjava/archive/2020/02/22/435150.htmlhttp://www.aygfsteel.com/waterjava/comments/435150.htmlhttp://www.aygfsteel.com/waterjava/archive/2020/02/22/435150.html#Feedback0http://www.aygfsteel.com/waterjava/comments/commentRss/435150.htmlhttp://www.aygfsteel.com/waterjava/services/trackbacks/435150.html

狼爱上狸 2020-02-22 16:33 发表评论
]]>
IPFS问题http://www.aygfsteel.com/waterjava/archive/2020/01/16/435040.html狼爱上狸狼爱上狸Thu, 16 Jan 2020 06:44:00 GMThttp://www.aygfsteel.com/waterjava/archive/2020/01/16/435040.htmlhttp://www.aygfsteel.com/waterjava/comments/435040.htmlhttp://www.aygfsteel.com/waterjava/archive/2020/01/16/435040.html#Feedback0http://www.aygfsteel.com/waterjava/comments/commentRss/435040.htmlhttp://www.aygfsteel.com/waterjava/services/trackbacks/435040.html 1.?nbsp; "Gateway": "/ip4/127.0.0.1/tcp/8080"修改为:"Gateway": "/ip4/0.0.0.0/tcp/8080"Q这h机就可以?92.168WEB讉K了?/div>
2.把WINDOWS防火墙入站的8080端口打开Q这样在局域网p讉K了?/div>


狼爱上狸 2020-01-16 14:44 发表评论
]]>【我的区块链之\? 谈一谈IPFS原理及玩?/title><link>http://www.aygfsteel.com/waterjava/archive/2020/01/12/435032.html</link><dc:creator>狼爱上狸</dc:creator><author>狼爱上狸</author><pubDate>Sun, 12 Jan 2020 08:17:00 GMT</pubDate><guid>http://www.aygfsteel.com/waterjava/archive/2020/01/12/435032.html</guid><wfw:comment>http://www.aygfsteel.com/waterjava/comments/435032.html</wfw:comment><comments>http://www.aygfsteel.com/waterjava/archive/2020/01/12/435032.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.aygfsteel.com/waterjava/comments/commentRss/435032.html</wfw:commentRss><trackback:ping>http://www.aygfsteel.com/waterjava/services/trackbacks/435032.html</trackback:ping><description><![CDATA[https://blog.csdn.net/qq_25870633/article/details/82027510<img src ="http://www.aygfsteel.com/waterjava/aggbug/435032.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.aygfsteel.com/waterjava/" target="_blank">狼爱上狸</a> 2020-01-12 16:17 <a href="http://www.aygfsteel.com/waterjava/archive/2020/01/12/435032.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>入门 WebpackQ看q篇够?/title><link>http://www.aygfsteel.com/waterjava/archive/2020/01/04/435018.html</link><dc:creator>狼爱上狸</dc:creator><author>狼爱上狸</author><pubDate>Sat, 04 Jan 2020 09:22:00 GMT</pubDate><guid>http://www.aygfsteel.com/waterjava/archive/2020/01/04/435018.html</guid><wfw:comment>http://www.aygfsteel.com/waterjava/comments/435018.html</wfw:comment><comments>http://www.aygfsteel.com/waterjava/archive/2020/01/04/435018.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.aygfsteel.com/waterjava/comments/commentRss/435018.html</wfw:commentRss><trackback:ping>http://www.aygfsteel.com/waterjava/services/trackbacks/435018.html</trackback:ping><description><![CDATA[<a >https://segmentfault.com/a/1190000006178770#articleHeader3</a><img src ="http://www.aygfsteel.com/waterjava/aggbug/435018.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.aygfsteel.com/waterjava/" target="_blank">狼爱上狸</a> 2020-01-04 17:22 <a href="http://www.aygfsteel.com/waterjava/archive/2020/01/04/435018.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>文档计划 | IPFS API参考文?/title><link>http://www.aygfsteel.com/waterjava/archive/2020/01/03/435016.html</link><dc:creator>狼爱上狸</dc:creator><author>狼爱上狸</author><pubDate>Fri, 03 Jan 2020 11:03:00 GMT</pubDate><guid>http://www.aygfsteel.com/waterjava/archive/2020/01/03/435016.html</guid><wfw:comment>http://www.aygfsteel.com/waterjava/comments/435016.html</wfw:comment><comments>http://www.aygfsteel.com/waterjava/archive/2020/01/03/435016.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.aygfsteel.com/waterjava/comments/commentRss/435016.html</wfw:commentRss><trackback:ping>http://www.aygfsteel.com/waterjava/services/trackbacks/435016.html</trackback:ping><description><![CDATA[<a >https://www.jianshu.com/p/e38d5f733c81</a><img src ="http://www.aygfsteel.com/waterjava/aggbug/435016.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.aygfsteel.com/waterjava/" target="_blank">狼爱上狸</a> 2020-01-03 19:03 <a href="http://www.aygfsteel.com/waterjava/archive/2020/01/03/435016.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>IPFS环境搭徏和用ipfs-api讉Kipfs|络http://www.aygfsteel.com/waterjava/archive/2020/01/03/435015.html狼爱上狸狼爱上狸Fri, 03 Jan 2020 09:55:00 GMThttp://www.aygfsteel.com/waterjava/archive/2020/01/03/435015.htmlhttp://www.aygfsteel.com/waterjava/comments/435015.htmlhttp://www.aygfsteel.com/waterjava/archive/2020/01/03/435015.html#Feedback0http://www.aygfsteel.com/waterjava/comments/commentRss/435015.htmlhttp://www.aygfsteel.com/waterjava/services/trackbacks/435015.htmlhttps://blog.csdn.net/mongo_node/article/details/80143631

狼爱上狸 2020-01-03 17:55 发表评论
]]>
安装solc指定版本http://www.aygfsteel.com/waterjava/archive/2020/01/01/435010.html狼爱上狸狼爱上狸Wed, 01 Jan 2020 04:28:00 GMThttp://www.aygfsteel.com/waterjava/archive/2020/01/01/435010.htmlhttp://www.aygfsteel.com/waterjava/comments/435010.htmlhttp://www.aygfsteel.com/waterjava/archive/2020/01/01/435010.html#Feedback0http://www.aygfsteel.com/waterjava/comments/commentRss/435010.htmlhttp://www.aygfsteel.com/waterjava/services/trackbacks/435010.htmlcnpm install -g solc@0.4.22


狼爱上狸 2020-01-01 12:28 发表评论
]]>
Node.js安装及环境配|之Windows?/title><link>http://www.aygfsteel.com/waterjava/archive/2020/01/01/435009.html</link><dc:creator>狼爱上狸</dc:creator><author>狼爱上狸</author><pubDate>Wed, 01 Jan 2020 04:13:00 GMT</pubDate><guid>http://www.aygfsteel.com/waterjava/archive/2020/01/01/435009.html</guid><wfw:comment>http://www.aygfsteel.com/waterjava/comments/435009.html</wfw:comment><comments>http://www.aygfsteel.com/waterjava/archive/2020/01/01/435009.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.aygfsteel.com/waterjava/comments/commentRss/435009.html</wfw:commentRss><trackback:ping>http://www.aygfsteel.com/waterjava/services/trackbacks/435009.html</trackback:ping><description><![CDATA[<h1><a >https://www.jianshu.com/p/03a76b2e7e00</a><br /></h1><img src ="http://www.aygfsteel.com/waterjava/aggbug/435009.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.aygfsteel.com/waterjava/" target="_blank">狼爱上狸</a> 2020-01-01 12:13 <a href="http://www.aygfsteel.com/waterjava/archive/2020/01/01/435009.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>crx文g怎么安装?h览器Chrome打开crx文g的方?/title><link>http://www.aygfsteel.com/waterjava/archive/2019/12/29/435002.html</link><dc:creator>狼爱上狸</dc:creator><author>狼爱上狸</author><pubDate>Sun, 29 Dec 2019 14:57:00 GMT</pubDate><guid>http://www.aygfsteel.com/waterjava/archive/2019/12/29/435002.html</guid><wfw:comment>http://www.aygfsteel.com/waterjava/comments/435002.html</wfw:comment><comments>http://www.aygfsteel.com/waterjava/archive/2019/12/29/435002.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.aygfsteel.com/waterjava/comments/commentRss/435002.html</wfw:commentRss><trackback:ping>http://www.aygfsteel.com/waterjava/services/trackbacks/435002.html</trackback:ping><description><![CDATA[<a >https://www.jb51.net/softjc/402153.html</a><img src ="http://www.aygfsteel.com/waterjava/aggbug/435002.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.aygfsteel.com/waterjava/" target="_blank">狼爱上狸</a> 2019-12-29 22:57 <a href="http://www.aygfsteel.com/waterjava/archive/2019/12/29/435002.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>go调用以太坊rpc写入合约操作中的DATA数据解析Q纯字符串参敎ͼhttp://www.aygfsteel.com/waterjava/archive/2019/12/27/434995.html狼爱上狸狼爱上狸Fri, 27 Dec 2019 06:49:00 GMThttp://www.aygfsteel.com/waterjava/archive/2019/12/27/434995.htmlhttp://www.aygfsteel.com/waterjava/comments/434995.htmlhttp://www.aygfsteel.com/waterjava/archive/2019/12/27/434995.html#Feedback0http://www.aygfsteel.com/waterjava/comments/commentRss/434995.htmlhttp://www.aygfsteel.com/waterjava/services/trackbacks/434995.htmlhttps://blog.csdn.net/weixin_42608885/article/details/100889008

狼爱上狸 2019-12-27 14:49 发表评论
]]>
一步步构徏自己的智能合U?/title><link>http://www.aygfsteel.com/waterjava/archive/2019/12/26/434994.html</link><dc:creator>狼爱上狸</dc:creator><author>狼爱上狸</author><pubDate>Thu, 26 Dec 2019 08:09:00 GMT</pubDate><guid>http://www.aygfsteel.com/waterjava/archive/2019/12/26/434994.html</guid><wfw:comment>http://www.aygfsteel.com/waterjava/comments/434994.html</wfw:comment><comments>http://www.aygfsteel.com/waterjava/archive/2019/12/26/434994.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.aygfsteel.com/waterjava/comments/commentRss/434994.html</wfw:commentRss><trackback:ping>http://www.aygfsteel.com/waterjava/services/trackbacks/434994.html</trackback:ping><description><![CDATA[<a >https://segmentfault.com/a/1190000014797663</a><img src ="http://www.aygfsteel.com/waterjava/aggbug/434994.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.aygfsteel.com/waterjava/" target="_blank">狼爱上狸</a> 2019-12-26 16:09 <a href="http://www.aygfsteel.com/waterjava/archive/2019/12/26/434994.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>如何审计一个智能合U?/title><link>http://www.aygfsteel.com/waterjava/archive/2019/12/26/434993.html</link><dc:creator>狼爱上狸</dc:creator><author>狼爱上狸</author><pubDate>Thu, 26 Dec 2019 07:37:00 GMT</pubDate><guid>http://www.aygfsteel.com/waterjava/archive/2019/12/26/434993.html</guid><wfw:comment>http://www.aygfsteel.com/waterjava/comments/434993.html</wfw:comment><comments>http://www.aygfsteel.com/waterjava/archive/2019/12/26/434993.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.aygfsteel.com/waterjava/comments/commentRss/434993.html</wfw:commentRss><trackback:ping>http://www.aygfsteel.com/waterjava/services/trackbacks/434993.html</trackback:ping><description><![CDATA[<a >https://cloud.tencent.com/developer/article/1522230</a><img src ="http://www.aygfsteel.com/waterjava/aggbug/434993.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.aygfsteel.com/waterjava/" target="_blank">狼爱上狸</a> 2019-12-26 15:37 <a href="http://www.aygfsteel.com/waterjava/archive/2019/12/26/434993.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>如何调用以太坊智能合U?/title><link>http://www.aygfsteel.com/waterjava/archive/2019/12/26/434992.html</link><dc:creator>狼爱上狸</dc:creator><author>狼爱上狸</author><pubDate>Thu, 26 Dec 2019 07:31:00 GMT</pubDate><guid>http://www.aygfsteel.com/waterjava/archive/2019/12/26/434992.html</guid><wfw:comment>http://www.aygfsteel.com/waterjava/comments/434992.html</wfw:comment><comments>http://www.aygfsteel.com/waterjava/archive/2019/12/26/434992.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.aygfsteel.com/waterjava/comments/commentRss/434992.html</wfw:commentRss><trackback:ping>http://www.aygfsteel.com/waterjava/services/trackbacks/434992.html</trackback:ping><description><![CDATA[<a >https://www.cnblogs.com/KRDecad3/p/11745568.html</a><img src ="http://www.aygfsteel.com/waterjava/aggbug/434992.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.aygfsteel.com/waterjava/" target="_blank">狼爱上狸</a> 2019-12-26 15:31 <a href="http://www.aygfsteel.com/waterjava/archive/2019/12/26/434992.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>U钥生成钱包助记词的程http://www.aygfsteel.com/waterjava/archive/2019/12/24/434984.html狼爱上狸狼爱上狸Tue, 24 Dec 2019 02:02:00 GMThttp://www.aygfsteel.com/waterjava/archive/2019/12/24/434984.htmlhttp://www.aygfsteel.com/waterjava/comments/434984.htmlhttp://www.aygfsteel.com/waterjava/archive/2019/12/24/434984.html#Feedback0http://www.aygfsteel.com/waterjava/comments/commentRss/434984.htmlhttp://www.aygfsteel.com/waterjava/services/trackbacks/434984.htmlhttps://www.cnblogs.com/hankal/p/9472920.html

狼爱上狸 2019-12-24 10:02 发表评论
]]>
BIP39钱包助记词规?/title><link>http://www.aygfsteel.com/waterjava/archive/2019/12/24/434983.html</link><dc:creator>狼爱上狸</dc:creator><author>狼爱上狸</author><pubDate>Tue, 24 Dec 2019 02:01:00 GMT</pubDate><guid>http://www.aygfsteel.com/waterjava/archive/2019/12/24/434983.html</guid><wfw:comment>http://www.aygfsteel.com/waterjava/comments/434983.html</wfw:comment><comments>http://www.aygfsteel.com/waterjava/archive/2019/12/24/434983.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.aygfsteel.com/waterjava/comments/commentRss/434983.html</wfw:commentRss><trackback:ping>http://www.aygfsteel.com/waterjava/services/trackbacks/434983.html</trackback:ping><description><![CDATA[<a >https://www.jianshu.com/p/d5bac6d36dc6</a><img src ="http://www.aygfsteel.com/waterjava/aggbug/434983.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.aygfsteel.com/waterjava/" target="_blank">狼爱上狸</a> 2019-12-24 10:01 <a href="http://www.aygfsteel.com/waterjava/archive/2019/12/24/434983.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>remixhttp://www.aygfsteel.com/waterjava/archive/2019/12/22/434980.html狼爱上狸狼爱上狸Sat, 21 Dec 2019 16:27:00 GMThttp://www.aygfsteel.com/waterjava/archive/2019/12/22/434980.htmlhttp://www.aygfsteel.com/waterjava/comments/434980.htmlhttp://www.aygfsteel.com/waterjava/archive/2019/12/22/434980.html#Feedback0http://www.aygfsteel.com/waterjava/comments/commentRss/434980.htmlhttp://www.aygfsteel.com/waterjava/services/trackbacks/434980.htmlhttps://remix.ethereum.org/
http://remix.hubwiz.com/
https://ethereum.github.io/


狼爱上狸 2019-12-22 00:27 发表评论
]]>
Web3与智能合U交互实?/title><link>http://www.aygfsteel.com/waterjava/archive/2019/12/21/434979.html</link><dc:creator>狼爱上狸</dc:creator><author>狼爱上狸</author><pubDate>Sat, 21 Dec 2019 06:46:00 GMT</pubDate><guid>http://www.aygfsteel.com/waterjava/archive/2019/12/21/434979.html</guid><wfw:comment>http://www.aygfsteel.com/waterjava/comments/434979.html</wfw:comment><comments>http://www.aygfsteel.com/waterjava/archive/2019/12/21/434979.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.aygfsteel.com/waterjava/comments/commentRss/434979.html</wfw:commentRss><trackback:ping>http://www.aygfsteel.com/waterjava/services/trackbacks/434979.html</trackback:ping><description><![CDATA[<p style="margin-top: 10px; margin-bottom: 10px; padding: 0px; font-family: verdana, "ms song", 宋体, Arial, 微Y雅黑, Helvetica, sans-serif; font-size: 12px;">最新内容会更新在主?a style="margin: 0px; padding: 0px; color: #3b5999; text-decoration-line: none;">深入出区块铄?/a><br style="margin: 0px; padding: 0px;" />原文链接:<a style="margin: 0px; padding: 0px; color: #3b5999; text-decoration-line: none;">Web3与智能合U交互实?/a></p><h2>写在前面</h2><p style="margin-top: 10px; margin-bottom: 10px; padding: 0px; font-family: verdana, "ms song", 宋体, Arial, 微Y雅黑, Helvetica, sans-serif; font-size: 12px;">在最初学习以太坊的时候,很多人都是自己创Z太坊节点后,使用geth与之交互。这U用命令行交互的方法虽然让很多E序员感到兴奋(黑客帝国的既视感Q)Q但不可能指望普通用户通过命o行用Dapp。因此,我们需要一U友好的方式Q比如一个web面Q来与智能合U交互,于是问题的答案就?code style="margin: 1px 5px; line-height: 1.8; vertical-align: middle; display: inline-block; padding: 0px 5px !important; font-family: "Courier New", sans-serif !important; background-color: #f5f5f5 !important; border: 1px solid #cccccc !important; border-radius: 3px !important;">web3.js</code>?/p><h2>Web3.js</h2><p style="margin-top: 10px; margin-bottom: 10px; padding: 0px; font-family: verdana, "ms song", 宋体, Arial, 微Y雅黑, Helvetica, sans-serif; font-size: 12px;"><a style="margin: 0px; padding: 0px; color: #3b5999; text-decoration-line: none;">Web3.js</a>是以太坊官方的Javascript APIQ可以帮助智能合U开发者用HTTP或者IPC与本地的或者远E的以太坊节点交互。实际上是一个库的集合,主要包括下面几个库:</p><ul style="margin: 0px 0px 0px 30px; padding: 0px; word-break: break-all; font-family: verdana, "ms song", 宋体, Arial, 微Y雅黑, Helvetica, sans-serif; font-size: 12px;"><li style="margin: 0px; padding: 0px; list-style: disc;"><code style="margin: 1px 5px; line-height: 1.8; vertical-align: middle; display: inline-block; padding: 0px 5px !important; font-family: "Courier New", sans-serif !important; background-color: #f5f5f5 !important; border: 1px solid #cccccc !important; border-radius: 3px !important;">web3-eth</code>用来与以太坊区块铑֒合约交互</li><li style="margin: 0px; padding: 0px; list-style: disc;"><code style="margin: 1px 5px; line-height: 1.8; vertical-align: middle; display: inline-block; padding: 0px 5px !important; font-family: "Courier New", sans-serif !important; background-color: #f5f5f5 !important; border: 1px solid #cccccc !important; border-radius: 3px !important;">web3-shh</code>用来控制whisper协议与p2p通信以及q播</li><li style="margin: 0px; padding: 0px; list-style: disc;"><code style="margin: 1px 5px; line-height: 1.8; vertical-align: middle; display: inline-block; padding: 0px 5px !important; font-family: "Courier New", sans-serif !important; background-color: #f5f5f5 !important; border: 1px solid #cccccc !important; border-radius: 3px !important;">web3-bzz</code>用来与swarm协议交互</li><li style="margin: 0px; padding: 0px; list-style: disc;"><code style="margin: 1px 5px; line-height: 1.8; vertical-align: middle; display: inline-block; padding: 0px 5px !important; font-family: "Courier New", sans-serif !important; background-color: #f5f5f5 !important; border: 1px solid #cccccc !important; border-radius: 3px !important;">web3-utils</code>包含了一些Dapp开发有用的功能</li></ul><p style="margin-top: 10px; margin-bottom: 10px; padding: 0px; font-family: verdana, "ms song", 宋体, Arial, 微Y雅黑, Helvetica, sans-serif; font-size: 12px;">Web3与geth通信使用的是 <a style="margin: 0px; padding: 0px; color: #3b5999; text-decoration-line: none;">JSON-RPC</a> Q这是一U轻量的RPCQRemote Procedure CallQ协议,整个通信的模型可以抽象ؓ下图?/p><p style="margin-top: 10px; margin-bottom: 10px; padding: 0px; font-family: verdana, "ms song", 宋体, Arial, 微Y雅黑, Helvetica, sans-serif; font-size: 12px;"><img src="https://learnblockchain.cn/images/Communication_Model.jpg" alt="Web3 Communication Model" style="margin: 0px; padding: 0px; border: 0px; max-width: 720px; height: auto;" /></p><h2>搭徏试?/h2><p style="margin-top: 10px; margin-bottom: 10px; padding: 0px; font-family: verdana, "ms song", 宋体, Arial, 微Y雅黑, Helvetica, sans-serif; font-size: 12px;">在开发初期,我们q没有必要用真实的公链Qؓ了开发效率,一般选择在本地搭建测试链。在本文我们选择?a style="margin: 0px; padding: 0px; color: #3b5999; text-decoration-line: none;">Ganache</a>Q在此之前用的是testrpcQGanache属于它的升版)Q一个图形化试软gQ也有命令行版本Q,可以一键在本地搭徏以太坊区块链试环境Qƈ且将区块铄状态通过囑Ş界面昄出来QGanache的运行界面如下图所C?/p><p style="margin-top: 10px; margin-bottom: 10px; padding: 0px; font-family: verdana, "ms song", 宋体, Arial, 微Y雅黑, Helvetica, sans-serif; font-size: 12px;"><img src="https://learnblockchain.cn/images/Ganache.png" alt="Ganache" style="margin: 0px; padding: 0px; border: 0px; max-width: 720px; height: auto;" /></p><p style="margin-top: 10px; margin-bottom: 10px; padding: 0px; font-family: verdana, "ms song", 宋体, Arial, 微Y雅黑, Helvetica, sans-serif; font-size: 12px;">从图中可以看到Ganache会默认创?0个̎P监听地址?code style="margin: 1px 5px; line-height: 1.8; vertical-align: middle; display: inline-block; padding: 0px 5px !important; font-family: "Courier New", sans-serif !important; background-color: #f5f5f5 !important; border: 1px solid #cccccc !important; border-radius: 3px !important;">http://127.0.0.1:7545</code>Q可以实时看?code style="margin: 1px 5px; line-height: 1.8; vertical-align: middle; display: inline-block; padding: 0px 5px !important; font-family: "Courier New", sans-serif !important; background-color: #f5f5f5 !important; border: 1px solid #cccccc !important; border-radius: 3px !important;">Current Block</code>?code style="margin: 1px 5px; line-height: 1.8; vertical-align: middle; display: inline-block; padding: 0px 5px !important; font-family: "Courier New", sans-serif !important; background-color: #f5f5f5 !important; border: 1px solid #cccccc !important; border-radius: 3px !important;">Gas Price</code>?code style="margin: 1px 5px; line-height: 1.8; vertical-align: middle; display: inline-block; padding: 0px 5px !important; font-family: "Courier New", sans-serif !important; background-color: #f5f5f5 !important; border: 1px solid #cccccc !important; border-radius: 3px !important;">Gas Limit</code>{信息?/p><h2>创徏合约</h2><p style="margin-top: 10px; margin-bottom: 10px; padding: 0px; font-family: verdana, "ms song", 宋体, Arial, 微Y雅黑, Helvetica, sans-serif; font-size: 12px;">目前以太坊官方全力支持的合约开发环境是<a style="margin: 0px; padding: 0px; color: #3b5999; text-decoration-line: none;">Remix IDE</a>Q我们在合约~辑面~写如下代码Q?/p><pre style="margin-top: 10px; margin-bottom: 10px; padding: 0px; white-space: pre-wrap; overflow-wrap: break-word; font-size: 12px;"><code javascript"="" style="margin: auto; vertical-align: middle; display: block; background-image: initial; background-position: initial; background-size: initial; background-repeat: initial; background-attachment: initial; background-origin: initial; background-clip: initial; height: auto; overflow-x: auto; padding: 5px !important; line-height: 1.5 !important; font-family: "Courier New", sans-serif !important; border: 1px solid #cccccc !important; border-radius: 3px !important;">pragma solidity ^<span style="margin: 0px; padding: 0px; line-height: 18px;">0.4</span><span style="margin: 0px; padding: 0px; line-height: 18px;">.21</span>; contract InfoContract { string fName; uint age; <span style="margin: 0px; padding: 0px; line-height: 18px;"><span style="margin: 0px; padding: 0px; color: #0000ff; line-height: 18px;">function</span> <span style="margin: 0px; padding: 0px; color: #a31515; line-height: 18px;">setInfo</span>(<span style="margin: 0px; padding: 0px; line-height: 18px;">string _fName, uint _age</span>) <span style="margin: 0px; padding: 0px; color: #a31515; line-height: 18px;">public</span> </span>{ fName = _fName; age = _age; } <span style="margin: 0px; padding: 0px; line-height: 18px;"><span style="margin: 0px; padding: 0px; color: #0000ff; line-height: 18px;">function</span> <span style="margin: 0px; padding: 0px; color: #a31515; line-height: 18px;">getInfo</span>() <span style="margin: 0px; padding: 0px; color: #a31515; line-height: 18px;">public</span> <span style="margin: 0px; padding: 0px; color: #a31515; line-height: 18px;">constant</span> <span style="margin: 0px; padding: 0px; color: #a31515; line-height: 18px;">returns</span> (<span style="margin: 0px; padding: 0px; line-height: 18px;">string, uint</span>) </span>{ <span style="margin: 0px; padding: 0px; color: #0000ff; line-height: 18px;">return</span> (fName, age); } }</code></pre><p style="margin-top: 10px; margin-bottom: 10px; padding: 0px; font-family: verdana, "ms song", 宋体, Arial, 微Y雅黑, Helvetica, sans-serif; font-size: 12px;">代码很简单,是单的l?code style="margin: 1px 5px; line-height: 1.8; vertical-align: middle; display: inline-block; padding: 0px 5px !important; font-family: "Courier New", sans-serif !important; background-color: #f5f5f5 !important; border: 1px solid #cccccc !important; border-radius: 3px !important;">name</code>?code style="margin: 1px 5px; line-height: 1.8; vertical-align: middle; display: inline-block; padding: 0px 5px !important; font-family: "Courier New", sans-serif !important; background-color: #f5f5f5 !important; border: 1px solid #cccccc !important; border-radius: 3px !important;">age</code>变量赋gdQ接下来切换?run ?tab 下,?code style="margin: 1px 5px; line-height: 1.8; vertical-align: middle; display: inline-block; padding: 0px 5px !important; font-family: "Courier New", sans-serif !important; background-color: #f5f5f5 !important; border: 1px solid #cccccc !important; border-radius: 3px !important;">Environment</code>切换?code style="margin: 1px 5px; line-height: 1.8; vertical-align: middle; display: inline-block; padding: 0px 5px !important; font-family: "Courier New", sans-serif !important; background-color: #f5f5f5 !important; border: 1px solid #cccccc !important; border-radius: 3px !important;">Web3 Provider</code>Qƈ输入我们的测试链的地址<code style="margin: 1px 5px; line-height: 1.8; vertical-align: middle; display: inline-block; padding: 0px 5px !important; font-family: "Courier New", sans-serif !important; background-color: #f5f5f5 !important; border: 1px solid #cccccc !important; border-radius: 3px !important;">http://127.0.0.1:7545</code>Q这里对q三个选项做一单说明:</p><ul style="margin: 0px 0px 0px 30px; padding: 0px; word-break: break-all; font-family: verdana, "ms song", 宋体, Arial, 微Y雅黑, Helvetica, sans-serif; font-size: 12px;"><li style="margin: 0px; padding: 0px; list-style: disc;"><code style="margin: 1px 5px; line-height: 1.8; vertical-align: middle; display: inline-block; padding: 0px 5px !important; font-family: "Courier New", sans-serif !important; background-color: #f5f5f5 !important; border: 1px solid #cccccc !important; border-radius: 3px !important;">Javascript VM</code>Q简单的Javascript虚拟机环境,Ual习合约~写的时候可以选择</li><li style="margin: 0px; padding: 0px; list-style: disc;"><code style="margin: 1px 5px; line-height: 1.8; vertical-align: middle; display: inline-block; padding: 0px 5px !important; font-family: "Courier New", sans-serif !important; background-color: #f5f5f5 !important; border: 1px solid #cccccc !important; border-radius: 3px !important;">Injected Web3</code>Q连接到嵌入到页面的Web3Q比如连接到MetaMask</li><li style="margin: 0px; padding: 0px; list-style: disc;"><code style="margin: 1px 5px; line-height: 1.8; vertical-align: middle; display: inline-block; padding: 0px 5px !important; font-family: "Courier New", sans-serif !important; background-color: #f5f5f5 !important; border: 1px solid #cccccc !important; border-radius: 3px !important;">Web3 Provider</code>Q连接到自定义的节点Q如U有的测试网l?/li></ul><p style="margin-top: 10px; margin-bottom: 10px; padding: 0px; font-family: verdana, "ms song", 宋体, Arial, 微Y雅黑, Helvetica, sans-serif; font-size: 12px;">如果q接成功Q那么在下面?code style="margin: 1px 5px; line-height: 1.8; vertical-align: middle; display: inline-block; padding: 0px 5px !important; font-family: "Courier New", sans-serif !important; background-color: #f5f5f5 !important; border: 1px solid #cccccc !important; border-radius: 3px !important;">Account</code>的选项会默认选择 Ganache 创徏的第一个̎户地址。接下来我们点击<code style="margin: 1px 5px; line-height: 1.8; vertical-align: middle; display: inline-block; padding: 0px 5px !important; font-family: "Courier New", sans-serif !important; background-color: #f5f5f5 !important; border: 1px solid #cccccc !important; border-radius: 3px !important;">Create</code>׃我们的合约部v到我们的试|中。接下来 Remix 的页面不要关闭,在后面编写前端代码时q要用到合约的地址以及<code style="margin: 1px 5px; line-height: 1.8; vertical-align: middle; display: inline-block; padding: 0px 5px !important; font-family: "Courier New", sans-serif !important; background-color: #f5f5f5 !important; border: 1px solid #cccccc !important; border-radius: 3px !important;">ABI</code>信息?/p><h2>安装Web3</h2><p style="margin-top: 10px; margin-bottom: 10px; padding: 0px; font-family: verdana, "ms song", 宋体, Arial, 微Y雅黑, Helvetica, sans-serif; font-size: 12px;">在这之前Q先在终端创建我们的目Q?/p><pre style="margin-top: 10px; margin-bottom: 10px; padding: 0px; white-space: pre-wrap; overflow-wrap: break-word; font-size: 12px;"><code style="margin: auto; vertical-align: middle; display: block; background-image: initial; background-position: initial; background-size: initial; background-repeat: initial; background-attachment: initial; background-origin: initial; background-clip: initial; height: auto; overflow-x: auto; padding: 5px !important; line-height: 1.5 !important; font-family: "Courier New", sans-serif !important; border: 1px solid #cccccc !important; border-radius: 3px !important;">> mkdir info > <span style="margin: 0px; padding: 0px; color: #0000ff; line-height: 18px;">cd</span> info</code></pre><p style="margin-top: 10px; margin-bottom: 10px; padding: 0px; font-family: verdana, "ms song", 宋体, Arial, 微Y雅黑, Helvetica, sans-serif; font-size: 12px;">接下来?node.js 的包理工具 npm 初始化项目,创徏<code style="margin: 1px 5px; line-height: 1.8; vertical-align: middle; display: inline-block; padding: 0px 5px !important; font-family: "Courier New", sans-serif !important; background-color: #f5f5f5 !important; border: 1px solid #cccccc !important; border-radius: 3px !important;">package.json</code> 文gQ其中保存了目需要的相关依赖环境?/p><pre style="margin-top: 10px; margin-bottom: 10px; padding: 0px; white-space: pre-wrap; overflow-wrap: break-word; font-size: 12px;"><code shell"="" style="margin: auto; vertical-align: middle; display: block; background-image: initial; background-position: initial; background-size: initial; background-repeat: initial; background-attachment: initial; background-origin: initial; background-clip: initial; height: auto; overflow-x: auto; padding: 5px !important; line-height: 1.5 !important; font-family: "Courier New", sans-serif !important; border: 1px solid #cccccc !important; border-radius: 3px !important;"><span style="margin: 0px; padding: 0px; color: #2b91af; line-height: 18px;">></span><span style="margin: 0px; padding: 0px; line-height: 18px;"> npm init</span></code></pre><p style="margin-top: 10px; margin-bottom: 10px; padding: 0px; font-family: verdana, "ms song", 宋体, Arial, 微Y雅黑, Helvetica, sans-serif; font-size: 12px;">一路按回R直到目创徏完成。最后,q行下面命o安装web.jsQ?/p><pre style="margin-top: 10px; margin-bottom: 10px; padding: 0px; white-space: pre-wrap; overflow-wrap: break-word; font-size: 12px;"><code shell"="" style="margin: auto; vertical-align: middle; display: block; background-image: initial; background-position: initial; background-size: initial; background-repeat: initial; background-attachment: initial; background-origin: initial; background-clip: initial; height: auto; overflow-x: auto; padding: 5px !important; line-height: 1.5 !important; font-family: "Courier New", sans-serif !important; border: 1px solid #cccccc !important; border-radius: 3px !important;"><span style="margin: 0px; padding: 0px; color: #2b91af; line-height: 18px;">></span><span style="margin: 0px; padding: 0px; line-height: 18px;"> npm install web3</span></code></pre><blockquote style="margin-right: 0px; margin-left: 0px; background-image: none; font-family: verdana, "ms song", 宋体, Arial, 微Y雅黑, Helvetica, sans-serif; font-size: 12px;"><p style="margin-top: 10px; margin-bottom: 10px; padding: 0px;"><em style="margin: 0px; padding: 0px;">注意Q?/em> 在实际安装过E中我发现web3在安装完成后q没?nbsp;<code style="margin: 1px 5px; line-height: 1.8; vertical-align: middle; display: inline-block; padding: 0px 5px !important; font-family: "Courier New", sans-serif !important; background-color: #f5f5f5 !important; border: 1px solid #cccccc !important; border-radius: 3px !important;">/node_modules/web3/dist/we3.min.js</code> 文gQ这个问题在 <a style="margin: 0px; padding: 0px; color: #3b5999; text-decoration-line: none;">issue#1041</a>中有体现Q但官方好像一直没解决。不q可以在q里<a style="margin: 0px; padding: 0px; color: #3b5999; text-decoration-line: none;">下蝲</a>所需的文Ӟ解压后将<code style="margin: 1px 5px; line-height: 1.8; vertical-align: middle; display: inline-block; padding: 0px 5px !important; font-family: "Courier New", sans-serif !important; background-color: #f5f5f5 !important; border: 1px solid #cccccc !important; border-radius: 3px !important;">dist</code>文g夹的内容拯?nbsp;<code style="margin: 1px 5px; line-height: 1.8; vertical-align: middle; display: inline-block; padding: 0px 5px !important; font-family: "Courier New", sans-serif !important; background-color: #f5f5f5 !important; border: 1px solid #cccccc !important; border-radius: 3px !important;">/node_modules/web3</code>路径下?/p></blockquote><h2>创徏 UI</h2><p style="margin-top: 10px; margin-bottom: 10px; padding: 0px; font-family: verdana, "ms song", 宋体, Arial, 微Y雅黑, Helvetica, sans-serif; font-size: 12px;">在项目目录下创徏<code style="margin: 1px 5px; line-height: 1.8; vertical-align: middle; display: inline-block; padding: 0px 5px !important; font-family: "Courier New", sans-serif !important; background-color: #f5f5f5 !important; border: 1px solid #cccccc !important; border-radius: 3px !important;">index.html</code>Q在q里我们创建基?UIQ功能包?code style="margin: 1px 5px; line-height: 1.8; vertical-align: middle; display: inline-block; padding: 0px 5px !important; font-family: "Courier New", sans-serif !important; background-color: #f5f5f5 !important; border: 1px solid #cccccc !important; border-radius: 3px !important;">name</code>?code style="margin: 1px 5px; line-height: 1.8; vertical-align: middle; display: inline-block; padding: 0px 5px !important; font-family: "Courier New", sans-serif !important; background-color: #f5f5f5 !important; border: 1px solid #cccccc !important; border-radius: 3px !important;">age</code>的输入框Q以及一个按钮,q些通过 jQuery 实现Q?/p><pre style="margin-top: 10px; margin-bottom: 10px; padding: 0px; white-space: pre-wrap; overflow-wrap: break-word; font-size: 12px;"><code xml"="" style="margin: auto; vertical-align: middle; display: block; background-image: initial; background-position: initial; background-size: initial; background-repeat: initial; background-attachment: initial; background-origin: initial; background-clip: initial; height: auto; overflow-x: auto; padding: 5px !important; line-height: 1.5 !important; font-family: "Courier New", sans-serif !important; border: 1px solid #cccccc !important; border-radius: 3px !important;"><span style="margin: 0px; padding: 0px; color: #2b91af; line-height: 18px;"><!DOCTYPE html></span> <span style="margin: 0px; padding: 0px; color: #0000ff; line-height: 18px;"><<span style="margin: 0px; padding: 0px; line-height: 18px;">html</span> <span style="margin: 0px; padding: 0px; color: #ff0000; line-height: 18px;">lang</span>=<span style="margin: 0px; padding: 0px; color: #a31515; line-height: 18px;">"en"</span>></span> <span style="margin: 0px; padding: 0px; color: #0000ff; line-height: 18px;"><<span style="margin: 0px; padding: 0px; line-height: 18px;">head</span>></span> <span style="margin: 0px; padding: 0px; color: #0000ff; line-height: 18px;"><<span style="margin: 0px; padding: 0px; line-height: 18px;">meta</span> <span style="margin: 0px; padding: 0px; color: #ff0000; line-height: 18px;">charset</span>=<span style="margin: 0px; padding: 0px; color: #a31515; line-height: 18px;">"UTF-8"</span>></span> <span style="margin: 0px; padding: 0px; color: #0000ff; line-height: 18px;"><<span style="margin: 0px; padding: 0px; line-height: 18px;">meta</span> <span style="margin: 0px; padding: 0px; color: #ff0000; line-height: 18px;">name</span>=<span style="margin: 0px; padding: 0px; color: #a31515; line-height: 18px;">"viewport"</span> <span style="margin: 0px; padding: 0px; color: #ff0000; line-height: 18px;">content</span>=<span style="margin: 0px; padding: 0px; color: #a31515; line-height: 18px;">"width=device-width, initial-scale=1.0"</span>></span> <span style="margin: 0px; padding: 0px; color: #0000ff; line-height: 18px;"><<span style="margin: 0px; padding: 0px; line-height: 18px;">meta</span> <span style="margin: 0px; padding: 0px; color: #ff0000; line-height: 18px;">http-equiv</span>=<span style="margin: 0px; padding: 0px; color: #a31515; line-height: 18px;">"X-UA-Compatible"</span> <span style="margin: 0px; padding: 0px; color: #ff0000; line-height: 18px;">content</span>=<span style="margin: 0px; padding: 0px; color: #a31515; line-height: 18px;">"ie=edge"</span>></span> <span style="margin: 0px; padding: 0px; color: #0000ff; line-height: 18px;"><<span style="margin: 0px; padding: 0px; line-height: 18px;">title</span>></span>Document<span style="margin: 0px; padding: 0px; color: #0000ff; line-height: 18px;"></<span style="margin: 0px; padding: 0px; line-height: 18px;">title</span>></span> <span style="margin: 0px; padding: 0px; color: #0000ff; line-height: 18px;"><<span style="margin: 0px; padding: 0px; line-height: 18px;">link</span> <span style="margin: 0px; padding: 0px; color: #ff0000; line-height: 18px;">rel</span>=<span style="margin: 0px; padding: 0px; color: #a31515; line-height: 18px;">"stylesheet"</span> <span style="margin: 0px; padding: 0px; color: #ff0000; line-height: 18px;">type</span>=<span style="margin: 0px; padding: 0px; color: #a31515; line-height: 18px;">"text/css"</span> <span style="margin: 0px; padding: 0px; color: #ff0000; line-height: 18px;">href</span>=<span style="margin: 0px; padding: 0px; color: #a31515; line-height: 18px;">"main.css"</span>></span> <span style="margin: 0px; padding: 0px; color: #0000ff; line-height: 18px;"><<span style="margin: 0px; padding: 0px; line-height: 18px;">script</span> <span style="margin: 0px; padding: 0px; color: #ff0000; line-height: 18px;">src</span>=<span style="margin: 0px; padding: 0px; color: #a31515; line-height: 18px;">"./node_modules/web3/dist/web3.min.js"</span>></span><span style="margin: 0px; padding: 0px; color: #0000ff; line-height: 18px;"></<span style="margin: 0px; padding: 0px; line-height: 18px;">script</span>></span> <span style="margin: 0px; padding: 0px; color: #0000ff; line-height: 18px;"></<span style="margin: 0px; padding: 0px; line-height: 18px;">head</span>></span> <span style="margin: 0px; padding: 0px; color: #0000ff; line-height: 18px;"><<span style="margin: 0px; padding: 0px; line-height: 18px;">body</span>></span> <span style="margin: 0px; padding: 0px; color: #0000ff; line-height: 18px;"><<span style="margin: 0px; padding: 0px; line-height: 18px;">div</span> <span style="margin: 0px; padding: 0px; color: #ff0000; line-height: 18px;">class</span>=<span style="margin: 0px; padding: 0px; color: #a31515; line-height: 18px;">"container"</span>></span> <span style="margin: 0px; padding: 0px; color: #0000ff; line-height: 18px;"><<span style="margin: 0px; padding: 0px; line-height: 18px;">h1</span>></span>Info Contract<span style="margin: 0px; padding: 0px; color: #0000ff; line-height: 18px;"></<span style="margin: 0px; padding: 0px; line-height: 18px;">h1</span>></span> <span style="margin: 0px; padding: 0px; color: #0000ff; line-height: 18px;"><<span style="margin: 0px; padding: 0px; line-height: 18px;">h2</span> <span style="margin: 0px; padding: 0px; color: #ff0000; line-height: 18px;">id</span>=<span style="margin: 0px; padding: 0px; color: #a31515; line-height: 18px;">"info"</span>></span><span style="margin: 0px; padding: 0px; color: #0000ff; line-height: 18px;"></<span style="margin: 0px; padding: 0px; line-height: 18px;">h2</span>></span> <span style="margin: 0px; padding: 0px; color: #0000ff; line-height: 18px;"><<span style="margin: 0px; padding: 0px; line-height: 18px;">label</span> <span style="margin: 0px; padding: 0px; color: #ff0000; line-height: 18px;">for</span>=<span style="margin: 0px; padding: 0px; color: #a31515; line-height: 18px;">"name"</span> <span style="margin: 0px; padding: 0px; color: #ff0000; line-height: 18px;">class</span>=<span style="margin: 0px; padding: 0px; color: #a31515; line-height: 18px;">"col-lg-2 control-label"</span>></span>Name<span style="margin: 0px; padding: 0px; color: #0000ff; line-height: 18px;"></<span style="margin: 0px; padding: 0px; line-height: 18px;">label</span>></span> <span style="margin: 0px; padding: 0px; color: #0000ff; line-height: 18px;"><<span style="margin: 0px; padding: 0px; line-height: 18px;">input</span> <span style="margin: 0px; padding: 0px; color: #ff0000; line-height: 18px;">id</span>=<span style="margin: 0px; padding: 0px; color: #a31515; line-height: 18px;">"name"</span> <span style="margin: 0px; padding: 0px; color: #ff0000; line-height: 18px;">type</span>=<span style="margin: 0px; padding: 0px; color: #a31515; line-height: 18px;">"text"</span>></span> <span style="margin: 0px; padding: 0px; color: #0000ff; line-height: 18px;"><<span style="margin: 0px; padding: 0px; line-height: 18px;">label</span> <span style="margin: 0px; padding: 0px; color: #ff0000; line-height: 18px;">for</span>=<span style="margin: 0px; padding: 0px; color: #a31515; line-height: 18px;">"name"</span> <span style="margin: 0px; padding: 0px; color: #ff0000; line-height: 18px;">class</span>=<span style="margin: 0px; padding: 0px; color: #a31515; line-height: 18px;">"col-lg-2 control-label"</span>></span>Age<span style="margin: 0px; padding: 0px; color: #0000ff; line-height: 18px;"></<span style="margin: 0px; padding: 0px; line-height: 18px;">label</span>></span> <span style="margin: 0px; padding: 0px; color: #0000ff; line-height: 18px;"><<span style="margin: 0px; padding: 0px; line-height: 18px;">input</span> <span style="margin: 0px; padding: 0px; color: #ff0000; line-height: 18px;">id</span>=<span style="margin: 0px; padding: 0px; color: #a31515; line-height: 18px;">"age"</span> <span style="margin: 0px; padding: 0px; color: #ff0000; line-height: 18px;">type</span>=<span style="margin: 0px; padding: 0px; color: #a31515; line-height: 18px;">"text"</span>></span> <span style="margin: 0px; padding: 0px; color: #0000ff; line-height: 18px;"><<span style="margin: 0px; padding: 0px; line-height: 18px;">button</span> <span style="margin: 0px; padding: 0px; color: #ff0000; line-height: 18px;">id</span>=<span style="margin: 0px; padding: 0px; color: #a31515; line-height: 18px;">"button"</span>></span>Update Info<span style="margin: 0px; padding: 0px; color: #0000ff; line-height: 18px;"></<span style="margin: 0px; padding: 0px; line-height: 18px;">button</span>></span> <span style="margin: 0px; padding: 0px; color: #0000ff; line-height: 18px;"></<span style="margin: 0px; padding: 0px; line-height: 18px;">div</span>></span> <span style="margin: 0px; padding: 0px; color: #0000ff; line-height: 18px;"><<span style="margin: 0px; padding: 0px; line-height: 18px;">script</span> <span style="margin: 0px; padding: 0px; color: #ff0000; line-height: 18px;">src</span>=<span style="margin: 0px; padding: 0px; color: #a31515; line-height: 18px;">"https://code.jquery.com/jquery-3.2.1.slim.min.js"</span>></span><span style="margin: 0px; padding: 0px; color: #0000ff; line-height: 18px;"></<span style="margin: 0px; padding: 0px; line-height: 18px;">script</span>></span> <span style="margin: 0px; padding: 0px; color: #0000ff; line-height: 18px;"><<span style="margin: 0px; padding: 0px; line-height: 18px;">script</span>></span><span style="margin: 0px; padding: 0px; line-height: 18px;"> <span style="margin: 0px; padding: 0px; color: #008000; line-height: 18px;">// Our future code here..</span> </span><span style="margin: 0px; padding: 0px; color: #0000ff; line-height: 18px;"></<span style="margin: 0px; padding: 0px; line-height: 18px;">script</span>></span> <span style="margin: 0px; padding: 0px; color: #0000ff; line-height: 18px;"></<span style="margin: 0px; padding: 0px; line-height: 18px;">body</span>></span> <span style="margin: 0px; padding: 0px; color: #0000ff; line-height: 18px;"></<span style="margin: 0px; padding: 0px; line-height: 18px;">html</span>></span></code></pre><p style="margin-top: 10px; margin-bottom: 10px; padding: 0px; font-family: verdana, "ms song", 宋体, Arial, 微Y雅黑, Helvetica, sans-serif; font-size: 12px;">接下来需要编?code style="margin: 1px 5px; line-height: 1.8; vertical-align: middle; display: inline-block; padding: 0px 5px !important; font-family: "Courier New", sans-serif !important; background-color: #f5f5f5 !important; border: 1px solid #cccccc !important; border-radius: 3px !important;">main.css</code>文g讑֮基本的样式:</p><pre style="margin-top: 10px; margin-bottom: 10px; padding: 0px; white-space: pre-wrap; overflow-wrap: break-word; font-size: 12px;"><code style="margin: auto; vertical-align: middle; display: block; background-image: initial; background-position: initial; background-size: initial; background-repeat: initial; background-attachment: initial; background-origin: initial; background-clip: initial; height: auto; overflow-x: auto; padding: 5px !important; line-height: 1.5 !important; font-family: "Courier New", sans-serif !important; border: 1px solid #cccccc !important; border-radius: 3px !important;"><span style="margin: 0px; padding: 0px; color: #0000ff; line-height: 18px;">body</span> { <span style="margin: 0px; padding: 0px; color: #a31515; line-height: 18px;">background-color</span>:<span style="margin: 0px; padding: 0px; line-height: 18px;">#F0F0F0</span>; <span style="margin: 0px; padding: 0px; color: #a31515; line-height: 18px;">padding</span>: <span style="margin: 0px; padding: 0px; line-height: 18px;">2em</span>; <span style="margin: 0px; padding: 0px; color: #a31515; line-height: 18px;">font-family</span>: <span style="margin: 0px; padding: 0px; color: #a31515; line-height: 18px;">'Raleway'</span>,<span style="margin: 0px; padding: 0px; color: #a31515; line-height: 18px;">'Source Sans Pro'</span>, <span style="margin: 0px; padding: 0px; color: #a31515; line-height: 18px;">'Arial'</span>; } <span style="margin: 0px; padding: 0px; line-height: 18px;">.container</span> { <span style="margin: 0px; padding: 0px; color: #a31515; line-height: 18px;">width</span>: <span style="margin: 0px; padding: 0px; line-height: 18px;">50%</span>; <span style="margin: 0px; padding: 0px; color: #a31515; line-height: 18px;">margin</span>: <span style="margin: 0px; padding: 0px; line-height: 18px;">0</span> auto; } <span style="margin: 0px; padding: 0px; color: #0000ff; line-height: 18px;">label</span> { <span style="margin: 0px; padding: 0px; color: #a31515; line-height: 18px;">display</span>:block; <span style="margin: 0px; padding: 0px; color: #a31515; line-height: 18px;">margin-bottom</span>:<span style="margin: 0px; padding: 0px; line-height: 18px;">10px</span>; } <span style="margin: 0px; padding: 0px; color: #0000ff; line-height: 18px;">input</span> { <span style="margin: 0px; padding: 0px; color: #a31515; line-height: 18px;">padding</span>:<span style="margin: 0px; padding: 0px; line-height: 18px;">10px</span>; <span style="margin: 0px; padding: 0px; color: #a31515; line-height: 18px;">width</span>: <span style="margin: 0px; padding: 0px; line-height: 18px;">50%</span>; <span style="margin: 0px; padding: 0px; color: #a31515; line-height: 18px;">margin-bottom</span>: <span style="margin: 0px; padding: 0px; line-height: 18px;">1em</span>; } <span style="margin: 0px; padding: 0px; color: #0000ff; line-height: 18px;">button</span> { <span style="margin: 0px; padding: 0px; color: #a31515; line-height: 18px;">margin</span>: <span style="margin: 0px; padding: 0px; line-height: 18px;">2em</span> <span style="margin: 0px; padding: 0px; line-height: 18px;">0</span>; <span style="margin: 0px; padding: 0px; color: #a31515; line-height: 18px;">padding</span>: <span style="margin: 0px; padding: 0px; line-height: 18px;">1em</span> <span style="margin: 0px; padding: 0px; line-height: 18px;">4em</span>; <span style="margin: 0px; padding: 0px; color: #a31515; line-height: 18px;">display</span>:block; } <span style="margin: 0px; padding: 0px; line-height: 18px;">#info</span> { <span style="margin: 0px; padding: 0px; color: #a31515; line-height: 18px;">padding</span>:<span style="margin: 0px; padding: 0px; line-height: 18px;">1em</span>; <span style="margin: 0px; padding: 0px; color: #a31515; line-height: 18px;">background-color</span>:<span style="margin: 0px; padding: 0px; line-height: 18px;">#fff</span>; <span style="margin: 0px; padding: 0px; color: #a31515; line-height: 18px;">margin</span>: <span style="margin: 0px; padding: 0px; line-height: 18px;">1em</span> <span style="margin: 0px; padding: 0px; line-height: 18px;">0</span>; }</code></pre><h2>使用Web3与智能合U交?/h2><p style="margin-top: 10px; margin-bottom: 10px; padding: 0px; font-family: verdana, "ms song", 宋体, Arial, 微Y雅黑, Helvetica, sans-serif; font-size: 12px;">UI 创徏好之后,?code style="margin: 1px 5px; line-height: 1.8; vertical-align: middle; display: inline-block; padding: 0px 5px !important; font-family: "Courier New", sans-serif !important; background-color: #f5f5f5 !important; border: 1px solid #cccccc !important; border-radius: 3px !important;"><script></code>标签中间~写<code style="margin: 1px 5px; line-height: 1.8; vertical-align: middle; display: inline-block; padding: 0px 5px !important; font-family: "Courier New", sans-serif !important; background-color: #f5f5f5 !important; border: 1px solid #cccccc !important; border-radius: 3px !important;">web.js</code>的代码与合约交互。首先创?code style="margin: 1px 5px; line-height: 1.8; vertical-align: middle; display: inline-block; padding: 0px 5px !important; font-family: "Courier New", sans-serif !important; background-color: #f5f5f5 !important; border: 1px solid #cccccc !important; border-radius: 3px !important;">web3</code>实例Qƈ与我们的试环境q接Q?/p><pre style="margin-top: 10px; margin-bottom: 10px; padding: 0px; white-space: pre-wrap; overflow-wrap: break-word; font-size: 12px;"><code javascript"="" style="margin: auto; vertical-align: middle; display: block; background-image: initial; background-position: initial; background-size: initial; background-repeat: initial; background-attachment: initial; background-origin: initial; background-clip: initial; height: auto; overflow-x: auto; padding: 5px !important; line-height: 1.5 !important; font-family: "Courier New", sans-serif !important; border: 1px solid #cccccc !important; border-radius: 3px !important;"><script> <span style="margin: 0px; padding: 0px; color: #0000ff; line-height: 18px;">if</span> (<span style="margin: 0px; padding: 0px; color: #0000ff; line-height: 18px;">typeof</span> web3 !== <span style="margin: 0px; padding: 0px; color: #a31515; line-height: 18px;">'undefined'</span>) { web3 = <span style="margin: 0px; padding: 0px; color: #0000ff; line-height: 18px;">new</span> Web3(web3.currentProvider); } <span style="margin: 0px; padding: 0px; color: #0000ff; line-height: 18px;">else</span> { <span style="margin: 0px; padding: 0px; color: #008000; line-height: 18px;">// set the provider you want from Web3.providers</span> web3 = <span style="margin: 0px; padding: 0px; color: #0000ff; line-height: 18px;">new</span> Web3(<span style="margin: 0px; padding: 0px; color: #0000ff; line-height: 18px;">new</span> Web3.providers.HttpProvider(<span style="margin: 0px; padding: 0px; color: #a31515; line-height: 18px;">"http://localhost:7545"</span>)); } <<span style="margin: 0px; padding: 0px; line-height: 18px;">/script></span></code></pre><p style="margin-top: 10px; margin-bottom: 10px; padding: 0px; font-family: verdana, "ms song", 宋体, Arial, 微Y雅黑, Helvetica, sans-serif; font-size: 12px;">q段代码?a style="margin: 0px; padding: 0px; color: #3b5999; text-decoration-line: none;">web3.js Github</a>提供的样例,意思是如果<code style="margin: 1px 5px; line-height: 1.8; vertical-align: middle; display: inline-block; padding: 0px 5px !important; font-family: "Courier New", sans-serif !important; background-color: #f5f5f5 !important; border: 1px solid #cccccc !important; border-radius: 3px !important;">web3</code>已经被定义,那么可以直接当作我们的 provider 使用。如果没有定义,则我们手动指?provider?/p><blockquote style="margin-right: 0px; margin-left: 0px; background-image: none; font-family: verdana, "ms song", 宋体, Arial, 微Y雅黑, Helvetica, sans-serif; font-size: 12px;"><p style="margin-top: 10px; margin-bottom: 10px; padding: 0px;">q里可能会存在疑问:Z?web3 会被事先定义呢?实际上,如果你用类?nbsp;<a style="margin: 0px; padding: 0px; color: #3b5999; text-decoration-line: none;">MetaMask</a>Q一?Chrome 上的插gQ迷你型以太坊钱包)q样的YӞprovider ׃被自动植入?/p></blockquote><p style="margin-top: 10px; margin-bottom: 10px; padding: 0px; font-family: verdana, "ms song", 宋体, Arial, 微Y雅黑, Helvetica, sans-serif; font-size: 12px;">在上面代码的基础上,接下来设|默认的以太坊̎P</p><pre style="margin-top: 10px; margin-bottom: 10px; padding: 0px; white-space: pre-wrap; overflow-wrap: break-word; font-size: 12px;"><code javascript"="" style="margin: auto; vertical-align: middle; display: block; background-image: initial; background-position: initial; background-size: initial; background-repeat: initial; background-attachment: initial; background-origin: initial; background-clip: initial; height: auto; overflow-x: auto; padding: 5px !important; line-height: 1.5 !important; font-family: "Courier New", sans-serif !important; border: 1px solid #cccccc !important; border-radius: 3px !important;">web3.eth.defaultAccount = web3.eth.accounts[<span style="margin: 0px; padding: 0px; line-height: 18px;">0</span>];</code></pre><p style="margin-top: 10px; margin-bottom: 10px; padding: 0px; font-family: verdana, "ms song", 宋体, Arial, 微Y雅黑, Helvetica, sans-serif; font-size: 12px;">在上文中我们使用 Ganache 已经创徏?10 个̎户了Q这里我们选择W一个̎户当作默认̎戗?/p><p style="margin-top: 10px; margin-bottom: 10px; padding: 0px; font-family: verdana, "ms song", 宋体, Arial, 微Y雅黑, Helvetica, sans-serif; font-size: 12px;">接下来需要让我们?code style="margin: 1px 5px; line-height: 1.8; vertical-align: middle; display: inline-block; padding: 0px 5px !important; font-family: "Courier New", sans-serif !important; background-color: #f5f5f5 !important; border: 1px solid #cccccc !important; border-radius: 3px !important;">web3</code>知道我们的合U是什么样的,q里需要用到合U的 <a style="margin: 0px; padding: 0px; color: #3b5999; text-decoration-line: none;">ABIQApplication Binary InterfaceQ?/a>?code style="margin: 1px 5px; line-height: 1.8; vertical-align: middle; display: inline-block; padding: 0px 5px !important; font-family: "Courier New", sans-serif !important; background-color: #f5f5f5 !important; border: 1px solid #cccccc !important; border-radius: 3px !important;">ABI</code>可以使我们调用合U的函数Qƈ且从合约中获取数据?/p><p style="margin-top: 10px; margin-bottom: 10px; padding: 0px; font-family: verdana, "ms song", 宋体, Arial, 微Y雅黑, Helvetica, sans-serif; font-size: 12px;">在上文中我们已经?Remix 中创Z我们的合U,q时重新回到 RemixQ在 Compile ?tab 下我们点?code style="margin: 1px 5px; line-height: 1.8; vertical-align: middle; display: inline-block; padding: 0px 5px !important; font-family: "Courier New", sans-serif !important; background-color: #f5f5f5 !important; border: 1px solid #cccccc !important; border-radius: 3px !important;">Details</code> 出现的页面中我们可以拯合约?code style="margin: 1px 5px; line-height: 1.8; vertical-align: middle; display: inline-block; padding: 0px 5px !important; font-family: "Courier New", sans-serif !important; background-color: #f5f5f5 !important; border: 1px solid #cccccc !important; border-radius: 3px !important;">ABI</code>Q如下图所C?br style="margin: 0px; padding: 0px;" /><img src="https://learnblockchain.cn/images/ABI.png" style="margin: 0px; padding: 0px; border: 0px; max-width: 720px; height: auto;" alt="" /><br style="margin: 0px; padding: 0px;" />其复制C码中Q?/p><pre style="margin-top: 10px; margin-bottom: 10px; padding: 0px; white-space: pre-wrap; overflow-wrap: break-word; font-size: 12px;"><code javascript"="" style="margin: auto; vertical-align: middle; display: block; background-image: initial; background-position: initial; background-size: initial; background-repeat: initial; background-attachment: initial; background-origin: initial; background-clip: initial; height: auto; overflow-x: auto; padding: 5px !important; line-height: 1.5 !important; font-family: "Courier New", sans-serif !important; border: 1px solid #cccccc !important; border-radius: 3px !important;"><span style="margin: 0px; padding: 0px; color: #0000ff; line-height: 18px;">var</span> infoContract = web3.eth.contract(PASTE ABI HERE!);</code></pre><p style="margin-top: 10px; margin-bottom: 10px; padding: 0px; font-family: verdana, "ms song", 宋体, Arial, 微Y雅黑, Helvetica, sans-serif; font-size: 12px;">接下来{?run 的tabQ拷贝合U的地址Q将其复制到下面的代码中Q?/p><pre style="margin-top: 10px; margin-bottom: 10px; padding: 0px; white-space: pre-wrap; overflow-wrap: break-word; font-size: 12px;"><code javascript"="" style="margin: auto; vertical-align: middle; display: block; background-image: initial; background-position: initial; background-size: initial; background-repeat: initial; background-attachment: initial; background-origin: initial; background-clip: initial; height: auto; overflow-x: auto; padding: 5px !important; line-height: 1.5 !important; font-family: "Courier New", sans-serif !important; border: 1px solid #cccccc !important; border-radius: 3px !important;"><span style="margin: 0px; padding: 0px; color: #0000ff; line-height: 18px;">var</span> info = InfoContract.at(<span style="margin: 0px; padding: 0px; color: #a31515; line-height: 18px;">'PASTE CONTRACT ADDRESS HERE'</span>);</code></pre><p style="margin-top: 10px; margin-bottom: 10px; padding: 0px; font-family: verdana, "ms song", 宋体, Arial, 微Y雅黑, Helvetica, sans-serif; font-size: 12px;">完成q些我们可以调用合U中的函CQ下面我们?jQuery 与我们的合约q行交互Q?/p><pre style="margin-top: 10px; margin-bottom: 10px; padding: 0px; white-space: pre-wrap; overflow-wrap: break-word; font-size: 12px;"><code javascript"="" style="margin: auto; vertical-align: middle; display: block; background-image: initial; background-position: initial; background-size: initial; background-repeat: initial; background-attachment: initial; background-origin: initial; background-clip: initial; height: auto; overflow-x: auto; padding: 5px !important; line-height: 1.5 !important; font-family: "Courier New", sans-serif !important; border: 1px solid #cccccc !important; border-radius: 3px !important;">info.getInfo(<span style="margin: 0px; padding: 0px; line-height: 18px;"><span style="margin: 0px; padding: 0px; color: #0000ff; line-height: 18px;">function</span>(<span style="margin: 0px; padding: 0px; line-height: 18px;">error, result</span>)</span>{ <span style="margin: 0px; padding: 0px; color: #0000ff; line-height: 18px;">if</span>(!error) { $(<span style="margin: 0px; padding: 0px; color: #a31515; line-height: 18px;">"#info"</span>).html(result[<span style="margin: 0px; padding: 0px; line-height: 18px;">0</span>]+<span style="margin: 0px; padding: 0px; color: #a31515; line-height: 18px;">' ('</span>+result[<span style="margin: 0px; padding: 0px; line-height: 18px;">1</span>]+<span style="margin: 0px; padding: 0px; color: #a31515; line-height: 18px;">' years old)'</span>); <span style="margin: 0px; padding: 0px; color: #0000ff; line-height: 18px;">console</span>.log(result); } <span style="margin: 0px; padding: 0px; color: #0000ff; line-height: 18px;">else</span> <span style="margin: 0px; padding: 0px; color: #0000ff; line-height: 18px;">console</span>.error(error); }); $(<span style="margin: 0px; padding: 0px; color: #a31515; line-height: 18px;">"#button"</span>).click(<span style="margin: 0px; padding: 0px; line-height: 18px;"><span style="margin: 0px; padding: 0px; color: #0000ff; line-height: 18px;">function</span>() </span>{ info.setInfo($(<span style="margin: 0px; padding: 0px; color: #a31515; line-height: 18px;">"#name"</span>).val(), $(<span style="margin: 0px; padding: 0px; color: #a31515; line-height: 18px;">"#age"</span>).val()); });</code></pre><p style="margin-top: 10px; margin-bottom: 10px; padding: 0px; font-family: verdana, "ms song", 宋体, Arial, 微Y雅黑, Helvetica, sans-serif; font-size: 12px;">以上的代码就单地实现了对合约中两个函数的调用Q分别读取和昄<code style="margin: 1px 5px; line-height: 1.8; vertical-align: middle; display: inline-block; padding: 0px 5px !important; font-family: "Courier New", sans-serif !important; background-color: #f5f5f5 !important; border: 1px solid #cccccc !important; border-radius: 3px !important;">name</code>?code style="margin: 1px 5px; line-height: 1.8; vertical-align: middle; display: inline-block; padding: 0px 5px !important; font-family: "Courier New", sans-serif !important; background-color: #f5f5f5 !important; border: 1px solid #cccccc !important; border-radius: 3px !important;">age</code>变量?/p><p style="margin-top: 10px; margin-bottom: 10px; padding: 0px; font-family: verdana, "ms song", 宋体, Arial, 微Y雅黑, Helvetica, sans-serif; font-size: 12px;">到此我们完成了全部的代码,完整代码可以?nbsp;<a style="margin: 0px; padding: 0px; color: #3b5999; text-decoration-line: none;">InfoContract</a> 中找到。在览器中打开<code style="margin: 1px 5px; line-height: 1.8; vertical-align: middle; display: inline-block; padding: 0px 5px !important; font-family: "Courier New", sans-serif !important; background-color: #f5f5f5 !important; border: 1px solid #cccccc !important; border-radius: 3px !important;">index.html</code>试效果如下图(输入名字和年龄后hQ?/p><p style="margin-top: 10px; margin-bottom: 10px; padding: 0px; font-family: verdana, "ms song", 宋体, Arial, 微Y雅黑, Helvetica, sans-serif; font-size: 12px;"><img src="https://learnblockchain.cn/images/page.png" style="margin: 0px; padding: 0px; border: 0px; max-width: 720px; height: auto;" alt="" /></p><p style="margin-top: 10px; margin-bottom: 10px; padding: 0px; font-family: verdana, "ms song", 宋体, Arial, 微Y雅黑, Helvetica, sans-serif; font-size: 12px;">本文的作者是盖盖Q他的微信公众号: chainlab</p><h2>参考文?/h2><ul style="margin: 0px 0px 0px 30px; padding: 0px; word-break: break-all; font-family: verdana, "ms song", 宋体, Arial, 微Y雅黑, Helvetica, sans-serif; font-size: 12px;"><li style="margin: 0px; padding: 0px; list-style: disc;"><a style="margin: 0px; padding: 0px; color: #3b5999; text-decoration-line: none;">Interacting with a Smart Contract through Web3.js (Tutorial)</a></li></ul><p style="margin-top: 10px; margin-bottom: 10px; padding: 0px; font-family: verdana, "ms song", 宋体, Arial, 微Y雅黑, Helvetica, sans-serif; font-size: 12px;">☛ <a style="margin: 0px; padding: 0px; color: #3b5999; text-decoration-line: none;">深入出区块?/a> - pȝ学习区块链,打造最好的区块链技术博客?/p><img src ="http://www.aygfsteel.com/waterjava/aggbug/434979.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.aygfsteel.com/waterjava/" target="_blank">狼爱上狸</a> 2019-12-21 14:46 <a href="http://www.aygfsteel.com/waterjava/archive/2019/12/21/434979.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>GitHub目、代码搜索、用等技?/title><link>http://www.aygfsteel.com/waterjava/archive/2019/12/21/434977.html</link><dc:creator>狼爱上狸</dc:creator><author>狼爱上狸</author><pubDate>Sat, 21 Dec 2019 02:14:00 GMT</pubDate><guid>http://www.aygfsteel.com/waterjava/archive/2019/12/21/434977.html</guid><wfw:comment>http://www.aygfsteel.com/waterjava/comments/434977.html</wfw:comment><comments>http://www.aygfsteel.com/waterjava/archive/2019/12/21/434977.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.aygfsteel.com/waterjava/comments/commentRss/434977.html</wfw:commentRss><trackback:ping>http://www.aygfsteel.com/waterjava/services/trackbacks/434977.html</trackback:ping><description><![CDATA[https://blog.csdn.net/xiaomu_347/article/details/80729892<img src ="http://www.aygfsteel.com/waterjava/aggbug/434977.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.aygfsteel.com/waterjava/" target="_blank">狼爱上狸</a> 2019-12-21 10:14 <a href="http://www.aygfsteel.com/waterjava/archive/2019/12/21/434977.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>如何?GitHub 上找C要的代码?http://www.aygfsteel.com/waterjava/archive/2019/12/20/434976.html狼爱上狸狼爱上狸Fri, 20 Dec 2019 08:49:00 GMThttp://www.aygfsteel.com/waterjava/archive/2019/12/20/434976.htmlhttp://www.aygfsteel.com/waterjava/comments/434976.htmlhttp://www.aygfsteel.com/waterjava/archive/2019/12/20/434976.html#Feedback0http://www.aygfsteel.com/waterjava/comments/commentRss/434976.htmlhttp://www.aygfsteel.com/waterjava/services/trackbacks/434976.html

GitHub 在开源世界的受欢q程度自不必多言。再加上前阵子,GitHub 官方又搞了个大新闻:U有仓库改ؓ免费使用Q这在原来可是需要真金白银的买的。可见微软收购后Q依然没有改?GitHub 的定位,甚至q更q一步?/p>

花开两朵Q各表一枝。我们今天想要聊的ƈ不是 GitHub 多么厉害Q而是?strong>怎么能把 GitHub 用得很厉?/strong>?/p>

你在 GitHub 上搜索代码时Q是怎么h作的呢?是不是就像这P直接在搜索框里输入要索的内容Q然后不断在列表里翻|自己需要的内容Q?/p>

或者是单筛选下Q在左侧加个语言的过滤项?/p>

再或者改变一下列表的排序方式

q就是「全部」了吗?

一般的pȝ索功能,都会有一个「高U搜索」的功能。需要在另外的界面里展开Q进行二ơ搜索之cȝ?GitHub 有没有类似的呢?

{案是肯定的。做Z个ؓ万千工程师提供服务的|站Q不仅要有,而且q要技术范ѝ?/p>

如果我们自己开发一个类似的应用Q会怎样实现呢?

带着思\Q咱们一h看看QGitHub 是怎样做的?/p>

q里我们假设正要学习 Spring CloudQ要找一?Spring Cloud ?Demo 参考练手?/p>

1. 明确搜烦仓库标题、仓库描q、README

GitHub 提供了便L搜烦方式Q可以限定只搜烦仓库的标题、或者描q、README{?/p>

以Spring Cloud ZQ一般一个仓库,大概是这L

其中Q红色箭头指的两个地方,分别是仓库的名称和描q。咱们可以直接限定关键字只查特定的地斏V比如咱们只x找仓库名U包?spring cloud 的仓库,可以使用语法

in:name 关键?/strong>

如果x找描q的内容Q可以用这L方式Q?/p>

in:descripton 关键?/strong>

q里是搜烦上面目描述的内宏V?/p>

一般项目,都会有个README文gQ如果要查该文g包含特定关键词的话,我想你猜C

in:readme 关键?/strong>

2. 明确搜烦 star、fork 数大于多的

一个项?star 数的多少Q一般代表该目有受Ƣ迎E度。虽然现在也有垃N目刷 star Q但毕竟是少敎ͼ star 依然是个不错的衡量标准?/p>

stars:> 数字 关键字?/strong>

比如׃要找 star 数大?3000 的Spring Cloud 仓库Q就可以q样

stars:>3000 spring cloud

如果不加 >= 的话Q是要精找 star 数等于具体数字的Q这个一般有点困难?/p>

如果要找在指定数字区间的话,使用

stars: 10..20 关键?/strong>

fork 数同理,上面的 stars 换成forkQ其它语法相?/p>

3. 明确搜烦仓库大小?/strong>

比如你只想看个简单的 DemoQ不x特别复杂的且占用盘I间较多的,可以在搜索的时候直接限定仓库的size?/p>

使用方式Q?/p>

size:>=5000 关键?/strong>

q里注意下,q个数字代表K, 5000代表着5M?/p>

4. 明确仓库是否q在更新l护

我们在确认是否要使用一些开源品,框架的时候,是否l箋l护是很重要的一炏V如果已l过时没人维护的东西Q踩了坑׃好办了。而在 GitHub 上找目的时候,不再需要每个都点到目里看看最q?push 的时_直接在搜索框卛_完成?/p>

元旦刚过Q比如咱们要找͘q年底依然在勤快更新的项目,可以直接指定更新时间在哪个旉前或后的

通过q样一条搜?strong>pushed:>2019-01-03 spring cloud

׃找C1?号之后,q在更新的项目?/p>

你是x指定旉之前或之后创建的仓库也是可以的,?strong>pushedҎcreatedp?/p>

5. 明确搜烦仓库?LICENSE

׃l常使用开源YӞ一定都知道Q开源Y件也是分不同的「门z」不同的LICENSE。开源不{于一切免费,不同的许可证要求也大不相同?2018q就出现?Facebook 修改 React 的许可协议导致各个公司纷U修改自q代码Q寻找替换的框架?/p>

例如׃要找协议是最为宽杄 Apache License 2 的代码,可以q样

license:apache-2.0 spring cloud

其它协议把 apache-2.0 替换一下即可,比如换成mit之类的?/p>

6. 明确搜烦仓库的语a

比如׃找 Java 的库Q?除了像上面在左侧点击选择之外Q还可以在搜索中qo。像q样Q?/p>

language:java 关键?/strong>

7.明确搜烦某个人或l织的仓?/strong>

比如׃惛_ GitHub 上找一下某个大是不是提交了新的功能,可以指定其名称后搜索,例如׃看下 Josh Long 有没有提交新?Spring Cloud 的代码,可以q样使用

user:joshlong

l合使用一下,?Java 目qo出来Q多个查询之间「空根{分隔即可?/p>

user:joshlong language:java

找某个组l的代码话,可以q样Q?/p>

org:spring-cloud

可以列出具体org 的仓库?/p>



作者:西安北大青鸟
链接Qhttps://www.jianshu.com/p/74ae16db62af
来源Q简?br />著作权归作者所有。商业{载请联系作者获得授权,非商业{载请注明出处?/div>

狼爱上狸 2019-12-20 16:49 发表评论
]]>
github新手使用指南http://www.aygfsteel.com/waterjava/archive/2019/12/20/434975.html狼爱上狸狼爱上狸Fri, 20 Dec 2019 07:30:00 GMThttp://www.aygfsteel.com/waterjava/archive/2019/12/20/434975.htmlhttp://www.aygfsteel.com/waterjava/comments/434975.htmlhttp://www.aygfsteel.com/waterjava/archive/2019/12/20/434975.html#Feedback0http://www.aygfsteel.com/waterjava/comments/commentRss/434975.htmlhttp://www.aygfsteel.com/waterjava/services/trackbacks/434975.html

https://blog.csdn.net/Hanani_Jia/article/details/77950594源博客地址

首先Q我先对GitHub来一个简单的介绍QGitHub有一个很强大的功能就是,你在服务器上边可以创Z个库Q稍后会介绍怎么创徏Q,写代码是一件很重的dQ尤其是很多人完成一个很大的目的时候,十分的复杂Q一h一h写某个项目,大家完成的时_完成的进度都是不相同的,你写一Ҏ写一点,甚至可能你今天写的出C错误Q媄响到了我昨天写的代码Q最后怎么才能大家的代码L的汇总v来,又怎么在汇L有h的代码之后发现错误等{一pd问题。这h们就用到了GitHubq个软g。我们在GitHub服务器上有一个主仓库Q这里用来储存你的所有代码,如果不付费的话是所有h都可以看的,如果你不惌别h看到你的代码Q可以选择付费仓库。我们创ZM库之后,可以在电脑上创建分支,之后你就可以在电脑上完成自己的代码,写完之后直接同步在电脑的分支Q当你认为可以上传的自己的主仓库Ӟ可以申h斎ͼ当通过审核的时候,你代码就出现在了自己的主仓库中,q样全世界的E序员都可以查看你的代码。全世界现在已经?00万的注册用户Q甚臌有一些相当知名的开源项目也在其中公布代码。在GitHub上你可以看到很多计算机领域的_英所分n的自q代码。这是GitHub的两个主要优点,适合团队协作Q以及下载其他优U者的代码?/p>

 

 

今天Q?/span>GitHub已是Q一个拥?43万开发者的C֌。其中不乏Linux发明?a rel="nofollow">Torvaldsq样的顶U黑客,以及Rails创始?a rel="nofollow">DHHq样的年L客?/span>

· q个星球上最行的开源托服务。目前已托管431万git目Q不仅越来越多知名开源项目迁入GitHubQ比如Ruby on Rails、jQuery、Ruby、Erlang/OTPQ近三年行的开源库往往在GitHub首发Q例如:BootStrap?/span>Node.js?/span>CoffeScript{?/span>alexa全球排名414的网站?img src="https://img-blog.csdn.net/20170912221840100?watermark/2/text/aHR0cDovL2Jsb2cuY3Nkbi5uZXQvSGFuYW5pX0ppYQ==/font/5a6L5L2T/fontsize/400/fill/I0JBQkFCMA==/dissolve/70/gravity/Center" alt="" />

 

 

https://github.com/ q是GitHub的官方网站,在官|上可以注册属于自己的GitHub账号Q网上是全英文的Q对于英语不好的同学使用h览器,h览器可以翻译网变Z文用v来十分方ѝ?/p>

 

通过单的步骤之后你就会有一个属于自qGitHub账号。再单注册完成之后会需要验证你所输入的邮才能正怋用你的GitHub?/p>

 在注册完成之后,完成一些简单的讄之后Q你需要创Z个属于自q?/span>

 

在登陆自qGitHub账号之后Q在|页右上角的加h用来创徏自己的库的按钮,之后的步骤将|页译成中文之后,按提C行创q库即可?/p>

 

W一个框是自׃ؓ自己的库起一个名字,W二个框是自己对库的一个简单介l?/p>

在创建完成自q库之后,下面p让自q电脑克隆一个自己所创徏的库Q方面自q脑上的代码同步到GitHub你所创徏的库当中?/p>

  Z实现Q就需要安装一个YӞGit Bash?/p>

 

下面我就介绍一下这个Y件的安装Q以及简单的配置?/p>

git-scm.com 首先q入GitHub官网Q下载适合自己电脑的版?/p>

 

下蝲完安装包之后q行

 

 

 

在安装过E中直接默认选项卛_?/p>


 在对git bashq行配置的时候大多数新手都是一头雾_下面我对配置的每一步就会有详细的记录。代码我也是从网上和学长那边要来的?/p>

 

我第一ơ打开软g后看到这个界面也是一脸懵逼的Q然后通过查阅了各U各L资料之后才有了一些思\?/p>

 首先要在本地创徏一?/span>ssh key q个的目的就是你现在需要在你电脑上获得一个密匙,是׃qx的验证码一L东西Q获取之后,在你?/span>GitHub账号里边输入之后Q你的电脑就和你的GitHub账号联系在一起了Q这样以后就可以十分方便的通过Git bash 随时上传你的代码。下边介l一下如果获得这个钥匙,又是如何输入C的GitHub里边的呢?/span>

  

很多人第一ơ打开q个GitHub的时候一脸懵|认ؓq是什么。对于一个新手来说看到这个是没有M思\Q没有Q何想法的?/span>

q一?/span> 开始是你的计算机的名字在我q里是Hanani @后边的内Ҏ你的计算机型P很多时候有的h打开之后@后边是ؕ码,q个时候也不要在意Q因为有些电脑型h中文的,可能在显C的时候出C问题Q不影响你后期的操作?/span>

  接下来,p开始获取属于你自己的密匙。在git bash中所有功能都是通过单的一些代码来实现的。获取密匙的时候需要输?/span>

$ ssh-keygen -t rsa -"your_email@youremail.com"

需要输入这个代码,引号内需要改成你在注?/span>GitHub的时候绑定的邮箱账号。之后会有一些简单的让你认的操作,之后让你会提C操作\径、密码等{,一般情况下q接按回R一路过可以?/span>

 

如果之后你出Cq个界面之后Q就说明你的密匙已经成功创徏了。现在你需要去他刚刚显C的存储位置打开它,把其中的内容复制出来?/span>


 

?/span>.sshq个文g夹中

之后你会看到q些内容Q有的h会在id_rsa后边带有一个pubQ之前看|上教程需要找到带pub的文Ӟ因ؓ我在生成后没有带.pub的文Ӟ怀着忐忑的心打开id_rsa后发现这里边的密匙也是可以用的。打开id_rsa的时候需要用C本的方式打开?/span>

ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQDIskXqZF3SSFtACK6zoNGJabikTBC3kig6+4j4dCq1tswhA9YkuJCi0WpRmGYWBQ67dyT2or7RedFZlULLZN3nL6AWlo5V2jRXw4WQxCon2rU1p122wmiTzqYOfsykjwullWV4bYcZU4n77A4/9WwlSqZCpEbcdwV8IMkvwfJUInSWqTvmYMcKTWu8yad5DZ2v7LBWfgsL/Tfx7aEB8UjDNJ6SPw30Yijy+62YrftYGgbuwoiL9hDNGO2LfjgOkglHTBJaZe31uQLLWc5uCzd+7Dgh7RaKMmeuz2Uv7yqm/IEU9jH8cPMR9YRPIhmzg38G2s9ILn27QqW9j1hrFY1V 15229020556@163.com

q就是我所获取的密匙,打开之后很长的一D,不要惊讶Q没有问题,q就是你所需要的密匙?/span>

 现在你就需要登录到你的GitHub上边dq个密匙Q?/span>

 

 

打开?/span>GitHub的设|界面,扑ֈSSH and GPG keysq个选项之后Q在|页右上角有一个添加新的SSH keys 点击

 

q里?/span>title 是让你给你的密匙起一个名字,Ҏ个h喜好Q什么名字都可以Q然后把你在刚刚文g中复制的密匙Q填写在下边的大框里。保存即可?/p>

之后你就可以回到你的Git bash上边?/p>

然后输入上边的代码,来检查是否成功绑定。第一ơ绑定的时候输入上边的代码之后会提C是?/span>continueQ在输入yes后如果出CQ?/span>You've successfully authenticated, but GitHub does not provide shell access ?/span>那就说明Q已l成功连上了GitHub。接下来q需要简单的讄一些东ѝ?/span>

输入上边的代码,name最好和GitHub上边的一Pemail是一定要是注册GitHub的那个邮地址

q两个的序可以颠倒,没有固定的顺序?/span>

 下面p你的库克隆下来到本地电脑中Q方便以后进行上传代码?/span>

 

在库创徏完成之后 会有一个网址出现在网中?/span>

 

个h习惯自q文g储存?/span>d盘之中,所以你先需要将git bash定位在d盘中

 

?/span>git bash中输?cd /D 注意盘名字一定要是大写。如不输入这个语?不给git bash定位的话Q默认的本地文g位置是在c盘中?/p>

输入之后会出?/span>/D说明定位成功?/p>

之后输入

git clone后边的网址是你创建库成功之后的网址


之后打开我所定位?/span>D?/p>

 

可以看到Q?/span>D盘中已经有以我的库名所创徏的文件夹了?/p>


打开q个文g夹,然后在其中创Z个Q意格式,L名称的文件?/p>

 

之后重新定位git 把书 的位|,定位在你库的文g夏V?/p>


之后输入ls语句 ls的作用是查看你目前所定位的文件夹中的文gQ现在可以看出来Q我刚刚所创徏的test文g已经出现了?/p>


然后输入 git add test.txt

之后输入然后git commit -m "cc"  引号内的内容可以随意改动Q这个语句的意思是 l你刚刚上传的文件一个备注,方便查找记忆而已


输入之后出现以上情况Q然后在输入git push origin master 之后会出C?/p>

 

 

界面Q在q里登陆你之前注册的GitHub账号之后点击login?/p>

 

如果之后出现q种情况的话Q就是登陆失败了Q这时候你需要输入你GitHub的̎号名U?/p>

输入之后会出现这个界面,然后再次输入你的GitHub密码?/p>


出现cM界面Q你可以欢gQ代表你成功了?/p>

现在打开你的GitHub|站Q找C创徏的库

 

发现今天的格子已l绿了,说明你已l上传了你刚刚所创徏的文件?/p>

再之后,你只需要将你的代码Q放到库的对应的文g夹中Q然后?先CDC库里面,?/span>git add 、git commit -m "   " ?span style="font-family:'宋体';">最?/span>git push origin masterQ将你的代码提交可以了?/p>

 同样我感觉网늉的github更适合新手白Qhttps://blog.csdn.net/hanani_jia/article/details/79855429 q是我写的一网늉github的简单操作,需要的可以看一下?/p>

狼爱上狸 2019-12-20 15:30 发表评论
]]>
TypeError: Cannot read property 'address' of undefinedhttp://www.aygfsteel.com/waterjava/archive/2019/12/18/434973.html狼爱上狸狼爱上狸Wed, 18 Dec 2019 11:27:00 GMThttp://www.aygfsteel.com/waterjava/archive/2019/12/18/434973.htmlhttp://www.aygfsteel.com/waterjava/comments/434973.htmlhttp://www.aygfsteel.com/waterjava/archive/2019/12/18/434973.html#Feedback0http://www.aygfsteel.com/waterjava/comments/commentRss/434973.htmlhttp://www.aygfsteel.com/waterjava/services/trackbacks/434973.html                     ^

TypeError: Cannot read property 'address' of undefined
解决办法Q调整gas的值就好了?/div>

狼爱上狸 2019-12-18 19:27 发表评论
]]>以太坊上最多存攑֤字?成本如何?http://www.aygfsteel.com/waterjava/archive/2019/12/16/434966.html狼爱上狸狼爱上狸Mon, 16 Dec 2019 01:28:00 GMThttp://www.aygfsteel.com/waterjava/archive/2019/12/16/434966.htmlhttp://www.aygfsteel.com/waterjava/comments/434966.htmlhttp://www.aygfsteel.com/waterjava/archive/2019/12/16/434966.html#Feedback0http://www.aygfsteel.com/waterjava/comments/commentRss/434966.htmlhttp://www.aygfsteel.com/waterjava/services/trackbacks/434966.html

狼爱上狸 2019-12-16 09:28 发表评论
]]>
|络在线工具http://www.aygfsteel.com/waterjava/archive/2019/12/16/434965.html狼爱上狸狼爱上狸Mon, 16 Dec 2019 01:16:00 GMThttp://www.aygfsteel.com/waterjava/archive/2019/12/16/434965.htmlhttp://www.aygfsteel.com/waterjava/comments/434965.htmlhttp://www.aygfsteel.com/waterjava/archive/2019/12/16/434965.html#Feedback0http://www.aygfsteel.com/waterjava/comments/commentRss/434965.htmlhttp://www.aygfsteel.com/waterjava/services/trackbacks/434965.html

狼爱上狸 2019-12-16 09:16 发表评论
]]>
以太坊区块链的区块(BlockQ结?/title><link>http://www.aygfsteel.com/waterjava/archive/2019/12/16/434964.html</link><dc:creator>狼爱上狸</dc:creator><author>狼爱上狸</author><pubDate>Mon, 16 Dec 2019 00:40:00 GMT</pubDate><guid>http://www.aygfsteel.com/waterjava/archive/2019/12/16/434964.html</guid><wfw:comment>http://www.aygfsteel.com/waterjava/comments/434964.html</wfw:comment><comments>http://www.aygfsteel.com/waterjava/archive/2019/12/16/434964.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.aygfsteel.com/waterjava/comments/commentRss/434964.html</wfw:commentRss><trackback:ping>http://www.aygfsteel.com/waterjava/services/trackbacks/434964.html</trackback:ping><description><![CDATA[https://blog.csdn.net/luoye4321/article/details/82531212<img src ="http://www.aygfsteel.com/waterjava/aggbug/434964.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.aygfsteel.com/waterjava/" target="_blank">狼爱上狸</a> 2019-12-16 08:40 <a href="http://www.aygfsteel.com/waterjava/archive/2019/12/16/434964.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>以太坊·将数据写入到区块链?/title><link>http://www.aygfsteel.com/waterjava/archive/2019/12/13/434961.html</link><dc:creator>狼爱上狸</dc:creator><author>狼爱上狸</author><pubDate>Fri, 13 Dec 2019 10:16:00 GMT</pubDate><guid>http://www.aygfsteel.com/waterjava/archive/2019/12/13/434961.html</guid><wfw:comment>http://www.aygfsteel.com/waterjava/comments/434961.html</wfw:comment><comments>http://www.aygfsteel.com/waterjava/archive/2019/12/13/434961.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.aygfsteel.com/waterjava/comments/commentRss/434961.html</wfw:commentRss><trackback:ping>http://www.aygfsteel.com/waterjava/services/trackbacks/434961.html</trackback:ping><description><![CDATA[https://blog.csdn.net/weixin_34055787/article/details/89733910<img src ="http://www.aygfsteel.com/waterjava/aggbug/434961.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.aygfsteel.com/waterjava/" target="_blank">狼爱上狸</a> 2019-12-13 18:16 <a href="http://www.aygfsteel.com/waterjava/archive/2019/12/13/434961.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>Visual Studio 2015下蝲http://www.aygfsteel.com/waterjava/archive/2019/12/01/434940.html狼爱上狸狼爱上狸Sun, 01 Dec 2019 04:30:00 GMThttp://www.aygfsteel.com/waterjava/archive/2019/12/01/434940.htmlhttp://www.aygfsteel.com/waterjava/comments/434940.htmlhttp://www.aygfsteel.com/waterjava/archive/2019/12/01/434940.html#Feedback0http://www.aygfsteel.com/waterjava/comments/commentRss/434940.htmlhttp://www.aygfsteel.com/waterjava/services/trackbacks/434940.html本文链接Qhttps://blog.csdn.net/yezishuang/article/details/91489354

1.Visual Studio 2015 专业版和企业版下?br />
https://www.cnblogs.com/bwlluck/p/5514424.html

https://www.cnblogs.com/wgscd/p/4671374.html

 

2.Visual Studio 2013

https://www.cnblogs.com/abeam/p/6781006.html

 

3.Visual Studio 2017

https://www.cnblogs.com/jian-pan/p/6942635.html

Microsoft Visual Studio Enterprise 2017 企业?br />KEYQNJVYC-BMHX2-G77MM-4XJMR-6Q8QF
Microsoft Visual Studio Professional 2017 专业?br />KEYQKBJFW-NXHK6-W4WJM-CRMQB-G3CDH

 

4.Visual Studio 2019

https://www.cnblogs.com/zengxiangzhan/p/vs2015.html

https://visualstudio.microsoft.com/zh-hans/downloads/ Q下载地址Q?br />
 Visual Studio 2019 Enterprise
BF8Y8-GN2QH-T84XB-QVY3B-RC4DF

Visual Studio 2019 Professional
NYWVH-HT4XC-R2WYW-9Y3CM-X4V3Y


狼爱上狸 2019-12-01 12:30 发表评论
]]>
使用Remix IDE快速部|你的第一个智能合U?/title><link>http://www.aygfsteel.com/waterjava/archive/2019/11/28/434938.html</link><dc:creator>狼爱上狸</dc:creator><author>狼爱上狸</author><pubDate>Thu, 28 Nov 2019 13:01:00 GMT</pubDate><guid>http://www.aygfsteel.com/waterjava/archive/2019/11/28/434938.html</guid><wfw:comment>http://www.aygfsteel.com/waterjava/comments/434938.html</wfw:comment><comments>http://www.aygfsteel.com/waterjava/archive/2019/11/28/434938.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.aygfsteel.com/waterjava/comments/commentRss/434938.html</wfw:commentRss><trackback:ping>http://www.aygfsteel.com/waterjava/services/trackbacks/434938.html</trackback:ping><description><![CDATA[https://blog.csdn.net/qq_27317475/article/details/80894593<img src ="http://www.aygfsteel.com/waterjava/aggbug/434938.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.aygfsteel.com/waterjava/" target="_blank">狼爱上狸</a> 2019-11-28 21:01 <a href="http://www.aygfsteel.com/waterjava/archive/2019/11/28/434938.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>genesis.json的问?/title><link>http://www.aygfsteel.com/waterjava/archive/2019/11/28/434937.html</link><dc:creator>狼爱上狸</dc:creator><author>狼爱上狸</author><pubDate>Thu, 28 Nov 2019 11:15:00 GMT</pubDate><guid>http://www.aygfsteel.com/waterjava/archive/2019/11/28/434937.html</guid><wfw:comment>http://www.aygfsteel.com/waterjava/comments/434937.html</wfw:comment><comments>http://www.aygfsteel.com/waterjava/archive/2019/11/28/434937.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.aygfsteel.com/waterjava/comments/commentRss/434937.html</wfw:commentRss><trackback:ping>http://www.aygfsteel.com/waterjava/services/trackbacks/434937.html</trackback:ping><description><![CDATA[<div> 以前的genesis.json的文件差不多是这LQ?/div><div>    {<br />      "config": {<br />            "chainId": 10,<br />            "homesteadBlock": 0,<br />            "eip155Block": 0,<br />            "eip158Block": 0<br />        },<br />      "alloc"      : {},<br />      "coinbase"   : "0x0000000000000000000000000000000000000000",<br />      "difficulty" : "0x00000002",<br />      "extraData"  : "",<br />      "gasLimit"   : "0x2fefd8",<br />      "nonce"      : "0x0000000000000042",<br />      "mixhash"    : "0x0000000000000000000000000000000000000000000000000000000000000000",<br />      "parentHash" : "0x0000000000000000000000000000000000000000000000000000000000000000",<br />      "timestamp"  : "0x00"<br />    }</div><div>用这个创世块的描q文件初始化Ӟ出现错误Q?/div><div>Fatal: Failed to write genesis block: unsupported fork ordering: eip150Block not enabled, but eip155Block enabled at 0</div><div>癑ֺ吧,没有一个解军_法?/div><div>后来用Puppeth命o创徏json文gQƈ做了修改Q如下所C:</div><div><pre style="background-color: #ffffff; color: #000000; font-family: "宋体"; font-size: 9pt;">{<br /> <span style="color:#660e7a;font-weight:bold;">"config"</span>: {<br /> <span style="color:#660e7a;font-weight:bold;">"chainId"</span>: <span style="color:#0000ff;">666</span>,<br /> <span style="color:#660e7a;font-weight:bold;">"homesteadBlock"</span>: <span style="color:#0000ff;">0</span>,<br /> <span style="color:#660e7a;font-weight:bold;">"eip150Block"</span>: <span style="color:#0000ff;">0</span>,<br /> <span style="color:#660e7a;font-weight:bold;">"eip150Hash"</span>: <span style="color:#008000;font-weight:bold;">"0x0000000000000000000000000000000000000000000000000000000000000000"</span>,<br /> <span style="color:#660e7a;font-weight:bold;">"eip155Block"</span>: <span style="color:#0000ff;">0</span>,<br /> <span style="color:#660e7a;font-weight:bold;">"eip158Block"</span>: <span style="color:#0000ff;">0</span>,<br /> <span style="color:#660e7a;font-weight:bold;">"byzantiumBlock"</span>: <span style="color:#0000ff;">0</span>,<br /> <span style="color:#660e7a;font-weight:bold;">"constantinopleBlock"</span>: <span style="color:#0000ff;">0</span>,<br /> <span style="color:#660e7a;font-weight:bold;">"petersburgBlock"</span>: <span style="color:#0000ff;">0</span>,<br /> <span style="color:#660e7a;font-weight:bold;">"istanbulBlock"</span>: <span style="color:#0000ff;">0</span>,<br /> <span style="color:#660e7a;font-weight:bold;">"ethash"</span>: {}<br /> },<br /> <span style="color:#660e7a;font-weight:bold;">"nonce"</span>: <span style="color:#008000;font-weight:bold;">"0x0"</span>,<br /> <span style="color:#660e7a;font-weight:bold;">"timestamp"</span>: <span style="color:#008000;font-weight:bold;">"0x5ddf8f3e"</span>,<br /> <span style="color:#660e7a;font-weight:bold;">"extraData"</span>: <span style="color:#008000;font-weight:bold;">"0x0000000000000000000000000000000000000000000000000000000000000000"</span>,<br /> <span style="color:#660e7a;font-weight:bold;">"gasLimit"</span>: <span style="color:#008000;font-weight:bold;">"0x47b760"</span>,<br /> <span style="color:#660e7a;font-weight:bold;">"difficulty"</span>: <span style="color:#008000;font-weight:bold;">"0x00002"</span>,<br /> <span style="color:#660e7a;font-weight:bold;">"mixHash"</span>: <span style="color:#008000;font-weight:bold;">"0x0000000000000000000000000000000000000000000000000000000000000000"</span>,<br /> <span style="color:#660e7a;font-weight:bold;">"coinbase"</span>: <span style="color:#008000;font-weight:bold;">"0x0000000000000000000000000000000000000000"</span>,<br /> <span style="color:#660e7a;font-weight:bold;">"alloc"</span>: { }<br /> },<br /> <span style="color:#008000;font-weight:bold;">"number"</span>: <span style="color:#008000;font-weight:bold;">"0x0"</span>,<br /> <span style="color:#008000;font-weight:bold;">"gasUsed"</span>: <span style="color:#008000;font-weight:bold;">"0x0"</span>,<br /> <span style="color:#008000;font-weight:bold;">"parentHash"</span>: <span style="color:#008000;font-weight:bold;">"0x0000000000000000000000000000000000000000000000000000000000000000"<br /></span>}<br /><br /><br /><br />初始化:<br />geth --identity "MyEth" --rpc --rpcport "8545" --rpccorsdomain "*" --datadir gethdata --port "30303" --nodiscover --rpcapi "db,eth,net,personal,web3" --networkid 1999 init genesis.json<br /></pre></div><div>控制収ͼ</div><div>geth --identity "MyEth" --rpc --rpcport "8545" --rpccorsdomain "*" --datadir gethdata --port "30303" --nodiscover --rpcapi "db,eth,net,personal,web3" --networkid 1999 --dev.period 1 console</div><div>建立用户Q?/div><div>>personal.newAccount();</div><div>挖矿Q?/div><div>miner.start();</div><div></div><div>l于利挖到了h生第一桉?/div><div></div><img src ="http://www.aygfsteel.com/waterjava/aggbug/434937.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.aygfsteel.com/waterjava/" target="_blank">狼爱上狸</a> 2019-11-28 19:15 <a href="http://www.aygfsteel.com/waterjava/archive/2019/11/28/434937.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>windows使用geth搭徏以太坊私?http://www.aygfsteel.com/waterjava/archive/2019/11/28/434935.html狼爱上狸狼爱上狸Thu, 28 Nov 2019 09:08:00 GMThttp://www.aygfsteel.com/waterjava/archive/2019/11/28/434935.htmlhttp://www.aygfsteel.com/waterjava/comments/434935.htmlhttp://www.aygfsteel.com/waterjava/archive/2019/11/28/434935.html#Feedback0http://www.aygfsteel.com/waterjava/comments/commentRss/434935.htmlhttp://www.aygfsteel.com/waterjava/services/trackbacks/434935.htmlW一?安装geth

下蝲地址Q?a target="_blank">https://ethereum.github.io/go-ethereum/downloads/

点击安装Ndevelopment tools

1.png

W二?创徏您的帐户

在当前文件夹下创建node1文g?/h3>

创徏一个̎P也称为钱包)

Devnet $ geth --datadir node1/ account new
Your new account is locked with a password. Please give a password. Do not forget this password.
Passphrase: 输入你的密码
Repeat passphrase: 认你的密码
Address: {08a58f09194e403d02a1928a7bf78646cfc260b0}

W三?geth命o创徏您的Genesis文g

生成的文件是用于初始化区块链的文件。第一个块叫做创世块,是根据genesis.json文g中的参数生成的?/p>

Geth安装后目录下有很多可执行文g如puppeth或bootnode。你可以?a target="_blank">Geth github上找到完整的列表?br /> Puppeth可以创徏创世区块的json文g?br /> 开始用PuppethQ?/p>

1、win?+ r q入cmd命o行,q入到安装geth的文件夹执行 puppeth 然后序执行下面操作

2、Please specify a network name to administer (no spaces, please)
> devnetQ这里随便填写一个网l管理名U即可,如有需要后面可以通过--network重新讄Q?br /> What would you like to do? (default = stats)
 1. Show network stats
 2. Configure new genesis
 3. Track new remote server
 4. Deploy network components

> 2Q这里选择2Q回车,配置新的创世区块Q?/p>

3、Which consensus engine to use? (default = clique)
   1. Ethash - proof-of-work
   2. Clique - proof-of-authorit

> 1Q这里选择powp机制Q?/p>

4、Which accounts should be pre-funded? (advisable at least one)

> 0x1234567890123456789012345678901234567890Q这个是讄预分配以太坊的̎P讄一个有U钥的地址可以后面试使用Q设|好后再按一ơ回车)

5、Specify your chain/network ID if you want an explicit one (default = random)
> 666Q这里就是链的chainIdQ可以随意输入也可以不输直接回R默认随机数字Q?/p>

6、What would you like to do? (default = stats)

  1. Show network stats
  2. Manage existing genesis
  3. Track new remote server
  4. Deploy network components
    > 2Q管理已拥有的创世块Q?/li>

7?1. Modify existing fork rules
2. Export genesis configuration
3. Remove genesis configuration
> 2Q选择导出创世配置Q?/p>

8、Which file to save the genesis into? (default = devnet.json)
> ./genesis.jsonQ导出的路径及文件名Q?/p>

OK,到这里创世json文g创徏完成?/p>

W四?geth命o初始化节?/h2>

现在我们有了q个genesis.json文gQ可以初始化创世块了Q?/p>

q入到geth安装文g夹下执行

geth --datadir node1/ init genesis.json

W五?bootnode命o操作

bootnode唯一的目的是帮助节点发现彼此Q记住,以太坊区块链是一个对{网l)

初始?bootnode

bootnode -genkey boot.Key

启动bootnode服务

bootnode -nodekey boot.key -addr:30310

随意使用M您喜Ƣ的端口Q但请避免用主端口(例如HTTPQ?0303用于公共以太坊网l?/p>

W六?geth命o启动节点

geth --datadir .\node1\ --syncmode 'full' --port 30311 --rpc --rpcaddr '127.0.0.1' --rpcport 8501 --rpcapi  'personal,db,eth,net,web3,txpool,miner' --bootnodes 'enode://ca88962dbcc8eb0c7587789866f21db68cdf32ad1ea890fe0d9f8fe010f7e9afe2e6a88d5c9d418be61a10b8a31b1e7c55213bb426dab91596ae36bd7d559333@127.0.0.1:30310' --networkid 666

参数解释Q?/p>

--syncmode 'full' 有助于防止错?a target="_blank">丢弃错误的传播块?br /> --port 是node1的端?br /> --rpcapi 允许RPC调用的模?br /> --bootnodes 要连接的bootnode
--networkId genesis.json文g中的chainId

W七?与您的节点进行交?/h2>

通过RPC方式

$ cd devnet
devnet$ geth attach 'http://localhost:8501'
Welcome to the Geth JavaScript console!

instance: Geth/v1.7.3-stable-4bb3c89d/linux-amd64/go1.9
coinbase: 0x87366ef81db496edd0ea2055ca605e8686eec1e6
at block: 945 (Sat, 10 Feb 2018 21:16:14 CET)
 modules: eth:1.0 miner:1.0 net:1.0 personal:1.0 rpc:1.0 txpool:1.0 web3:1.0

使用Geth控制?/p>

>net.version
"1515"
> eth.blockNumber
1910
> eth.coinbase
"0x87366ef81db496edd0ea2055ca605e8686eec1e6"
> eth.sendTransaction({'from':eth.coinbase, 'to':'0x08a58f09194e403d02a1928a7bf78646cfc260b0', 'value':web3.toWei(3, 'ether')})
"0x299a99baa1b39bdee5f02e3c660e19e744f81c2e886b5fc24aa83f92fe100d3f"
>eth.getTransactionReceipt("0x299a99baa1b39bdee5f02e3c660e19e744f81c2e886b5fc24aa83f92fe100d3f")
{
  blockHash: "0x212fb593980bd42fcaf3f6d1e6db2dd86d3764df8cac2d90408f481ae7830de8",
  blockNumber: 2079,
  contractAddress: null,
  cumulativeGasUsed: 21000,
  from: "0x87366ef81db496edd0ea2055ca605e8686eec1e6",
  gasUsed: 21000,
  logs: [],
  logsBloom: "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000",
  status: "0x1",
  to: "0x08a58f09194e403d02a1928a7bf78646cfc260b0",
  transactionHash: "0x299a99baa1b39bdee5f02e3c660e19e744f81c2e886b5fc24aa83f92fe100d3f",
  transactionIndex: 0
}
> exitQ退出)


来自:https://www.haowenbo.com/articles/2019/07/24/1563963176492.html



狼爱上狸 2019-11-28 17:08 发表评论
]]> վ֩ģ壺 ״| ƽ| | Դ| | | ƽ| Դ| | | | Ϫ| Ҧ| ˴| | Ȫ| | | | ʯ| ̶| | ׯ| | Ӻ| | Ƽ| | | | «| ʹ| Ͼ| | 㽭ʡ| | ˱| ī񹤿| ³| | |