2020-05-18

開(kāi)發(fā)以太坊過(guò)程中遇到的問(wèn)題

1.后臺(tái)已啟動(dòng)了ganache-cli
truffle(development)> web3.eth.getBalance(web3.eth.accounts[1])
/usr/local/lib/node_modules/truffle/build/cli.bundled.js:212023
throw new Error('Provided address "'+ address +'" is invalid, the capitalization checksum test

failed, or its an indrect IBAN address which can't be converted.');
^

Uncaught:
Error: Provided address "undefined" is invalid, the capitalization checksum test failed, or its an

indrect IBAN address which can't be converted.
at Method.inputAddressFormatter

(/usr/local/lib/node_modules/truffle/build/webpack:/node_modules/web3-core-

helpers/src/formatters.js:409:1)
at /usr/local/lib/node_modules/truffle/build/webpack:/node_modules/web3-core-

method/src/index.js:144:1
at Array.map (<anonymous>)
at Method.formatInput (/usr/local/lib/node_modules/truffle/build/webpack:/node_modules/web3-

core-method/src/index.js:142:1)
at Method.toPayload (/usr/local/lib/node_modules/truffle/build/webpack:/node_modules/web3-core-

method/src/index.js:177:1)
at Eth.send [as getBalance]

(/usr/local/lib/node_modules/truffle/build/webpack:/node_modules/web3-core-method/src/index.js:467:1)
at evalmachine.<anonymous>:0:10
at sigintHandlersWrap (vm.js:274:15)
at Script.runInContext (vm.js:128:14)
at runScript

(/usr/local/lib/node_modules/truffle/build/webpack:/packages/core/lib/console.js:222:1)
at Console.interpret

(/usr/local/lib/node_modules/truffle/build/webpack:/packages/core/lib/console.js:237:1)
at ReplManager.interpret

(/usr/local/lib/node_modules/truffle/build/webpack:/packages/core/lib/repl.js:129:1)
at bound (domain.js:426:14)
at REPLServer.runBound [as eval] (domain.js:439:12)
at REPLServer.onLine (repl.js:759:10)
at REPLServer.emit (events.js:310:20)
at REPLServer.EventEmitter.emit (domain.js:482:12)
at REPLServer.Interface._onLine (readline.js:322:10)
at REPLServer.Interface._line (readline.js:699:8)
at REPLServer.Interface._ttyWrite (readline.js:1025:14)
at REPLServer.self._ttyWrite (repl.js:836:7)
at ReadStream.onkeypress (readline.js:198:10)
問(wèn)題為:賬戶的地址找不到

2.ipfs安裝成功并啟動(dòng)
輸入http://127.0.0.1:5001/webui顯示網(wǎng)絡(luò)無(wú)法訪問(wèn)

3.安裝ipfs-api
sudo npm install ipfs-api
或者sudo npm install ipfs-http-client
出現(xiàn)如下錯(cuò)誤:
jiaorj@jiaorj-virtual-machine:/ubuntu-share/ubuntu1/ebay_dapp/app$ sudo npm install ipfs-http-client

iso-constants@0.1.2 install /ubuntu-share/ubuntu1/ebay_dapp/app/node_modules/iso-constants
node build.js > index.browser.js

sh: 1: cannot create index.browser.js: Permission denied
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@1.2.9 (node_modules/fsevents):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents@1.2.9: wanted {"os":"darwin","arch":"any"} (current: {"os":"linux","arch":"x64"})

npm ERR! code ELIFECYCLE
npm ERR! errno 2
npm ERR! iso-constants@0.1.2 install: node build.js > index.browser.js
npm ERR! Exit status 2
npm ERR!
npm ERR! Failed at the iso-constants@0.1.2 install script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in:
npm ERR! /home/jiaorj/.npm/_logs/2020-05-18T07_09_37_890Z-debug.log
問(wèn)題解決,參考:https://www.cnblogs.com/jasonLiu2018/p/11987328.html
經(jīng)過(guò)面向搜索引擎開(kāi)發(fā),有提到用sudo,但是發(fā)現(xiàn)還是不行,實(shí)際原因是由于用的是root賬戶權(quán)限執(zhí)行npm,而npm默認(rèn)是不適用root權(quán)限創(chuàng)建內(nèi)容,因此會(huì)出現(xiàn)權(quán)限問(wèn)題而導(dǎo)致失敗,加上參數(shù)--unsafe-perm=true --allow-root即可解決問(wèn)題。
即輸入命令:sudo npm install ipfs-http-client --unsafe-perm=true --allow-root解決

安裝ipfs-http-client成功.PNG

問(wèn)題未解決!記錄一下!

最后編輯于
?著作權(quán)歸作者所有,轉(zhuǎn)載或內(nèi)容合作請(qǐng)聯(lián)系作者
【社區(qū)內(nèi)容提示】社區(qū)部分內(nèi)容疑似由AI輔助生成,瀏覽時(shí)請(qǐng)結(jié)合常識(shí)與多方信息審慎甄別。
平臺(tái)聲明:文章內(nèi)容(如有圖片或視頻亦包括在內(nèi))由作者上傳并發(fā)布,文章內(nèi)容僅代表作者本人觀點(diǎn),簡(jiǎn)書(shū)系信息發(fā)布平臺(tái),僅提供信息存儲(chǔ)服務(wù)。

友情鏈接更多精彩內(nèi)容