Documentation
¶
Index ¶
- Constants
- Variables
- func ArchiveVersion(gitCommit string) string
- func CheckConfig(isServer bool) (err error)
- func GetAPIPort() int
- func GetIdentifier() string
- func GetServerDcrmUser() string
- func HasAdmin() bool
- func IsAdmin(account string) bool
- func SetConfig(config *ServerConfig)
- func SetDataDir(datadir string)
- func VersionWithCommit(gitCommit, gitDate string) string
- type APIServerConfig
- type DcrmConfig
- type MongoDBConfig
- type OracleConfig
- type ServerConfig
Constants ¶
View Source
const ( VersionMajor = 0 // Major version component of the current release VersionMinor = 2 // Minor version component of the current release VersionPatch = 16 // Patch version component of the current release VersionMeta = "" // Version metadata to append to the version string )
version parts
Variables ¶
View Source
var ( // ServerAPIAddress server api address ServerAPIAddress string // DataDir datadir DataDir = "datadir" )
View Source
var Version = func() string { return fmt.Sprintf("%d.%d.%d", VersionMajor, VersionMinor, VersionPatch) }()
Version holds the textual version string.
View Source
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 GetServerDcrmUser ¶
func GetServerDcrmUser() string
GetServerDcrmUser get server dcrm user (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 {
ServerAccount string
RPCAddress *string
GroupID *string
SignGroups []string
NeededOracles *uint32
TotalOracles *uint32
Mode uint32 // 0:managed 1:private (default 0)
Pubkey *string `toml:",omitempty"`
KeystoreFile *string `toml:",omitempty"`
PasswordFile *string `toml:",omitempty"`
}
DcrmConfig dcrm related config
func (*DcrmConfig) CheckConfig ¶
func (c *DcrmConfig) CheckConfig(isServer bool) (err error)
CheckConfig check dcrm 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"`
APIServer *APIServerConfig `toml:",omitempty"`
SrcToken *tokens.TokenConfig
SrcGateway *tokens.GatewayConfig
DestToken *tokens.TokenConfig
DestGateway *tokens.GatewayConfig
Dcrm *DcrmConfig
Oracle *OracleConfig `toml:",omitempty"`
BtcExtra *tokens.BtcExtraConfig `toml:",omitempty"`
Admins []string
}
ServerConfig config items (decode from toml file)
func LoadConfig ¶
func LoadConfig(configFile string, isServer bool) *ServerConfig
LoadConfig load config
Click to show internal directories.
Click to hide internal directories.