[Ethereum] connect ethereum wallet(or mist) to to ethereum local private network

go-ethereummistNetworkprivate-blockchain

I would like to create a private network for test. And I would like to connect to this private network from commandline client or Ethereum wallet/mint.

I have created a private network as below.

geth --datadir=./chaindata init genesis.json

The content of genesis.json is genesis.json

Afterwards, I have started private network with following commands. (I have tried both of these commands seperately)

geth --datadir=./chaindata 
geth --datadir=./chaindata --networkid 15

Afterwards, I have opened another terminal and try to connect running private network. But it does not connect.

geth attach

I have realised it is trying to connect default geth.ipc which is not running and I have send the running private network's geth.ipc as parameter and I is solved.

geth attach ~/chaindata/geth.ipc

But, I could not change the default geth.ipc for Mist or Ethereum Wallet. How can I connect Ethereum Wallet/Mist to private network?

Ethereum Wallet/Mist error message during startup

Couldn't connect to node? See the logs for more:
...
...
INFO [07-16|15:47:51] Starting P2P networking 
Fatal: Error starting protocol stack: listen udp :30303: bind:   address already in use

Best Answer

to start a local test network you can now use

geth --dev

once you do, take note of where it has actually created it by reading the line:

IPC endpoint opened: /var/folders/y1/jynwfrwj411bxck8whqgcbr00000gq/T/ethereum_dev_mode/geth.ipc

Then to have MIST connect to the private network type this in your terminal (MAC version)

open -a /Applications/Mist.app --args --rpc /var/folders/y1/jynwfrwj411bxck8whqgcbr00000gq/T/ethereum_dev_mode/geth.ipc