Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

INF-346 Fix & consolidate CN envvars for local dev for audius-compose #4614

Merged
merged 1 commit into from
Jan 13, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
75 changes: 75 additions & 0 deletions dev-tools/startup/creator-node.sh
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
#!/usr/bin/env sh

### Environment Variables

# Unique to each node

export delegateOwnerWallet=$(printenv "CN${replica}_SP_OWNER_ADDRESS")
export delegatePrivateKey=$(printenv "CN${replica}_SP_OWNER_PRIVATE_KEY")

Expand All @@ -8,6 +12,77 @@ export spID=$replica

export creatorNodeEndpoint="http://audius-protocol-creator-node-${replica}:4000"

# Constants

export logLevel="debug"
export devMode="true"
export creatorNodeIsDebug="true"
export debuggerPort=10000
export expressAppConcurrency=2

export identityService="http://identity-service:7000"

export rateLimitingAudiusUserReqLimit=3000
export rateLimitingUserReqLimit=3000
export rateLimitingMetadataReqLimit=3000
export rateLimitingImageReqLimit=6000
export rateLimitingTrackReqLimit=6000
export rateLimitingBatchCidsExistLimit=1
export maxAudioFileSizeBytes=250000000
export maxMemoryFileSizeBytes=50000000

export ethProviderUrl="http://eth-ganache:8545"
export ethTokenAddress="${ETH_TOKEN_ADDRESS}"
export ethRegistryAddress="${ETH_REGISTRY_ADDRESS}"
export ethOwnerWallet="${ETH_OWNER_WALLET}"
export dataProviderUrl="http://poa-ganache:8545"
export dataRegistryAddress="${POA_REGISTRY_ADDRESS}"

export storagePath=/file_storage
export port=4000
export redisPort=6379

# Sync / SnapbackSM configs
export stateMonitoringQueueRateLimitInterval=60000
export stateMonitoringQueueRateLimitJobsPerInterval=1
export snapbackModuloBase=3
export minimumDailySyncCount=5
export minimumRollingSyncCount=10
export minimumSuccessfulSyncCountPercentage=50
export snapbackHighestReconfigMode=PRIMARY_AND_OR_SECONDARIES
export secondaryUserSyncDailyFailureCountThreshold=100
export maxSyncMonitoringDurationInMs=10000 # 10sec
export skippedCIDsRetryQueueJobIntervalMs=30000 # 30sec in ms
export monitorStateJobLastSuccessfulRunDelayMs=600000 # 10min in ms
export findSyncRequestsJobLastSuccessfulRunDelayMs=600000 # 10min in ms
export findReplicaSetUpdatesJobLastSuccessfulRunDelayMs=600000 # 10min in ms
export fetchCNodeEndpointToSpIdMapIntervalMs=10000 #10sec in ms
export enforceWriteQuorum=true
export recoverOrphanedDataQueueRateLimitInterval=60000 #1min in ms
export recoverOrphanedDataQueueRateLimitJobsPerInterval=1
export mergePrimaryAndSecondaryEnabled=true
export maxNumberSecondsPrimaryRemainsUnhealthy=30
export maxNumberSecondsSecondaryRemainsUnhealthy=10

# peerSetManager
export peerHealthCheckRequestTimeout=2000 # ms
export minimumMemoryAvailable=2000000000 # bytes; 2gb
export maxFileDescriptorsAllocatedPercentage=95
export maxNumberSecondsPrimaryRemainsUnhealthy=5
export maxNumberSecondsSecondaryRemainsUnhealthy=5

# Number of missed blocks after which we would consider a discovery node unhealthy
export discoveryNodeUnhealthyBlockDiff=10

# Maximum number of wallets the /users/batch_clock_status route will accept at one time
export maxBatchClockStatusBatchSize=5

export entityManagerAddress="0x5b9b42d6e4B2e4Bf8d42Eba32D46918e10899B66"
export entityManagerReplicaSetEnabled="true"

# Premium content
export premiumContentEnabled="true"

cd ../audius-libs
npm link

Expand Down
25 changes: 0 additions & 25 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -377,31 +377,6 @@ services:
build: creator-node
command: sh -c ". /tmp/dev-tools/startup/startup.sh && scripts/start.sh"
env_file: .env # used by the startup script
environment:
logLevel: "debug"
devMode: "true"
creatorNodeIsDebug: "true"
debuggerPort: 10000

rateLimitingAudiusUserReqLimit: 3000
rateLimitingUserReqLimit: 3000
rateLimitingMetadataReqLimit: 3000
rateLimitingImageReqLimit: 6000
rateLimitingTrackReqLimit: 6000
rateLimitingBatchCidsExistLimit: 1
maxAudioFileSizeBytes: 250000000
maxMemoryFileSizeBytes: 50000000
expressAppConcurrency: 2

identityService: "http://identity-service:7000"

ethProviderUrl: "http://eth-ganache:8545"
ethTokenAddress: "${ETH_TOKEN_ADDRESS}"
ethRegistryAddress: "${ETH_REGISTRY_ADDRESS}"
ethOwnerWallet: "${ETH_OWNER_WALLET}"

dataProviderUrl: "http://poa-ganache:8545"
dataRegistryAddress: "${POA_REGISTRY_ADDRESS}"
volumes:
- ./creator-node/src:/usr/src/app/src
- audius-libs:/usr/src/audius-libs
Expand Down