Documentation
¶
Index ¶
- Constants
- Variables
- func AudioRewardsManagerPubkey() string
- func DefaultEthRPC() string
- func DefaultRegistryAddress() string
- func ForwardChainIDRequired(chainID string) bool
- func GetDbURL() string
- func GetEnvWithDefault(key, defaultValue string) stringdeprecated
- func GetEthRPC() string
- func GetLogLevel() string
- func GetProtocolDashboardURL() string
- func GetRegistryAddress() string
- func GetRuntimeEnvironment() string
- func MakeRewards(claimAuthorities []rewards.ClaimAuthority, rewardExtensions []rewards.Reward) []rewards.Reward
- type Config
- type RollupInterval
- type Rules
- type SandboxVars
- type StateSyncConfig
- type UpgradeSchedule
Constants ¶
const ( ProdRegistryAddress = "0xd976d3b4f4e22a238c1A736b6612D22f17b6f64C" StageRegistryAddress = "0xc682C2166E11690B64338e11633Cb8Bb60B0D9c0" DevRegistryAddress = "0xABbfF712977dB51f9f212B85e8A4904c818C2b63" ProdAcdcAddress = "0x1Cd8a543596D499B9b6E7a6eC15ECd2B7857Fd64" StageAcdcAddress = "0x1Cd8a543596D499B9b6E7a6eC15ECd2B7857Fd64" DevAcdcAddress = "0x254dffcd3277C0b1660F6d42EFbB754edaBAbC2B" ProdAcdcChainID = 31524 StageAcdcChainID = 1056801 DevAcdcChainID = 1337 ProdEthRpc = "https://eth-validator.audius.co" StageEthRpc = "https://eth-validator.staging.audius.co" DevEthRpc = "http://eth-ganache:8545" DbURL = "postgresql://postgres:postgres@localhost:5432/openaudio" ProdDashboardURL = "https://dashboard.audius.org" StageDashboardURL = "https://dashboard.staging.audius.org" DevDashboardURL = "http://localhost" DefaultCoreRootDir = "/data/core" DefaultStateSyncSnapshotMinFreeBytes int64 = 80 * 1024 * 1024 * 1024 // 80 GiB )
const ( // Mainnet bootstrap peers. Keep this broad: every validator starts from this // list before PEX fills the address book, so a stale or tiny list becomes a // consensus-gossip availability risk. ProdPersistentPeers = "326d405aba6eab9df677ddf62d1331638e99da91@34.71.91.82:26656," + "edf0b62f900c6319fdb482b0379b91b8a3c0d773@104.154.119.194:26656," + "0b6bade75a38b6e7468d795dfdc7b2cf9f717255@val003.open-audio-validator.com:26656," + "0c196c272a34ad51ab563253234e71b664b309da@val007.open-audio-validator.com:26656," + "12abeaff908616575cec416af2c79c540bee63e1@audius-creator-4.theblueprint.xyz:26656," + "1375316fb25560f97bf7cf6e02cede670d840618@audius-creator-7.theblueprint.xyz:26656," + "13bcf9b4c1df378f4d2de4fb8801cabfa0a01a11@audius-creator-8.theblueprint.xyz:26656," + "29156c622bd3e4183c3994a435da878c0cdc9fa6@val016.open-audio-validator.com:26656," + "29d7892d176fb6f6a3740fdb753a618c612b9f0b@val011.open-audio-validator.com:26656," + "2ec3f5d35b751db7c38d008f965cc268a139a15d@audius-content-2.figment.io:26656," + "32b088725b4b82c3604cd05dc1f5ea3c8c09c5ba@audius-creator-5.theblueprint.xyz:26656," + "3317946736f9e99c01bcfeeccd44c41b0d53caee@val005.open-audio-validator.com:26656," + "33623aa633af52ef4d692320de0d22d1897fbbb9@audius-figment-1-validator-19.figment.io:26656," + "34df66133ab8e1e761d1e5a60c7453683dcb0ba7@audius-creator-9.theblueprint.xyz:26656," + "3714f1a5753d776e628be0524897be5a962db97e@audius-creator-6.theblueprint.xyz:26656," + "3bd77cde0aa19b7d0370c1b4d0d26cde8ac38aa9@audius-creator-3.theblueprint.xyz:26656," + "4868de2a01f29367796063cd87ed8d93b9866d84@val010.open-audio-validator.com:26656," + "4a1e3fd9a5a1c982b0c7372abb80305b5b4cceee@audius-creator-11.theblueprint.xyz:26656," + "51fc74a91a1daef3834e3028e3592d03633c44ed@audius-creator-15.theblueprint.xyz:26656," + "568224b2a1957bf45d9ce6835b9bbf346d0e7424@audius-creator-14.theblueprint.xyz:26656," + "59f72f7f31155f850181fea0c525073c74b93741@audius-content-3.figment.io:26656," + "5cba61b158b3b23705d859ddc98150a1ccb79b1d@cn1.shakespearetech.com:26656," + "61cc1a7db1c91fd0ff9c3670cf5e03939fa53a78@val002.open-audio-validator.com:26656," + "6210e9689aa8b3539b2191ea44879dbca7ca6691@audius-creator-17.theblueprint.xyz:26656" StagePersistentPeers = "" /* 362-byte string literal not displayed */ DevPersistentPeers = "ffad25668e060a357bbe534c8b7e5b4e1274368b@openaudio-1:26656" )
const ( ProdStateSyncRpcs = "https://creatornode.audius.co,https://rpc.audius.co,https://v.monophonic.digital" StageStateSyncRpcs = "https://creatornode11.audius.co,https://creatornode5.audius.co" )
const CometRPCSocket = "/tmp/cometbft.rpc.sock"
const PrivilegedServiceSocket = "/tmp/cometbft.privileged.sock"
const PrivilegedServiceSocketURI = "unix://" + PrivilegedServiceSocket
Variables ¶
var ( DevAudioRewardsManagerPubkey = "DJPzVothq58SmkpRb1ATn5ddN2Rpv1j2TcGvM3XsHf1c" ProdAudioRewardsManagerPubkey = "71hWFVYokLaN1PNYzTAWi13EfJ7Xt9VbSWUKsXUT8mxE" )
Solana reward manager pubkeys for the AUDIO mint, per environment. Used as a denylist by validateCreateRewardPool: pools cannot be created for the AUDIO RM, so AUDIO sender attestations stay on the network-wide validator/AAO trust set rather than shifting to pool- controlled authorities. Empty values disable the denylist for that environment.
var ( DevClaimAuthorities = []rewards.ClaimAuthority{ { Address: "0xfc3916B97489d2eFD81DDFDf11bad8E33ad5b87a", Name: "Audius", }, } StageClaimAuthorities = []rewards.ClaimAuthority{ { Address: "0xDC2BDF1F23381CA2eC9e9c70D4FD96CD8645D090", Name: "Audius", }, } ProdClaimAuthorities = []rewards.ClaimAuthority{ { Address: "0xc8d0C29B6d540295e8fc8ac72456F2f4D41088c8", Name: "Audius", }, } )
var ( // BaseRewards contains all rewards that are common across all environments BaseRewards = []rewards.Reward{ { Amount: 1, RewardId: "p", Name: "profile completion", }, { Amount: 1, RewardId: "e", Name: "endless listen streak", }, { Amount: 1, RewardId: "u", Name: "upload tracks", }, { Amount: 1, RewardId: "r", Name: "referrals", }, { Amount: 1, RewardId: "rv", Name: "referrals verified", }, { Amount: 1, RewardId: "rd", Name: "referred", }, { Amount: 5, RewardId: "v", Name: "verified", }, { Amount: 1, RewardId: "m", Name: "mobile install", }, { Amount: 1000, RewardId: "tt", Name: "trending tracks", }, { Amount: 1000, RewardId: "tut", Name: "trending underground", }, { Amount: 100, RewardId: "tp", Name: "trending playlist", }, { Amount: 2, RewardId: "ft", Name: "first tip", }, { Amount: 2, RewardId: "fp", Name: "first playlist", }, { Amount: 5, RewardId: "b", Name: "audio match buyer", }, { Amount: 5, RewardId: "s", Name: "audio match seller", }, { Amount: 1, RewardId: "o", Name: "airdrop 2", }, { Amount: 1, RewardId: "c", Name: "first weekly comment", }, { Amount: 25, RewardId: "p1", Name: "play count milestone", }, { Amount: 100, RewardId: "p2", Name: "play count milestone", }, { Amount: 1000, RewardId: "p3", Name: "play count milestone", }, { Amount: 100, RewardId: "t", Name: "tastemaker", }, { Amount: 1000, RewardId: "dvl", Name: "daily volume leader", }, { Amount: 10, RewardId: "cp", Name: "comment pin", }, { Amount: 1000, RewardId: "cs", Name: "cosign challenge", }, { Amount: 1000, RewardId: "w", Name: "remix contest winner", }, } // Environment-specific reward extensions DevRewardExtensions = []rewards.Reward{} StageRewardExtensions = []rewards.Reward{} ProdRewardExtensions = []rewards.Reward{} )
var Version string
Functions ¶
func AudioRewardsManagerPubkey ¶ added in v1.2.13
func AudioRewardsManagerPubkey() string
AudioRewardsManagerPubkey returns the configured AUDIO RM pubkey for the current runtime environment, or "" if none is configured. Callers MUST treat "" as "no denylist enforcement."
func DefaultEthRPC ¶
func DefaultEthRPC() string
func DefaultRegistryAddress ¶
func DefaultRegistryAddress() string
func ForwardChainIDRequired ¶ added in v1.13.0
ForwardChainIDRequired reports whether ForwardTransaction on this chain refuses requests that carry no chain ID.
func GetEnvWithDefault
deprecated
func GetLogLevel ¶
func GetLogLevel() string
func GetProtocolDashboardURL ¶
func GetProtocolDashboardURL() string
func GetRegistryAddress ¶
func GetRegistryAddress() string
func GetRuntimeEnvironment ¶
func GetRuntimeEnvironment() string
func MakeRewards ¶
Types ¶
type Config ¶
type Config struct {
/* Comet Config */
RootDir string
RPCladdr string
P2PLaddr string
PSQLConn string
PersistentPeers string
Seeds string
ExternalAddress string
AddrBookStrict bool
MaxInboundPeers int
MaxOutboundPeers int
CometLogLevel string
RetainHeight int64
/* Audius Config */
Environment string
WalletAddress string
ProposerAddress string
GRPCladdr string
CoreServerAddr string
NodeEndpoint string
Archive bool
LogLevel string
/* Ethereum Config */
EthRPCUrl string
EthRegistryAddress string
/* System Config */
SlaRollupInterval int
ValidatorVotingPower int
ValidatorPurgeMinValidators int
ValidatorWardenIntervalMins int // how often the validator warden checks for underperformance (minutes)
UseHttpsForSdk bool
StateSync *StateSyncConfig
/* Entity Manager Config */
AcdcEntityManagerAddress string
AcdcChainID uint
/* Derived Config */
GenesisFile *types.GenesisDoc
Upgrades *UpgradeSchedule
EthereumKey *ecdsa.PrivateKey
CometKey *ed25519.PrivKey
Rewards []rewards.Reward
/* Attestation Thresholds */
AttRegistrationMin int // minimum number of attestations needed to register a new node
AttRegistrationRSize int // rendezvous size for registration attestations (should be >= to AttRegistrationMin)
AttDeregistrationMin int // minimum number of attestations needed to deregister a node
AttDeregistrationRSize int // rendezvous size for deregistration attestations (should be >= to AttDeregistrationMin)
/* Feature flags */
ProgrammableDistributionEnabled bool
SkipEthRegistration bool
EnableETL bool
EnableExplorer bool
EnableGRPCReflection bool
}
func ReadConfig ¶
func SetupNode ¶
Reads in config, sets up comet files, and cleans up state based on setup configuration.
- reads in env config - determines env - gathers chain id
func (*Config) ChainID ¶ added in v1.14.1
ChainID is the genesis chain ID, or "" before a genesis file is loaded. Signing payloads bind to it, so callers must refuse to sign when it is empty rather than fall back to an unbound domain.
func (*Config) NewSandboxVars ¶
func (c *Config) NewSandboxVars(env ...string) *SandboxVars
type RollupInterval ¶
type RollupInterval struct {
BlockInterval int
}
type Rules ¶ added in v1.9.0
type Rules struct {
AttestationDomainEnforced bool
AuthEnforced bool
ContentAuthEnforced bool
// ContentAuthStrict only means anything with ContentAuthEnforced.
ContentAuthStrict bool
// LegacyRegistrationClosed makes legacy validator registrations fail.
LegacyRegistrationClosed bool
}
Rules is the resolved rule set for a single height: a flat description of active behaviors with no heights in sight.
type SandboxVars ¶
type StateSyncConfig ¶
type StateSyncConfig struct {
// will periodically save pg_dumps to disk and serve them to other nodes
ServeSnapshots bool
// will download pg_dumps from other nodes on initial sync
Enable bool
// list of rpc endpoints to download pg_dumps from
RPCServers []string
// number of snapshots to keep on disk
Keep int
// interval to save snapshots in blocks
BlockInterval int64
// number of chunk fetchers to use
ChunkFetchers int32
// minimum free bytes required on the snapshot disk before creating snapshots
SnapshotMinFreeBytes int64
}
type UpgradeSchedule ¶ added in v1.9.0
type UpgradeSchedule struct {
AttestationDomainHeight int64
// AuthEnforcementHeight activates authorization enforcement for
// ManageEntity transactions: the signer must match the EIP-712 recovery
// and be authorized (own wallet or active approved grant) against the
// consensus auth state, or the transaction is rejected at the mempool and
// proposal stages. It also closes proposal-level submission of genesis
// migration transactions. Enforcement must not be scheduled on a
// persistent network earlier than the height its auth state began being
// tracked, or it will trust state built from unverified signers.
AuthEnforcementHeight int64
// ContentAuthEnforcementHeight activates content authorization: a
// FileUpload must carry a validator signature over the bound
// UploadAttestation rather than the legacy unbound per-cid signature, and
// a ManageEntity Track create/update may only assert cids that the
// consensus content-auth state records as belonging to the acting user.
//
// Must not be scheduled on a persistent network earlier than the height
// its content-auth state began being tracked, or tracks whose cids predate
// the projection become unwritable. The genesis rollover is the natural
// activation point: the migration replay seeds a cid for every track that
// exists.
ContentAuthEnforcementHeight int64
// ContentAuthStrictHeight closes the first-assertion window that
// ContentAuthEnforcementHeight opens. Between the two heights a cid nobody
// holds goes to whoever asserts it first; from this height a Track
// create/update may only assert cids the content-auth state already
// records as the acting user's, and a cid nobody holds is refused.
//
// The window exists for the genesis migration: the API flusher replays
// old-chain track writes naming cids nobody attested (old-chain storage
// never did, and the replay seeds only the snapshot's tracks) and stalls
// on the first refused row. It is not safe to leave open — the upload row
// is public while it transcodes and the attestation is visible in the
// mempool before it lands, so anyone who reads a cid there can take the
// claim by naming it first. Schedule strict as soon as the flusher has
// drained; never before, or it stalls.
ContentAuthStrictHeight int64
// LegacyRegistrationClosedHeight makes FinalizeBlock ignore legacy
// validator registrations: from this height one fails without writing a
// registered node or emitting a validator update. Live nodes register
// through attestations, and the mempool and proposal stages refuse
// legacy registrations on every network. Blocks before this height
// replay as they were applied, since their tx results are committed in
// the next block's header.
LegacyRegistrationClosedHeight int64
}
UpgradeSchedule is the activation-height table for one network. Each field names an upgrade and holds the first height at which it is active (0 = never).
func ScheduleForChainID ¶ added in v1.9.0
func ScheduleForChainID(chainID string) *UpgradeSchedule
ScheduleForChainID returns the upgrade schedule for a chain ID. Unknown chain IDs get an empty schedule — no upgrades active — so a fresh or test-only chain never picks up activations meant for another network.
func (*UpgradeSchedule) RulesetAt ¶ added in v1.9.0
func (u *UpgradeSchedule) RulesetAt(height int64) Rules
RulesetAt resolves the rules governing the given block height. A nil schedule (tests, unknown chains) resolves to no active upgrades.