musique/server
2022-12-16 11:38:05 +01:00
..
proto integrated new host recognition algorithm with Musique 2022-12-16 02:11:43 +01:00
scan integrated new host recognition algorithm with Musique 2022-12-16 02:11:43 +01:00
.gitignore Known hosts knowladge sharing algorithm; nicks and ports 2022-12-15 00:28:36 +01:00
go.mod Known hosts knowladge sharing algorithm; nicks and ports 2022-12-15 00:28:36 +01:00
handlers.go cleanup of server directory structure 2022-12-14 17:49:14 +01:00
main.go integrated new host recognition algorithm with Musique 2022-12-16 02:11:43 +01:00
musique-bridge.go Musique configuration file 2022-12-16 11:38:05 +01:00
README.md Known hosts knowladge sharing algorithm; nicks and ports 2022-12-15 00:28:36 +01:00
timesync.go cleanup of server directory structure 2022-12-14 17:49:14 +01:00

Server

Development notes

Testing server list synchronisation (2022-12-14)

For ease of testing you can launch N instances of server in N tmux panes.

$ while true; do sleep {n}; echo "======="; ./server -nick {nick} -port {port}; done

where n is increasing for each server to ensure that initial scan would not cover entire task of network scanning.

Next you can use this script to test:

go build
killall server
sleep 4

# Repeat line below for all N servers
echo '{"version":1, "type":"hosts"}' | nc localhost {port} | jq

# Choose one or few that will request synchronization with their remotes
echo '{"version":1, "type":"synchronize-hosts-with-remotes"}' | nc localhost {port} | jq

# Ensure that all synchronisation propagated with enough sleep time
sleep 2

# Repeat line below for all N servers
echo '{"version":1, "type":"hosts"}' | nc localhost {port} | jq