-
-
Notifications
You must be signed in to change notification settings - Fork 52
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* ADD: Gas Limit Option added gas limit option to validator and execution clients * Update services.js * Update TekuGasLimitConfig.js Config formating and error handling * Update TekuGasLimitConfig.js error handling if gas_limit doesn't exist
- Loading branch information
Showing
6 changed files
with
193 additions
and
4 deletions.
There are no files selected for viewing
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
export class TekuGasLimitConfig{ | ||
constructor(nodeConnection) { | ||
this.nodeConnection = nodeConnection; | ||
} | ||
|
||
async createGasConfigFile(gasLimit, feeRecipient, configPath){ | ||
const configContent = | ||
`{ | ||
"default_config": { | ||
"fee_recipient": "${feeRecipient}", | ||
"builder": { | ||
"enabled": true, | ||
"gas_limit": "${gasLimit}" | ||
} | ||
} | ||
}`; | ||
await this.nodeConnection.sshService.exec(`echo '${configContent}' > ${configPath}/gas_config.json`); | ||
} | ||
|
||
async removeGasConfigFile(configPath){ | ||
await this.nodeConnection.sshService.exec(`rm -f ${configPath}/gas_config.json`); | ||
} | ||
|
||
async readGasConfigFile(configPath){ | ||
let result = await this.nodeConnection.sshService.exec(`test -f ${configPath}/gas_config.json`) | ||
if(result.rc == 0){ | ||
let gasLimit = await this.nodeConnection.sshService.exec(`cat ${configPath}/gas_config.json`) | ||
if(gasLimit.includes("gas_limit")){ | ||
gasLimit = gasLimit.stdout.match(/^.*gas_limit.*$/gm)[0].split(':')[1]; | ||
return gasLimit; | ||
} | ||
else{ | ||
return ""; | ||
} | ||
} | ||
else{ | ||
return ""; | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters