Documentation ¶
Index ¶
- Constants
- Variables
- func InitConfig(path string) error
- func Initialize(repoRoot string) error
- func KeyPath(repoRoot string) string
- func LoadPrivateKey(repoRoot string) (crypto.PrivateKey, error)
- func PathRoot() (string, error)
- func PathRootWithDefault(path string) (string, error)
- func PluginPath() (string, error)
- func SetPath(root string)
- type Appchain
- type Bitxhub
- type Config
- type Log
- type Port
Constants ¶
View Source
const ( // DefaultPathName is the default config dir name DefaultPathName = ".pier" // DefaultPathRoot is the path to the default config dir location. DefaultPathRoot = "~/" + DefaultPathName // EnvDir is the environment variable used to change the path root. EnvDir = "PIER_PATH" // ConfigName is config name ConfigName = "pier.toml" // config path ConfigPath = "../../config" // KeyName KeyName = "key.json" // KeyPassword KeyPassword = "bitxhub" )
View Source
const (
// Items
LogLevel = "log.level"
)
Variables ¶
View Source
var RootPath string
Functions ¶
func Initialize ¶
Initialize creates .pier path and necessary configuration, account file and so on.
func LoadPrivateKey ¶
func LoadPrivateKey(repoRoot string) (crypto.PrivateKey, error)
LoadPrivateKey loads private key from config path
func PathRootWithDefault ¶
PathRootWithDefault gets current config path with default value
Types ¶
type Appchain ¶
type Appchain struct { Plugin string `toml:"plugin" json:"plugin"` Config string `toml:"config" json:"config"` }
Appchain are configs about appchain
type Bitxhub ¶
type Bitxhub struct { Addr string `toml:"addr" json:"addr"` Validators []string `toml:"validators" json:"validators"` }
Bitxhub are config about bitxhub
func (*Bitxhub) GetValidators ¶
GetValidators gets validator address of bitxhub
type Config ¶
type Config struct { RepoRoot string Title string `toml:"title" json:"title"` Port Port `toml:"port" json:"port"` Bitxhub Bitxhub `toml:"bitxhub" json:"bitxhub"` Log Log `toml:"log" json:"log"` Appchain Appchain `toml:"appchain" json:"appchain"` }
Config represents the necessary config data for starting pier
func UnmarshalConfig ¶
UnmarshalConfig read from config files under config path
Click to show internal directories.
Click to hide internal directories.