How to establish connection for mining testnet blocks?

0

0

I am new here. I really want to know how scryptcoins work so i wanted to create and altcoin to learn on something.

I learned c++ years ago so i know i have some basic knowledge but sometimes i get stuck, and i need help.

Now i have a problem. I created my coin. I wanted to start on testnet on local network beetwen 2 pcs.

Server PC:

./xxxd -testnet -listen=1 -server=1 -connect=

Client PC

./xxxd -testnet -connect=

Than tried getinfo:

Conenctions: 0

The two pc can ping each other.

I tried other ways like:

Server PC:

./xxxd -testnet -connect=

Client PC

./xxxd -testnet -connect=


Server PC:

./xxxd -testnet -listen=1 -server=1 -connect=:

Client PC

./xxxd -testnet -connect=:

In getinfo they didn't have any connections. I searched forums, topic and found nothing.

If you can help me, please write down your oppinion.

milito

Posted 2014-04-26T09:35:44.280

Reputation: 9

>debug log: server (with -daemon)

connected <clientip>:<port send version message: version 71001, blocks=0, us=<mainip>:<port>, them=0.0.0.0:0, peer=<clientip>:<port> socket closed disconnecting node <clientip>:<port>

ENDOFSERVERDEBUG######START client debug

connected <serverpeerip>:<port> send version message: version 71001, blocks=0, us=<mainip>:<port>, them=0.0.0.0:0, peer=<serverpeerip>:<port> socket closed disconnecting node <serverpeerip>:<port> – milito 2014-04-26T09:45:28.167

Answers

1

The -connect option overrides -listen; if you specify -connect then the daemon does not listen for connections. So both your hosts are trying to connect to the other, but neither one is accepting connections.

If you use -bind, the daemon will accept connections on a particular interface, even if -connect is also specified.

So let's suppose the two hosts have IP addresses 192.168.0.1 and 192.168.0.2 respectively.

On host1:

 mycoind -bind=192.168.0.1 -connect=192.168.0.2 -testnet -server

On host2:

 mycoind -bind=192.168.0.2 -connect=192.168.0.1 -testnet -server

I have tested this with bitcoind and it works.

Note that other machines on the 192.168.0 network will be able to connect to either host. If it is a local network, this should not be a problem. You will want to make sure that your router will not do port forwarding to port 8333 on either machine.

You should also check firewall settings on both machines to make sure each will accept incoming connections from the other on port 8333. (Actually, if just one of them will accept connections from the other, that should be sufficient.)

Nate Eldredge

Posted 2014-04-26T09:35:44.280

Reputation: 21 420

Hi! Thank for response! i tried and they can't connect to each other. in lsof -M -i i saw that both are Listening on p2p and rpc port.milito 2014-04-26T21:27:24.467

If i turn off the pc i can see in debug.log that they can connect to each other. But when it's they connect and they want to send version blocks and other infos. But after that they disconnect.milito 2014-04-26T21:29:44.327

@milito: Do you have the same problem with the standard bitcoind daemon? If not, then the problem may be somewhere in the changes that you have made to the source, and there's not really any way we can help you with that.Nate Eldredge 2014-04-26T21:31:58.010

i will check it nowmilito 2014-04-26T22:01:05.970

Hi again!

I checked with the original source code and now they can connect and i see it in the getinfo, but they cant sync now. i got this in debug.log

connected 192.168.1.104:24070 send version message: version 71001, blocks=0, us=xx.xx.xx.xx:24070, them=0.0.0.0:0, peer=192.168.1.104:24070 socket closed disconnecting node 192.168.1.104:24070 – milito 2014-04-27T16:41:59.897

@milito: I'm out of ideas. Time for you to read the source and fire up a debugger, I guess.Nate Eldredge 2014-04-27T16:46:43.437

Okay! It's not my problem! I searched the source code, no bug in there. Everything is works fine! But they cant sync. IN -lsof -M -i i see that both are listening on IPV4 and IPV6 on port 24071 wich is RPC port. Itried to connect with putting the port and the and of the ip both p2p or rpc and nothing. In conenction they can see each other but after i set generate the other will have 1 block and the other have 0 blocks.... After generating the merkle hash should i do something? i inserted nNonce, hash and genblockhashmilito 2014-04-28T15:49:36.837