Documentation
¶
Index ¶
- Constants
- Variables
- func ArchiveVersion(gitCommit string) string
- func CheckConfig(isServer bool) (err error)
- func GetAPIPort() int
- func GetIdentifier() string
- func HasAdmin() bool
- func IsAdmin(account string) bool
- func IsDcrmEnabled() bool
- func IsDcrmInitiator(account string) bool
- func SetConfig(config *ServerConfig)
- func VersionWithCommit(gitCommit, gitDate string) string
- type APIServerConfig
- type DcrmConfig
- type DcrmNodeConfig
- type MongoDBConfig
- type OracleConfig
- type ServerConfig
Constants ¶
const ( VersionMajor = 0 // Major version component of the current release VersionMinor = 3 // Minor version component of the current release VersionPatch = 1 // Patch version component of the current release VersionMeta = "" // Version metadata to append to the version string )
version parts
Variables ¶
var ( // ServerAPIAddress server api address ServerAPIAddress string )
var Version = func() string { return fmt.Sprintf("%d.%d.%d", VersionMajor, VersionMinor, VersionPatch) }()
Version holds the textual version string.
var VersionWithMeta = func() string { v := Version if VersionMeta != "" { v += "-" + VersionMeta } return v }()
VersionWithMeta holds the textual version string including the metadata.
Functions ¶
func ArchiveVersion ¶
ArchiveVersion holds the textual version string used for Geth archives. e.g. "1.8.11-dea1ce05" for stable releases, or
"1.8.13-unstable-21c059b6" for unstable releases
func GetIdentifier ¶
func GetIdentifier() string
GetIdentifier get identifier (to distiguish in dcrm accept)
func IsDcrmEnabled ¶ added in v0.3.0
func IsDcrmEnabled() bool
IsDcrmEnabled is dcrm enabled (for dcrm sign)
func IsDcrmInitiator ¶ added in v0.3.0
IsDcrmInitiator is initiator of dcrm sign
func VersionWithCommit ¶
VersionWithCommit add git commit and data to version.
Types ¶
type APIServerConfig ¶
APIServerConfig api service config
type DcrmConfig ¶
type DcrmConfig struct {
Disable bool
GroupID *string
NeededOracles *uint32
TotalOracles *uint32
Mode uint32 // 0:managed 1:private (default 0)
Initiators []string
DefaultNode *DcrmNodeConfig
OtherNodes []*DcrmNodeConfig
}
DcrmConfig dcrm related config
func (*DcrmConfig) CheckConfig ¶
func (c *DcrmConfig) CheckConfig(isServer bool) (err error)
CheckConfig check dcrm config
type DcrmNodeConfig ¶ added in v0.3.0
type DcrmNodeConfig struct {
RPCAddress *string
SignGroups []string `toml:",omitempty" json:",omitempty"`
KeystoreFile *string `json:"-"`
PasswordFile *string `json:"-"`
}
DcrmNodeConfig dcrm node config
func (*DcrmNodeConfig) CheckConfig ¶ added in v0.3.0
func (c *DcrmNodeConfig) CheckConfig(isServer bool) (err error)
CheckConfig check dcrm node config
type MongoDBConfig ¶
type MongoDBConfig struct {
DBURL string
DBName string
UserName string `json:"-"`
Password string `json:"-"`
}
MongoDBConfig mongodb config
type OracleConfig ¶
type OracleConfig struct {
ServerAPIAddress string
}
OracleConfig oracle config
func (*OracleConfig) CheckConfig ¶
func (c *OracleConfig) CheckConfig() (err error)
CheckConfig check oracle config
type ServerConfig ¶
type ServerConfig struct {
Identifier string
MongoDB *MongoDBConfig `toml:",omitempty" json:",omitempty"`
APIServer *APIServerConfig `toml:",omitempty" json:",omitempty"`
SrcChain *tokens.ChainConfig
SrcGateway *tokens.GatewayConfig
DestChain *tokens.ChainConfig
DestGateway *tokens.GatewayConfig
Dcrm *DcrmConfig `toml:",omitempty" json:",omitempty"`
Oracle *OracleConfig `toml:",omitempty" json:",omitempty"`
BtcExtra *tokens.BtcExtraConfig `toml:",omitempty" json:",omitempty"`
Admins []string `toml:",omitempty" json:",omitempty"`
}
ServerConfig config items (decode from toml file)
func LoadConfig ¶
func LoadConfig(configFile string, isServer bool) *ServerConfig
LoadConfig load config