config

package
v0.0.2 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 23, 2022 License: MIT Imports: 6 Imported by: 0

Documentation

Overview

Package config defines the config for the project

Index

Constants

This section is empty.

Variables

View Source
var CrazedLevelMappings = map[int]string{
	0: "Mixed",
	1: "Indifferent",
	2: "Curious",
	3: "Interested",
	4: "Obsessed",
	5: "Manic",
}

CrazedLevelMappings maps the crazed level to the adjectives

Functions

func ReadConfig

func ReadConfig() error

ReadConfig reads in the project config in from env vars

Types

type Config

type Config struct {
	HTTP    string `envconfig:"http_url" default:"http://localhost:8545"` // HTTP URL of the chain
	WS      string `envconfig:"ws_url" default:"ws://localhost:8546"`     // Websocket URL of the chain
	ChainID uint64 `envconfig:"chain_id" default:"1337"`                  // ID of the chain
	// Funding Key is the main key to fund fans from. Default is the default used by geth, hardhat, ganache, etc...
	FundingKey        string            `envconfig:"funding_key" default:"ac0974bec39a17e36ba4a6b4d238ff944bacb478cbed5efcae784d7bf4f2ff80"`
	CrazedLevel       int               `envconfig:"crazed_level" default:"0"` // Crazed level for the fans
	FundingPrivateKey *ecdsa.PrivateKey `ignored:"true"`                       // Transformed private key
	BigChainID        *big.Int          `ignored:"true"`                       // ChainID in big.Int format
}

Config details the config for the project

var Current *Config

Current holds the current project's config

func (*Config) GetCrazedLevel

func (c *Config) GetCrazedLevel() int

GetCrazedLevel retrieves the current crazed level, processing Mixed if necessary

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL