diff --git a/Makefile b/Makefile index 9f61b34..fd25d7c 100644 --- a/Makefile +++ b/Makefile @@ -5,5 +5,8 @@ BUILDDATE=`date -u +"%Y-%m-%dT%H:%M:%S%:z"` PACKAGE=exanode-chaind LDFLAGS="-X ${PACKAGE}/version.Version=${VERSION} -X ${PACKAGE}/version.BuildDate=${BUILDDATE} -X ${PACKAGE}/version.GitCommit=${GITCOMMIT} -X ${PACKAGE}/version.GitDate=${GITDATE} -s -w" +test: + go test ./... --cover + run_devnet: @go run ./metrics.go ./clients.go ./logging.go ./tracing.go ./main.go --base-dir . \ No newline at end of file diff --git a/chaind.yml b/chaind.yml index 4567383..d9728ad 100644 --- a/chaind.yml +++ b/chaind.yml @@ -42,11 +42,6 @@ validators: # derived from the data obtained by the other modules. balances: enable: true - indexes: - - 0 - - 1 - - 2 - - 3 # beacon-committees contains configuration for obtaining beacon committee-related # information. beacon-committees: @@ -74,10 +69,9 @@ summarizer: enable: true validators: enable: true - indexes: - - 0 - - 1 - - 2 - - 3 - # balance-retention: "P6M" - # epoch-retention: "P1Y" \ No newline at end of file + retain: + - 0xab0bdda0f85f842f431beaccf1250bf1fd7ba51b4100fd64364b6401fda85bb0069b3e715b58819684e7fc0b10a72a34 + - 0x876dd4705157eb66dc71bc2e07fb151ea53e1a62a0bb980a7ce72d15f58944a8a3752d754f52f4a60dbfc7b18169f268 + - 0x9314c6de0386635e2799af798884c2ea09c63b9f079e572acc00b06a7faccce501ea4dfc0b1a23b8603680a5e3481327 + balance-retention: "PT30M" + epoch-retention: "PT130M" \ No newline at end of file diff --git a/docker-compose.yml b/docker-compose.yml index 2aa06cd..86dea3e 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -37,20 +37,6 @@ services: volumes: - ./devnet.env:/exanode-devnet/scripts/vars.env - chaind: - build: . - restart: unless-stopped - networks: - - chaind - volumes: - - ./chaind.config.docker-compose.yml:/app/chaind.yml:ro - command: --base-dir /app - environment: - &environment - CHAIND_CHAINDB_URL: postgres://chaind:chaind@db:5432 - CHAIND_ETH2CLIENT_ADDRESS: http://devnet:8001/ - CHAIND_ETH1CLIENT_ADDRESS: http://devnet:6001/ - db: image: "postgres:14.2-bullseye" networks: diff --git a/helm/values_holesky_retain.yaml b/helm/values_holesky_retain.yaml new file mode 100644 index 0000000..5bf4b28 --- /dev/null +++ b/helm/values_holesky_retain.yaml @@ -0,0 +1,450 @@ +# -- Overrides the chart's name +nameOverride: "" + +# -- Overrides the chart's computed fullname +fullnameOverride: "" + +# -- Number of replicas +replicas: 1 + +image: + # -- chaind container image repository + repository: kubnoepro03-harbor.exaion.in/staking-eth/exanode-chaind + # -- chaind container image tag + tag: latest-validator- + # -- chaind container pull policy + pullPolicy: Always + +# -- Command replacement for the chaind container +customCommand: [ ] # Only change this if you need to change the default command + +executionLayer: + host: "192.168.11.115" + port: "8545" + +consensusLayer: + host: "163.114.159.124" + port: "9718" + +startSlot: 1043598 +startBlock: 983406 + +validators: + - '1526829' + - '1508519' + - '1508524' + - '1508503' + - '1478247' + - '1508516' + - '1508532' + - '1527484' + - '1508500' + - '1478246' + - '1508529' + - '1503410' + - '1508512' + - '1508518' + - '1508507' + - '1508514' + - '1508537' + - '1508528' + - '1508530' + - '1508535' + - '1595502' + - '1508523' + - '1508511' + - '1504730' + - '1508502' + - '1508504' + - '1508522' + - '1508517' + - '1508536' + - '1494870' + - '1508506' + - '1508501' + - '1508531' + - '1595501' + - '1508534' + - '1508533' + - '1508539' + - '1508520' + - '1508521' + - '1509718' + - '1508515' + - '1595500' + - '1558267' + - '1508505' + - '1508538' + - '1508508' + - '1548592' + - '1508513' + - '1508509' + - '1558876' + - '1508510' + - '1508525' + - '1508526' + - '1595677' + - '1596021' + - '1596022' + + +# -- Config file +# @default -- See `values.yaml` +config: | + # log-level is the base log level of the process. + # 'info' should be a suitable log level, unless detailed information is + # required in which case 'debug' or 'trace' can be used. + log-level: trace + # log-file specifies that log output should go to a file. If this is not + # present log output will be to stderr. + # log-file: /var/log/chaind.log + + chaindb: + # url is the URL of the PostgreSQL database. + url: postgres://{{ .Values.db.primary.initdb.user }}:{{ .Values.db.primary.initdb.password }}@{{ .Release.Name }}-db:5432/chain + max-connections: 16 + # eth2client contains configuration for the Ethereum 2 client. + eth2client: + # log-level is the log level of the specific module. If not present the base log + # level will be used. + log-level: debug + # address is the address of the beacon node. + address: {{ .Values.consensusLayer.host }}:{{ .Values.consensusLayer.port }} + # eth1client contains configuration for the Ethereum 1 client. + eth1client: + # address is the address of the Ethereum 1 node. + address: {{ .Values.executionLayer.host }}:{{ .Values.executionLayer.port }} + # blocks contains configuration for obtaining block-related information. + blocks: + # enable states if this module will be operational. + enable: true + # address is a separate connection for this module. If not present then + # chaind will use the eth2client connection. + # address: localhost:5051 + # start-slot is the slot from which to start. chaind should keep track of this itself, + # however if you wish to start from a later slot this can be set. + start-slot: {{ .Values.startSlot }} + # refetch will refetch block data from a beacon node even if it has already has a block + # in its database. + # refetch: false + # validators contains configuration for obtaining validator-related information. + validators: + enable: true + # balances contains configuration for obtaining validator balances. This is + # a separate configuration flag for two reasons. First, it can take a long + # time to retrieve this information. Second, the information can be + # derived from the data obtained by the other modules. + balances: + enable: true + # beacon-committees contains configuration for obtaining beacon committee-related + # information. + beacon-committees: + enable: true + # proposer-duties contains configuration for obtaining proposer duty-related + # information. + proposer-duties: + enable: true + # finalizer updates tables with information available for finalized states. + finalizer: + enable: true + # eth1deposits contains information about transactions made to the deposit contract + # on the Ethereum 1 network. + eth1deposits: + enable: true + # start-block is the block from which to start fetching deposits. chaind should + # keep track of this itself, however if you wish to start from a different block this + # can be set. + start-block: {{ .Values.startBlock }} + summarizer: + enable: true + epochs: + enable: true + blocks: + enable: true + validators: + enable: true + balance-retention: "P3D" + epoch-retention: "P3D" + retain: + {{- range .Values.validators }} + - {{ . | quote }} + {{- end }} + metrics: + prometheus: + listen-address: 0.0.0.0:{{ .Values.metricsPort }} + +ingress: + # -- Ingress resource for the HTTP API + enabled: false + # -- Annotations for Ingress + annotations: { } + # kubernetes.io/ingress.class: nginx + # kubernetes.io/tls-acme: "true" + # -- Ingress host + hosts: + - host: chart-example.local + paths: [ ] + # -- Ingress TLS + tls: [ ] + # - secretName: chart-example-tls + # hosts: + # - chart-example.local + +# - HTTP port for chaind interface +httpPort: 9000 + +# - Metrics port for chaind interface +metricsPort: 8000 + +service: + # -- Service type + type: ClusterIP + +# -- Affinity configuration for pods +affinity: { } + +# -- Image pull secrets for Docker images +imagePullSecrets: + - name: harbor-robot-secret + +# -- Annotations for the StatefulSet +annotations: + linkerd.io/inject: "enabled" + +# -- Liveness probe +# @default -- See `values.yaml` +livenessProbe: + tcpSocket: + port: http + initialDelaySeconds: 60 + periodSeconds: 120 + +# -- Readiness probe +# @default -- See `values.yaml` +readinessProbe: + tcpSocket: + port: http + initialDelaySeconds: 10 + periodSeconds: 10 + +# -- Node selector for pods +nodeSelector: { } +# -- Pod labels +podLabels: { } + +# -- Pod annotations +podAnnotations: + linkerd.io/inject: "enabled" + +# -- Pod management policy +podManagementPolicy: OrderedReady + +# -- Pod priority class +priorityClassName: null + +# -- Resource requests and limits +resources: { } +# limits: +# cpu: 500m +# memory: 2Gi +# requests: +# cpu: 300m +# memory: 1Gi + +# -- The security context for pods +# @default -- See `values.yaml` +securityContext: + fsGroup: 10001 + runAsGroup: 10001 + runAsNonRoot: true + runAsUser: 10001 + +# -- The security context for containers +# @default -- See `values.yaml` +containerSecurityContext: { } + # capabilities: + # drop: + # - ALL + # readOnlyRootFilesystem: true + # runAsNonRoot: true +# runAsUser: 1000 + +serviceAccount: + # -- Specifies whether a service account should be created + create: true + # -- Annotations to add to the service account + annotations: { } + # -- The name of the service account to use. + # If not set and create is true, a name is generated using the fullname template + name: "" + +# -- How long to wait until the pod is forcefully terminated +terminationGracePeriodSeconds: 300 + +# -- Tolerations for pods +## ref: https://kubernetes.io/docs/concepts/configuration/taint-and-toleration/ +tolerations: [ ] + +# -- Topology Spread Constraints for pods +## ref: https://kubernetes.io/docs/concepts/scheduling-eviction/topology-spread-constraints/ +topologySpreadConstraints: [ ] + +# -- Define the PodDisruptionBudget spec +# If not set then a PodDisruptionBudget will not be created +podDisruptionBudget: { } +# minAvailable: 1 +# maxUnavailable: 1 + +# -- Update stategy for the Statefulset +updateStrategy: + # -- Update stategy type + type: RollingUpdate + +# -- Additional init containers +initContainers: [ ] +# - name: my-init-container +# image: busybox:latest +# command: ['sh', '-c', 'echo hello'] + +# -- Additional containers +extraContainers: [ ] + +# -- Additional volumes +extraVolumes: [ ] + +# -- Additional volume mounts +extraVolumeMounts: [ ] + +# -- Additional ports. Useful when using extraContainers +extraPorts: [ ] + +# -- Additional env variables +extraEnv: [ ] + +# -- Additional env variables injected via a created secret +secretEnv: { } + +initChownData: + # -- Init container to set the correct permissions to access data directories + enabled: true + image: + # -- Container repository + repository: busybox + # -- Container tag + tag: "1.34.1" + # -- Container pull policy + pullPolicy: Always + # -- Resource requests and limits + resources: { } + # limits: + # cpu: 100m + # memory: 128Mi + # requests: + # cpu: 100m + # memory: 128Mi + + +persistence: + # -- Uses an EmptyDir when not enabled + enabled: false + # -- Use an existing PVC when persistence.enabled + existingClaim: null + # -- Access mode for the volume claim template + accessModes: + - ReadWriteOnce + # -- Requested size for volume claim template + size: 1Gi + # -- Use a specific storage class + # E.g 'local-path' for local storage to achieve best performance + # Read more (https://github.com/rancher/local-path-provisioner) + storageClassName: cinder-nvme-retain + # -- Annotations for volume claim template + annotations: { } + # -- Selector for volume claim template + selector: { } + # matchLabels: + # app.kubernetes.io/name: something + +metrics: + enabled: true + + serviceMonitor: + # -- If true, a ServiceMonitor CRD is created for a prometheus operator + # https://github.com/coreos/prometheus-operator + enabled: true + # -- Path to scrape + path: /metrics + # -- Alternative namespace for ServiceMonitor + namespace: null + # -- Additional ServiceMonitor labels + labels: { } + # -- Additional ServiceMonitor annotations + annotations: { } + # -- ServiceMonitor scrape interval + interval: 5s + # -- ServiceMonitor scheme + scheme: http + # -- ServiceMonitor TLS configuration + tlsConfig: { } + # -- ServiceMonitor scrape timeout + scrapeTimeout: 2s + # -- ServiceMonitor relabelings + relabelings: + - action: replace + replacement: "chaind" + targetLabel: type + - action: replace + replacement: "holesky" + targetLabel: network + - action: replace + replacement: "false" + targetLabel: witness + + prometheusRule: + enabled: true + namespace: "monitoring" + additionalRuleLabels: + scope: staking + network: holesky + additionalRules: [ ] + +db: + metrics: + enabled: true + serviceMonitor: + enabled: true + jobLabel: + type: db + network: holesky + db: chaind + + image: + debug: true + # -- If enabled a postgres chart will be deployed as a dependency to be used as a slashing protection database + enabled: true + auth: + database: chain + enablePostgresUser: true + postgresPassword: postgres + primary: + name: chain + extendedConfiguration: |- + max_wal_size = 2GB + log_duration = 1 + log_min_duration_statement = 100 + initdb: + user: postgres + password: postgres + scripts: + init_01.sql: | + CREATE DATABASE chain; + persistence: + # -- Uses an EmptyDir when not enabled + enabled: true + storageClass: cinder-nvme-retain + size: 2Ti + dataSource: + kind: PersistentVolumeClaim + name: data-chaind-holesky-db-0 + containerSecurityContext: + privileged: true \ No newline at end of file