63 lines
1.2 KiB
Markdown
63 lines
1.2 KiB
Markdown
# MP2 Distributed Group Membership
|
|
|
|
## Files
|
|
- `peer.py` - membership daemon
|
|
- `scripts/cmd.sh` - start/kill/control VMs
|
|
- `scripts/view.sh` - tmux membership dashboard
|
|
- `scripts/pretty_membership.py` - dashboard formatter
|
|
|
|
## Running a node
|
|
Set `MACHINE_INDEX` to the VM's index, then run:
|
|
|
|
```bash
|
|
MACHINE_INDEX=1 python3 peer.py
|
|
```
|
|
|
|
## Starting the demo
|
|
Start the dashboard. `tmux` is required:
|
|
|
|
```bash
|
|
./scripts/view.sh
|
|
```
|
|
|
|
From another terminal, start the VMs:
|
|
|
|
```bash
|
|
./scripts/cmd.sh start 1
|
|
./scripts/cmd.sh start 2 3 4 5
|
|
./scripts/cmd.sh start 6 7 8 9 10
|
|
```
|
|
|
|
## Commands
|
|
The following commands are available in the peer prompt:
|
|
|
|
```text
|
|
list_mem
|
|
list_self
|
|
leave
|
|
display_suspects
|
|
switch suspect
|
|
switch nosuspect
|
|
display_protocol
|
|
set_drop_rate <percent>
|
|
```
|
|
|
|
## Demo/testing helpers
|
|
Run these from the `MP2` directory:
|
|
|
|
```bash
|
|
./scripts/cmd.sh kill 4 8
|
|
./scripts/cmd.sh start 4 8
|
|
./scripts/cmd.sh cmd all "switch suspect"
|
|
./scripts/cmd.sh cmd all "set_drop_rate 10"
|
|
./scripts/cmd.sh status
|
|
./scripts/cmd.sh log
|
|
```
|
|
|
|
## Introducer
|
|
`VM1` / `172.22.156.3`
|
|
|
|
## Notes
|
|
- Gossip is default mode.
|
|
- Artificial drops are applied at receivers.
|
|
- Rejoining processes receive a new timestamp in their node ID. |