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 LoadNodePrivateKey(repoRoot string) (crypto.PrivateKey, error)
- func LoadPrivateKey(repoRoot string) (crypto.PrivateKey, error)
- func NodeKeyPath(repoRoot string) string
- 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
- type Security
- type Union
Constants ¶
View Source
const ( DirectMode = "direct" RelayMode = "relay" UnionMode = "union" )
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" // NodeKeyName NodeKeyName = "node.priv" // KeyPassword KeyPassword = "bitxhub" // API name APIName = "api" // Bitxhub type BitxhubType = "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 LoadNodePrivateKey ¶ added in v1.4.0
func LoadNodePrivateKey(repoRoot string) (crypto.PrivateKey, error)
func LoadPrivateKey ¶
func LoadPrivateKey(repoRoot string) (crypto.PrivateKey, error)
LoadPrivateKey loads private key from config path
func NodeKeyPath ¶ added in v1.4.0
func PathRootWithDefault ¶
PathRootWithDefault gets current config path with default value
Types ¶
type Appchain ¶
type Appchain struct {
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"` Security Security `toml:"security" json:"security"` }
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
type Relay ¶
type Relay struct { Addr string `toml:"addr" json:"addr"` Quorum uint64 `toml:"quorum" json:"quorum"` Validators []string `toml:"validators" json:"validators"` }
Relay are configs about bitxhub
func (*Relay) GetValidators ¶
GetValidators gets validator address of bitxhub
Click to show internal directories.
Click to hide internal directories.