Skip to content
This repository has been archived by the owner on Feb 26, 2024. It is now read-only.

Truffle v4 'truffle develop' on Windows without connection to internet/offline gives error #656

Closed
GeoffreySari opened this issue Nov 2, 2017 · 8 comments

Comments

@GeoffreySari
Copy link

GeoffreySari commented Nov 2, 2017

[ethereum.stackexchange.com]https://ethereum.stackexchange.com/questions/29669/user-truffle-on-testrpc-offline


Issue

Running truffle develop on windows, while not connected to network/internet gives error.

Steps to Reproduce

  1. Create initial project in a desire folder truffle init
  2. Disconnect Wifi/Lan connection. Then run truffle develop

Expected Behavior

Unable to connect to ethereum client when disconnected from network/internet though WIFI/LAN.
However, when connected to a Wifi/Lan with internet, it works as expected and opens a console that we can run truffle commands migrate, test normally.

It be great to connect to http://localhost:9545/ while offline and not connected to internet.

Actual Results

$ truffle develop
Truffle Develop started at http://localhost:9545/

Accounts:
(0) 0x627306090abab3a6e1400e9345bc60c78a8bef57
...
(9) 0x5aeda56215b167893e80b4fe645ba6d5bab767de

Mnemonic: candy maple cake sugar pudding cream honey rich smooth crumble sweet t                                                                                                                reat

Could not connect to your Ethereum client. Please check that your Ethereum clien                                                                                                                t:
    - is running
    - is accepting RPC connections (i.e., "--rpc" option is used in geth)
    - is accessible over the network
    - is properly configured in your Truffle configuration file (truffle.js)

Environment

  • Operating System: Windows
  • Truffle version: v4
  • Ethereum client: Testrpc
@GeoffreySari
Copy link
Author

For anyone, who may experience similar issue. Here's a quick solution I found to get truffle working offline.

So truffle deploy doesn't work because of truffle's need to create an external RPC IP Address, as it seems.

A quick solution to this issue of truffle deploy not working, was simply running a mobile hotspot from my Smart phone and connecting my host machine to the wifi. Then running truffle deploy without internet connection disabled from Smart phone got it working as expected, at least for now

@gnidan
Copy link
Contributor

gnidan commented Nov 9, 2017

Re-opening this; it's a real problem!

Discovered the cause via a StackOverflow question.

Required Truffle fix: Replace localhost with 127.0.0.1 everywhere.

@ghost
Copy link

ghost commented Nov 29, 2017

I am experiencing a similar problem on a mac High Sierra.
I cannot connect to the truffle development environment when wifi is turned off.

For me it depends to which wifi I am connected whether or not it works:

  • Cannot connect to the truffle development environment on home wifi
  • Can connect to truffle development environment on work wifi

In case truffle cannot connect, I also cannot find a node (truffle dev) process running on port 9545. I do find a process running on the expected port if I run truffle development --log and can successfully connect to it from a different terminal.

Workaround:

  1. Open 2 terminals
  2. Run truffle develop --log in one
  3. Run truffle console in the other

@gnidan
Copy link
Contributor

gnidan commented Mar 29, 2018

Is this problem still happening? Seems like most of the localhost references have been changed to the more reliable 127.0.0.1

@cgewecke
Copy link
Contributor

Tested this on 4.1.5 and it seems to be working. Closing.

@raky35
Copy link

raky35 commented Apr 27, 2018

$ npm -version truffle
5.8.0
turffle.js
mistConnection: {
host: '127.0.0.1',
port: 8545,
network_id: "*",
from:'0xXXXXXXXX'

truffle migrate --network mistConnection
Compiling ./contracts/Voting.sol...
Writing artifacts to ./build/contracts

Could not connect to your Ethereum client. Please check that your Ethereum client:
- is running
- is accepting RPC connections (i.e., "--rpc" option is used in geth)
- is accessible over the network
- is properly configured in your Truffle configuration file (truffle.js)

@mryellow
Copy link

mryellow commented Sep 25, 2018

Believe this remains an issue in 4.1.8.

'Invalid JSON RPC response'

Sent from mobile (no connectivity).

edit: 4.1.14 also. Debian.

@yhjhoo
Copy link

yhjhoo commented Sep 16, 2021

to working in a retricted network, can't connect to internet to reach to RPC connections.

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

No branches or pull requests

6 participants