Skip to content

Commit

Permalink
feat: Add support for modularised images (#572)
Browse files Browse the repository at this point in the history
Signed-off-by: Iliya Savov <[email protected]>
Signed-off-by: georgi-l95 <[email protected]>
Co-authored-by: Iliya Savov <[email protected]>
  • Loading branch information
georgi-l95 and isavov authored Mar 25, 2024
1 parent ec1e25a commit 295b65e
Show file tree
Hide file tree
Showing 6 changed files with 47 additions and 38 deletions.
2 changes: 1 addition & 1 deletion .env
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ RELAY_IMAGE_PREFIX=ghcr.io/hashgraph/
RELAY_IMAGE_TAG=0.42.0

#### JSON RPC Relay limits ####
RELAY_MEM_LIMIT=512m
RELAY_MEM_LIMIT=768m

#### JSON RPC Relay settings ####
RELAY_HEDERA_NETWORK={"network-node:50211":"0.0.3"}
Expand Down
Original file line number Diff line number Diff line change
@@ -1 +1,6 @@
autoRenew.targetTypes=
ledger.id=0x01
netty.mode=DEV
contracts.chainId=298
hedera.recordStream.logPeriod=1
balances.exportPeriodSecs=400
3 changes: 2 additions & 1 deletion docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,8 @@ services:
[
"CMD",
"grep",
"Now current platform status = ACTIVE",
"-E",
"Now current platform status = ACTIVE|Hedera - Hederanode#0 is ACTIVE",
"/opt/hgcapp/services-hedera/HapiApp2.0/output/hgcaa.log"
]
interval: 30s
Expand Down
30 changes: 15 additions & 15 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 3 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@hashgraph/hedera-local",
"version": "2.19.1",
"version": "2.19.2",
"description": "Developer tooling for running Local Hedera Network (Consensus + Mirror Nodes).",
"main": "index.ts",
"scripts": {
Expand Down Expand Up @@ -57,13 +57,13 @@
"typescript": "^5.3.3"
},
"dependencies": {
"@hashgraph/sdk": "^2.41.0",
"@hashgraph/sdk": "^2.43.0",
"blessed": "^0.1.81",
"blessed-terminal": "^0.1.22",
"csv-parser": "^3.0.0",
"detect-port": "^1.5.1",
"dockerode": "^4.0.2",
"dotenv": "^16.3.1",
"dotenv": "^16.4.5",
"ethers": "^6.11.1",
"js-yaml": "^4.1.0",
"rimraf": "^5.0.5",
Expand Down
39 changes: 21 additions & 18 deletions src/state/InitState.ts
Original file line number Diff line number Diff line change
Expand Up @@ -231,25 +231,28 @@ export class InitState implements IState{
* @param {Array<Configuration> | undefined} nodeConfiguration - The node configuration.
*/
private configureNodeProperties(nodeConfiguration: Array<Configuration> | undefined): void {
const propertiesFilePath = join(this.cliOptions.workDir, NETWORK_NODE_CONFIG_DIR_PATH, 'bootstrap.properties');

let newProperties = '';
originalNodeConfiguration.bootsrapProperties.forEach(property => {
newProperties = newProperties.concat(`${property.key}=${property.value}\n`);
});

if (!nodeConfiguration) {
this.logger.trace(INIT_STATE_NO_NODE_CONF_NEEDED, this.stateName);
return;
const propertiesFiles = ['bootstrap.properties', 'application.properties']
for (let index = 0; index < propertiesFiles.length; index++) {
const propertiesFilePath = join(this.cliOptions.workDir, NETWORK_NODE_CONFIG_DIR_PATH, propertiesFiles[index]);

let newProperties = '';
originalNodeConfiguration.bootsrapProperties.forEach(property => {
newProperties = newProperties.concat(`${property.key}=${property.value}\n`);
});

if (!nodeConfiguration) {
this.logger.trace(INIT_STATE_NO_NODE_CONF_NEEDED, this.stateName);
return;
}
nodeConfiguration!.forEach(property => {
newProperties = newProperties.concat(`${property.key}=${property.value}\n`);
this.logger.trace(`Bootstrap property ${property.key} will be set to ${property.value}.`, this.stateName);
});

writeFileSync(propertiesFilePath, newProperties, { flag: 'w' });

this.logger.info(INIT_STATE_BOOTSTRAPPED_PROP_SET, this.stateName);
}
nodeConfiguration!.forEach(property => {
newProperties = newProperties.concat(`${property.key}=${property.value}\n`);
this.logger.trace(`Bootstrap property ${property.key} will be set to ${property.value}.`, this.stateName);
});

writeFileSync(propertiesFilePath, newProperties, { flag: 'w' });

this.logger.info(INIT_STATE_BOOTSTRAPPED_PROP_SET, this.stateName);
}

/**
Expand Down

0 comments on commit 295b65e

Please sign in to comment.