func NewACS(cfg Config) *ACS {
	if cfg.F == 0 {
		cfg.F = (cfg.N - 1) / 3
	}
	acs := &ACS{
		Config:       cfg,
		rbcInstances: make(map[uint64]*RBC),
		bbaInstances: make(map[uint64]*BBA),
		rbcResults:   make(map[uint64][]byte),
		bbaResults:   make(map[uint64]bool),
		messageQue:   newMessageQue(),
		closeCh:      make(chan struct{}),
		inputCh:      make(chan acsInputTuple),
		messageCh:    make(chan acsMessageTuple),
	}
	for _, id := range cfg.Nodes {
		acs.rbcInstances[id] = NewRBC(cfg, id)
		acs.bbaInstances[id] = NewBBA(cfg)
	}
	go acs.run()
	return acs
}
NewACS returns a new ACS instance configured with the given Config and node
ids.
package hbbft
import (
	"fmt"
)
type ACSMessage struct {
	ProposerID uint64
	Payload interface{}
}
type ACS struct {
	Config
	rbcInstances map[uint64]*RBC
	bbaInstances map[uint64]*BBA
	rbcResults map[uint64][]byte
	bbaResults map[uint64]bool
	output map[uint64][]byte
	messageQue *messageQue
	decided bool
	closeCh   chan struct{}
	inputCh   chan acsInputTuple
	messageCh chan acsMessageTuple
}
type (
	acsMessageTuple struct {
		senderID uint64
		msg      *ACSMessage
		err      chan error
	}
	acsInputResponse struct {
		rbcMessages []*BroadcastMessage
		acsMessages []*ACSMessage
		err         error
	}
	acsInputTuple struct {
		value    []byte
		response chan acsInputResponse
	}
)