Skip to content

Commit

Permalink
Improve stability of local node (#312)
Browse files Browse the repository at this point in the history
Signed-off-by: Iliya Savov <[email protected]>
Co-authored-by: Iliya Savov <[email protected]>
  • Loading branch information
isavov and isavov authored Apr 19, 2023
1 parent 4536b80 commit bd9926d
Show file tree
Hide file tree
Showing 17 changed files with 47 additions and 72 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ Note: The image may look different if you are on a different version
- **CPUs:** 6
- **Memory:** 8GB
- **Swap:** 1 GB
- **Disk Image Size:** 60 GB
- **Disk Image Size:** 64 GB

Note: The image may look different if you are on a different version
![settings.png](https://raw.githubusercontent.com/hashgraph/hedera-local-node/main/settings.png)
Expand Down
6 changes: 3 additions & 3 deletions cli.js
Original file line number Diff line number Diff line change
Expand Up @@ -91,12 +91,12 @@ Requirements:
- Docker Compose => v2.12.2
Docker Compose version check: docker compose version
* Ensure the gRPC FUSE for file sharing setting is disabled in the docker settings
* Ensure the gRPC FUSE for file sharing setting is disabled in the docker settings and VirtioFS is enabled
* Ensure the following configurations are set at minimum in Docker Settings -> Resources and are available for use
CPUs: 6
Memory: 5GB
Memory: 8GB
Swap: 1 GB
Disk Image Size: 59.6 GB`)
Disk Image Size: 64 GB`)
.parse();

async function main(accounts, balance, detached, host) {
Expand Down
1 change: 1 addition & 0 deletions compose-network/mirror-node/application.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ hedera:
listener:
type: SHARED_POLL
importer:
startDate: 1970-01-01T00:00:00.000Z
parser:
record:
entity:
Expand Down
4 changes: 2 additions & 2 deletions compose-network/mirror-node/init.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@ PGCONF="${PGCONF:-/var/lib/postgresql/data}"
PGHBA="${PGCONF}/pg_hba.conf"
DB_SPECIFIC_SQL="alter user :ownerUsername with createrole;"

# TimescaleDB v2 schema no longer creates the REST API user, while v1 schema still does
if [[ "${TIMESCALEDB}" == "true" ]]; then
# v2 schema no longer creates the REST API user, while v1 schema still does
if [[ "${SCHEMA_V2}" == "true" ]]; then
DB_SPECIFIC_SQL="create user :restUsername with login password :'restPassword' in role readonly;"
fi

Expand Down

This file was deleted.

This file was deleted.

This file was deleted.

3 changes: 0 additions & 3 deletions compose-network/network-node/data/onboard/addressBook.txt

This file was deleted.

This file was deleted.

3 changes: 0 additions & 3 deletions compose-network/network-node/settings.txt
Original file line number Diff line number Diff line change
Expand Up @@ -12,14 +12,11 @@ reconnect.active, 1
reconnect.asyncStreamTimeoutMilliseconds, 60000
reconnect.reconnectWindowSeconds, -1
showInternalStats, 1
state.roundsExpired, 500
state.saveStatePeriod, 900
state.signedStateDisk, 5
state.signedStateKeep, 10
throttle7extra, 0.5
useLoopbackIp, false
waitAtStartup, false
jasperDb.storagePath, /opt/hgcapp/services-hedera/HapiApp2.0/data/saved
jasperDb.iteratorInputBufferBytes, 16777216
prometheusEndpointEnabled, true
transactionMaxBytes, 6144
51 changes: 23 additions & 28 deletions docker-compose.evm.yml
Original file line number Diff line number Diff line change
@@ -1,43 +1,38 @@
services:
record-streams-uploader:
restart: "no"
entrypoint: [
"echo",
"Deleting old recordStream files.",
"&&",
"rm -rf /records/*",
"&&",
"echo",
"This container is intentionally disabled by the EVM profile."
]
entrypoint:
[
"/bin/bash",
"-c",
"echo 'Deleting old recordStream files.';find /records/ -type f -delete;echo 'This container is intentionally disabled by the EVM profile.';"
]
command: []
account-balances-uploader:
restart: "no"
entrypoint: [
"echo",
"Deleting old accountBalances files.",
"&&",
"rm -rf /balances/*",
"&&",
"echo",
"This container is intentionally disabled by the EVM profile."
]
entrypoint:
[
"/bin/bash",
"-c",
"echo 'Deleting old accountBalances files.';find /balances/ -type f -delete;echo 'This container is intentionally disabled by the EVM profile.';"
]
command: []
record-sidecar-uploader:
restart: "no"
entrypoint: [
"echo",
"Deleting old sidecars files.",
"&&",
"rm -rf /sidecar-files/*",
"&&",
"echo",
"This container is intentionally disabled by the EVM profile."
]
entrypoint:
[
"/bin/bash",
"-c",
"echo 'Deleting old sidecars files.';find /sidecar-files/ -type f -delete;echo 'This container is intentionally disabled by the EVM profile.';"
]
command: []
minio:
restart: "no"
entrypoint: [ "echo", "This container is intentionally disabled by the EVM profile." ]
entrypoint:
[
"echo",
"This container is intentionally disabled by the EVM profile."
]
command: []
importer:
volumes:
Expand Down
33 changes: 14 additions & 19 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,6 @@ services:
- "${APPLICATION_CONFIG_PATH}:/opt/hgcapp/services-hedera/HapiApp2.0/data/config"
- "${NETWORK_NODE_LOGS_ROOT_PATH}/logs:/opt/hgcapp/services-hedera/HapiApp2.0/output"
- "${APPLICATION_ROOT_PATH}/data/keys:/opt/hgcapp/services-hedera/HapiApp2.0/data/keys"
- "${APPLICATION_ROOT_PATH}/data/onboard:/opt/hgcapp/services-hedera/HapiApp2.0/data/onboard"
- "${NETWORK_NODE_LOGS_ROOT_PATH}/stats:/opt/hgcapp/services-hedera/HapiApp2.0/data/stats"
- "${APPLICATION_ROOT_PATH}/config.txt:/opt/hgcapp/services-hedera/HapiApp2.0/config.txt"
- "${APPLICATION_ROOT_PATH}/settings.txt:/opt/hgcapp/services-hedera/HapiApp2.0/settings.txt"
Expand Down Expand Up @@ -202,8 +201,8 @@ services:
ROSETTA_PASSWORD: mirror_rosetta_pass
networks:
- mirror-node
expose:
- "5432"
ports:
- "5432:5432"
restart: unless-stopped
stop_grace_period: 2m
stop_signal: SIGTERM
Expand Down Expand Up @@ -348,7 +347,6 @@ services:
network-node:
condition: service_started
networks:
- json-rpc-relay
- mirror-node
- network-node-bridge
environment:
Expand Down Expand Up @@ -409,18 +407,18 @@ services:
ipv4_address: 172.27.0.4

grafana:
image: "${GRAFANA_IMAGE_NAME}:${GRAFANA_IMAGE_TAG}"
container_name: grafana
ports:
- "3000:3000"
restart: unless-stopped
volumes:
- ./compose-network/grafana/datasources:/etc/grafana/provisioning/datasources
- ./compose-network/grafana/dashboards:/etc/grafana/provisioning/dashboards
- grafana-data:/var/lib/grafana
networks:
network-node-bridge:
ipv4_address: 172.27.0.5
image: "${GRAFANA_IMAGE_NAME}:${GRAFANA_IMAGE_TAG}"
container_name: grafana
ports:
- "3000:3000"
restart: unless-stopped
volumes:
- ./compose-network/grafana/datasources:/etc/grafana/provisioning/datasources
- ./compose-network/grafana/dashboards:/etc/grafana/provisioning/dashboards
- grafana-data:/var/lib/grafana
networks:
network-node-bridge:
ipv4_address: 172.27.0.5

networks:
network-node-bridge:
Expand All @@ -438,9 +436,6 @@ networks:
cloud-storage:
name: cloud-storage
driver: bridge
json-rpc-relay:
name: json-rpc-relay
driver: bridge

volumes:
mirror-node-postgres:
Expand Down
Binary file modified settings.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions src/utils/nodeController.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ module.exports = class NodeController {
const nullOutput = this.getNullOutput();
console.log("Stopping the network...");
shell.cd(__dirname);
shell.cd("../../");
console.log("Stopping the docker containers...");
shell.exec(`docker compose kill 2>${nullOutput}`);
shell.exec(`docker compose down -v 2>${nullOutput}`);
Expand Down
1 change: 1 addition & 0 deletions templates/application.template.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ hedera:
listener:
type: SHARED_POLL
importer:
startDate: 1970-01-01T00:00:00Z
parser:
record:
entity:
Expand Down
1 change: 1 addition & 0 deletions templates/local/application.template.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ hedera:
listener:
type: SHARED_POLL
importer:
startDate: 1970-01-01T00:00:00Z
parser:
record:
entity:
Expand Down
3 changes: 0 additions & 3 deletions templates/settings.txt
Original file line number Diff line number Diff line change
Expand Up @@ -12,14 +12,11 @@ reconnect.active, 1
reconnect.asyncStreamTimeoutMilliseconds, 60000
reconnect.reconnectWindowSeconds, -1
showInternalStats, 1
state.roundsExpired, 500
state.saveStatePeriod, 900
state.signedStateDisk, 5
state.signedStateKeep, 10
throttle7extra, 0.5
useLoopbackIp, false
waitAtStartup, false
jasperDb.storagePath, /opt/hgcapp/services-hedera/HapiApp2.0/data/saved
jasperDb.iteratorInputBufferBytes, 16777216
prometheusEndpointEnabled, true
transactionMaxBytes, {{transactionMaxBytes}}

0 comments on commit bd9926d

Please sign in to comment.