My own implementation of the Raft consensus algorithm. For now nodes can elect a leader and receive empty heartbeats from it.
https://en.wikipedia.org/wiki/Raft_(computer_science)
http://thesecretlivesofdata.com/raft/
By the Raft specification, a node becomes a leader when it gets votes from majority. For now, after the node announces an election, it does not count the number of votes it receives and thinks that it's a leader when it receives at least one vote.
go build
./raft-blockchain <host:port> <file_with_other_nodes_in_the_network>
cd config
./runNode1.sh
Open 2 more terminals and run ./runNode2.sh and ./runNode3.sh respectively