11package geyser
22
33import (
4+ "context"
5+ "strings"
46 "time"
57
68 "github.com/code-payments/code-server/pkg/config"
@@ -22,8 +24,8 @@ const (
2224 ProgramUpdateQueueSizeConfigEnvName = envConfigPrefix + "PROGRAM_UPDATE_QUEUE_SIZE"
2325 defaultProgramUpdateQueueSize = 1_000_000
2426
25- VmAccountConfigEnvName = envConfigPrefix + "VM_ACCOUNT "
26- defaultVmAccount = ""
27+ VmAccountsConfigEnvName = envConfigPrefix + "VM_ACCOUNTS "
28+ defaultVmAccounts = ""
2729
2830 MemoryAccountBackupWorkerIntervalConfigEnvName = envConfigPrefix + "MEMORY_ACCOUNT_BACKUP_WORKER_INTERVAL"
2931 defaultMemoryAccountBackupWorkerInterval = time .Minute
@@ -36,7 +38,7 @@ type conf struct {
3638 programUpdateWorkerCount config.Uint64
3739 programUpdateQueueSize config.Uint64
3840
39- vmAccount config.String
41+ vmAccounts config.String
4042
4143 memoryAccountBackkupWorkerInterval config.Duration
4244}
@@ -54,9 +56,17 @@ func WithEnvConfigs() ConfigProvider {
5456 programUpdateWorkerCount : env .NewUint64Config (ProgramUpdateWorkerCountConfigEnvName , defaultProgramUpdateWorkerCount ),
5557 programUpdateQueueSize : env .NewUint64Config (ProgramUpdateQueueSizeConfigEnvName , defaultProgramUpdateQueueSize ),
5658
57- vmAccount : env .NewStringConfig (VmAccountConfigEnvName , defaultVmAccount ),
59+ vmAccounts : env .NewStringConfig (VmAccountsConfigEnvName , defaultVmAccounts ),
5860
5961 memoryAccountBackkupWorkerInterval : env .NewDurationConfig (MemoryAccountBackupWorkerIntervalConfigEnvName , defaultMemoryAccountBackupWorkerInterval ),
6062 }
6163 }
6264}
65+
66+ func parseVmAccountsConfig (ctx context.Context , c * conf ) []string {
67+ parts := strings .Split (c .vmAccounts .Get (ctx ), "," )
68+ for i , part := range parts {
69+ parts [i ] = strings .TrimSpace (part )
70+ }
71+ return parts
72+ }
0 commit comments