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
15 changes: 15 additions & 0 deletions .vscode/launch.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
{
// Use IntelliSense to learn about possible attributes.
// Hover to view descriptions of existing attributes.
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
"version": "0.2.0",
"configurations": [
{
"name": "Launch",
"type": "go",
"request": "launch",
"mode": "auto",
"program": "main.go"
}
]
}
2 changes: 1 addition & 1 deletion api/dbv1/jsonb_access_gate.go
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ func (gate *PurchaseGate) toFullPurchaseGate(cfg config.Config, userMap map[int3
}

// add network take last (after rounding error is distributed)
splitMap[cfg.StakingBridgeUsdcPayoutWallet] = int64(networkCut)
splitMap[cfg.SolanaConfig.StakingBridgeUsdcTokenAccount.String()] = int64(networkCut)
return &FullPurchaseGate{
Price: gate.Price,
Splits: splitMap,
Expand Down
44 changes: 22 additions & 22 deletions config/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,29 +10,27 @@ import (
)

type Config struct {
Env string
DbUrl string
Nodes []Node
DeadNodes []string
DelegatePrivateKey string
AxiomToken string
AxiomDataset string
PythonUpstreams []string
NetworkTakeRate float64
StakingBridgeUsdcPayoutWallet string
SolanaConfig SolanaConfig
AntiAbuseOracles []string
Rewards []rewards.Reward
Env string
DbUrl string
Nodes []Node
DeadNodes []string
DelegatePrivateKey string
AxiomToken string
AxiomDataset string
PythonUpstreams []string
NetworkTakeRate float64
SolanaConfig SolanaConfig
AntiAbuseOracles []string
Rewards []rewards.Reward
}

var Cfg = Config{
Env: os.Getenv("ENV"),
DbUrl: os.Getenv("discoveryDbUrl"),
DelegatePrivateKey: os.Getenv("delegatePrivateKey"),
AxiomToken: os.Getenv("axiomToken"),
AxiomDataset: os.Getenv("axiomDataset"),
NetworkTakeRate: 10,
StakingBridgeUsdcPayoutWallet: "7vGA3fcjvxa3A11MAxmyhFtYowPLLCNyvoxxgN3NN2Vf",
Env: os.Getenv("ENV"),
DbUrl: os.Getenv("discoveryDbUrl"),
DelegatePrivateKey: os.Getenv("delegatePrivateKey"),
AxiomToken: os.Getenv("axiomToken"),
AxiomDataset: os.Getenv("axiomDataset"),
NetworkTakeRate: 10,
}

func init() {
Expand All @@ -44,10 +42,12 @@ func init() {
case "development":
fallthrough
case "":
if Cfg.DelegatePrivateKey == "" {
// Dummy key
Cfg.DelegatePrivateKey = "13422b9affd75ff80f94f1ea394e6a6097830cb58cda2d3542f37464ecaee7df"
}
Cfg.AntiAbuseOracles = []string{"http://audius-protocol-discovery-provider-1"}
Cfg.Nodes = DevNodes
// Dummy key
Cfg.DelegatePrivateKey = "13422b9affd75ff80f94f1ea394e6a6097830cb58cda2d3542f37464ecaee7df"
Cfg.Rewards = core_config.MakeRewards(core_config.DevClaimAuthorities, core_config.DevRewardExtensions)
case "stage":
fallthrough
Expand Down
44 changes: 26 additions & 18 deletions config/solana_config.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,32 +22,37 @@ type SolanaConfig struct {
RewardManagerLookupTable solana.PublicKey

ClaimableTokensProgramID solana.PublicKey

StakingBridgeUsdcTokenAccount solana.PublicKey
}

const (
// Dev
DevSolanaRelay = "http://audius-protocol-discovery-provider-1/solana/relay"
DevMintAudio = "37RCjhgV1qGV2Q54EHFScdxZ22ydRMdKMtVgod47fDP3"
DevRewardManagerProgramID = "testLsJKtyABc9UXJF8JWFKf1YH4LmqCWBC42c6akPb"
DevRewardManagerState = "DJPzVothq58SmkpRb1ATn5ddN2Rpv1j2TcGvM3XsHf1c"
DevRewardManagerLookupTable = "GNHKVSmHvoRBt1JJCxz7RSMfzDQGDGhGEjmhHyxb3K5J"
DevClaimableTokensProgramID = "testHKV1B56fbvop4w6f2cTGEub9dRQ2Euta5VmqdX9"
DevSolanaRelay = "http://audius-protocol-discovery-provider-1/solana/relay"
DevMintAudio = "37RCjhgV1qGV2Q54EHFScdxZ22ydRMdKMtVgod47fDP3"
DevRewardManagerProgramID = "testLsJKtyABc9UXJF8JWFKf1YH4LmqCWBC42c6akPb"
DevRewardManagerState = "DJPzVothq58SmkpRb1ATn5ddN2Rpv1j2TcGvM3XsHf1c"
DevRewardManagerLookupTable = "GNHKVSmHvoRBt1JJCxz7RSMfzDQGDGhGEjmhHyxb3K5J"
DevClaimableTokensProgramID = "testHKV1B56fbvop4w6f2cTGEub9dRQ2Euta5VmqdX9"
DevStakingBridgeUsdcTokenAccount = "GKvndGv2CoKgKQ17GUtFSc7KrFonYxhfbWeczS29MbpP"

// Stage
StageSolanaRelay = "https://discoveryprovider.staging.audius.co/solana/relay"
StageMintAudio = "BELGiMZQ34SDE6x2FUaML2UHDAgBLS64xvhXjX5tBBZo"
StageRewardManagerProgramID = "CDpzvz7DfgbF95jSSCHLX3ERkugyfgn9Fw8ypNZ1hfXp"
StageRewardManagerState = "GaiG9LDYHfZGqeNaoGRzFEnLiwUT7WiC6sA6FDJX9ZPq"
StageRewardManagerLookupTable = "ChFCWjeFxM6SRySTfT46zXn2K7m89TJsft4HWzEtkB4J"
StageClaimableTokensProgramID = "2sjQNmUfkV6yKKi4dPR8gWRgtyma5aiymE3aXL2RAZww"
StageSolanaRelay = "https://discoveryprovider.staging.audius.co/solana/relay"
StageMintAudio = "BELGiMZQ34SDE6x2FUaML2UHDAgBLS64xvhXjX5tBBZo"
StageRewardManagerProgramID = "CDpzvz7DfgbF95jSSCHLX3ERkugyfgn9Fw8ypNZ1hfXp"
StageRewardManagerState = "GaiG9LDYHfZGqeNaoGRzFEnLiwUT7WiC6sA6FDJX9ZPq"
StageRewardManagerLookupTable = "ChFCWjeFxM6SRySTfT46zXn2K7m89TJsft4HWzEtkB4J"
StageClaimableTokensProgramID = "2sjQNmUfkV6yKKi4dPR8gWRgtyma5aiymE3aXL2RAZww"
StageStakingBridgeUsdcTokenAccount = "GKvndGv2CoKgKQ17GUtFSc7KrFonYxhfbWeczS29MbpP"

// Prod
ProdSolanaRelay = "https://discoveryprovider.audius.co/solana/relay"
ProdMintAudio = "9LzCMqDgTKYz9Drzqnpgee3SGa89up3a247ypMj2xrqM"
ProdRewardManagerProgramID = "DDZDcYdQFEMwcu2Mwo75yGFjJ1mUQyyXLWzhZLEVFcei"
ProdRewardManagerState = "71hWFVYokLaN1PNYzTAWi13EfJ7Xt9VbSWUKsXUT8mxE"
ProdRewardManagerLookupTable = "4UQwpGupH66RgQrWRqmPM9Two6VJEE68VZ7GeqZ3mvVv"
ProdClaimableTokensProgramID = "Ewkv3JahEFRKkcJmpoKB7pXbnUHwjAyXiwEo4ZY2rezQ"
ProdSolanaRelay = "https://discoveryprovider.audius.co/solana/relay"
ProdMintAudio = "9LzCMqDgTKYz9Drzqnpgee3SGa89up3a247ypMj2xrqM"
ProdRewardManagerProgramID = "DDZDcYdQFEMwcu2Mwo75yGFjJ1mUQyyXLWzhZLEVFcei"
ProdRewardManagerState = "71hWFVYokLaN1PNYzTAWi13EfJ7Xt9VbSWUKsXUT8mxE"
ProdRewardManagerLookupTable = "4UQwpGupH66RgQrWRqmPM9Two6VJEE68VZ7GeqZ3mvVv"
ProdClaimableTokensProgramID = "Ewkv3JahEFRKkcJmpoKB7pXbnUHwjAyXiwEo4ZY2rezQ"
ProdStakingBridgeUsdcTokenAccount = "7vGA3fcjvxa3A11MAxmyhFtYowPLLCNyvoxxgN3NN2Vf"
)

func NewSolanaConfig() SolanaConfig {
Expand Down Expand Up @@ -80,6 +85,7 @@ func NewSolanaConfig() SolanaConfig {
cfg.RewardManagerState = solana.MustPublicKeyFromBase58(DevRewardManagerState)
cfg.RewardManagerLookupTable = solana.MustPublicKeyFromBase58(DevRewardManagerLookupTable)
cfg.ClaimableTokensProgramID = solana.MustPublicKeyFromBase58(DevClaimableTokensProgramID)
cfg.StakingBridgeUsdcTokenAccount = solana.MustPublicKeyFromBase58(DevStakingBridgeUsdcTokenAccount)
case "stage":
fallthrough
case "staging":
Expand All @@ -89,6 +95,7 @@ func NewSolanaConfig() SolanaConfig {
cfg.RewardManagerState = solana.MustPublicKeyFromBase58(StageRewardManagerState)
cfg.RewardManagerLookupTable = solana.MustPublicKeyFromBase58(StageRewardManagerLookupTable)
cfg.ClaimableTokensProgramID = solana.MustPublicKeyFromBase58(StageClaimableTokensProgramID)
cfg.StakingBridgeUsdcTokenAccount = solana.MustPublicKeyFromBase58(StageStakingBridgeUsdcTokenAccount)
case "prod":
fallthrough
case "production":
Expand All @@ -98,6 +105,7 @@ func NewSolanaConfig() SolanaConfig {
cfg.RewardManagerState = solana.MustPublicKeyFromBase58(ProdRewardManagerState)
cfg.RewardManagerLookupTable = solana.MustPublicKeyFromBase58(ProdRewardManagerLookupTable)
cfg.ClaimableTokensProgramID = solana.MustPublicKeyFromBase58(ProdClaimableTokensProgramID)
cfg.StakingBridgeUsdcTokenAccount = solana.MustPublicKeyFromBase58(ProdStakingBridgeUsdcTokenAccount)
default:
log.Fatalf("Unknown environment: %s", env)
}
Expand Down
46 changes: 46 additions & 0 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -28,26 +28,55 @@ require (

require (
filippo.io/edwards25519 v1.0.0-rc.1 // indirect
github.com/DataDog/zstd v1.5.2 // indirect
github.com/andres-erbsen/clock v0.0.0-20160526145045-9e14626cd129 // indirect
github.com/andybalholm/brotli v1.1.1 // indirect
github.com/asaskevich/govalidator v0.0.0-20230301143203-a9d515a09cc2 // indirect
github.com/beorn7/perks v1.0.1 // indirect
github.com/blendle/zapdriver v1.3.1 // indirect
github.com/buger/jsonparser v1.1.1 // indirect
github.com/cenkalti/backoff/v4 v4.3.0 // indirect
github.com/cespare/xxhash/v2 v2.3.0 // indirect
github.com/cockroachdb/errors v1.11.3 // indirect
github.com/cockroachdb/fifo v0.0.0-20240606204812-0bbfbd93a7ce // indirect
github.com/cockroachdb/logtags v0.0.0-20230118201751-21c54148d20b // indirect
github.com/cockroachdb/pebble v1.1.2 // indirect
github.com/cockroachdb/redact v1.1.5 // indirect
github.com/cockroachdb/tokenbucket v0.0.0-20230807174530-cc333fc44b06 // indirect
github.com/cometbft/cometbft v1.0.1 // indirect
github.com/cometbft/cometbft-db v1.0.1 // indirect
github.com/cometbft/cometbft/api v1.0.0 // indirect
github.com/cosmos/gogoproto v1.7.0 // indirect
github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc // indirect
github.com/decred/dcrd/dcrec/secp256k1/v4 v4.4.0 // indirect
github.com/dgraph-io/badger/v4 v4.5.1 // indirect
github.com/dgraph-io/ristretto/v2 v2.1.0 // indirect
github.com/dolthub/maphash v0.1.0 // indirect
github.com/dustin/go-humanize v1.0.1 // indirect
github.com/fatih/color v1.18.0 // indirect
github.com/felixge/httpsnoop v1.0.4 // indirect
github.com/gagliardetto/treeout v0.1.4 // indirect
github.com/gammazero/deque v1.0.0 // indirect
github.com/getsentry/sentry-go v0.27.0 // indirect
github.com/go-kit/log v0.2.1 // indirect
github.com/go-logfmt/logfmt v0.6.0 // indirect
github.com/go-logr/logr v1.4.2 // indirect
github.com/go-logr/stdr v1.2.2 // indirect
github.com/go-openapi/analysis v0.23.0 // indirect
github.com/go-openapi/errors v0.22.0 // indirect
github.com/go-openapi/jsonpointer v0.21.0 // indirect
github.com/go-openapi/jsonreference v0.21.0 // indirect
github.com/go-openapi/loads v0.22.0 // indirect
github.com/go-openapi/spec v0.21.0 // indirect
github.com/go-openapi/strfmt v0.23.0 // indirect
github.com/go-openapi/swag v0.23.0 // indirect
github.com/go-openapi/validate v0.24.0 // indirect
github.com/gogo/protobuf v1.3.2 // indirect
github.com/golang/groupcache v0.0.0-20210331224755-41bb18bfe9da // indirect
github.com/golang/protobuf v1.5.4 // indirect
github.com/golang/snappy v0.0.5-0.20220116011046-fa5810519dcb // indirect
github.com/google/btree v1.1.3 // indirect
github.com/google/flatbuffers v24.12.23+incompatible // indirect
github.com/google/go-cmp v0.7.0 // indirect
github.com/google/go-querystring v1.1.0 // indirect
github.com/google/uuid v1.6.0 // indirect
Expand All @@ -59,30 +88,46 @@ require (
github.com/jackc/pgpassfile v1.0.0 // indirect
github.com/jackc/pgservicefile v0.0.0-20240606120523-5a60cdf6a761 // indirect
github.com/jackc/puddle/v2 v2.2.2 // indirect
github.com/jmhodges/levigo v1.0.0 // indirect
github.com/josharian/intern v1.0.0 // indirect
github.com/json-iterator/go v1.1.12 // indirect
github.com/klauspost/compress v1.18.0 // indirect
github.com/kr/pretty v0.3.1 // indirect
github.com/kr/text v0.2.0 // indirect
github.com/linxGnu/grocksdb v1.9.3 // indirect
github.com/logrusorgru/aurora v2.0.3+incompatible // indirect
github.com/mailru/easyjson v0.7.7 // indirect
github.com/mattn/go-colorable v0.1.14 // indirect
github.com/mattn/go-isatty v0.0.20 // indirect
github.com/mattn/go-runewidth v0.0.16 // indirect
github.com/mitchellh/go-testing-interface v1.14.1 // indirect
github.com/mitchellh/mapstructure v1.5.1-0.20231216201459-8508981c8b6c // indirect
github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd // indirect
github.com/modern-go/reflect2 v1.0.2 // indirect
github.com/mostynb/zstdpool-freelist v0.0.0-20201229113212-927304c0c3b1 // indirect
github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822 // indirect
github.com/oasisprotocol/curve25519-voi v0.0.0-20230904125328-1f23a7beb09a // indirect
github.com/oklog/ulid v1.3.1 // indirect
github.com/petermattis/goid v0.0.0-20250319124200-ccd6737f222a // indirect
github.com/pkg/errors v0.9.1 // indirect
github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2 // indirect
github.com/prometheus/client_golang v1.20.5 // indirect
github.com/prometheus/client_model v0.6.1 // indirect
github.com/prometheus/common v0.62.0 // indirect
github.com/prometheus/procfs v0.15.1 // indirect
github.com/rivo/uniseg v0.4.7 // indirect
github.com/rogpeppe/go-internal v1.14.1 // indirect
github.com/sasha-s/go-deadlock v0.3.5 // indirect
github.com/segmentio/asm v1.2.0 // indirect
github.com/streamingfast/logging v0.0.0-20230608130331-f22c91403091 // indirect
github.com/supranational/blst v0.3.14 // indirect
github.com/syndtr/goleveldb v1.0.1-0.20210819022825-2ae1ddf74ef7 // indirect
github.com/tidwall/match v1.1.1 // indirect
github.com/tidwall/pretty v1.2.1 // indirect
github.com/valyala/bytebufferpool v1.0.0 // indirect
go.etcd.io/bbolt v1.4.0-alpha.0.0.20240404170359-43604f3112c5 // indirect
go.mongodb.org/mongo-driver v1.14.0 // indirect
go.opencensus.io v0.24.0 // indirect
go.opentelemetry.io/auto/sdk v1.1.0 // indirect
go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.59.0 // indirect
go.opentelemetry.io/otel v1.34.0 // indirect
Expand All @@ -91,6 +136,7 @@ require (
go.uber.org/multierr v1.11.0 // indirect
go.uber.org/ratelimit v0.2.0 // indirect
golang.org/x/crypto v0.37.0 // indirect
golang.org/x/exp v0.0.0-20240909161429-701f63a606c0 // indirect
golang.org/x/net v0.39.0 // indirect
golang.org/x/sys v0.32.0 // indirect
golang.org/x/term v0.31.0 // indirect
Expand Down
Loading