Skip to content
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
14 changes: 9 additions & 5 deletions api/health_check.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ package api

import (
"context"
"slices"

core_indexer "api.audius.co/indexer"
"connectrpc.com/connect"
Expand Down Expand Up @@ -64,11 +65,14 @@ func (app *ApiServer) healthCheck(c *fiber.Ctx) error {

healthyNodes := app.contentNodeMonitor.GetContentNodes()
// Convert config.Node to contentNode
contentNodes := make([]contentNode, len(healthyNodes))
for i, node := range healthyNodes {
contentNodes[i] = contentNode{
DelegateOwnerWallet: node.DelegateOwnerWallet,
Endpoint: node.Endpoint,
contentNodes := make([]contentNode, 0, len(healthyNodes))
for _, node := range healthyNodes {
// icky reaching into config to check upload nodes
if slices.Contains(app.contentNodeMonitor.config.UploadNodes, node.Endpoint) {

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can't we just read Config directly here? Not sure why we need to grab it from the monitor.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

wdym? Like config.Cfg? I would like to avoid globals but maybe you're right

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah I meant config.Cfg. Harder to test for sure.
Alternatively, I have often wondered why we don't make the config available on the app instance itself....

contentNodes = append(contentNodes, contentNode{
DelegateOwnerWallet: node.DelegateOwnerWallet,
Endpoint: node.Endpoint,
})
}
}

Expand Down
4 changes: 4 additions & 0 deletions config/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ type Config struct {
ArtistCoinRewardsStaticSenders []Node
StoreAllNodes []string
DeadNodes []string
UploadNodes []string
VerifierAddress string
DelegatePrivateKey string
AxiomToken string
Expand Down Expand Up @@ -99,6 +100,7 @@ func init() {
Cfg.SolanaIndexerWorkers = 1
Cfg.DeadNodes = []string{}
Cfg.StoreAllNodes = []string{}
Cfg.UploadNodes = DevUploadNodes
Cfg.AudiusdChainID = core_config.DevAcdcChainID
Cfg.AudiusdEntityManagerAddress = core_config.DevAcdcAddress
Cfg.AudiusAppUrl = "http://localhost:3000"
Expand All @@ -112,6 +114,7 @@ func init() {
Cfg.Nodes = StageNodes
Cfg.DeadNodes = []string{}
Cfg.StoreAllNodes = []string{}
Cfg.UploadNodes = StageUploadNodes
Cfg.Rewards = core_config.MakeRewards(core_config.StageClaimAuthorities, core_config.StageRewardExtensions)
Cfg.AudiusdURL = "creatornode11.staging.audius.co"
Cfg.ChainId = "audius-testnet-alpha"
Expand Down Expand Up @@ -152,6 +155,7 @@ func init() {
Cfg.StoreAllNodes = []string{
"https://creatornode2.audius.co",
}
Cfg.UploadNodes = ProdUploadNodes
Cfg.Rewards = core_config.MakeRewards(core_config.ProdClaimAuthorities, core_config.ProdRewardExtensions)
Cfg.AudiusdURL = "creatornode.audius.co"
Cfg.ChainId = "audius-mainnet-alpha-beta"
Expand Down
12 changes: 12 additions & 0 deletions config/nodes.go
Original file line number Diff line number Diff line change
Expand Up @@ -184,4 +184,16 @@ var (
OwnerWallet: "0xCBB025e7933FADfc7C830AE520Fb2FD6D28c1065",
},
}

ProdUploadNodes = []string{

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

need input on what these should be

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

i think this is good for now

"https://creatornode.audius.co",
"https://creatornode2.audius.co",
"https://creatornode3.audius.co",
}
StageUploadNodes = []string{
"https://creatornode6.staging.audius.co",
}
DevUploadNodes = []string{
"http://audius-creator-node-1",
}
)