Skip to content

Commit

Permalink
Move simplebft to orderer and fix proto compile
Browse files Browse the repository at this point in the history
Proto compilation was broken for sbft.  In order to fix this, the
simplebft.proto needed to be under the same proto root as the
config.proto and consensus.proto from the sbft package.

This seemed like an opportune time to move the simplebft code out of the
legacy consensus dir and into orderer dir.

Change-Id: Ie84dfaede6ebd5a2cffdcd021bf1d2f1966979f2
Signed-off-by: Jason Yellick <jyellick@us.ibm.com>
  • Loading branch information
Jason Yellick committed Nov 9, 2016
1 parent 1950782 commit 1230e0f
Show file tree
Hide file tree
Showing 35 changed files with 206 additions and 128 deletions.
Empty file added orderer/sbft/.protoroot
Empty file.
2 changes: 1 addition & 1 deletion orderer/sbft/backend/backend.go
Original file line number Diff line number Diff line change
Expand Up @@ -39,10 +39,10 @@ import (
"encoding/asn1"

"github.com/golang/protobuf/proto"
s "github.com/hyperledger/fabric/consensus/simplebft"
"github.com/hyperledger/fabric/orderer/rawledger"
"github.com/hyperledger/fabric/orderer/sbft/connection"
"github.com/hyperledger/fabric/orderer/sbft/persist"
s "github.com/hyperledger/fabric/orderer/sbft/simplebft"
cb "github.com/hyperledger/fabric/protos/common"
ab "github.com/hyperledger/fabric/protos/orderer"
"github.com/op/go-logging"
Expand Down
45 changes: 39 additions & 6 deletions orderer/sbft/backend/consensus.pb.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 4 additions & 2 deletions orderer/sbft/backend/consensus.proto
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,12 @@ syntax = "proto3";

package backend;

import "github.com/hyperledger/fabric/consensus/simplebft/simplebft.proto";
option go_package = "github.com/hyperledger/fabric/orderer/sbft/backend";

import "simplebft/simplebft.proto";

service consensus {
rpc consensus(handshake) returns (stream simplebft.msg) {}
rpc consensus(handshake) returns (stream simplebft.Msg) {}
}

message handshake {
Expand Down
2 changes: 1 addition & 1 deletion orderer/sbft/backend/events.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ limitations under the License.
package backend

import (
s "github.com/hyperledger/fabric/consensus/simplebft"
s "github.com/hyperledger/fabric/orderer/sbft/simplebft"
)

type Timer struct {
Expand Down
2 changes: 1 addition & 1 deletion orderer/sbft/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ See the License for the specific language governing permissions and
limitations under the License.
*/

package main
package sbft

import (
"encoding/json"
Expand Down
66 changes: 52 additions & 14 deletions orderer/sbft/config.pb.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

10 changes: 6 additions & 4 deletions orderer/sbft/config.proto
Original file line number Diff line number Diff line change
Expand Up @@ -16,17 +16,19 @@ limitations under the License.

syntax = "proto3";

package main;
option go_package = "github.com/hyperledger/fabric/orderer/sbft";

import "github.com/hyperledger/fabric/consensus/simplebft/simplebft.proto";
package sbft;

import "simplebft/simplebft.proto";

message consensus_config {
simplebft.config consensus = 1;
simplebft.Config consensus = 1;
map<string, bytes> peers = 2;
};

message json_config {
simplebft.config consensus = 1;
simplebft.Config consensus = 1;
repeated peer peers = 2;
};

Expand Down
4 changes: 2 additions & 2 deletions orderer/sbft/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ See the License for the specific language governing permissions and
limitations under the License.
*/

package main
package sbft

import (
"flag"
Expand All @@ -23,12 +23,12 @@ import (
_ "net/http/pprof"
"os"

pb "github.com/hyperledger/fabric/consensus/simplebft"
"github.com/hyperledger/fabric/orderer/common/bootstrap/static"
"github.com/hyperledger/fabric/orderer/rawledger/fileledger"
"github.com/hyperledger/fabric/orderer/sbft/backend"
"github.com/hyperledger/fabric/orderer/sbft/connection"
"github.com/hyperledger/fabric/orderer/sbft/persist"
pb "github.com/hyperledger/fabric/orderer/sbft/simplebft"
ab "github.com/hyperledger/fabric/protos/orderer"
"github.com/op/go-logging"
"google.golang.org/grpc"
Expand Down
2 changes: 1 addition & 1 deletion orderer/sbft/sbft_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ See the License for the specific language governing permissions and
limitations under the License.
*/

package main
package sbft

import (
"fmt"
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.

0 comments on commit 1230e0f

Please sign in to comment.