Skip to content

Latest commit

 

History

20 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Indra's Net

Shared cluster.json

One file for the whole cluster (copy the same file to every node):

{
  "peers": [
    { "host": "127.0.0.1", "port": 9001 },
    { "host": "127.0.0.1", "port": 9002 },
    { "host": "127.0.0.1", "port": 9003 }
  ],
  "heartbeatIntervalMs": 50,
  "electionTimeoutMinMs": 150,
  "electionTimeoutMaxMs": 300
}

Timing fields are optional; omitted values use the defaults above.

Each process picks its own listen address on the command line. The node dials every peer in the file except itself (matching host + port).

Peers are identified as host:port on the wire (no separate IDs).

Run nodes

swift run indras-net 127.0.0.1 9001 --cluster cluster.json
swift run indras-net 127.0.0.1 9002 --cluster cluster.json
swift run indras-net 127.0.0.1 9003 --cluster cluster.json

Nodes exchange JSON hello (with host:port as the peer identity), then ping connected peers on a random interval (200–500 ms).

Testing

./test-scripts/coverage.sh

About

Raft in swift, maybe more

Resources

Stars

1 star

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages