Skip to content

Commit

Permalink
WIP: not tested, not documented
Browse files Browse the repository at this point in the history
  • Loading branch information
ayuryshev committed Mar 18, 2019
1 parent aa9a29c commit 0f5b0ff
Show file tree
Hide file tree
Showing 4 changed files with 32 additions and 6 deletions.
28 changes: 22 additions & 6 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@ DOCKER_OPTS?=GO111MODULE=on GOOS=linux # go options for compiling for docker con
build: dep host-apps bin

clean:
rm -rf ./apps
rm -f ./skywire-node ./skywire-cli ./manager-node ./thereallssh-cli
-rm -rf ./apps
-rm -f ./skywire-node ./skywire-cli ./manager-node ./thereallssh-cli

install:
${OPTS} go install ./cmd/skywire-node ./cmd/skywire-cli ./cmd/manager-node ./cmd/therealssh-cli
Expand Down Expand Up @@ -87,12 +87,28 @@ docker-volume: docker-apps docker-bin bin
node: docker-clean docker-image docker-network docker-volume
docker run -d -v $(shell pwd)/node:/sky --network=${DOCKER_NETWORK} --name=${DOCKER_NODE} ${DOCKER_IMAGE} bash -c "cd /sky && ./skywire-node"

run:
./skywire-node

node-stop:
-docker container stop ${DOCKER_NODE}

refresh-node: node-stop docker-bin
# cp ./skywire-node ./node
# cp ./skywire-node ./node
docker container start ${DOCKER_NODE}

# Host goals

run: stop build
cat ./node/skywire.json|grep static_public_key |cut -d ':' -f2 |tr -d '"'','' ' > ./PK
./skywire-node &>/dev/null &

stop:
-bash -c "kill $$(ps aux |grep '[s]kywire-node' |awk '{print $$2}')"

refresh: stop
${OPTS} go build -o ./skywire-node ./cmd/skywire-node
./skywire-node &>/dev/null &


# Test of chat
# test-chat: run node
# ./skywire-cli add-transport $(cat ./node/PK)

3 changes: 3 additions & 0 deletions tests/001-add-transport
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
#!/bin/bash
# PRECONDITION: `make node && make run`
./skywire-cli add-transport $(cat ./node/PK)
4 changes: 4 additions & 0 deletions tests/002-chat-2-messages
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
#!/bin/bash
# PRECONDITION: `make node && make run && ./001-add-transport`
curl --data {'"recipient":"'$(cat ./node/PK)'", "message":"MESSAGE '$RANDOM'"}' -X POST http://$(docker inspect -f '{{range .NetworkSettings.Networks}}{{.IPAddress}}{{end}}' SKY01):8000/message
curl --data {'"recipient":"'$(cat ./PK)'", "message":"MESSAGE '$RANDOM'"}' -X POST http://localhost:8000/message
3 changes: 3 additions & 0 deletions tests/003-chat-256-messages
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
#!/bin/bash
# PRECONDITION: `make node && make run && ./001-add-transport`
# Implement it

0 comments on commit 0f5b0ff

Please sign in to comment.