Skip to content

5 Transaction Service

senthil edited this page May 27, 2020 · 1 revision

Transaction Service

type transactionService struct {
     membershipManager MembershipManager
     txQueue           TransactionQueue
}

type TransactionService interface {
     SubmitTransaction(txEnvelope *pb.Envelope) error
}

Transaction Queue

type transactionQueue struct {
     Queue []*pb.Transaction
     mu    sync.RWMutex
}

type TransactionQueue interface {
     Enqueue(tx *pb.Transaction) error
     Dequeue() (tx *pb.Transaction, error)
     Peek() (tx *pb.Transaction, error)
     Size() uint64
}