func startNode(id uint64, peers []raft.Peer, iface iface) *node { st := raft.NewMemoryStorage() c := &raft.Config{ ID: id, ElectionTick: 10, HeartbeatTick: 1, Storage: st, MaxSizePerMsg: 1024 * 1024, MaxInflightMsgs: 256, } rn := raft.StartNode(c, peers) n := &node{ Node: rn, id: id, storage: st, iface: iface, pausec: make(chan bool), } n.start() return n }
func newRaftStorage() *raftStorage { return &raftStorage{ MemoryStorage: raft.NewMemoryStorage(), } }