Skip to content
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

Add jito grpc plugin #306

Merged
merged 1 commit into from
Jun 16, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion dysnix/solana/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ name: solana
description: Solana blockchain node Helm chart
type: application

version: 0.1.27
version: 0.1.28
appVersion: "v1.17.34"

keywords:
Expand Down
6 changes: 5 additions & 1 deletion dysnix/solana/templates/configmap-plugins.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,12 @@ metadata:
labels:
{{- include "solana.labels" . | nindent 4 }}
data:
{{- if and .Values.plugins.yellowstoneGRPC.enabled .Values.plugins.yellowstoneGRPC.config }}
{{- if .Values.plugins.yellowstoneGRPC.enabled }}
yellowstone-grpc-config.json: |-
{{- .Values.plugins.yellowstoneGRPC.config | nindent 4 }}
{{- end }}
{{- if .Values.plugins.jitoGRPC.enabled }}
jitogrpc-config.json: |-
{{- .Values.plugins.jitoGRPC.config | nindent 4 }}
{{- end }}
{{- end }}
18 changes: 18 additions & 0 deletions dysnix/solana/templates/scripts/_download-plugins.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
set -e

YELLOWSTONE_GRPC__PLUGIN_DIR="$PLUGINS_DIR/yellowstone-grpc"
JITO_GRPC_DIR="$PLUGINS_DIR/jito-grpc"

yellowstone_grpc_bootstrap() {
echo "Yellowstone gRPC: Downloading plugin version ${YELLOWSTONE_GRPC__VERSION}.."
Expand All @@ -25,9 +26,26 @@ yellowstone_grpc_bootstrap() {
echo "Yellowstone gRPC: Bootstrap done!"
}

jito_grpc_bootstrap() {
{{- if .Values.plugins.jitoGRPC.enabled }}
{{- with .Values.plugins.jitoGRPC }}
mkdir -p "$JITO_GRPC_DIR"

echo "Jito gRPC: Copying config file to ${YELLOWSTONE_GRPC__PLUGIN_DIR}.."
cp -L "$JITO_GRPC__CONFIG_PATH" "$JITO_GRPC_DIR/config.json"

echo "Jito gRPC: Changing listen IP address in config file to ${YELLOWSTONE_GRPC__LISTEN_IP}.."
sed -i "s/LISTEN_IP/${JITO_GRPC__LISTEN_IP}/g" "$JITO_GRPC_DIR/config.json"

echo "Jito gRPC: Bootstrap done!"
{{- end }}
{{- end }}
}

main() {
cd /tmp
if [ "$YELLOWSTONE_GRPC__ENABLED" = "1" ]; then yellowstone_grpc_bootstrap; fi
if [ "$JITO_GRPC__ENABLED" = "1" ]; then jito_grpc_bootstrap; fi
}

main
5 changes: 5 additions & 0 deletions dysnix/solana/templates/service.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,11 @@ spec:
targetPort: ws
protocol: TCP
name: ws
{{- if $.Values.plugins.enabled }}
{{- if or $.Values.plugins.yellowstoneGRPC.enabled $.Values.plugins.jitoGRPC.enabled }}
{{- toYaml $.Values.plugins.grpc.service_ports | nindent 4 }}
{{- end }}
{{- end }}
{{- with .extraPorts }}
{{- toYaml . | nindent 4 }}
{{- end }}
Expand Down
11 changes: 11 additions & 0 deletions dysnix/solana/templates/statefulset.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,12 @@ spec:
value: /config/yellowstone-grpc-config.json
- name: YELLOWSTONE_GRPC__LISTEN_IP
value: {{ .yellowstoneGRPC.listenIP }}
- name: JITO_GRPC__ENABLED
value: {{ ternary "1" "0" .jitoGRPC.enabled | quote }}
- name: JITO_GRPC__CONFIG_PATH
value: /config/jitogrpc-config.json
- name: JITO_GRPC__LISTEN_IP
value: {{ .jitoGRPC.listenIP }}
volumeMounts:
- name: plugins
mountPath: /plugins
Expand Down Expand Up @@ -132,6 +138,11 @@ spec:
- name: ws
containerPort: {{ get .Values.solanaArgs "rpc-port" | add 1 }}
protocol: TCP
{{- if .Values.plugins.enabled }}
{{- if or .Values.plugins.yellowstoneGRPC.enabled .Values.plugins.jitoGRPC.enabled }}
{{- toYaml .Values.plugins.grpc.ports | nindent 12 }}
{{- end }}
{{- end }}
{{- with .Values.extraContainerPorts }}
{{- toYaml . | nindent 12 }}
{{- end }}
Expand Down
83 changes: 41 additions & 42 deletions dysnix/solana/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -340,6 +340,17 @@ plugins:
## @param plugins.enabled Enable download of Geyser plugins
##
enabled: false
grpc:
ports:
- name: grpc
containerPort: 10000
protocol: TCP
service_ports:
- name: grpc
protocol: TCP
port: 10000
targetPort: grpc

yellowstoneGRPC:
## @param plugins.yellowstoneGRPC.enabled Enable download of Yellowstone gRPC
##
Expand Down Expand Up @@ -372,55 +383,43 @@ plugins:
"unary_concurrency_limit": 100,
"unary_disabled": false,
"filters": {
"accounts": {
"max": 1,
"any": false,
"account_max": 10,
"account_reject": ["TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA"],
"owner_max": 10,
"owner_reject": ["11111111111111111111111111111111"]
},
"slots": {
"max": 1
},
"transactions": {
"max": 1,
"any": false,
"account_include_max": 10,
"account_include_reject": ["TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA"],
"account_exclude_max": 10,
"account_required_max": 10
},
"transactions_status": {
"max": 1,
"any": false,
"account_include_max": 10,
"account_include_reject": ["TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA"],
"account_exclude_max": 10,
"account_required_max": 10
},
"blocks": {
"max": 1,
"account_include_max": 10,
"account_include_any": false,
"account_include_reject": ["TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA"],
"include_transactions": true,
"include_accounts" : false,
"include_entries" : false
},
"blocks_meta": {
"max": 1
},
"entry": {
"max": 1
}
}
},
"prometheus": {
"address": "LISTEN_IP:8999"
},
"block_fail_action": "log"
}
jitoGRPC:
## @param plugins.jitoGRPC.enabled Enable download of Jito gRPC
##
enabled: false
## @param plugins.jitoGRPC.version Jito gRPC version
##
version: v1.17.20
## @param plugins.jitoGRPC.downloadURL From where the plugin needs to be downloaded
##
downloadURL: https://github.com/jito-foundation/geyser-grpc-plugin/releases/download/v1.17.20/libgeyser_grpc_plugin_server.so
## @param plugins.jitoGRPC.listenIP Jito gRPC listen IP address, without port
## works by replacing LISTEN_IP string inside json file with the value provided
## default: Pod IP address from K8s downward API
##
listenIP: $(MY_POD_IP)
## @param plugins.jitoGRPC.config [string, default: look in values.yaml] Jito gRPC config.json file
##
config: |-
{
"libpath": "/lib/libgeyser_grpc_plugin_server.so",
"bind_address": "0.0.0.0:10000",
"account_update_buffer_size": 100000,
"slot_update_buffer_size": 100000,
"block_update_buffer_size": 100000,
"transaction_update_buffer_size": 100000,
"geyser_service_config": {
"heartbeat_interval_ms": 1000,
"subscriber_buffer_size": 1000000
}
}

## You need first to create a keypair JSON files
## I.e. solana-keygen new --no-bip39-passphrase --silent && cat /root/.config/solana/id.json
Expand Down
Loading