Documentation ¶
Index ¶
- Constants
- Variables
- func GetAPI(repoRoot string) (string, error)
- 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 Config
- type Direct
- type Log
- type Mode
- type Port
- type Relay
Constants ¶
View Source
const ( DirectMode = "direct" RelayMode = "relay" )
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" // API name APIName = "api" )
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 Config ¶
type Config struct { RepoRoot string Title string `toml:"title" json:"title"` Port Port `toml:"port" json:"port"` Mode Mode `toml:"mode" json:"mode"` 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
type Log ¶
type Log struct { Dir string `toml:"dir" json:"dir"` Filename string `toml:"filename" json:"filename"` ReportCaller bool `mapstructure:"report_caller"` Level string `toml:"level" json:"level"` }
Log are config about log
Click to show internal directories.
Click to hide internal directories.