diff --git a/main.go b/main.go index 7322eab..2a8352c 100644 --- a/main.go +++ b/main.go @@ -111,35 +111,4 @@ func StartNode(replicaID uint64, exampleShardID uint64, addr string) *dragonboat return nh - // raftStopper.RunWorker(func() { - // // use a NO-OP client session here - // // check the example in godoc to see how to use a regular client session - // cs := nh.GetNoOPSession(exampleShardID) - // for { - // select { - // case v, ok := <-ch: - // if !ok { - // return - // } - // // remove the \n char - // msg := strings.Replace(v, "\n", "", 1) - // if cmd, addr, replicaID, err := splitMembershipChangeCmd(msg); err == nil { - // // input is a membership change request - // makeMembershipChange(nh, cmd, addr, replicaID) - // } else { - // // input is a regular message need to be proposed - // ctx, cancel := context.WithTimeout(context.Background(), 3*time.Second) - // // make a proposal to update the IStateMachine instance - // _, err := nh.SyncPropose(ctx, cs, []byte(msg)) - // cancel() - // if err != nil { - // fmt.Fprintf(os.Stderr, "SyncPropose returned error %v\n", err) - // } - // } - // case <-raftStopper.ShouldStop(): - // return - // } - // } - // }) - // raftStopper.Wait() }