autonomys / astral

Home of our Block Explorer
https://explorer.subspace.network
11 stars 9 forks source link

Simplify docker setup #919

Closed marc-aurele-besner closed 1 week ago

marc-aurele-besner commented 1 week ago

User description

Simplify docker setup


PR Type

enhancement, configuration changes


Description


Changes walkthrough πŸ“

Relevant files
Configuration changes
7 files
project.ts
Update environment variable names for network configuration

indexers/taurus/consensus/project.ts
  • Updated environment variable names for chain ID and RPC URLs.
  • Changed dictionary URL environment variable.
  • +3/-3     
    project.ts
    Update environment variable names for network configuration

    indexers/taurus/leaderboard/project.ts
  • Updated environment variable names for chain ID and RPC URLs.
  • Changed dictionary URL environment variable.
  • +3/-3     
    project.ts
    Update environment variable names for network configuration

    indexers/taurus/staking/project.ts
  • Updated environment variable names for chain ID and RPC URLs.
  • Changed dictionary URL environment variable.
  • +3/-3     
    .env
    Simplify and consolidate environment variables                     

    .env
  • Added NETWORK_ID environment variable.
  • Consolidated RPC URLs and chain ID into single variables.
  • Removed specific network database and RPC configurations.
  • +7/-17   
    docker-compose.yml
    Simplify and consolidate Docker Compose configurations     

    docker-compose.yml
  • Made network ID dynamic using environment variable.
  • Consolidated dictionary and subquery node configurations.
  • Removed specific network configurations for Taurus and Gemini.
  • +44/-271
    init-db.sql
    Simplify database initialization script                                   

    indexers/db/docker-entrypoint-initdb.d/init-db.sql
  • Removed creation of specific network databases.
  • Ensured extension creation in the default database.
  • +1/-14   
    databases.yaml
    Remove specific network database configurations                   

    indexers/db/metadata/databases/databases.yaml - Removed specific network database configurations.
    +0/-9     
    Enhancement
    8 files
    consensus_account_histories.yaml
    Add table configuration for account histories                       

    indexers/db/metadata/databases/default/tables/consensus_account_histories.yaml - Added new table configuration for `account_histories`.
    +36/-1   
    consensus_account_profiles.yaml
    Add table configuration for account profiles                         

    indexers/db/metadata/databases/default/tables/consensus_account_profiles.yaml - Added new table configuration for `account_profiles`.
    +45/-1   
    consensus_account_rewards.yaml
    Add table configuration for account rewards                           

    indexers/db/metadata/databases/default/tables/consensus_account_rewards.yaml - Added new table configuration for `account_rewards`.
    +40/-1   
    consensus_accounts.yaml
    Add table configuration for accounts                                         

    indexers/db/metadata/databases/default/tables/consensus_accounts.yaml - Added new table configuration for `accounts`.
    +56/-1   
    consensus_blocks.yaml
    Add table configuration for blocks                                             

    indexers/db/metadata/databases/default/tables/consensus_blocks.yaml - Added new table configuration for `blocks`.
    +62/-1   
    consensus_event_modules.yaml
    Add table configuration for event modules                               

    indexers/db/metadata/databases/default/tables/consensus_event_modules.yaml - Added new table configuration for `event_modules`.
    +43/-1   
    consensus_events.yaml
    Add table configuration for events                                             

    indexers/db/metadata/databases/default/tables/consensus_events.yaml - Added new table configuration for `events`.
    +62/-1   
    consensus_extrinsic_modules.yaml
    Add table configuration for extrinsic modules                       

    indexers/db/metadata/databases/default/tables/consensus_extrinsic_modules.yaml - Added new table configuration for `extrinsic_modules`.
    +43/-1   

    πŸ’‘ PR-Agent usage: Comment /help "your question" on any pull request to receive relevant information

    netlify[bot] commented 1 week ago

    Deploy Preview for dev-astral canceled.

    Name Link
    Latest commit b40a6a6af4464ac4e0d73fcd20e15b398d5e62b1
    Latest deploy log https://app.netlify.com/sites/dev-astral/deploys/672b982c1fa1470008dcd5dc
    github-actions[bot] commented 1 week ago

    PR Reviewer Guide πŸ”

    Here are some key observations to aid the review process:

    ⏱️ Estimated effort to review: 4 πŸ”΅πŸ”΅πŸ”΅πŸ”΅βšͺ
    πŸ§ͺ No relevant tests
    πŸ”’ No security concerns identified
    ⚑ Recommended focus areas for review

    Environment Variable Handling
    The use of non-null assertion operator '!' with environment variables (e.g., `process.env.CHAIN_ID!`) assumes the presence of these variables without handling potential undefined cases. This could lead to runtime errors if the environment variables are not set. Type Assertion
    Direct type assertion in `process.env.RPC_URLS!?.split(",") as string[] | string` could lead to incorrect type assignments if the environment variable format is not as expected. Proper parsing and validation of environment variables should be implemented. Dynamic Environment Variables
    The introduction of dynamic environment variables (e.g., `${NETWORK_ID}`) in Docker Compose configurations requires careful management to ensure they are correctly set in all environments to avoid service misconfiguration.
    github-actions[bot] commented 1 week ago

    PR Code Suggestions ✨

    No code suggestions found for the PR.