Skip to content

Commit

Permalink
feat(config): add presets for the node config (#1170)
Browse files Browse the repository at this point in the history
  • Loading branch information
yoavGrs authored Sep 28, 2023
1 parent 49bfcbd commit f604edd
Show file tree
Hide file tree
Showing 5 changed files with 9 additions and 14 deletions.
5 changes: 3 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -70,8 +70,9 @@ cargo run --release --package papyrus_node --bin papyrus_node
`Papyrus` default [configuration file](config/default_config.json) documents all the available parameters,
including pointers to common values and `#is_none` flags for optional parameters.

You can override the default with your own key-value configuration json file, by providing a path to the
`--config_file` command-line argument. Note that the configuration file can be partial or even empty.
You can override the default with configuration json files, by providing paths to the `--config_file`
command-line argument. We provide preset json files for several Starknet networks [here](config/presets).
Note that the configuration files can be partial.
Alternatively, You can specify environment variables and command-line arguments.
See the available command-line arguments by running:

Expand Down
2 changes: 1 addition & 1 deletion deployments/helm/files/backup.sh
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ if [ -n "${CONCURRENT_REQUESTS}" ]; then
sed -i "s/concurrent_requests: 10/concurrent_requests: $CONCURRENT_REQUESTS/g" /app/config/config.yaml
fi

RUN_CMD="/app/target/release/papyrus_node --chain_id=${CHAIN_ID} --central_url=${CENTRAL_URL} ${ADDITIONAL_ARGS}"
RUN_CMD="/app/target/release/papyrus_node --config_file=/app/config/presets/${PRESET} ${ADDITIONAL_ARGS}"

while true; do
# start papyrus and save the pid
Expand Down
3 changes: 1 addition & 2 deletions deployments/helm/templates/configmap.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,7 @@ metadata:
{{- include "papyrus.labels" . | nindent 4 }}
data:
RUST_LOG: {{ .Values.rustLogLevel }}
CHAIN_ID: {{ .Values.starknet.chainId }}
CENTRAL_URL: {{ .Values.starknet.centralUrl }}
PRESET: {{ .Values.starknet.preset }}
CONCURRENT_REQUESTS: {{ .Values.node.concurrentFgRequests | quote }}
{{- if .Values.starknet.additionalHeaders }}
ADDITIONAL_HEADER: {{ .Values.starknet.additionalHeaders }}
Expand Down
6 changes: 2 additions & 4 deletions deployments/helm/templates/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -58,10 +58,8 @@ spec:
memory: {{ .Values.deployment.resources.requests.memory }}
{{- if not .Values.backup.enabled }}
args:
- --chain_id
- {{ .Values.starknet.chainId }}
- --central.url
- {{ .Values.starknet.centralUrl }}
- --config_file
- /app/config/presets/{{ .Values.starknet.preset }}
- --base_layer.node_url
- {{ .Values.base_layer_node_url }}
{{- if .Values.services }}
Expand Down
7 changes: 2 additions & 5 deletions deployments/helm/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,8 @@ node:
base_layer_node_url:

starknet:
chainId: SN_MAIN # possible values: SN_MAIN, SN_GOERLI
# feeder-gateway url
# SN_MAIN: https://alpha-mainnet.starknet.io
# SN_GOERLI: https://alpha4.starknet.io
centralUrl: https://alpha-mainnet.starknet.io
# possible values: "mainnet.json", "testnet1.json", "testnet2.json".
preset: mainnet.json
additionalHeaders: # optional addtional headers for SN communication

deployment:
Expand Down

0 comments on commit f604edd

Please sign in to comment.