-
Notifications
You must be signed in to change notification settings - Fork 73
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[DRAFT] Improvements on env variables awareness and update of the related documentation #1843
Open
Neurone
wants to merge
1
commit into
hashgraph:main
Choose a base branch
from
InternetOfPeers:improve-default-envs
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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,113 @@ | ||
# Default configuration if not overridden. | ||
# For a detailed description of all the fields see ./docs/configuration.md | ||
# Some configuration can be overridden with a corresponding env variable. | ||
# If you don't override a parameter, a default value is used instead, sometimes derived from the SDK. | ||
# Here you can see all th possible override. | ||
# The value you see here is the default used by the application if not overriding. | ||
# Using this env file means settings all values equals to their default | ||
|
||
CACHE_MAX=1_000 # Number of entries | ||
CACHE_TTL=3_600_000 # Seconds | ||
CHAIN_ID=298 # Hex or decimal. Default value is 298 (0x12a) commonly used for a "local-node" network. | ||
CLIENT_TRANSPORT_SECURITY="false" # Use "true" to enable. Any other value means "false" | ||
CONSENSUS_MAX_EXECUTION_TIME=10000 # Milliseconds. Default derived by @hashgraph/sdk if not defined. | ||
CONTRACT_QUERY_TIMEOUT_RETRIES=1 # Number of retries | ||
DEBUG_API_ENABLED="false" # Use "true" to enable. Any other value means "false" | ||
DEFAULT_RATE_LIMIT=200 # Total amount of requests available per IP | ||
ESTIMATE_GAS_THROWS="true" # Use "true" to enable. Any other value means "false" | ||
ETH_CALL_ACCEPTED_ERRORS="false" # Use "true" to enable. Any other value means "false" | ||
ETH_CALL_DEFAULT_TO_CONSENSUS_NODE="false" # Use "false" to disable. Any other value means "true" | ||
ETH_FEE_HISTORY_FIXED="true" # Use "true" to enable. Any other value means "false" | ||
ETH_GET_LOGS_BLOCK_RANGE_LIMIT=1000 # Number of blocks | ||
ETH_GET_TRANSACTION_COUNT_MAX_BLOCK_RANGE=1000 # Number of transactions | ||
ETH_POPULATE_SYNTHETIC_CONTRACT_RESULTS="true" # Use "true" to enable. Any other value means "false" | ||
FEE_HISTORY_MAX_RESULTS=10 # Number of results | ||
FILE_APPEND_MAX_CHUNKS=20 # number of chunks | ||
FILTER_API_ENABLED="false" # Use "true" to enable. Any other value means "false" | ||
FILTER_TTL=300000 # Milliseconds. | ||
GAS_PRICE_TINY_BAR_BUFFER=10000000000 # Tinybars | ||
HAPI_CLIENT_DURATION_RESET=0 # Milliseconds. 0 means the client never resets based on time | ||
HAPI_CLIENT_ERROR_RESET="[50]" # Array of protobuf status codes | ||
HAPI_CLIENT_TRANSACTION_RESET=0 # Number of transactions. | ||
|
||
|
||
HAVEGED_IMAGE_TAG | ||
HBAR_RATE_LIMIT_DURATION | ||
HBAR_RATE_LIMIT_TINYBAR | ||
HEDERA_NETWORK | ||
INPUT_SIZE_LIMIT | ||
LIMIT_DURATION | ||
LOCAL_NODE | ||
LOG_LEVEL | ||
MIRROR_IMAGE_TAG | ||
MIRROR_NODE_AGENT_CACHEABLE_DNS | ||
MIRROR_NODE_CONTRACT_RESULTS_LOGS_PG_MAX | ||
MIRROR_NODE_CONTRACT_RESULTS_PG_MAX | ||
MIRROR_NODE_HTTP_KEEP_ALIVE | ||
MIRROR_NODE_HTTP_KEEP_ALIVE_MSECS | ||
MIRROR_NODE_HTTP_MAX_SOCKETS | ||
MIRROR_NODE_HTTP_MAX_TOTAL_SOCKETS | ||
MIRROR_NODE_HTTP_SOCKET_TIMEOUT | ||
MIRROR_NODE_LIMIT_PARAM | ||
MIRROR_NODE_LIMIT_PARAM | ||
MIRROR_NODE_MAX_REDIRECTS | ||
MIRROR_NODE_RETRIES | ||
MIRROR_NODE_RETRIES_DEVMODE | ||
MIRROR_NODE_RETRY_CODES | ||
MIRROR_NODE_RETRY_DELAY | ||
MIRROR_NODE_RETRY_DELAY_DEVMODE | ||
MIRROR_NODE_TIMEOUT | ||
MIRROR_NODE_URL | ||
MIRROR_NODE_URL | ||
MIRROR_NODE_URL_HEADER_X_API_KEY | ||
NETWORK_NODE_IMAGE_TAG | ||
OPERATOR_ID | ||
OPERATOR_ID_ETH_SENDRAWTRANSACTION | ||
OPERATOR_ID_MAIN | ||
OPERATOR_KEY | ||
OPERATOR_KEY_ETH_SENDRAWTRANSACTION | ||
OPERATOR_KEY_MAIN | ||
PRIVATE_KEY | ||
RATE_LIMIT_DISABLED | ||
REDIS_ENABLED | ||
REDIS_RECONNECT_DELAY_MS | ||
REDIS_URL | ||
RELAY_BASE_URL | ||
REQUEST_ID_IS_OPTIONAL | ||
SDK_REQUEST_TIMEOUT | ||
SEND_RAW_TRANSACTION_SIZE_LIMIT | ||
SERVER_PORT | ||
SIGNED_TXS | ||
SMART_CONTRACTS_AMOUNT | ||
SUBSCRIPTIONS_ENABLED | ||
TEST_ONLY_ENV_VAR_EMPTYSTRING | ||
TEST_ONLY_ENV_VAR_NONNUMERICSTRING | ||
TEST_ONLY_ENV_VAR_NUMERICSTRING | ||
TEST_WS_SERVER | ||
TIER_1_RATE_LIMIT | ||
TIER_2_RATE_LIMIT | ||
TIER_3_RATE_LIMIT | ||
TX_DEFAULT_GAS | ||
WALLETS_AMOUNT | ||
WEB_SOCKET_HTTP_PORT | ||
WEB_SOCKET_PORT | ||
WS_CACHE_TTL | ||
WS_CONNECTION_LIMIT | ||
WS_CONNECTION_LIMIT_PER_IP | ||
WS_MAX_INACTIVITY_TTL | ||
WS_MULTIPLE_ADDRESSES_ENABLED | ||
WS_PING_INTERVAL | ||
WS_POLLING_INTERVAL | ||
WS_RELAY_URL | ||
WS_SUBSCRIPTION_LIMIT | ||
|
||
# Testing | ||
|
||
DEV_MODE="false" # Use "true" to enable. Any other value means "false" | ||
E2E_RELAY_HOST="http://localhost:7546" # Remote JSON-RPC Relay URL to point to. | ||
E2E_SERVER_PORT=7546 # Port for local testing, used in some acceptance tests. | ||
|
||
|
||
# Development related | ||
SEM_VER= | ||
SNAPSHOT= |
Large diffs are not rendered by default.
Oops, something went wrong.
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 |
---|---|---|
@@ -1,21 +1,18 @@ | ||
# Development mode | ||
|
||
`Developer mode` is intended to be used by users when developing and testing smart contracts. It allows `hardhat-chai-matchers` and other similar libraries to correctly assert revert messages of non-pure contract methods. | ||
It will also be expanded with special settings to speed up the [local node](https://github.com/hashgraph/hedera-local-node). | ||
`Developer mode` is intended to be used by users when developing and testing smart contracts. It allows `hardhat-chai-matchers` and other similar libraries to correctly assert revert messages of non-pure contract methods. It will also be expanded with special settings to speed up the [local node](https://github.com/hashgraph/hedera-local-node). | ||
|
||
## Enabling | ||
|
||
To enable `dev mode` start the Relay with the environment variable `DEV_MODE` set to `true`. | ||
|
||
|
||
## Rationale | ||
## Rationale | ||
|
||
In the example below `contract.call()` will make the following requests to the JSON RPC Relay: `eth_chainId, eth_estimateGas, eth_sendRawTransaction, eth_getTransactionByHash` | ||
|
||
```typescript | ||
await expect(contract.call()).to.be.revertedWith("Some revert message"); | ||
``` | ||
|
||
The asserting method expects to catch an error from any of the called API endpoints. Normally `eth_estimateGas` throws the error if the contract call is about to revert, | ||
but that is currently not possible in the context of Hedera. Instead the error can be thrown by `eth_getTransactionByHash` after the transaction has gone through the consensus nodes. | ||
Since that is not the normal desired behaviour it is only enabled in this mode. | ||
The asserting method expects to catch an error from any of the called API endpoints. Normally `eth_estimateGas` throws the error if the contract call is about to revert, but that is currently not possible in the context of Hedera. Instead the error can be thrown by `eth_getTransactionByHash` after the transaction has gone through the consensus nodes. | ||
Since that is not the normal desired behaviour it is only enabled in this mode. |
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 |
---|---|---|
@@ -1,5 +1,5 @@ | ||
HEDERA_NETWORK=mainnet | ||
HEDERA_NETWORK="mainnet" | ||
OPERATOR_ID_MAIN=<...redacted...> | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Q: why was this needed? Isn't it inherently string already? |
||
OPERATOR_KEY_MAIN=<...redacted...> | ||
CHAIN_ID=0x127 | ||
MIRROR_NODE_URL=https://mainnet-public.mirrornode.hedera.com/ | ||
MIRROR_NODE_URL="https://mainnet-public.mirrornode.hedera.com/" |
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 |
---|---|---|
@@ -1,5 +1,5 @@ | ||
HEDERA_NETWORK=previewnet | ||
HEDERA_NETWORK="previewnet" | ||
OPERATOR_ID_MAIN=<...redacted...> | ||
OPERATOR_KEY_MAIN=<...redacted...> | ||
CHAIN_ID=0x129 | ||
MIRROR_NODE_URL=https://previewnet.mirrornode.hedera.com/ | ||
MIRROR_NODE_URL="https://previewnet.mirrornode.hedera.com/" |
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 |
---|---|---|
@@ -1,5 +1,5 @@ | ||
HEDERA_NETWORK=testnet | ||
HEDERA_NETWORK="testnet" | ||
OPERATOR_ID_MAIN=<...redacted...> | ||
OPERATOR_KEY_MAIN=<...redacted...> | ||
CHAIN_ID=0x128 | ||
MIRROR_NODE_URL=https://testnet.mirrornode.hedera.com/ | ||
MIRROR_NODE_URL="https://testnet.mirrornode.hedera.com/" |
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
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Does the existing Configuration.md not satisfy this or does it need further emphasis.
This file would be a dupe of that and would require extra effort to maintain on top of that README
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is another approach to note the Config README in the
env.sample
file?