diff --git a/install/2nodes_test/example_st2.sh b/install/2nodes_test/example_st2.sh index 92af055aa..9d86b3f91 100755 --- a/install/2nodes_test/example_st2.sh +++ b/install/2nodes_test/example_st2.sh @@ -9,3 +9,9 @@ cd node_3333 cd ../node_4444 ../ucoind -c ../regtest.conf -p 4444 & cd .. + +sleep 1 + +mkdir -p conf +mv node_3333/peer_*.conf conf/peer3333.conf +mv node_4444/peer_*.conf conf/peer4444.conf diff --git a/install/2nodes_test/example_st3.sh b/install/2nodes_test/example_st3.sh index d5afdc2b1..6c62b6751 100755 --- a/install/2nodes_test/example_st3.sh +++ b/install/2nodes_test/example_st3.sh @@ -7,10 +7,6 @@ # +-----------+ | fundee | # +-----------+ -mkdir -p conf -cp node_3333/peer.conf conf/peer3333.conf -cp node_4444/peer.conf conf/peer4444.conf - # connect ./ucoincli -c conf/peer3333.conf 4445 diff --git a/install/2nodes_test/example_st4r.sh b/install/2nodes_test/example_st4r.sh index 37c9bacb0..4d0e71a7e 100755 --- a/install/2nodes_test/example_st4r.sh +++ b/install/2nodes_test/example_st4r.sh @@ -17,14 +17,14 @@ PAYEE=node_${PAY_END} PAYEE_PORT=$(( ${PAY_END} + 1 )) nodeid() { - cat $1/peer.conf | awk '(NR==3) { print $1 }' | cut -d '=' -f2 + cat conf/peer$1.conf | awk '(NR==3) { print $1 }' | cut -d '=' -f2 } pay() { echo "payment ${PAYER} --> ${PAYEE}" - payer_id=`nodeid $PAYER` - payee_id=`nodeid $PAYEE` + payer_id=`nodeid $PAY_BEGIN` + payee_id=`nodeid $PAY_END` ./routing $PAYER/dbucoin $payer_id $payee_id $AMOUNT if [ $? -ne 0 ]; then diff --git a/install/4nodes_test/example_st2.sh b/install/4nodes_test/example_st2.sh index 69900ffec..aea250df6 100755 --- a/install/4nodes_test/example_st2.sh +++ b/install/4nodes_test/example_st2.sh @@ -13,3 +13,11 @@ cd ../node_5555 cd ../node_6666 ../ucoind -c ../regtest.conf -p 6666 & cd .. + +sleep 3 + +mkdir -p conf +mv node_3333/peer_*.conf conf/peer3333.conf +mv node_4444/peer_*.conf conf/peer4444.conf +mv node_5555/peer_*.conf conf/peer5555.conf +mv node_6666/peer_*.conf conf/peer6666.conf diff --git a/install/4nodes_test/example_st3.sh b/install/4nodes_test/example_st3.sh index fd1cab933..34c82901c 100755 --- a/install/4nodes_test/example_st3.sh +++ b/install/4nodes_test/example_st3.sh @@ -47,12 +47,6 @@ # | fundee +-------------+ FUNDER | # +-----------+ +-----------+ -mkdir -p conf -cp node_3333/peer.conf conf/peer3333.conf -cp node_4444/peer.conf conf/peer4444.conf -cp node_5555/peer.conf conf/peer5555.conf -cp node_6666/peer.conf conf/peer6666.conf - # connect ./ucoincli -c conf/peer3333.conf 4445 sleep 1 diff --git a/install/4nodes_test/example_st4r.sh b/install/4nodes_test/example_st4r.sh index d18d3bddd..8f4fd2379 100755 --- a/install/4nodes_test/example_st4r.sh +++ b/install/4nodes_test/example_st4r.sh @@ -18,14 +18,14 @@ PAYEE_PORT=$(( ${PAY_END} + 1 )) nodeid() { - cat $1/peer.conf | awk '(NR==3) { print $1 }' | cut -d '=' -f2 + cat conf/peer$1.conf | awk '(NR==3) { print $1 }' | cut -d '=' -f2 } pay() { echo "payment ${PAYER} --> ${PAYEE}" - payer_id=`nodeid $PAYER` - payee_id=`nodeid $PAYEE` + payer_id=`nodeid $PAY_BEGIN` + payee_id=`nodeid $PAY_END` ./routing $PAYER/dbucoin $payer_id $payee_id $AMOUNT if [ $? -ne 0 ]; then diff --git a/ucoind/ucoind.c b/ucoind/ucoind.c index 7b67b7d3b..fab65eb8b 100644 --- a/ucoind/ucoind.c +++ b/ucoind/ucoind.c @@ -171,7 +171,9 @@ int main(int argc, char *argv[]) ln_print_node(&mNode); //peer config出力 - FILE *fp = fopen("peer.conf", "w"); + char fname[256]; + sprintf(fname, "peer_%s.conf", mNode.alias); + FILE *fp = fopen(fname, "w"); if (fp) { if (p_addr->type == LN_NODEDESC_IPV4) { fprintf(fp, "ipaddr=%d.%d.%d.%d\n",