Skip to content

Commit

Permalink
Merge pull request #461 from zpcsa/develop
Browse files Browse the repository at this point in the history
 Config file for pools
  • Loading branch information
jonano614 authored Dec 6, 2018
2 parents e00c9de + a9afc7e commit 0c38334
Show file tree
Hide file tree
Showing 9 changed files with 640 additions and 6 deletions.
2 changes: 2 additions & 0 deletions client/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@ sources = \
network.c \
time.c \
math.c \
xdag_config.c \
$(dnet)/dnet_crypt.c \
$(dnet)/dnet_xdag.c \
$(dfslib)/dfslib_crypt.c \
Expand Down Expand Up @@ -91,6 +92,7 @@ headers = \
network.h \
time.h \
math.h \
xdag_config.h \
$(dnet)/dnet_crypt.h \
$(dnet)/dnet_history.h \
$(dnet)/dnet_main.h \
Expand Down
18 changes: 18 additions & 0 deletions client/example.ini
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
######################
# XDAG Configuration #
######################
[POOL]
#pool ip
ip = 127.0.0.1
#pool port
port = 65535
max_connection_count_input = 4096
max_miner_ip_count = 128
connections_per_miner_limit = 128
pool_fee = 1
pool_reward = 5
pool_direct = 5
pool_fund = 0.5



16 changes: 14 additions & 2 deletions client/init.c
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@
#include "utils/log.h"
#include "utils/utils.h"
#include "json-rpc/rpc_service.h"
#include "xdag_config.h"

char *g_coinname, *g_progname;
#define coinname g_coinname
Expand Down Expand Up @@ -95,8 +96,15 @@ int xdag_init(int argc, char **argv, int isGui)
}
continue;
}

if (ARG_EQUAL(argv[i], "-a", "")) { /* miner address */
if (ARG_EQUAL(argv[i], "-f", "")){ /* configuration file */
if (++i < argc) {
if(argv[i]!=NULL&&argv[i][0]!='-'&&pool_arg==NULL){
char buf[80];
if(get_pool_config(argv[i],buf,sizeof(buf))) return -1;
pool_arg = buf;
}
}
}else if (ARG_EQUAL(argv[i], "-a", "")) { /* miner address */
if (++i < argc) miner_address = argv[i];
} else if(ARG_EQUAL(argv[i], "-c", "")) { /* another full node address */
if (++i < argc && n_addrports < 256)
Expand Down Expand Up @@ -285,6 +293,7 @@ void printUsage(char* appName)
" -a address - specify your address to use in the miner\n"
" -c ip:port - address of another xdag full node to connect\n"
" -d - run as daemon (default is interactive mode)\n"
" -f - configuration file path(pools only)\n"
" -h - print this help\n"
" -i - run as interactive terminal for daemon running in this folder\n"
" -l - output non zero balances of all accounts\n"
Expand All @@ -311,3 +320,6 @@ void printUsage(char* appName)
" -tag - tag for pool to distingush pools. Max length is 32 chars\n"
, appName);
}



3 changes: 2 additions & 1 deletion client/netdb-testnet.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
213.21.5.18:3366
77.55.222.85:3366
87.6.21.13:6667
79.18.247.42:6667
95.105.233.208:19995
82.119.116.99:19995
3 changes: 2 additions & 1 deletion client/netdb-white-testnet.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
213.21.5.18:3366
77.55.222.85:3366
87.6.21.13:6667
79.18.247.42:6667
95.105.233.208:19995
82.119.116.99:19995
2 changes: 1 addition & 1 deletion client/netdb-white.txt
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
52.83.192.224:13655
54.39.28.77:13654
59.110.170.149:13655
87.6.21.13:9998
79.18.247.42:9998
83.219.150.219:16775
88.99.213.241:16775
88.198.100.226:13654
Expand Down
2 changes: 1 addition & 1 deletion client/netdb.txt
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
52.83.192.224:13655
54.39.28.77:13654
59.110.170.149:13655
87.6.21.13:9998
79.18.247.42:9998
83.219.150.219:16775
88.99.213.241:16775
88.198.100.226:13654
Expand Down
Loading

0 comments on commit 0c38334

Please sign in to comment.