我一直在使用Stephen Grider的this course学习Solidity,并且一直进行到现在为止,在这里我正尝试将my code部署到Rinkeby测试网络。
作为引用,我将Node 11.15.0和npm 6.7.0与以下依赖项结合使用:
"dependencies": {
"ganache-cli": "^6.4.3",
"mocha": "^6.1.4",
"nan": "^2.14.0",
"scrypt": "^6.0.3",
"solc": "^0.4.25",
"truffle": "^4.1.15",
"truffle-hdwallet-provider": "0.0.4",
"web3": "^1.0.0-beta.35" }
我花了数小时在Node.js,npm版本和各种依赖关系组合之间进行切换,从最新版本到类(class)中指定的版本。当我遇到许多问题时,最突出的两个问题似乎是
(node:32436) V8: C:\Desktop\solidity\inbox\node_modules\solc\soljson.js:3 Invalid asm.js: Invalid member of stdlib
和
C:\Desktop\solidity\inbox\node_modules\solc\soljson.js:1
var Module;if(!Module)Module=(typeof Module!=="undefined"?Module:null)||{};var moduleOverrides={};for(var key in Module){if(Module.hasOwnProperty(key)){moduleOverrides[key]=Module[key]}}var ENVIRONMENT_IS_WEB=typeof window==="object";var ENVIRONMENT_IS_WORKER=typeof importScripts==="function";var ENVIRONMENT_IS_NODE=typeof process==="object"&&typeof require==="function"&&!ENVIRONMENT_IS_WEB&&!ENVIRONMENT_IS_WORKER;var ENVIRONMENT_IS_SHELL=!ENVIRONMENT_IS_WEB&&!ENVIRONMENT_IS_NODE&&!ENVIRONMENT_IS_WORKER;if(ENVIRONMENT_IS_NODE){if(!Module["print"])Module["print"]=function print(x){process["stdout"].write(x+"\n")};if(!Module["printErr"])Module["printErr"]=function printErr(x){process["stderr"].write(x+"\n")};var nodeFS=require("fs");var nodePath=require("path");Module["read"]=function read(filename,binary){filename=nodePath["normalize"](filename);var ret=nodeFS["readFileSync"](filename);if(!ret&&filename!=nodePath["resolve"](filename)){filename=path.joi
Error: CONNECTION ERROR: Couldn't connect to node rinkeby.infura.io/v3/acb10732334e4450ba7dc55e618eb70a.
at Object.InvalidConnection (C:\Desktop\solidity\inbox\node_modules\truffle-hdwallet-provider\node_modules\web3\lib\web3\errors.js:28:16)
at HttpProvider.sendAsync (C:\Desktop\solidity\inbox\node_modules\truffle-hdwallet-provider\node_modules\web3\lib\web3\httpprovider.js:129:25)
at Web3Subprovider.handleRequest (C:\Desktop\solidity\inbox\node_modules\web3-provider-engine\subproviders\web3.js:13:17)
at next (C:\Desktop\solidity\inbox\node_modules\web3-provider-engine\index.js:95:18)
at FilterSubprovider.handleRequest (C:\Desktop\solidity\inbox\node_modules\web3-provider-engine\subproviders\filters.js:87:7)
at next (C:\Desktop\solidity\inbox\node_modules\web3-provider-engine\index.js:95:18)
at HookedWalletSubprovider.handleRequest (C:\Desktop\solidity\inbox\node_modules\web3-provider-engine\subproviders\hooked-wallet.js:109:7)
at next (C:\Desktop\solidity\inbox\node_modules\web3-provider-engine\index.js:95:18)
at Web3ProviderEngine._handleAsync (C:\Desktop\solidity\inbox\node_modules\web3-provider-engine\index.js:82:3)
at Web3ProviderEngine._fetchBlock (C:\Desktop\solidity\inbox\node_modules\web3-provider-engine\index.js:191:8)
at Web3ProviderEngine._fetchLatestBlock (C:\Desktop\solidity\inbox\node_modules\web3-provider-engine\index.js:167:8)
at Web3ProviderEngine._startPolling (C:\Desktop\solidity\inbox\node_modules\web3-provider-engine\index.js:144:8)
at Web3ProviderEngine.start (C:\Desktop\solidity\inbox\node_modules\web3-provider-engine\index.js:38:8)
at new HDWalletProvider (C:\Desktop\solidity\inbox\node_modules\truffle-hdwallet-provider\index.js:46:15)
at Object.<anonymous> (C:\Desktop\solidity\inbox\deploy.js:6:18)
at Module._compile (internal/modules/cjs/loader.js:816:30)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:827:10)
at Module.load (internal/modules/cjs/loader.js:685:32)
at Function.Module._load (internal/modules/cjs/loader.js:620:12)
at Function.Module.runMain (internal/modules/cjs/loader.js:877:12)
at internal/main/run_main_module.js:21:11
我的问题是根据我的代码是否有针对这些问题的任何修复程序,或者是否有更简单的方法来部署到区块链?先感谢您。
最佳答案
您可能是指https://rinkeby.infura.io/...
(您缺少https://
。)