Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

error when tried to connect to infura blockchain LESSON 12 #166

Open
anthonylauw opened this issue Apr 20, 2022 · 1 comment
Open

error when tried to connect to infura blockchain LESSON 12 #166

anthonylauw opened this issue Apr 20, 2022 · 1 comment

Comments

@anthonylauw
Copy link

Hi i encountered the below issue, please advise how to solve this

Error: connection not open on send()
at Object.ConnectionError (C:\Users\anthony\Downloads\Flashloan\node_modules\web3-core-helpers\lib\errors.js:66:23)
at Object.ConnectionNotOpenError (C:\Users\anthony\Downloads\Flashloan\node_modules\web3-core-helpers\lib\errors.js:49:21)
at C:\Users\anthony\Downloads\Flashloan\node_modules\web3-providers-ws\lib\index.js:155:37
at Map.forEach ()
at WebsocketProvider._onClose (C:\Users\anthony\Downloads\Flashloan\node_modules\web3-providers-ws\lib\index.js:154:27)
at W3CWebSocket._dispatchEvent [as dispatchEvent] (C:\Users\anthony\Downloads\Flashloan\node_modules\yaeti\lib\EventTarget.js:115:12)
at W3CWebSocket.onConnectFailed (C:\Users\anthony\Downloads\Flashloan\node_modules\websocket\lib\W3CWebSocket.js:219:14)
at WebSocketClient. (C:\Users\anthony\Downloads\Flashloan\node_modules\websocket\lib\W3CWebSocket.js:59:25)
at WebSocketClient.emit (node:events:390:28)
at WebSocketClient.failHandshake (C:\Users\anthony\Downloads\Flashloan\node_modules\websocket\lib\WebSocketClient.js:339:10)
at ClientRequest. (C:\Users\anthony\Downloads\Flashloan\node_modules\websocket\lib\WebSocketClient.js:278:18)
at ClientRequest.emit (node:events:390:28)
at HTTPParser.parserOnIncomingClient (node:_http_client:623:27)
at HTTPParser.parserOnHeadersComplete (node:_http_common:128:17)
at TLSSocket.socketOnData (node:_http_client:487:22)
at TLSSocket.emit (node:events:390:28) {
code: 1006,
reason: 'connection failed'
}

@Kali-Decoder
Copy link

First install @hdwallet module and store your mnemonic of wallet in env file also install env module and then create your network like i am creating ropsten here
:=
ropsten: {
provider: () => new HDWalletProvider(Process.env.KEY, https://ropsten.infura.io/v3/${Process.env.PROJECTID}),
network_id: 3, // Ropsten's id
gas: 5500000, // Ropsten has a lower block limit than mainnet
confirmations: 2, // # of confs to wait between deployments. (default: 0)
timeoutBlocks: 200, // # of blocks before a deployment times out (minimum/default: 50)
skipDryRun: true // Skip dry run before migrations? (default: false for public nets )
},

then Run command npx truffle network --ropsten

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants