Hi all,
Sorry to bother you with a question that has been asked 781235 times already: the impossibility to connect to seed node (Error: Couldn't connect to the seed node 10.0.2.15 on port 6819 - please check multichaind is running at that address and that your firewall settings allow incoming connections.). I've seen multiple threads but I couldn't solve my problem after countless hours browsing the web, that's why I'm here. We need to use this for a class and my fellow students couldn't connect either.
I had one idea for the origin of the bug: the ip of the seed node is not the same as what we set in the Vagrantfile.
I installed multichain on my computer (Ubuntu 16.04 LTS) and would like to have 3 VMs talking to each other. One VM would create a blockchain and the other two would interact with it.
The Vagrantfile I used is the following (provided by my professor):
# -*- mode: ruby -*-
# vi: set ft=ruby :
Vagrant.require_version ">= 1.6.2"
Vagrant.configure(2) do |config|
config.vm.box = "ubuntu/trusty64"
# config.vm.box = "https://cloud-images.ubuntu.com/vagrant/wily/current/wily-server-cloudimg-amd64-vagrant-disk1.box"
# config.vm.hostname = "Multichain"
# config.vm.network :private_network, :ip => '10.4.4.4'
number_of_nodes = 3
number_of_nodes.times do |i|
config.vm.define "multichain-node-#{i}" do |node|
node.vm.hostname = "multichain-node-#{i}"
node.vm.network :private_network, :ip => "10.4.4.#{i}"
node.vm.provider :virtualbox do |vb|
#vb.gui = true
vb.customize ["modifyvm", :id, "--memory", "512"]
vb.customize ["modifyvm", :id, "--natdnshostresolver1", "off"]
vb.customize ["modifyvm", :id, "--natdnsproxy1", "off"]
vb.name = "MultiChain-#{i}"
end
end
i += 1
end
config.ssh.forward_agent = true
config.ssh.forward_x11 = true
config.vm.provision "shell", :inline => "wget http://www.multichain.com/download/multichain-1.0-alpha-16.tar.gz"
config.vm.provision "shell", :inline => "tar -xvzf multichain-1.0-alpha-16.tar.gz"
config.vm.provision "shell", :inline => "cd multichain-1.0-alpha-16 && mv multichaind multichain-cli multichain-util /usr/local/bin"
end
Then I run:
$ vagrant up
$ vagrant ssh multichain-node-0
Welcome to Ubuntu 14.04.5 LTS (GNU/Linux 3.13.0-100-generic x86_64)
* Documentation: https://help.ubuntu.com/
System information disabled due to load higher than 1.0
Get cloud support with Ubuntu Advantage Cloud Guest:
http://www.ubuntu.com/business/services/cloud
0 packages can be updated.
0 updates are security updates.
New release '16.04.1 LTS' available.
Run 'do-release-upgrade' to upgrade to it.
/usr/bin/xauth: file /home/vagrant/.Xauthority does not exist
Following the example on https://github.com/oschain/multichain/blob/master/README.md , in multichain-node-0 I run:
vagrant@multichain-node-1:~$ multichain-util create lamchain
MultiChain utilities build 1.0 alpha 16 protocol 10003
Blockchain parameter set was successfully generated.
You can edit it in /home/vagrant/.multichain/lamchain/params.dat before running multichaind for the first time.
To generate blockchain please run "multichaind lamchain".
vagrant@multichain-node-1:~$ multichaind lamchain -daemon -debug=mchn -debug=mchnminor -debug=net
MultiChain Core Daemon build 1.0 alpha 16 protocol 10003
Multichain server starting
vagrant@multichain-node-1:~$ Looking for genesis block...
Genesis block found
New users can connect to this node using
multichaind lamchain@10.0.2.15:6819
Node started
Now I open a new tab in my terminal (Ctrl + Alt + t) and connect to the second node using on my machine (terminal of my Ubuntu, not a VM):
$ vagrant ssh multichain-node-1
Welcome to Ubuntu 14.04.5 LTS (GNU/Linux 3.13.0-100-generic x86_64)
* Documentation: https://help.ubuntu.com/
System information disabled due to load higher than 1.0
Get cloud support with Ubuntu Advantage Cloud Guest:
http://www.ubuntu.com/business/services/cloud
0 packages can be updated.
0 updates are security updates.
New release '16.04.1 LTS' available.
Run 'do-release-upgrade' to upgrade to it.
/usr/bin/xauth: file /home/vagrant/.Xauthority does not exist
vagrant@multichain-node-2:~$
Now, on the second node I want to connect to the blockchain, using:
vagrant@multichain-node-2:~$ multichaind lamchain@10.0.2.15:6819 -debug=mchn -debug=mchnminor -debug=net
MultiChain Core Daemon build 1.0 alpha 16 protocol 10003
Retrieving blockchain parameters from the seed node 10.0.2.15:6819 ...
Error: Couldn't connect to the seed node 10.0.2.15 on port 6819 - please c
heck multichaind is running at that address and that your firewall settings
allow incoming connections.
My guess is that there's a problem because it connects on node 10.0.2.15 and not 10.4.4.1 as we set in the Vagrantfile?
If I run ip a I get:
vagrant@multichain-node-1:~$ ip a
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN group default
link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
inet 127.0.0.1/8 scope host lo
valid_lft forever preferred_lft forever
inet6 ::1/128 scope host
valid_lft forever preferred_lft forever
2: eth0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP group default qlen 1000
link/ether 08:00:27:24:94:c4 brd ff:ff:ff:ff:ff:ff
inet 10.0.2.15/24 brd 10.0.2.255 scope global eth0
valid_lft forever preferred_lft forever
inet6 fe80::a00:27ff:fe24:94c4/64 scope link
valid_lft forever preferred_lft forever
3: eth1: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP group default qlen 1000
link/ether 08:00:27:60:10:bf brd ff:ff:ff:ff:ff:ff
inet 10.4.4.1/24 brd 10.4.4.255 scope global eth1
valid_lft forever preferred_lft forever
inet6 fe80::a00:27ff:fe60:10bf/64 scope link
valid_lft forever preferred_lft forever
And :
vagrant@multichain-node-2:~$ ip a
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN group default
link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
inet 127.0.0.1/8 scope host lo
valid_lft forever preferred_lft forever
inet6 ::1/128 scope host
valid_lft forever preferred_lft forever
2: eth0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP group default qlen 1000
link/ether 08:00:27:24:94:c4 brd ff:ff:ff:ff:ff:ff
inet 10.0.2.15/24 brd 10.0.2.255 scope global eth0
valid_lft forever preferred_lft forever
inet6 fe80::a00:27ff:fe24:94c4/64 scope link
valid_lft forever preferred_lft forever
3: eth1: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP group default qlen 1000
link/ether 08:00:27:39:f3:4e brd ff:ff:ff:ff:ff:ff
inet 10.4.4.2/24 brd 10.4.4.255 scope global eth1
valid_lft forever preferred_lft forever
inet6 fe80::a00:27ff:fe39:f34e/64 scope link
valid_lft forever preferred_lft forever
It is probably useful to know also that my internet connection is under my school's firewall.
Thanks A LOT even if you don't answer but took the time to read until here, it's still very nice of you! By helping me you might end up solving a problem for lots of students :)