![](https://img-blog.csdnimg.cn/20201014180756927.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
区块链
小小练
这个作者很懒,什么都没留下…
展开
-
在本地私链部署智能合约
工具Gethweb3jremix使用solidity编写智能合约pragma solidity 0.4.25;contract KYC { //自定义的结构类型 struct customer { string name; //姓名 uint8 age; //年龄 } //映射EOA与数据 mapping(uint => customer) private customers; //将信息记录在日志中 event InsertEvn(addr原创 2021-10-10 18:53:16 · 12336 阅读 · 0 评论 -
Geth使用loadScript(“contract.js“)部署智能合约时,报错Error: authentication needed: password or unlock undefined
原因:第一个账户未解锁,而合约部署需要支付汽油费解决:1、personal.unlockAccount(eth.accounts[0])解锁账户;2、loadScript("contract.js")部署合约3、miner.start()矿工挖矿,合约被写到区块链4、miner.stop()结束挖矿5、合约地址为:Contract mined! address 后面部分具体操作如下:> loadScript("F:/MyGeth/DAPP/chap06/smartContract原创 2021-10-08 21:25:41 · 10107 阅读 · 0 评论