5

This question already has an answer here:

I have seen option to connect Mist to a privatenet here like this

geth --networkid 1234 --ipcpath /Users/you/Library/Ethereum/geth.ipc

Looks like the path is hardcoded somewhere in the code.

How can I connect Mist to a private network which is remote?

marked as duplicate by Waqar Lim Apr 15 '16 at 8:49

This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.

4

Looks like the path is hardcoded somewhere in the code.

Yes. The Mist connections are hard coded to use IPC only, and not RPC.

user@Kumquat:~/EthereumSource/mist$ find . -iname '*ipc*'
./tests/mocha-in-browser/spec/ipc-spec.js
./modules/ipc
./modules/ipc/ipcProviderBackend.js
./modules/ipc/ipcProviderWrapper.js
./modules/ipc/getIpcPath.js
./modules/ipcCommunicator.js
user@Kumquat:~/EthereumSource/mist$ find . -iname '*rpc*'
./nodes/eth/darwin-x64/libjsonrpccpp-client.0.dylib
./nodes/eth/darwin-x64/libjsonrpccpp-server.0.dylib
./nodes/eth/darwin-x64/libjsonrpccpp-common.0.dylib
./nodes/eth/darwin-x64/libweb3jsonrpc.dylib

And your IPC paths can be found in modules/ipc/getIpcPath.js lines 7 to 24

module.exports = function() {
    var p = require('path');
    var path = global.path.HOME;

    if(process.platform === 'darwin')
        path += '/Library/Ethereum/geth.ipc';

    if(process.platform === 'freebsd' ||
       process.platform === 'linux' ||
       process.platform === 'sunos')
        path += '/.ethereum/geth.ipc';

    if(process.platform === 'win32')
        path = '\\\\.\\pipe\\geth.ipc';

    console.log('CONNECT to IPC PATH: '+ path);
    return path;
};

Mist and geth communicate via IPC by opening a file descriptor on the local computer and then send messages to each other through this file descriptor. So no remote connection currently.



How can i connect Mist to a private network which is remote?

You could try connecting your local instance of geth with your remote geth node using the P2P protocol, and then connect Mist to your local geth instance using IPC.

In other words, just make your local computer another node in your private network.

You can install a separately installed copy of geth, or use the geth packaged with Mist which is available in the following directories:

  • {MISTINSTALLDIRECTORY}/resources/node/geth/geth for Linux and Mac OS X
  • {MISTINSTALLDIRECTORY}\resources\node\geth\geth.exe for Windows

If your private network has a --networkid {xyz} and a custom genesis file, use the --networkid {xyz} and --genesis {custom genesis file}.

The next thing is to get your local geth to talk to your private network nodes. This will have to be done using --bootnodes or creating the files static-nodes.json or trusted nodes in your data directory. Remember to add --maxpeers {x} for a non-zero {x} as omitting this from the command line seems to prevent the connections being made.

  • 1
    > You could try connecting your local instance of geth with your remote geth node using the P2P protocol, and then connect Mist to your local geth instance using IPC. please explain i don't understand it. – niksmac Apr 15 '16 at 3:53
  • How is your remote private network configured? You could for example create a private network between two separate companies by running geth with a --networkid {uniqueid} and --genesis {custom genesis file} and have them talking to each other just like how the mainnet Ethereum network communicates through port 30303. – Bokky WeAreAllAssange PooBah Apr 15 '16 at 4:05
  • So it is not possible to connect Mist to remote client, as of now? – niksmac Apr 15 '16 at 4:17
  • Not from what I've look at in the source code. – Bokky WeAreAllAssange PooBah Apr 15 '16 at 4:19
  • 1
    I've revised the answer. You are welcome to edit. – Bokky WeAreAllAssange PooBah Apr 15 '16 at 5:23

Not the answer you're looking for? Browse other questions tagged or ask your own question.