2019-08-28 23:39:33 +08:00
|
|
|
#!/bin/bash
|
|
|
|
|
2019-09-03 17:41:17 +08:00
|
|
|
GO_PKGS_PATH=./tests/interop/go_pkgs
|
|
|
|
|
|
|
|
DAEMON_REPO=go-libp2p-daemon
|
|
|
|
DAEMON_PATH=$GO_PKGS_PATH/$DAEMON_REPO
|
|
|
|
|
|
|
|
EXAMPLES_PATHS=$GO_PKGS_PATH/examples
|
|
|
|
|
|
|
|
|
2019-08-28 23:39:33 +08:00
|
|
|
go version
|
2019-09-03 17:41:17 +08:00
|
|
|
|
|
|
|
# Install `p2pd`
|
|
|
|
# FIXME: Use the canonical repo in libp2p, when we don't need `insecure`.
|
|
|
|
if [ ! -e "$DAEMON_PATH" ]; then
|
2019-09-03 22:25:29 +08:00
|
|
|
git clone https://github.com/mhchia/$DAEMON_REPO.git --branch test/add-options $DAEMON_PATH
|
|
|
|
if [ "$?" != 0 ]; then
|
|
|
|
echo "Failed to clone the daemon repo"
|
|
|
|
exit 1
|
|
|
|
fi
|
2019-09-03 17:41:17 +08:00
|
|
|
fi
|
2019-09-03 22:25:29 +08:00
|
|
|
|
|
|
|
cd $DAEMON_PATH && go install ./...
|
2019-09-03 17:41:17 +08:00
|
|
|
|
|
|
|
cd -
|
|
|
|
|
|
|
|
# Install example modeuls
|
2019-09-03 22:25:29 +08:00
|
|
|
cd $EXAMPLES_PATHS && go install ./...
|
2019-09-03 17:41:17 +08:00
|
|
|
|
2019-09-03 23:36:31 +08:00
|
|
|
echo "Finish installing go modules for interop."
|