Skip to content

[Feature 04] Multi-Chain Configuration #23

@onlyhyde

Description

@onlyhyde

Overview

Support multiple EVM chains through configuration file. Manage signers per chain.

Implementation Details

Files:

  • config/config.toml - Configuration file
  • internal/config/config.go - Config loading
  • internal/signer/manager.go - Signer manager

Configuration Format (TOML)

[server]
address = ":9090"

[[chains]]
network = "eip155:8453"      # Base Mainnet
rpcUrl = "https://mainnet.base.org"
privateKey = "${BASE_MAINNET_PRIVATE_KEY}"

[[chains]]
network = "eip155:84532"     # Base Sepolia
rpcUrl = "https://sepolia.base.org"
privateKey = "${BASE_SEPOLIA_PRIVATE_KEY}"

SignerManager

type SignerManager struct {
    signers map[string]*EVMSigner  // network -> signer
}

func (m *SignerManager) GetSigner(network string) (*EVMSigner, bool)
func (m *SignerManager) SupportedNetworks() []string

Multi-Chain Facilitator

type Service struct {
    facilitator   *x402.Facilitator
    signerManager *SignerManager
}

Acceptance Criteria

  • TOML config parsing with environment variable substitution
  • SignerManager for multiple chains
  • Register facilitators per network with SDK
  • Network detection from PaymentRequirements
  • Tests for config loading
  • Tests for multi-chain routing

Dependencies

Branch

feature/multi-chain-config

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions