Skip to content

Commit

Permalink
chore: Cherry Pick: Modify and mount default block streams output dir…
Browse files Browse the repository at this point in the history
…ectory (#16753)

Signed-off-by: Matt Hess <[email protected]>
  • Loading branch information
mhess-swl authored Nov 22, 2024
1 parent 81b7849 commit 3b4ffec
Show file tree
Hide file tree
Showing 11 changed files with 14 additions and 3 deletions.
1 change: 1 addition & 0 deletions hedera-node/configuration/compose/node.properties
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
hedera.recordStream.logDir=data/recordStreams
hedera.recordStream.sidecarDir=
netty.mode=TEST
blockStream.blockFileDir=data/blockStreams
1 change: 1 addition & 0 deletions hedera-node/configuration/dev/application.properties
Original file line number Diff line number Diff line change
Expand Up @@ -13,3 +13,4 @@ bootstrap.throttleDefsJson.resource=genesis/throttles-dev.json
ledger.id=0x03
blockStream.streamMode=BOTH
nodes.enableDAB=true
blockStream.blockFileDir=data/blockStreams
1 change: 1 addition & 0 deletions hedera-node/configuration/dev/node.properties
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,4 @@ hedera.profiles.active=DEV
hedera.recordStream.logDir=data/recordStreams
hedera.recordStream.sidecarDir=
stats.executionTimesToTrack=1000
blockStream.blockFileDir=data/blockStreams
1 change: 1 addition & 0 deletions hedera-node/data/config/node.properties
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,4 @@ hedera.recordStream.logDir=data/recordstreams/
hedera.recordStream.sidecarDir=
hedera.recordStream.queueCapacity=5000
netty.mode=TEST
blockStream.blockFileDir=data/blockStreams/
1 change: 1 addition & 0 deletions hedera-node/docker/.dockerignore
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ docs/
hapi-proto/target/
hedera-node/data/lib/
hedera-node/data/recordstreams/
hedera-node/data/blockStreams/
hedera-node/data/accountBalances/
hedera-node/data/saved/
hedera-node/databases/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@
public record BlockStreamConfig(
@ConfigProperty(defaultValue = "BOTH") @NetworkProperty StreamMode streamMode,
@ConfigProperty(defaultValue = "FILE") @NodeProperty BlockStreamWriterMode writerMode,
@ConfigProperty(defaultValue = "data/block-streams") @NodeProperty String blockFileDir,
@ConfigProperty(defaultValue = "/opt/hgcapp/blockStreams") @NodeProperty String blockFileDir,
@ConfigProperty(defaultValue = "true") @NetworkProperty boolean compressFilesOnCreation,
@ConfigProperty(defaultValue = "32") @NetworkProperty int serializationBatchSize,
@ConfigProperty(defaultValue = "32") @NetworkProperty int hashCombineBatchSize,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,7 @@ RUN mkdir -p "/opt/hgcapp" && \
mkdir -p "/opt/hgcapp/accountBalances" && \
mkdir -p "/opt/hgcapp/eventsStreams" && \
mkdir -p "/opt/hgcapp/recordStreams" && \
mkdir -p "/opt/hgcapp/blockStreams" && \
mkdir -p "/opt/hgcapp/services-hedera" && \
mkdir -p "/opt/hgcapp/services-hedera/HapiApp2.0" && \
mkdir -p "/opt/hgcapp/services-hedera/HapiApp2.0/data" && \
Expand Down Expand Up @@ -129,6 +130,7 @@ RUN echo >> /etc/sudoers && \
VOLUME "/opt/hgcapp/accountBalances"
VOLUME "/opt/hgcapp/eventsStreams"
VOLUME "/opt/hgcapp/recordStreams"
VOLUME "/opt/hgcapp/blockStreams"
VOLUME "/opt/hgcapp/services-hedera/HapiApp2.0/data/config"
VOLUME "/opt/hgcapp/services-hedera/HapiApp2.0/data/diskFs"
VOLUME "/opt/hgcapp/services-hedera/HapiApp2.0/data/keys"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -175,6 +175,7 @@ RUN mkdir -p "/opt/hgcapp" && \
mkdir -p "/opt/hgcapp/accountBalances" && \
mkdir -p "/opt/hgcapp/eventsStreams" && \
mkdir -p "/opt/hgcapp/recordStreams" && \
mkdir -p "/opt/hgcapp/blockStreams" && \
mkdir -p "/opt/hgcapp/services-hedera" && \
mkdir -p "/opt/hgcapp/services-hedera/HapiApp2.0" && \
mkdir -p "/opt/hgcapp/services-hedera/HapiApp2.0/data" && \
Expand Down Expand Up @@ -279,6 +280,7 @@ ENV LOG_DIR_NAME ""
VOLUME "/opt/hgcapp/accountBalances"
VOLUME "/opt/hgcapp/eventsStreams"
VOLUME "/opt/hgcapp/recordStreams"
VOLUME "/opt/hgcapp/blockStreams"
VOLUME "/opt/hgcapp/services-hedera/HapiApp2.0/data/config"
VOLUME "/opt/hgcapp/services-hedera/HapiApp2.0/data/diskFs"
VOLUME "/opt/hgcapp/services-hedera/HapiApp2.0/data/keys"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,7 @@ RUN mkdir -p "/opt/hgcapp" && \
mkdir -p "/opt/hgcapp/accountBalances" && \
mkdir -p "/opt/hgcapp/eventsStreams" && \
mkdir -p "/opt/hgcapp/recordStreams" && \
mkdir -p "/opt/hgcapp/blockStreams" && \
mkdir -p "/opt/hgcapp/services-hedera" && \
mkdir -p "/opt/hgcapp/services-hedera/HapiApp2.0" && \
mkdir -p "/opt/hgcapp/services-hedera/HapiApp2.0/data" && \
Expand Down Expand Up @@ -122,6 +123,7 @@ RUN chmod +rx /usr/local/bin/wait-for
VOLUME "/opt/hgcapp/accountBalances"
VOLUME "/opt/hgcapp/eventsStreams"
VOLUME "/opt/hgcapp/recordStreams"
VOLUME "/opt/hgcapp/blockStreams"
VOLUME "/opt/hgcapp/services-hedera/HapiApp2.0/data/config"
VOLUME "/opt/hgcapp/services-hedera/HapiApp2.0/data/diskFs"
VOLUME "/opt/hgcapp/services-hedera/HapiApp2.0/data/keys"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ public class ProcessUtils {
private static final String[] EMPTY_STRING_ARRAY = new String[0];
public static final String SAVED_STATES_DIR = "saved";
public static final String RECORD_STREAMS_DIR = "recordStreams";
public static final String BLOCK_STREAMS_DIR = "block-streams";
public static final String BLOCK_STREAMS_DIR = "blockStreams";
private static final long WAIT_SLEEP_MILLIS = 100L;

public static final Executor EXECUTOR = Executors.newCachedThreadPool();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ public static void main(@NonNull final String[] args) throws IOException {
.toAbsolutePath()
.normalize();
final var blocksLoc =
node0Data.resolve("block-streams/block-0.0.3").toAbsolutePath().normalize();
node0Data.resolve("blockStreams/block-0.0.3").toAbsolutePath().normalize();
final var blocks = BlockStreamAccess.BLOCK_STREAM_ACCESS.readBlocks(blocksLoc);
final var recordsLoc =
node0Data.resolve("recordStreams/record0.0.3").toAbsolutePath().normalize();
Expand Down

0 comments on commit 3b4ffec

Please sign in to comment.