Documentation
      ¶
    
    
  
    
  
    Index ¶
- Constants
 - Variables
 - func DefaultEthRPC() string
 - func DefaultRegistryAddress() string
 - func GetDbURL() string
 - func GetEnvWithDefault(key, defaultValue string) string
 - 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 SandboxVars
 - type StateSyncConfig
 
Constants ¶
      View Source
      
  
    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" )
      View Source
      
  
    const ( ProdPersistentPeers = "" /* 484-byte string literal not displayed */ StagePersistentPeers = "" /* 362-byte string literal not displayed */ DevPersistentPeers = "ffad25668e060a357bbe534c8b7e5b4e1274368b@openaudio-1:26656" )
      View Source
      
  
    const ( ProdStateSyncRpcs = "https://creatornode.audius.co,https://creatornode2.audius.co" StageStateSyncRpcs = "https://creatornode11.audius.co,https://creatornode5.audius.co" )
      View Source
      
  
    const CometRPCSocket = "/tmp/cometbft.rpc.sock"
    
      View Source
      
  
const PrivilegedServiceSocket = "/tmp/cometbft.privileged.sock"
    Variables ¶
      View Source
      
  
    var ( DevClaimAuthorities = []rewards.ClaimAuthority{ { Address: "0xfc3916B97489d2eFD81DDFDf11bad8E33ad5b87a", Name: "Audius", }, } StageClaimAuthorities = []rewards.ClaimAuthority{ { Address: "0xDC2BDF1F23381CA2eC9e9c70D4FD96CD8645D090", Name: "Audius", }, } ProdClaimAuthorities = []rewards.ClaimAuthority{ { Address: "0xc8d0C29B6d540295e8fc8ac72456F2f4D41088c8", Name: "Audius", }, } )
      View Source
      
  
    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: 10000, RewardId: "dvl", Name: "daily volume leader", }, } // Environment-specific reward extensions DevRewardExtensions = []rewards.Reward{} StageRewardExtensions = []rewards.Reward{} ProdRewardExtensions = []rewards.Reward{} )
      View Source
      
  
var Version string
    Functions ¶
func DefaultEthRPC ¶
func DefaultEthRPC() string
func DefaultRegistryAddress ¶
func DefaultRegistryAddress() string
func GetEnvWithDefault ¶
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 */
	RunDownMigration     bool
	SlaRollupInterval    int
	ValidatorVotingPower int
	UseHttpsForSdk       bool
	StateSync *StateSyncConfig
	/* Entity Manager Config */
	AcdcEntityManagerAddress string
	AcdcChainID              uint
	/* Derived Config */
	GenesisFile *types.GenesisDoc
	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
}
    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) NewSandboxVars ¶
func (c *Config) NewSandboxVars(env ...string) *SandboxVars
func (*Config) RunDownMigrations ¶
type RollupInterval ¶
type RollupInterval struct {
	BlockInterval int
}
    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
}
     Click to show internal directories. 
   Click to hide internal directories.