***************************************************
SOLUTIONS POSTED FOLLOWING QUESTIONS***************************************************
I'm creating an altcoin based on Pfennig (
https://github.com/project-bitmark/pfennig), the cloneable reference implementation of Bitmark (
https://github.com/project-bitmark/bitmark), in order to gain a deeper understanding of cryptocurrency. This coin is not going to market. It's intended only as a means of educating myself about different cryptocurrencies and their inner workings.
Please don't poop on me with posts about crappy altcoins, etc.
The difficulties I'm experiencing are as follows;
1. Clients do not connect to seednodes;chainparams.cpp22 unsigned int pnSeed[] =
23 {
24 0x688312e4 // Updated seed node
25 };
After first run to set the rpcuser and rpcpassword, the daemon does not attempt to connect to hardcoded seed nodes.
In the above example, taken from the coin source, shows the hex IP of my VPS seednode at 104.131.20.192.
The VPS at 104.131.20.192 is set to listen using the following;
./betacoind -listen=1 -printtoconsole &
and reports the following;
Betacoin version v0.9.2.1-7ecf3af-dirty-beta (2014-08-16 21:43:28 -0400)
Using OpenSSL version OpenSSL 1.0.1e 11 Feb 2013
Using BerkeleyDB version Berkeley DB 4.8.30: (April 9, 2010)
Default data directory /home/ubox/.betacoin
Using data directory /home/ubox/.betacoin
Using at most 125 connections (1024 file descriptors available)
Using 8 threads for script verification
Using wallet wallet.dat
init message: Verifying wallet...
CDBEnv::Open : LogDir=/home/ubox/.betacoin/database ErrorFile=/home/ubox/.betacoin/db.log
Bound to [::]:9751
Bound to 0.0.0.0:9751
init message: Loading block index...
Opening LevelDB in /home/ubox/.betacoin/blocks/index
Opened LevelDB successfully
Opening LevelDB in /home/ubox/.betacoin/chainstate
Opened LevelDB successfully
LoadBlockIndexDB(): last block file = 0
LoadBlockIndexDB(): last block file info: CBlockFileInfo(blocks=1, size=254, heights=0...0, time=2014-08-16...2014-08-16)
LoadBlockIndexDB(): transaction index disabled
LoadBlockIndexDB(): hashBestChain=c44dec01e2ba3f7d0376654b4fb790fd0e3e7c2996c389a57ca3e48270f1c57a height=0 date=2014-08-16 02:36:49 progress=0.000008
init message: Verifying blocks...
block index 126ms
init message: Loading wallet...
nFileVersion = 90201
Keys: 101 plaintext, 0 encrypted, 101 w/ metadata, 101 total
wallet 160ms
init message: Loading addresses...
Loaded 1 addresses from peers.dat 0ms
mapBlockIndex.size() = 1
nBestHeight = 0
setKeyPool.size() = 100
mapWallet.size() = 0
mapAddressBook.size() = 1
ext-ip thread start
dnsseed thread start
Loading addresses from DNS seeds (could take a while)
opencon thread start
addcon thread start
net thread start
msghand thread start
dumpaddr thread start
init message: Done loading
1 addresses found from DNS seeds
dnsseed thread exit
connect() to 104.131.53.44:9751 failed after select(): Connection refused (111)
GetMyExternalIP() received [184.75.210.198] 184.75.210.198:0
GetMyExternalIP() returned 184.75.210.198
AddLocal(184.75.210.198:9751,4)
ext-ip thread exit
connect() to 104.131.53.44:9751 failed after select(): Connection refused (111)
connect() to 104.131.53.44:9751 failed after select(): Connection refused (111)
connect() to 104.131.53.44:9751 failed after select(): Connection refused (111)
connect() to 104.131.53.44:9751 failed after select(): Connection refused (111)
connect() to 104.131.53.44:9751 failed after select(): Connection refused (111)
connect() to 104.131.53.44:9751 failed after select(): Connection refused (111)
connect() to 104.131.53.44:9751 failed after select(): Connection refused (111)
connect() to 104.131.53.44:9751 failed after select(): Connection refused (111)
connect() to 104.131.53.44:9751 failed after select(): Connection refused (111)
connect() to 104.131.53.44:9751 failed after select(): Connection refused (111)
SOLVED:https://bitcointalk.org/index.php?topic=775332.msg8901349#msg8901349https://bitcointalk.org/index.php?topic=34586.msg1983185#msg19831852. Clients only connect when using -connect or -addnode commands;After first run to set the rpcuser and rpcpassword, the daemon will only connect to another client if using -addnode or -connect commands.
Using the following command, I am able to connect a client to my seednode at 104.131.20.192 ;
./betacoind -listen=1 -connect=104.131.20.192 &
and successfully mine blocks using;
./betacoind -listen=1 -gen=1 -connect=104.131.20.192 &
SOLVED:This was the result of improper pnSeed formatting and broken DNS seed. Peers now connect automatically via seednode or dns.
3. Client does not pull from peers.dat;On all subsequent instances of the daemon no connection is made unless -connect or -addnode is specified.
The following instance of the daemon results in no connections despite having peers in the peer.dat file.
./betacoind -listen=1 -gen=1
Why is the client not pulling peers from the peer.dat file?
4. Clients are not able to connect to the DNS Seeder;The DNS seeder shows no attempted connections.
I have my domain configured with both and A record and NS record as follows;
A Record:
seed.cryptodistributed.org 104.131.53.44
www.seed.cryptodistributed.org 104.131.53.44
NS Record:
cryptodistributed.org seed.cryptodistributed.org
Which appears to be functioning correctly as per
https://www.whatsmydns.net/#A/seed.cryptodistributed.orgThe address of the dnsseed is entered as such in;
chainparams.cpp
64 vSeeds.push_back(CDNSSeedData("cryptodistributed.org", "seed.cryptodistributed.org"));
On the clients attempting to connect:
Betacoin version v0.9.2.1-7ecf3af-dirty-beta (2014-08-16 21:43:28 -0400)
Using OpenSSL version OpenSSL 1.0.1e 11 Feb 2013
Using BerkeleyDB version Berkeley DB 4.8.30: (April 9, 2010)
Default data directory /home/ubox/.betacoin
Using data directory /home/ubox/.betacoin
Using at most 125 connections (1024 file descriptors available)
Using 8 threads for script verification
Using wallet wallet.dat
init message: Verifying wallet...
CDBEnv::Open : LogDir=/home/ubox/.betacoin/database ErrorFile=/home/ubox/.betacoin/db.log
Bound to [::]:9751
Bound to 0.0.0.0:9751
init message: Loading block index...
Opening LevelDB in /home/ubox/.betacoin/blocks/index
Opened LevelDB successfully
Opening LevelDB in /home/ubox/.betacoin/chainstate
Opened LevelDB successfully
LoadBlockIndexDB(): last block file = 0
LoadBlockIndexDB(): last block file info: CBlockFileInfo(blocks=1, size=254, heights=0...0, time=2014-08-16...2014-08-16)
LoadBlockIndexDB(): transaction index disabled
LoadBlockIndexDB(): hashBestChain=c44dec01e2ba3f7d0376654b4fb790fd0e3e7c2996c389a57ca3e48270f1c57a height=0 date=2014-08-16 02:36:49 progress=0.000008
init message: Verifying blocks...
block index 126ms
init message: Loading wallet...
nFileVersion = 90201
Keys: 101 plaintext, 0 encrypted, 101 w/ metadata, 101 total
wallet 160ms
init message: Loading addresses...
Loaded 1 addresses from peers.dat 0ms
mapBlockIndex.size() = 1
nBestHeight = 0
setKeyPool.size() = 100
mapWallet.size() = 0
mapAddressBook.size() = 1
ext-ip thread start
dnsseed thread start
Loading addresses from DNS seeds (could take a while)
opencon thread start
addcon thread start
net thread start
msghand thread start
dumpaddr thread start
init message: Done loading
1 addresses found from DNS seeds
dnsseed thread exit
connect() to 104.131.53.44:9751 failed after select(): Connection refused (111)
GetMyExternalIP() received [184.75.210.198] 184.75.210.198:0
GetMyExternalIP() returned 184.75.210.198
AddLocal(184.75.210.198:9751,4)
ext-ip thread exit
connect() to 104.131.53.44:9751 failed after select(): Connection refused (111)
connect() to 104.131.53.44:9751 failed after select(): Connection refused (111)
connect() to 104.131.53.44:9751 failed after select(): Connection refused (111)
connect() to 104.131.53.44:9751 failed after select(): Connection refused (111)
connect() to 104.131.53.44:9751 failed after select(): Connection refused (111)
connect() to 104.131.53.44:9751 failed after select(): Connection refused (111)
connect() to 104.131.53.44:9751 failed after select(): Connection refused (111)
connect() to 104.131.53.44:9751 failed after select(): Connection refused (111)
connect() to 104.131.53.44:9751 failed after select(): Connection refused (111)
connect() to 104.131.53.44:9751 failed after select(): Connection refused (111)
On the DNS seeder:
./dnsseed -h seed.cryptodistributed.org -n 104.131.53.44
Starting 4 DNS threads for seed.cryptodistributed.org on 104.131.53.44 (port 53) ......done
Starting seeder...done
Starting 96 crawler threads...done
0/2 available (2 tried in 100s, 0 new, 0 active), 0 banned; 0 DNS requests, 4 db queries
SOLVED:In the dnsseeder, main.cpp:
Line 351
- db.Add(CService("kjy2eqzk4zwi5zd3.onion", 9751), true);
+ db.Add(CService("104.131.18.228", GetDefaultPort()), true);
DNS seeder serves peers from seednode.
I will happily provide additional details if anyone has an idea as to what might be the problem.
Thanks!