@@ -24,12 +24,14 @@ import (
24
24
25
25
"github.com/hyperledger/fabric/orderer/common/bootstrap/provisional"
26
26
localconfig "github.com/hyperledger/fabric/orderer/localconfig"
27
+ "github.com/hyperledger/fabric/orderer/multichain"
27
28
"github.com/hyperledger/fabric/orderer/rawledger/fileledger"
28
29
"github.com/hyperledger/fabric/orderer/sbft"
29
30
"github.com/hyperledger/fabric/orderer/sbft/backend"
30
31
"github.com/hyperledger/fabric/orderer/sbft/connection"
31
32
"github.com/hyperledger/fabric/orderer/sbft/persist"
32
33
pb "github.com/hyperledger/fabric/orderer/sbft/simplebft"
34
+ cb "github.com/hyperledger/fabric/protos/common"
33
35
ab "github.com/hyperledger/fabric/protos/orderer"
34
36
"github.com/op/go-logging"
35
37
"google.golang.org/grpc"
@@ -59,6 +61,55 @@ func init() {
59
61
logging .SetLevel (logging .DEBUG , "" )
60
62
}
61
63
64
+ // Consenter interface implementation for new main application:
65
+ // This part is Work In Progress
66
+
67
+ type consenter struct {}
68
+
69
+ type chain struct {
70
+ support multichain.ConsenterSupport
71
+ }
72
+
73
+ // New creates a new consenter for the SBFT consensus scheme.
74
+ // It accepts messages being delivered via Enqueue, orders them, and then
75
+ // uses the blockcutter to form the messages into blocks before writing to
76
+ // the given ledger.
77
+ func New () multichain.Consenter {
78
+ return & consenter {}
79
+ }
80
+
81
+ // HandleChain creates/returns a reference to a Chain for the given set of support resources.
82
+ func (solo * consenter ) HandleChain (support multichain.ConsenterSupport ) (multichain.Chain , error ) {
83
+ return newChain (support ), nil
84
+ }
85
+
86
+ func newChain (support multichain.ConsenterSupport ) * chain {
87
+ return & chain {
88
+ support : support ,
89
+ }
90
+ }
91
+
92
+ // Chain interface implementation:
93
+
94
+ // TODO
95
+ // Start allocates whatever resources are needed for staying up to date with the chain
96
+ func (ch * chain ) Start () {
97
+
98
+ }
99
+
100
+ // TODO
101
+ // Halt frees the resources which were allocated for this Chain
102
+ func (ch * chain ) Halt () {
103
+
104
+ }
105
+
106
+ // TODO
107
+ // Enqueue accepts a message and returns true on acceptance, or false on shutdown
108
+ func (ch * chain ) Enqueue (env * cb.Envelope ) bool {
109
+ return false
110
+ }
111
+
112
+ // The "old", SBFT only application:
62
113
func main () {
63
114
var c flags
64
115
0 commit comments