Skip to content

Commit

Permalink
Merge pull request #13 from pokt-network/add-resources
Browse files Browse the repository at this point in the history
[poktroll-sequencer] Add resources
  • Loading branch information
okdas authored Dec 5, 2023
2 parents 8353e82 + 86bdda4 commit fff6f3b
Show file tree
Hide file tree
Showing 4 changed files with 23 additions and 16 deletions.
2 changes: 1 addition & 1 deletion charts/poktroll-sequencer/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ type: application
# This is the chart version. This version number should be incremented each time you make changes
# to the chart and its templates, including the app version.
# Versions are expected to follow Semantic Versioning (https://semver.org/)
version: 0.0.4
version: 0.0.5

# This is the version number of the application being deployed. This version number should be
# incremented each time you make changes to the application. Versions are not expected to
Expand Down
2 changes: 2 additions & 0 deletions charts/poktroll-sequencer/templates/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,8 @@ spec:
- name: poktrolld-sequencer
image: "{{ .Values.image.repository }}:{{ .Values.image.tag }}"
imagePullPolicy: {{ .Values.image.pullPolicy }}
resources:
{{- toYaml .Values.resources | nindent 12 }}
securityContext:
{{ toYaml .Values.podSecurityContext | indent 12 }}
env:
Expand Down
22 changes: 8 additions & 14 deletions charts/poktroll-sequencer/templates/scripts.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,20 +6,13 @@ data:
pocket.sh: |-
#!/bin/sh
echo "AUTH_TOKEN is: $AUTH_TOKEN"
VALIDATOR_NAME=sequencer1
CHAIN_ID=pocket
KEY_NAME=pocket-key
KEY_2_NAME=pocket-key-2
TOKEN_AMOUNT="10000000000000000000000000upokt"
STAKING_AMOUNT="1000000000upokt"
# reset any existing genesis/chain data
poktrolld tendermint unsafe-reset-all
rm -rf /root/.pocket/data/
echo '{"height":"0","round":0,"step":0}' > /root/.pocket/data/priv_validator_state.json
# create a random Namespace ID for your rollup to post blocks to
openssl rand -hex 10 > /root/.pocket/data/namespace-id
NAMESPACE_ID=$(cat /root/.pocket/data/namespace-id)
openssl rand -hex 8 > /root/.pocket/data/namespace-id
NAMESPACE=$(cat /root/.pocket/data/namespace-id)
# query the DA Layer start height, in this case we are querying
# our local devnet at port 26657, the RPC. The RPC endpoint is
Expand All @@ -29,7 +22,8 @@ data:
curl http://{{ .Values.dataAvailability.celestia.hostname }}:26657/block | jq -r '.result.block.header.height' > /root/.pocket/data/da-block-height
DA_BLOCK_HEIGHT=$(cat /root/.pocket/data/da-block-height)
echo -e "Your NAMESPACE_ID is $NAMESPACE_ID \n\n Your DA_BLOCK_HEIGHT is $DA_BLOCK_HEIGHT"
echo "AUTH_TOKEN is: $AUTH_TOKEN"
echo -e "Your NAMESPACE is $NAMESPACE \n\n Your DA_BLOCK_HEIGHT is $DA_BLOCK_HEIGHT"
ls -la /root/.pocket/config-src/
mkdir -p /root/.pocket/config/
Expand All @@ -40,8 +34,8 @@ data:
# start the node
# You can attach to this process with delve (dlv) for debugging purpose with `dlv attach $(pgrep poktrolld) --listen :40004 --headless --api-version=2 --accept-multiclient` - run inside the container!
poktrolld start --rollkit.aggregator true --rollkit.da_layer celestia --rollkit.da_config='{"base_url":"http://{{ .Values.dataAvailability.celestia.hostname }}:26658","timeout":60000000000,"fee":600000,"gas_limit":6000000,"auth_token":"'$AUTH_TOKEN'"}' --rollkit.namespace_id $NAMESPACE_ID --rollkit.da_start_height $DA_BLOCK_HEIGHT --rpc.laddr tcp://0.0.0.0:36657 --p2p.laddr "0.0.0.0:36656"
poktrolld start --rollkit.aggregator=true --rollkit.da_layer=celestia --rollkit.da_config='{"base_url":"http://{{ .Values.dataAvailability.celestia.hostname }}:26658","timeout":60000000000,"fee":600000,"gas_limit":6000000,"auth_token":"'$AUTH_TOKEN'"}' --rollkit.namespace_id=$NAMESPACE --rollkit.da_start_height=$DA_BLOCK_HEIGHT --rpc.laddr=tcp://0.0.0.0:36657 --p2p.laddr="0.0.0.0:36656"
# OR debug the node (uncomment this line but comment previous line)
# dlv exec /usr/local/bin/poktrolld --listen :40004 --headless --api-version=2 --accept-multiclient -- start --rollkit.aggregator true --rollkit.da_layer celestia --rollkit.da_config='{"base_url":"http://{{ .Values.dataAvailability.celestia.hostname }}:26658","timeout":60000000000,"fee":600000,"gas_limit":6000000,"auth_token":"'$AUTH_TOKEN'"}' --rollkit.namespace_id $NAMESPACE_ID --rollkit.da_start_height $DA_BLOCK_HEIGHT --rpc.laddr tcp://0.0.0.0:36657 --p2p.laddr "0.0.0.0:36656"
# dlv exec /usr/local/bin/poktrolld --listen :40004 --headless --api-version=2 --accept-multiclient -- start --rollkit.aggregator=true --rollkit.da_layer=celestia --rollkit.da_config='{"base_url":"http://{{ .Values.dataAvailability.celestia.hostname }}:26658","timeout":60000000000,"fee":600000,"gas_limit":6000000,"auth_token":"'$AUTH_TOKEN'"}' --rollkit.namespace_id=$NAMESPACE --rollkit.da_start_height=$DA_BLOCK_HEIGHT --rpc.laddr=tcp://0.0.0.0:36657 --p2p.laddr="0.0.0.0:36656"
13 changes: 12 additions & 1 deletion charts/poktroll-sequencer/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -25,4 +25,15 @@ dataAvailability:
podSecurityContext: {}
# allowPrivilegeEscalation: true
# capabilities:
# add: ["SYS_PTRACE"]
# add: ["SYS_PTRACE"]
resources: {}
# We usually recommend not to specify default resources and to leave this as a conscious
# choice for the user. This also increases chances charts run on environments with little
# resources, such as Minikube. If you do want to specify resources, uncomment the following
# lines, adjust them as necessary, and remove the curly braces after 'resources:'.
# limits:
# cpu: 8
# memory: 16Gi
# requests:
# cpu: 4
# memory: 12Gi

0 comments on commit fff6f3b

Please sign in to comment.