Skip to content

Commit

Permalink
Makefile, add deploy-tmux and deploy-screen
Browse files Browse the repository at this point in the history
  • Loading branch information
kekebit authored and woodser committed Sep 7, 2024
1 parent dbbfb50 commit e4f0277
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 3 deletions.
15 changes: 14 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ haveno-apps:
refresh-deps:
./gradlew --write-verification-metadata sha256 && ./gradlew build --refresh-keys --refresh-dependencies -x test -x checkstyleMain -x checkstyleTest

deploy:
deploy-screen:
# create a new screen session named 'localnet'
screen -dmS localnet
# deploy each node in its own named screen window
Expand All @@ -43,6 +43,19 @@ deploy:
# give time to start
sleep 5

deploy-tmux:
# Start a new tmux session named 'localnet' (detached)
tmux new-session -d -s localnet -n main "make seednode-local"
# Split the window into panes and run each node in its own pane
tmux split-window -h -t localnet "make user1-desktop-local" # Split horizontally for user1
tmux split-window -v -t localnet:0.0 "make user2-desktop-local" # Split vertically on the left for user2
tmux split-window -v -t localnet:0.1 "make arbitrator-desktop-local" # Split vertically on the right for arbitrator
tmux select-layout -t localnet tiled
# give time to start
sleep 5
# Attach to the tmux session
tmux attach-session -t localnet

.PHONY: build seednode localnet

# Local network
Expand Down
6 changes: 4 additions & 2 deletions docs/installing.md
Original file line number Diff line number Diff line change
Expand Up @@ -95,9 +95,11 @@ If you are a developer who wants to test Haveno in a more controlled way, follow

#### Deploy

If you are a *screen* user, simply run `make deploy`. This command will open all needed Haveno instances (seednode, user1, user2, arbitrator) using *screen*.
If you are a *screen* user, simply run `make deploy-screen`. This command will open all needed Haveno instances (seednode, user1, user2, arbitrator) using *screen*.

If you don't use *screen*, open 4 terminal windows and run in each one of them:
If you are a *tmux* user, simply run `make deploy-tmux`. This command will open all needed Haveno instances (seednode, user1, user2, arbitrator) using *tmux* and attach them to splitted view.

If you don't use *screen* or *tmux*, open 4 terminal windows and run in each one of them:

1. `make seednode-local`
2. `make user1-desktop-local` or if you want to run user1 as a daemon: `make user1-daemon-local`
Expand Down

0 comments on commit e4f0277

Please sign in to comment.