2017-01-10 06:08:33 +01:00
|
|
|
#! /bin/sh -e
|
|
|
|
|
|
|
|
# Wherever we are, we want to be in daemon/test dir.
|
|
|
|
cd `git rev-parse --show-toplevel`/daemon/test
|
|
|
|
|
|
|
|
. scripts/vars.sh
|
|
|
|
. scripts/helpers.sh
|
|
|
|
|
|
|
|
parse_cmdline 2 "$@"
|
|
|
|
setup_lightning 2
|
|
|
|
|
|
|
|
start_lightningd 2 lightningd/lightningd
|
|
|
|
|
2017-01-10 06:08:33 +01:00
|
|
|
if lcli1 connect localhost $PORT2 $ID1; then
|
|
|
|
echo Connected OK with wrong ID? >&2
|
|
|
|
exit 1
|
|
|
|
fi
|
|
|
|
|
|
|
|
lcli1 connect localhost $PORT2 $ID2
|
2017-01-10 06:08:33 +01:00
|
|
|
|
2017-01-10 06:08:34 +01:00
|
|
|
# Should now be exchanging gossip
|
|
|
|
lcli1 getpeers | $FGREP '"condition" : "Exchanging gossip"'
|
|
|
|
|
|
|
|
# It should have gone through these steps
|
|
|
|
lcli1 getpeers info | $FGREP "Starting handshake as initiator"
|
|
|
|
lcli1 getpeers info | $FGREP "Beginning gossip"
|
|
|
|
lcli1 getpeers info | $FGREP "Exchanging gossip"
|
|
|
|
|
|
|
|
# Both should still be owned by gossip
|
|
|
|
lcli1 getpeers | $FGREP '"owner" : "lightningd_gossip"'
|
|
|
|
lcli2 getpeers | $FGREP '"owner" : "lightningd_gossip"'
|
2017-01-10 06:08:33 +01:00
|
|
|
|
|
|
|
lcli1 stop
|
|
|
|
lcli2 stop
|
|
|
|
|
|
|
|
all_ok
|