Skip to content

Commit 1e9dbfb

Browse files
sanding
Signed-off-by: Matt Peterson <[email protected]>
1 parent df154c3 commit 1e9dbfb

File tree

4 files changed

+9
-17
lines changed

4 files changed

+9
-17
lines changed

consumer.sh

Lines changed: 5 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -5,11 +5,12 @@ echo "Starting consumer..."
55
# Set the gRPC server address and method
66
GRPC_SERVER="localhost:8080"
77
GRPC_METHOD="BlockStreamGrpc/StreamSource"
8+
PATH_TO_PROTO="./protos/src/main/protobuf/blockstream.proto"
89

910
trap "echo 'Received SIGINT, stopping...'; exit 0" SIGINT
1011

11-
payload="{\"id\": 0}"
12-
12+
# Generate and push messages to the gRPC server as a consumer.
13+
# Response block messages from the gRPC server are printed to stdout.
1314
(
1415
iter=$1
1516
while true; do
@@ -21,14 +22,9 @@ payload="{\"id\": 0}"
2122

2223
((iter++))
2324

25+
# Configure the message speed
2426
sleep 0.25
2527

2628
done
27-
) | grpcurl -plaintext -proto ./protos/src/main/protobuf/blockstream.proto -d @ $GRPC_SERVER $GRPC_METHOD
28-
29-
#grpcurl -vv -plaintext -proto ./protos/src/main/protobuf/blockstream.proto -d "$payload" localhost:8080 BlockStreamGrpc/StreamSource
29+
) | grpcurl -plaintext -proto $PATH_TO_PROTO -d @ $GRPC_SERVER $GRPC_METHOD
3030

31-
# Initiate the bidirectional streaming connection
32-
#grpcurl -vv -plaintext -proto ./protos/src/main/protobuf/blockstream.proto -d "$payload" $GRPC_SERVER $GRPC_METHOD | handle_streaming | grpcurl -plaintext -d @ $GRPC_SERVER $GRPC_METHOD
33-
#grpcurl -plaintext -proto ./protos/src/main/protobuf/blockstream.proto -d @ $GRPC_SERVER $GRPC_METHOD
34-
#handle_streaming | grpcurl -plaintext -d @ $GRPC_SERVER $GRPC_METHOD --format json

producer.sh

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,5 @@
11
#!/bin/bash
22

3-
#!/bin/bash
4-
53
usage_error() {
64
echo "Usage: $0 <integer> [positive-integer]"
75
exit 1
@@ -26,6 +24,7 @@ fi
2624

2725
GRPC_SERVER="localhost:8080"
2826
GRPC_METHOD="BlockStreamGrpc/StreamSink"
27+
PATH_TO_PROTO="./protos/src/main/protobuf/blockstream.proto"
2928

3029
echo "Starting producer..."
3130

@@ -39,7 +38,8 @@ function cleanup {
3938
# Trap SIGINT
4039
trap cleanup SIGINT
4140

42-
# Generate a new message every second and send to grpcurl
41+
# Generate and push messages to the gRPC server as a producer.
42+
# Response messages from the gRPC server are printed to stdout.
4343
(
4444
iter=$1
4545
while true; do
@@ -53,7 +53,7 @@ trap cleanup SIGINT
5353

5454
sleep 0.25
5555
done
56-
) | grpcurl -vv -plaintext -proto ./protos/src/main/protobuf/blockstream.proto -d @ $GRPC_SERVER $GRPC_METHOD &
56+
) | grpcurl -vv -plaintext -proto $PATH_TO_PROTO -d @ $GRPC_SERVER $GRPC_METHOD &
5757

5858
GRPC_PID=$!
5959

server/src/main/java/com/hedera/block/server/persistence/storage/FileSystemBlockStorage.java

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -128,5 +128,4 @@ private String resolvePath(Long id) {
128128

129129
return fullPath.toString();
130130
}
131-
132131
}

server/src/test/java/com/hedera/block/server/persistence/RangeTest.java

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -74,13 +74,10 @@ public void testReadRangeWhenBlocksLessThanWindow() {
7474
}
7575

7676
int window = 10;
77-
int numOfWindows = 1;
7877

79-
// verifyReadRange(window, numOfWindows, blockPersistenceHandler);
8078
Queue<BlockStreamServiceGrpcProto.Block> results = blockPersistenceHandler.readRange(1, window);
8179
assertNotNull(results);
8280
assertEquals(numOfBlocks, results.size());
83-
8481
}
8582

8683
private static void verifyReadRange(

0 commit comments

Comments
 (0)