Skip to content

Commit

Permalink
Merge pull request #671 from holographxyz/testnet
Browse files Browse the repository at this point in the history
Release/012-Blondie-v10-mainnet
  • Loading branch information
sogoiii authored Jun 5, 2024
2 parents d9ef159 + 0a78825 commit 19138f8
Show file tree
Hide file tree
Showing 40 changed files with 3,614 additions and 1,593 deletions.
128 changes: 128 additions & 0 deletions .github/actions/develop/deploy-indexer/action.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,128 @@
name: 'deploy-indexer'
runs:
using: 'composite'
steps:
- name: -> V2 -- Deploy INDEXER cli in staging [namespace -> ${{ env.STG_COMMON_NAMESPACE_V2 }}]
uses: tensor-hq/eksctl-helm-action@main
env:
RELEASE_NAME: ${{ env.INDEXER_RELEASE_NAME_V2 }} # notice
HOLOGRAPH_VERSION: 'V2'
#
ENABLE_DEBUG: 'true'
HEALTHCHECK: 'true'
MODE: 'auto'
ENABLE_UNSAFE: 'false'
ENABLE_SYNC: 'true'
ENABLE_PROCESS_BLOCK_RANGE: 'true' # undefined/true
UPDATE_BLOCK_HEIGHT: 'api' # api/file/disable
#
ENABLE_PROCESS_BLOCK_RANGE_arbitrum: 'true' # undefined/true
ENABLE_PROCESS_BLOCK_RANGE_optimism: 'true'
ENABLE_PROCESS_BLOCK_RANGE_binance: 'true'
ENABLE_PROCESS_BLOCK_RANGE_mantle: 'true'
ENABLE_PROCESS_BLOCK_RANGE_zora: 'true'
ENABLE_PROCESS_BLOCK_RANGE_avalanche: 'true'
ENABLE_PROCESS_BLOCK_RANGE_ethereum: 'true'
ENABLE_PROCESS_BLOCK_RANGE_polygon: 'true'
ENABLE_PROCESS_BLOCK_RANGE_base: 'true'
ENABLE_PROCESS_BLOCK_RANGE_linea: 'true'
#
AVALANCHE_NETWORK: 'avalancheTestnet'
POLYGON_NETWORK: '{polygonTestnet}'
BINANCE_NETWORK: 'binanceSmartChainTestnet'
MANTLE_NETWORK: '{mantleTestnet}'
ETHEREUM_NETWORK: '{ethereumTestnetSepolia}'
OPTIMISM_NETWORK: '{optimismTestnetSepolia}'
ARBITRUM_NETWORK: '{arbitrumTestnetSepolia}'
ZORA_NETWORK: '{zoraTestnetSepolia}'
BASE_NETWORK: '{baseTestnetSepolia}'
LINEA_NETWORK: '{lineaTestnetGoerli}'
with:
eks_cluster: ${{ env.CLUSTER_NAME }}
command: |-
helm upgrade --install $RELEASE_NAME \
holo-indexer-${{ env.STG_HOLOGRAPH_INDEXER_HELM_CHART_VERSION }}.tgz \
-n ${{ env.STG_COMMON_NAMESPACE_V2 }} \
\
--set dummy_deployment_namespace=dev-cli-dummies \
\
--set image.repository=${{ env.ECR_REPOSITORY }} \
--set image.image_tag=${{ env.IMAGE_TAG }} \
--set config_file_data=${{ env.INDEXER_HOLOGRAPH_CONFIG_FILE_DATA }} \
--set holo_indexer_password=$DEV_INDEXER_V2_PASSWORD \
--set HOLO_INDEXER_HOST=$DEV_INDEXER_V2_HOLO_INDEXER_HOST \
--set OPERATOR_API_KEY=$DEV_INDEXER_V2_OPERATOR_API_KEY \
--set HOLOGRAPH_ENVIRONMENT=${{ env.HOLOGRAPH_ENVIRONMENT }} \
--set HOLOGRAPH_ADDRESS=$DEV_INDEXER_V2_HOLOGRAPH_ADDRESS \
--set HOLOGRAPH_VERSION=${{ env.HOLOGRAPH_VERSION }} \
--set BLOCK_PROCESSING_VERSION=${{ env.BLOCK_PROCESSING_VERSION }} \
\
--set ENABLE_DEBUG=$ENABLE_DEBUG \
--set ENABLE_SYNC=$ENABLE_SYNC \
--set HEALTHCHECK=$HEALTHCHECK \
--set MODE=$MODE \
\
--set AVALANCHE_NETWORK="${AVALANCHE_NETWORK}" \
--set POLYGON_NETWORK="${POLYGON_NETWORK}" \
--set BINANCE_NETWORK="${BINANCE_NETWORK}" \
--set MANTLE_NETWORK="${MANTLE_NETWORK}" \
--set ETHEREUM_NETWORK="${ETHEREUM_NETWORK}" \
--set OPTIMISM_NETWORK="${OPTIMISM_NETWORK}" \
--set ARBITRUM_NETWORK="${ARBITRUM_NETWORK}" \
--set ZORA_NETWORK="${ZORA_NETWORK}" \
--set BASE_NETWORK="${BASE_NETWORK}" \
--set LINEA_NETWORK="${LINEA_NETWORK}" \
\
--set ENABLE_UNSAFE="${ENABLE_UNSAFE}" \
--set UPDATE_BLOCK_HEIGHT=$UPDATE_BLOCK_HEIGHT \
\
--set ENABLE_PROCESS_BLOCK_RANGE.arbitrum=$ENABLE_PROCESS_BLOCK_RANGE_arbitrum \
--set ENABLE_PROCESS_BLOCK_RANGE.binance=$ENABLE_PROCESS_BLOCK_RANGE_binance \
--set ENABLE_PROCESS_BLOCK_RANGE.avalanche=$ENABLE_PROCESS_BLOCK_RANGE_avalanche \
--set ENABLE_PROCESS_BLOCK_RANGE.optimism=$ENABLE_PROCESS_BLOCK_RANGE_optimism \
--set ENABLE_PROCESS_BLOCK_RANGE.ethereum=$ENABLE_PROCESS_BLOCK_RANGE_ethereum \
--set ENABLE_PROCESS_BLOCK_RANGE.polygon=$ENABLE_PROCESS_BLOCK_RANGE_polygon \
--set ENABLE_PROCESS_BLOCK_RANGE.mantle=$ENABLE_PROCESS_BLOCK_RANGE_mantle \
--set ENABLE_PROCESS_BLOCK_RANGE.zora=$ENABLE_PROCESS_BLOCK_RANGE_zora \
--set ENABLE_PROCESS_BLOCK_RANGE.base=$ENABLE_PROCESS_BLOCK_RANGE_base \
--set ENABLE_PROCESS_BLOCK_RANGE.linea=$ENABLE_PROCESS_BLOCK_RANGE_linea \
\
--set dev_rpc_config_values.avalancheTestnet_rpc_url=$DEV_INDEXER_V2_AVALANCHE_TESTNET_RPC_URL \
--set dev_rpc_config_values.polygonTestnet_rpc_url=$DEV_INDEXER_V2_POLYGON_TESTNET_RPC_URL \
--set dev_rpc_config_values.polygonTestnetAmoy_rpc_url=$DEV_INDEXER_V2_POLYGON_TESTNET_AMOY_RPC_URL \
--set dev_rpc_config_values.binanceTestnet_rpc_url=$DEV_INDEXER_V2_BINANCE_SMART_CHAIN_TESTNET_RPC_URL \
--set dev_rpc_config_values.mantleTestnet_rpc_url=$DEV_INDEXER_V2_MANTLE_TESTNET_RPC_URL \
--set dev_rpc_config_values.mantleTestnetSepolia_rpc_url=$DEV_INDEXER_V2_MANTLE_TESTNET_SEPOLIA_RPC_URL \
--set dev_rpc_config_values.ethereumTestnetSepolia_rpc_url=$DEV_INDEXER_V2_ETHEREUM_TESTNET_SEPOLIA_RPC_URL \
--set dev_rpc_config_values.optimismTestnetSepolia_rpc_url=$DEV_INDEXER_V2_OPTIMISM_TESTNET_SEPOLIA_RPC_URL \
--set dev_rpc_config_values.arbitrumTestnetSepolia_rpc_url=$DEV_INDEXER_V2_ARBITRUM_TESTNET_SEPOLIA_RPC_URL \
--set dev_rpc_config_values.zoraTestnetSepolia_rpc_url=$DEV_INDEXER_V2_ZORA_TESTNET_SEPOLIA_RPC_URL \
--set dev_rpc_config_values.baseTestnetSepolia_rpc_url=$DEV_INDEXER_V2_BASE_TESTNET_SEPOLIA_RPC_URL \
--set dev_rpc_config_values.lineaTestnetGoerli_rpc_url=$DEV_INDEXER_V2_LINEA_TESTNET_GOERLI_RPC_URL \
--set dev_rpc_config_values.lineaTestnetSepolia_rpc_url=$DEV_INDEXER_V2_LINEA_TESTNET_SEPOLIA_RPC_URL \
\
--set dev_rpc_config_values.private_key=$DEV_INDEXER_V2_PRIVATE_KEY \
--set dev_rpc_config_values.address=$DEV_INDEXER_V2_DEV_WALLET_ADDRESS \
--set dev_rpc_config_values.version="beta3" \
\
--set datadog_tags.env=${{ env.CLUSTER_NAME }} \
--set datadog_tags.service=$RELEASE_NAME \
--set datadog_tags.version=$RELEASE_NAME-${{ env.STG_HOLOGRAPH_INDEXER_HELM_CHART_VERSION }} \
\
--set autoscaling.enabled=false \
--set replicaCountAvalanche=1 \
--set replicaCountPolygon=0 \
--set replicaCountBinance=1 \
--set replicaCountMantle=0 \
--set replicaCountEthereum=1 \
--set replicaCountArbitrum=1 \
--set replicaCountOptimism=1 \
--set replicaCountBase=1 \
--set replicaCountLinea=1 \
--set replicaCountZora=1 \
\
--set sqs.SQS_USER_AWS_ACCESS_KEY_ID=$COMMON_AWS_ACCESS_KEY_ID_SQS \
--set sqs.SQS_USER_AWS_SECRET_ACCESS_KEY=$COMMON_AWS_SECRET_ACCESS_KEY_SQS \
--set sqs.SQS_ENDPOINT=$DEV_INDEXER_V2_SQS_ENDPOINT \
--set sqs.SQS_QUEUE_URL=$DEV_INDEXER_V2_SQS_QUEUE_URL \
--set sqs.AWS_REGION=$COMMON_AWS_REGION
119 changes: 119 additions & 0 deletions .github/actions/develop/deploy-operator/action.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,119 @@
name: 'deploy-operator'
runs:
using: 'composite'
steps:
- name: -> V2 -- Deploy OPERATOR cli in staging [namespace -> ${{ env.STG_COMMON_NAMESPACE_V2 }}]
uses: tensor-hq/eksctl-helm-action@main
env:
RELEASE_NAME: ${{ env.OPERATOR_RELEASE_NAME_V2 }} # notice
HOLOGRAPH_VERSION: 'V2'
#
ENABLE_DEBUG: 'true'
ENABLE_SYNC: 'true'
HEALTHCHECK: 'true'
MODE: 'auto'
ENABLE_UNSAFE: 'false'
ENABLE_PROCESS_BLOCK_RANGE: 'true' # undefined/true
UPDATE_BLOCK_HEIGHT: 'api' # api/file/disable
#
ENABLE_PROCESS_BLOCK_RANGE_arbitrum: 'true' # undefined/true
ENABLE_PROCESS_BLOCK_RANGE_optimism: 'true'
ENABLE_PROCESS_BLOCK_RANGE_binance: 'true'
ENABLE_PROCESS_BLOCK_RANGE_mantle: 'true'
ENABLE_PROCESS_BLOCK_RANGE_zora: 'true'
ENABLE_PROCESS_BLOCK_RANGE_avalanche: 'true'
ENABLE_PROCESS_BLOCK_RANGE_ethereum: 'true'
ENABLE_PROCESS_BLOCK_RANGE_polygon: 'true'
ENABLE_PROCESS_BLOCK_RANGE_base: 'true'
ENABLE_PROCESS_BLOCK_RANGE_linea: 'true'
#
AVALANCHE_NETWORK: 'avalancheTestnet'
POLYGON_NETWORK: '{polygonTestnet}'
BINANCE_NETWORK: 'binanceSmartChainTestnet'
MANTLE_NETWORK: '{mantleTestnet}'
ETHEREUM_NETWORK: '{ethereumTestnetSepolia}'
OPTIMISM_NETWORK: '{optimismTestnetSepolia}'
ARBITRUM_NETWORK: '{arbitrumTestnetSepolia}'
ZORA_NETWORK: '{zoraTestnetSepolia}'
BASE_NETWORK: '{baseTestnetSepolia}'
LINEA_NETWORK: '{lineaTestnetGoerli}'
with:
eks_cluster: ${{ env.CLUSTER_NAME }}
command: |-
helm upgrade --install $RELEASE_NAME \
holo-operator-${{ env.STG_HOLOGRAPH_OPERATOR_HELM_CHART_VERSION }}.tgz \
-n ${{ env.STG_COMMON_NAMESPACE_V2 }} \
\
--set dummy_deployment_namespace=dev-cli-dummies \
\
--set image.repository=${{ env.ECR_REPOSITORY }} \
--set image.image_tag=${{ env.IMAGE_TAG }} \
--set config_file_data=${{ env.OPERATOR_HOLOGRAPH_CONFIG_FILE_DATA }} \
--set holo_operator_password=$DEV_OPERATOR_V2_PASSWORD \
--set HOLO_OPERATOR_HOST=$DEV_OPERATOR_V2_HOLO_OPERATOR_HOST \
--set OPERATOR_API_KEY=$DEV_OPERATOR_V2_OPERATOR_API_KEY \
--set HOLOGRAPH_ENVIRONMENT=${{ env.HOLOGRAPH_ENVIRONMENT }} \
--set HOLOGRAPH_ADDRESS=$DEV_OPERATOR_V2_HOLOGRAPH_ADDRESS \
--set HOLOGRAPH_VERSION=${{ env.HOLOGRAPH_VERSION }} \
\
--set ENABLE_DEBUG=$ENABLE_DEBUG \
--set ENABLE_SYNC=$ENABLE_SYNC \
--set HEALTHCHECK=$HEALTHCHECK \
--set MODE=$MODE \
--set ENABLE_UNSAFE="${ENABLE_UNSAFE}" \
--set UPDATE_BLOCK_HEIGHT=$UPDATE_BLOCK_HEIGHT \
\
--set ENABLE_PROCESS_BLOCK_RANGE.arbitrum=$ENABLE_PROCESS_BLOCK_RANGE_arbitrum \
--set ENABLE_PROCESS_BLOCK_RANGE.binance=$ENABLE_PROCESS_BLOCK_RANGE_binance \
--set ENABLE_PROCESS_BLOCK_RANGE.avalanche=$ENABLE_PROCESS_BLOCK_RANGE_avalanche \
--set ENABLE_PROCESS_BLOCK_RANGE.optimism=$ENABLE_PROCESS_BLOCK_RANGE_optimism \
--set ENABLE_PROCESS_BLOCK_RANGE.ethereum=$ENABLE_PROCESS_BLOCK_RANGE_ethereum \
--set ENABLE_PROCESS_BLOCK_RANGE.polygon=$ENABLE_PROCESS_BLOCK_RANGE_polygon \
--set ENABLE_PROCESS_BLOCK_RANGE.mantle=$ENABLE_PROCESS_BLOCK_RANGE_mantle \
--set ENABLE_PROCESS_BLOCK_RANGE.zora=$ENABLE_PROCESS_BLOCK_RANGE_zora \
--set ENABLE_PROCESS_BLOCK_RANGE.base=$ENABLE_PROCESS_BLOCK_RANGE_base \
--set ENABLE_PROCESS_BLOCK_RANGE.linea=$ENABLE_PROCESS_BLOCK_RANGE_linea \
\
--set AVALANCHE_NETWORK="${AVALANCHE_NETWORK}" \
--set POLYGON_NETWORK="${POLYGON_NETWORK}" \
--set BINANCE_NETWORK="${BINANCE_NETWORK}" \
--set MANTLE_NETWORK="${MANTLE_NETWORK}" \
--set ETHEREUM_NETWORK="${ETHEREUM_NETWORK}" \
--set OPTIMISM_NETWORK="${OPTIMISM_NETWORK}" \
--set ARBITRUM_NETWORK="${ARBITRUM_NETWORK}" \
--set ZORA_NETWORK="${ZORA_NETWORK}" \
--set BASE_NETWORK="${BASE_NETWORK}" \
--set LINEA_NETWORK="${LINEA_NETWORK}" \
\
--set dev_rpc_config_values.avalancheTestnet_rpc_url=$DEV_OPERATOR_V2_AVALANCHE_TESTNET_RPC_URL \
--set dev_rpc_config_values.polygonTestnet_rpc_url=$DEV_OPERATOR_V2_POLYGON_TESTNET_RPC_URL \
--set dev_rpc_config_values.polygonTestnetAmoy_rpc_url=$DEV_OPERATOR_V2_POLYGON_TESTNET_AMOY_RPC_URL \
--set dev_rpc_config_values.binanceTestnet_rpc_url=$DEV_OPERATOR_V2_BINANCE_SMART_CHAIN_TESTNET_RPC_URL \
--set dev_rpc_config_values.mantleTestnet_rpc_url=$DEV_OPERATOR_V2_MANTLE_TESTNET_RPC_URL \
--set dev_rpc_config_values.mantleTestnetSepolia_rpc_url=$DEV_OPERATOR_V2_MANTLE_TESTNET_SEPOLIA_RPC_URL \
--set dev_rpc_config_values.ethereumTestnetSepolia_rpc_url=$DEV_OPERATOR_V2_ETHEREUM_TESTNET_SEPOLIA_RPC_URL \
--set dev_rpc_config_values.optimismTestnetSepolia_rpc_url=$DEV_OPERATOR_V2_OPTIMISM_TESTNET_SEPOLIA_RPC_URL \
--set dev_rpc_config_values.arbitrumTestnetSepolia_rpc_url=$DEV_OPERATOR_V2_ARBITRUM_TESTNET_SEPOLIA_RPC_URL \
--set dev_rpc_config_values.zoraTestnetSepolia_rpc_url=$DEV_OPERATOR_V2_ZORA_TESTNET_SEPOLIA_RPC_URL \
--set dev_rpc_config_values.baseTestnetSepolia_rpc_url=$DEV_OPERATOR_V2_BASE_TESTNET_SEPOLIA_RPC_URL \
--set dev_rpc_config_values.lineaTestnetGoerli_rpc_url=$DEV_OPERATOR_V2_LINEA_TESTNET_GOERLI_RPC_URL \
--set dev_rpc_config_values.lineaTestnetSepolia_rpc_url=$DEV_OPERATOR_V2_LINEA_TESTNET_SEPOLIA_RPC_URL \
\
--set dev_rpc_config_values.private_key=$DEV_OPERATOR_V2_PRIVATE_KEY \
--set dev_rpc_config_values.address=$DEV_OPERATOR_V2_DEV_WALLET_ADDRESS \
\
--set autoscaling.enabled=false \
--set replicaCountAvalanche=1 \
--set replicaCountPolygon=0 \
--set replicaCountBinance=1 \
--set replicaCountMantle=0 \
--set replicaCountEthereum=1 \
--set replicaCountArbitrum=1 \
--set replicaCountOptimism=1 \
--set replicaCountBase=1 \
--set replicaCountLinea=1 \
--set replicaCountZora=1 \
\
--set datadog_tags.env=${{ env.CLUSTER_NAME }} \
--set datadog_tags.service=$RELEASE_NAME \
--set datadog_tags.version=$RELEASE_NAME-${{ env.STG_HOLOGRAPH_OPERATOR_HELM_CHART_VERSION }}
90 changes: 90 additions & 0 deletions .github/actions/develop/initial-setup/action.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,90 @@
name: 'initial-setup'
runs:
using: 'composite'
steps:
- name: Use Githubs federated identity with AWS
uses: aws-actions/configure-aws-credentials@v1
with:
role-to-assume: ${{ env.IAM_ROLE }}
aws-region: ${{ env.AWS_REGION }}

- name: Get secrets from AWS Secrets Manager
uses: aws-actions/aws-secretsmanager-get-secrets@v1
with:
aws-region: ${{ env.AWS_REGION }}
secret-ids: |
DEV_INDEXER_V2
DEV_OPERATOR_V2
COMMON
parse-json-secrets: true # to be able to get the json k/v pairs

- name: Login to ECR
id: login-ecr
uses: aws-actions/amazon-ecr-login@v1

- name: Checkout the code
uses: actions/checkout@v4

# This is a separate action that sets up buildx runner
- name: Set up Docker Buildx
id: buildx
uses: docker/setup-buildx-action@v2

# So now you can use Actions' own caching!
- name: Cache Docker layers
uses: actions/cache@v2
with:
path: /tmp/.buildx-cache
key: ${{ runner.os }}-single-buildx-${{ github.sha }}
restore-keys: |
${{ runner.os }}-single-buildx
# And make it available for builds
- name: Build image
uses: docker/build-push-action@v2
with:
context: .
builder: ${{ steps.buildx.outputs.name }}
file: Dockerfile
build-args: AWS_ECR_URL=${{ steps.login-ecr.outputs.registry }}
platforms: linux/amd64
tags: ${{ steps.login-ecr.outputs.registry }}/${{ env.ECR_REPOSITORY }}:${{ env.IMAGE_TAG }}
cache-from: type=local,src=/tmp/.buildx-cache
cache-to: type=local,dest=/tmp/.buildx-cache-new
push: true # set false to deactivate the push to ECR

# This ugly bit is necessary if you don't want your cache to grow forever until it hits GitHub's limit of 5GB.
# https://github.com/docker/build-push-action/issues/252 & https://github.com/moby/buildkit/issues/1896
- name: Move cache
shell: bash
run: |
rm -rf /tmp/.buildx-cache
mv /tmp/.buildx-cache-new /tmp/.buildx-cache
- name: Configure AWS creds to access EKS
# TIP: the deployment user must be in the masters group in the aws-auth config map in the cluster
uses: aws-actions/configure-aws-credentials@v1
with:
aws-access-key-id: ${{ env.AWS_KEY_ID }} #notice: unique for each env
aws-secret-access-key: ${{ env.AWS_ACCESS_KEY }} #notice: unique for each env
aws-region: ${{ env.AWS_REGION }}

# NOTICE: --- INDEXER ---
- name: Pull the holograph-indexer helm chart version x.x.x from ECR
shell: bash
env:
CHART_REPO: holo-indexer
CHART_VERSION: ${{ env.STG_HOLOGRAPH_INDEXER_HELM_CHART_VERSION }}
ECR_REGISTRY: ${{ steps.login-ecr.outputs.registry }}
run: |
helm pull oci://$ECR_REGISTRY/$CHART_REPO --version $CHART_VERSION
# NOTICE: --- OPERATOR ---
- name: Pull the holograph-operator helm chart version x.x.x from ECR
shell: bash
env:
CHART_REPO: holo-operator
CHART_VERSION: ${{ env.STG_HOLOGRAPH_OPERATOR_HELM_CHART_VERSION }}
ECR_REGISTRY: ${{ steps.login-ecr.outputs.registry }}
run: |
helm pull oci://$ECR_REGISTRY/$CHART_REPO --version $CHART_VERSION
Loading

0 comments on commit 19138f8

Please sign in to comment.