Documentation
¶
Index ¶
- func GetEnvBool(key string, required bool, defaultValue bool) bool
- func GetEnvBytes(key string, required bool) []byte
- func GetEnvString(key string, required bool) string
- func GetEnvStringsArray(key string, required bool) []string
- func GetSecureBytesEnv(key string, required bool) *sbytes.SecureBytes
- func GetSecureStringEnv(key string, required bool) *sstring.SecureString
- type AppConfig
- type BlockchainConfig
- type Config
- type DBConfig
- type IPFSConfig
- type PeerConfig
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GetEnvBytes ¶
func GetEnvString ¶
func GetEnvStringsArray ¶
func GetSecureBytesEnv ¶
func GetSecureBytesEnv(key string, required bool) *sbytes.SecureBytes
func GetSecureStringEnv ¶
func GetSecureStringEnv(key string, required bool) *sstring.SecureString
Types ¶
type AppConfig ¶
type AppConfig struct {
// DirPath is the path to the directory where all files for this application are saved.
DirPath string
HMACSecret *sbytes.SecureBytes
AppSecret *sstring.SecureString
// HTTPAddress is the address and port that the HTTP JSON API server will listen on.
// Do not expose to the public!
HTTPAddress string
GeoLiteDBPath string
BannedCountries []string
}
AppConfig represents the configuration for the application. It contains settings for the directory path, HTTP address, and RPC address.
type BlockchainConfig ¶
type BlockchainConfig struct {
// ChainID is the unique ID for this blockchain instance.
ChainID uint16 `json:"chain_id"`
}
BlockchainConfig represents the configuration for the blockchain. It contains settings for the chain ID, transactions per block, difficulty, mining reward, gas price, and units of gas.
type Config ¶
type Config struct {
// Blockchain configuration.
Blockchain BlockchainConfig
// Application configuration.
App AppConfig
// Database configuration.
DB DBConfig
// Peer configuration.
Peer PeerConfig
// IPFS configuration.
IPFS IPFSConfig
}
Config represents the configuration for the application. It contains settings for the blockchain, application, database, and peer connections.
type DBConfig ¶
type DBConfig struct {
// DataDir is the location of the database files.
DataDir string
}
DBConfig represents the configuration for the database. It contains the location of the database files.
type IPFSConfig ¶
type PeerConfig ¶
type PeerConfig struct {
// ListenPort is the port that the peer will listen on.
ListenPort int
// KeyName is the name of the key used for encryption.
KeyName string
// RendezvousString is the string used for rendezvous connections.
RendezvousString string
// BootstrapPeers is a list of multiaddresses for bootstrap peers.
BootstrapPeers []maddr.Multiaddr
// ListenAddresses is a list of multiaddresses that the peer will listen on.
ListenAddresses []maddr.Multiaddr
}
PeerConfig represents the configuration for peer connections. It contains settings for the listen port, key name, rendezvous string, bootstrap peers, and listen addresses.