Skip to content
This repository was archived by the owner on Apr 25, 2025. It is now read-only.

Commit 5754d26

Browse files
committed
[FABG-716] Remove Event Hub
This change removes the EventHub code from the Go SDK. As of this change, you must update to Fabric 1.1 or higher. Change-Id: Ibf3219e15dcc6c166dca0108c1ee82133de4541a Signed-off-by: Troy Ronda <troy@troyronda.com>
1 parent 6c18d00 commit 5754d26

File tree

65 files changed

+90
-2669
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

65 files changed

+90
-2669
lines changed

README.md

Lines changed: 2 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -40,22 +40,12 @@ You're good to go, happy coding! Check out the examples for usage demonstrations
4040

4141
### Current Compatibility
4242
The SDK's integration tests run against three tagged Fabric versions:
43-
- prev (currently v1.0.6)
44-
- stable (currently v1.1.0)
43+
- prev (currently v1.1.0)
44+
- stable (currently v1.2.0)
4545
- prerelease (currently disabled)
4646

4747
Additionally for development purposes integration tests also run against the devstable Fabric version as needed.
4848

49-
### v1.0 Notes
50-
The SDK uses the Fabric v1.1 delivery service as the default event mechanism. When using Fabric v1.0, you must override this default by setting the event service type in the config:
51-
52-
```
53-
client:
54-
peer:
55-
eventService:
56-
type: eventhub
57-
```
58-
5949
### Retired versions
6050
When the 'prev' code level is updated, the last tested fabric-sdk-go commit or tag is listed below.
6151

internal/github.com/hyperledger/fabric/events/consumer/adapter.go

Lines changed: 0 additions & 33 deletions
This file was deleted.

internal/github.com/hyperledger/fabric/events/consumer/consumer.go

Lines changed: 0 additions & 40 deletions
This file was deleted.

pkg/client/channel/api_test.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,7 @@ func TestTimeoutOptions(t *testing.T) {
8484

8585
options := []RequestOption{WithTimeout(fab.PeerResponse, 20*time.Second),
8686
WithTimeout(fab.ResMgmt, 25*time.Second), WithTimeout(fab.OrdererResponse, 30*time.Second),
87-
WithTimeout(fab.EventHubConnection, 35*time.Second), WithTimeout(fab.Execute, 40*time.Second),
87+
WithTimeout(fab.PeerConnection, 35*time.Second), WithTimeout(fab.Execute, 40*time.Second),
8888
WithTimeout(fab.Query, 45*time.Second)}
8989

9090
for _, option := range options {
@@ -94,7 +94,7 @@ func TestTimeoutOptions(t *testing.T) {
9494
assert.True(t, opts.Timeouts[fab.PeerResponse] == 20*time.Second, "timeout value by type didn't match with one supplied")
9595
assert.True(t, opts.Timeouts[fab.ResMgmt] == 25*time.Second, "timeout value by type didn't match with one supplied")
9696
assert.True(t, opts.Timeouts[fab.OrdererResponse] == 30*time.Second, "timeout value by type didn't match with one supplied")
97-
assert.True(t, opts.Timeouts[fab.EventHubConnection] == 35*time.Second, "timeout value by type didn't match with one supplied")
97+
assert.True(t, opts.Timeouts[fab.PeerConnection] == 35*time.Second, "timeout value by type didn't match with one supplied")
9898
assert.True(t, opts.Timeouts[fab.Execute] == 40*time.Second, "timeout value by type didn't match with one supplied")
9999
assert.True(t, opts.Timeouts[fab.Query] == 45*time.Second, "timeout value by type didn't match with one supplied")
100100

pkg/client/channel/invoke/txnhandler_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@ func TestExecuteTxHandlerSuccess(t *testing.T) {
7979

8080
clientContext := setupChannelClientContext(nil, nil, []fab.Peer{mockPeer1, mockPeer2}, t)
8181

82-
//Prepare mock eventhub
82+
// Prepare mock event service
8383
mockEventService := fcmocks.NewMockEventService()
8484
clientContext.EventService = mockEventService
8585

pkg/client/ledger/opts_test.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@ func TestTimeoutOptions(t *testing.T) {
8383

8484
options := []RequestOption{WithTimeout(fab.PeerResponse, 20*time.Second),
8585
WithTimeout(fab.ResMgmt, 25*time.Second), WithTimeout(fab.OrdererResponse, 30*time.Second),
86-
WithTimeout(fab.EventHubConnection, 35*time.Second), WithTimeout(fab.Execute, 40*time.Second),
86+
WithTimeout(fab.PeerConnection, 35*time.Second), WithTimeout(fab.Execute, 40*time.Second),
8787
WithTimeout(fab.Query, 45*time.Second)}
8888

8989
for _, option := range options {
@@ -93,7 +93,7 @@ func TestTimeoutOptions(t *testing.T) {
9393
assert.True(t, opts.Timeouts[fab.PeerResponse] == 20*time.Second, "timeout value by type didn't match with one supplied")
9494
assert.True(t, opts.Timeouts[fab.ResMgmt] == 25*time.Second, "timeout value by type didn't match with one supplied")
9595
assert.True(t, opts.Timeouts[fab.OrdererResponse] == 30*time.Second, "timeout value by type didn't match with one supplied")
96-
assert.True(t, opts.Timeouts[fab.EventHubConnection] == 35*time.Second, "timeout value by type didn't match with one supplied")
96+
assert.True(t, opts.Timeouts[fab.PeerConnection] == 35*time.Second, "timeout value by type didn't match with one supplied")
9797
assert.True(t, opts.Timeouts[fab.Execute] == 40*time.Second, "timeout value by type didn't match with one supplied")
9898
assert.True(t, opts.Timeouts[fab.Query] == 45*time.Second, "timeout value by type didn't match with one supplied")
9999

pkg/client/resmgmt/opts_test.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ func TestTimeoutOptions(t *testing.T) {
7777

7878
options := []RequestOption{WithTimeout(fab.PeerResponse, 20*time.Second),
7979
WithTimeout(fab.ResMgmt, 25*time.Second), WithTimeout(fab.OrdererResponse, 30*time.Second),
80-
WithTimeout(fab.EventHubConnection, 35*time.Second), WithTimeout(fab.Execute, 40*time.Second),
80+
WithTimeout(fab.PeerConnection, 35*time.Second), WithTimeout(fab.Execute, 40*time.Second),
8181
WithTimeout(fab.Query, 45*time.Second)}
8282

8383
for _, option := range options {
@@ -87,7 +87,7 @@ func TestTimeoutOptions(t *testing.T) {
8787
assert.True(t, opts.Timeouts[fab.PeerResponse] == 20*time.Second, "timeout value by type didn't match with one supplied")
8888
assert.True(t, opts.Timeouts[fab.ResMgmt] == 25*time.Second, "timeout value by type didn't match with one supplied")
8989
assert.True(t, opts.Timeouts[fab.OrdererResponse] == 30*time.Second, "timeout value by type didn't match with one supplied")
90-
assert.True(t, opts.Timeouts[fab.EventHubConnection] == 35*time.Second, "timeout value by type didn't match with one supplied")
90+
assert.True(t, opts.Timeouts[fab.PeerConnection] == 35*time.Second, "timeout value by type didn't match with one supplied")
9191
assert.True(t, opts.Timeouts[fab.Execute] == 40*time.Second, "timeout value by type didn't match with one supplied")
9292
assert.True(t, opts.Timeouts[fab.Query] == 45*time.Second, "timeout value by type didn't match with one supplied")
9393

pkg/common/errors/status/status.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ const (
5858

5959
// EndorserServerStatus status returned by the endorser server
6060
EndorserServerStatus
61-
// EventServerStatus status returned by the eventhub
61+
// EventServerStatus status returned by the event service
6262
EventServerStatus
6363
// OrdererServerStatus status returned by the ordering service
6464
OrdererServerStatus

pkg/common/providers/fab/network.go

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,6 @@ type OrdererConfig struct {
8484
// PeerConfig defines a peer configuration
8585
type PeerConfig struct {
8686
URL string
87-
EventURL string
8887
GRPCOptions map[string]interface{}
8988
TLSCACert *x509.Certificate
9089
}

pkg/common/providers/fab/provider.go

Lines changed: 2 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -95,9 +95,6 @@ type EndpointConfig interface {
9595

9696
// EventServiceConfig specifies configuration options for the event service
9797
type EventServiceConfig interface {
98-
// Type returns the type of event service to use
99-
Type() EventServiceType
100-
10198
// BlockHeightLagThreshold returns the block height lag threshold. This value is used for choosing a peer
10299
// to connect to. If a peer is lagging behind the most up-to-date peer by more than the given number of
103100
// blocks then it will be excluded from selection.
@@ -121,10 +118,8 @@ type EventServiceConfig interface {
121118
type TimeoutType int
122119

123120
const (
124-
// EndorserConnection connection timeout
125-
EndorserConnection TimeoutType = iota
126-
// EventHubConnection connection timeout
127-
EventHubConnection
121+
// PeerConnection connection timeout
122+
PeerConnection TimeoutType = iota
128123
// EventReg connection timeout
129124
EventReg
130125
// Query timeout
@@ -161,18 +156,6 @@ const (
161156
SelectionServiceRefresh
162157
)
163158

164-
// EventServiceType specifies the type of event service to use
165-
type EventServiceType int
166-
167-
const (
168-
// AutoDetectEventServiceType uses channel capabilities to determine which event service to use
169-
AutoDetectEventServiceType EventServiceType = iota
170-
// DeliverEventServiceType uses the Deliver Service for block and filtered-block events
171-
DeliverEventServiceType
172-
// EventHubEventServiceType uses the Event Hub for block events
173-
EventHubEventServiceType
174-
)
175-
176159
// Providers represents the SDK configured service providers context.
177160
type Providers interface {
178161
LocalDiscoveryProvider() LocalDiscoveryProvider

0 commit comments

Comments
 (0)