Skip to content

Commit cafdc42

Browse files
authored
updates to integration the fabricx notification service into the token-sdk (#1125)
fix(config)!: Update the keep alive configuration for grpc fix(nwo): Fix Query Service Port update(queryservice): Expose GetTransactionStatus Signed-off-by: Angelo De Caro <adc@zurich.ibm.com>
1 parent 1ab49ce commit cafdc42

File tree

29 files changed

+1520
-494
lines changed

29 files changed

+1520
-494
lines changed

docs/configuration.md

Lines changed: 37 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -62,21 +62,32 @@ fsc:
6262
files:
6363
- /path/to/client/tls/ca.crt
6464

65-
# GRPC Server keepalive parameters
65+
# GRPC Server keepalive parameters.
66+
# This section can be omitted.
6667
keepalive:
67-
# minInterval is the minimum permitted time between client pings.
68-
# If clients send pings more frequently, the peer server will
69-
# disconnect them
70-
# If not specified, default is 60 seconds
71-
minInterval: 60s
72-
# interval is the duration after which if the server does not see
73-
# any activity from the client it pings the client to see if it's alive
74-
# If not specified, default is 2 hours
75-
interval: 300s
76-
# Timeout is the duration the server waits for a response
77-
# from the client after sending a ping before closing the connection
78-
# If not specified, default is 20 seconds
79-
timeout: 600s
68+
# MaxConnectionIdle: send GOAWAY and gracefully close if connection is idle this long (no RPCs).
69+
# Format: Go duration string (e.g. "5m", "30s"). Zero/omitted disables.
70+
max-connection-idle: "5m"
71+
# MaxConnectionAge: maximum lifetime of a connection before server initiates close to rotate connections.
72+
# Format: Go duration string. Zero/omitted disables.
73+
max-connection-age: "2h"
74+
# MaxConnectionAgeGrace: additional grace period after MaxConnectionAge to allow in-flight RPCs to finish.
75+
# Format: Go duration string.
76+
max-connection-age-grace: "5m"
77+
# Time: server's expectation for how often the client should send keepalive pings.
78+
# Format: Go duration string.
79+
time: "2m"
80+
# Timeout: how long the server waits for a keepalive ping ACK before considering the connection dead.
81+
# Format: Go duration string.
82+
timeout: "20s"
83+
# EnforcementPolicy: maps to keepalive.EnforcementPolicy; may be omitted to disable enforcement.
84+
enforcement-policy:
85+
# MinTime: minimum allowed time between client pings; server may close connections that ping more often.
86+
# Format: Go duration string.
87+
min-time: "1m"
88+
# PermitWithoutStream: allow keepalive pings even when there are no active RPC streams.
89+
# true = permit pings without streams (recommended if clients ping periodically).
90+
permit-without-stream: true
8091

8192
# ------------------- P2P Configuration -------------------------
8293
p2p:
@@ -295,14 +306,19 @@ fabric:
295306
clientKey:
296307
file: /path/to/client.key
297308

298-
# Client keepalive settings for GRPC
309+
# Client keepalive settings for GRPC.
310+
# This section can be omitted.
299311
keepalive:
300-
# If not provided, the default is 60 seconds
301-
interval: 60s
302-
# If not provided, the default is 20 seconds
303-
timeout: 600s
304-
# If not provided, the default is 10 seconds
305-
connectionTimeout: 10s
312+
# Time: how often the client sends keepalive pings to the server.
313+
# Format: Go duration string (e.g. "30s", "2m"). Zero/omitted disables.
314+
time: "2m"
315+
# Timeout: how long the client waits for a keepalive ACK from the server
316+
# before considering the connection dead.
317+
# Format: Go duration string. Should be noticeably smaller than `time`.
318+
timeout: "20s"
319+
# PermitWithoutStream: allow keepalive pings even when there are no active RPCs.
320+
# true = permit pings without active streams (recommended for many clients).
321+
permit-without-stream: true
306322

307323
ordering:
308324
# number of retries to attempt to send a transaction to an orderer

integration/benchmark/grpc/grpc_bench_test.go

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -184,7 +184,7 @@ func WithServerECDSASigner(certPath, keyPath string) ServerOption {
184184
require.NoError(tb, err)
185185
c.signer = signer
186186
serialized, _ := signer.Serialize()
187-
c.idProvider = &benchmark.MockIdentityProvider{DefaultSigner: view.Identity(serialized)}
187+
c.idProvider = &benchmark.MockIdentityProvider{DefaultSigner: serialized}
188188
}
189189
}
190190

@@ -237,7 +237,6 @@ func setupServer(tb testing.TB, opts ...ServerOption) string {
237237
Key: keyPEM,
238238
UseTLS: true,
239239
},
240-
KaOpts: grpc.KeepaliveOptions{},
241240
Logger: nil,
242241
HealthCheckEnabled: false,
243242
})
@@ -285,7 +284,6 @@ func setupClient(tb testing.TB, srvEndpoint string, opts ...ClientOption) (*benc
285284
ServerRootCAs: [][]byte{certPEM},
286285
UseTLS: true,
287286
},
288-
KaOpts: grpc.KeepaliveOptions{},
289287
Timeout: 5 * time.Second,
290288
AsyncConnect: false,
291289
})

integration/benchmark/grpc/remote/server/main.go

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,6 @@ func main() {
4848
Key: keyPEM,
4949
UseTLS: true,
5050
},
51-
KaOpts: grpc.KeepaliveOptions{},
5251
Logger: nil,
5352
HealthCheckEnabled: false,
5453
})

integration/fsc/pingpong/README.md

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -452,18 +452,6 @@ fsc:
452452
files:
453453
- ./../../crypto/peerOrganizations/fsc.example.com/peers/initiator.fsc.example.com/tls/ca.crt
454454
rootCertFile: ./../../crypto/ca-certs.pem
455-
# Keepalive settings for node server and clients
456-
keepalive:
457-
# MinInterval is the minimum permitted time between client pings.
458-
# If clients send pings more frequently, the peer server will
459-
# disconnect them
460-
minInterval: 60s
461-
# Interval is the duration after which if the server does not see
462-
# any activity from the client it pings the client to see if it's alive
463-
interval: 300s
464-
# Timeout is the duration the server waits for a response
465-
# from the client after sending a ping before closing the connection
466-
timeout: 600s
467455
# P2P configuration
468456
p2p:
469457
# Listening address

integration/fsc/pingpong/testdata/fsc/nodes/initiator.0/core.yaml

Lines changed: 0 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -38,20 +38,6 @@ fsc:
3838
# Private key used for TLS server
3939
key:
4040
file: ./../../crypto/peerOrganizations/fsc.example.com/peers/initiator.fsc.example.com/tls/server.key
41-
# If mutual TLS is enabled, clientRootCAs.files contains a list of additional root certificates
42-
# used for verifying certificates of client connections.
43-
# Keepalive settings for node server and clients
44-
keepalive:
45-
# MinInterval is the minimum permitted time between client pings.
46-
# If clients send pings more frequently, the peer server will
47-
# disconnect them
48-
minInterval: 60s
49-
# Interval is the duration after which if the server does not see
50-
# any activity from the client it pings the client to see if it's alive
51-
interval: 300s
52-
# Timeout is the duration the server waits for a response
53-
# from the client after sending a ping before closing the connection
54-
timeout: 600s
5541
# P2P configuration
5642
p2p:
5743
# Type of p2p communication. Currently supported: libp2p (default), rest

integration/fsc/pingpong/testdata/fsc/nodes/responder.0/core.yaml

Lines changed: 0 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -38,20 +38,6 @@ fsc:
3838
# Private key used for TLS server
3939
key:
4040
file: ./../../crypto/peerOrganizations/fsc.example.com/peers/responder.fsc.example.com/tls/server.key
41-
# If mutual TLS is enabled, clientRootCAs.files contains a list of additional root certificates
42-
# used for verifying certificates of client connections.
43-
# Keepalive settings for node server and clients
44-
keepalive:
45-
# MinInterval is the minimum permitted time between client pings.
46-
# If clients send pings more frequently, the peer server will
47-
# disconnect them
48-
minInterval: 60s
49-
# Interval is the duration after which if the server does not see
50-
# any activity from the client it pings the client to see if it's alive
51-
interval: 300s
52-
# Timeout is the duration the server waits for a response
53-
# from the client after sending a ping before closing the connection
54-
timeout: 600s
5541
# P2P configuration
5642
p2p:
5743
# Type of p2p communication. Currently supported: libp2p (default), rest

integration/nwo/fabric/topology/core_template.go

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -281,10 +281,6 @@ fabric:
281281
clientKey:
282282
file: {{ .PeerLocalTLSDir Peer }}/server.key
283283
{{- end }}
284-
keepalive:
285-
interval: 60s
286-
timeout: 600s
287-
connectionTimeout: 10s
288284
ordering:
289285
numRetries: 3
290286
retryInterval: 3s

integration/nwo/fabricx/extensions/scv2/ext.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ func (e *Extension) CheckTopology() {
5959

6060
func (e *Extension) GenerateArtifacts() {
6161
generateQSExtension(e.network)
62-
generateNSExtension(e.network)
62+
generateNSExtension(e.network, e.sidecar.Ports[fabric_network.ListenPort])
6363
}
6464

6565
func (e *Extension) PostRun(load bool) {

integration/nwo/fabricx/extensions/scv2/notificationservice.go

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ import (
2323
)
2424

2525
// generateNSExtensions adds the committers notification service information to the config
26-
func generateNSExtension(n *network.Network) {
26+
func generateNSExtension(n *network.Network, notificationServicePort uint16) {
2727
context := n.Context
2828

2929
fscTop, ok := context.TopologyByName("fsc").(*fsc.Topology)
@@ -33,7 +33,6 @@ func generateNSExtension(n *network.Network) {
3333

3434
// TODO set correct values
3535
notificationServiceHost := "localhost"
36-
notificationServicePort := 5411
3736

3837
// TODO: most of this logic should go somewhere
3938

integration/nwo/fsc/node/core_template.go

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -57,18 +57,6 @@ fsc:
5757
files:
5858
- {{ .NodeLocalTLSDir Peer }}/ca.crt
5959
{{- end }}
60-
# Keepalive settings for node server and clients
61-
keepalive:
62-
# MinInterval is the minimum permitted time between client pings.
63-
# If clients send pings more frequently, the peer server will
64-
# disconnect them
65-
minInterval: 60s
66-
# Interval is the duration after which if the server does not see
67-
# any activity from the client it pings the client to see if it's alive
68-
interval: 300s
69-
# Timeout is the duration the server waits for a response
70-
# from the client after sending a ping before closing the connection
71-
timeout: 600s
7260
# P2P configuration
7361
p2p:
7462
# Type of p2p communication. Currently supported: libp2p (default), rest

0 commit comments

Comments
 (0)