Documentation ¶
Index ¶
- Constants
- Variables
- func BaseDir(s []byte) (string, error)
- type Address
- type Setting
- func (s *Setting) BaseDir() string
- func (s *Setting) CheckAddress(adr string, hasPort, isEmptyHost bool) error
- func (s *Setting) InBlacklist(remote string) bool
- func (s *Setting) IsTrusted(adr string) bool
- func (s *Setting) OpenDB() error
- func (s *Setting) Sign(v proto.Marshaler) (*address.Signature, error)
- func (s *Setting) ValidatorAddress() (*address.Address, error)
- func (s *Setting) ValidatorsHash() []byte
Constants ¶
View Source
const DefaultMinimumFee = 0.05
DefaultMinimumFee is the minimum fee to receive minable tx.
Variables ¶
View Source
var DBVersion = "1.0.0"
DBVersion a version of DB.
View Source
var ErrTorAddress = errors.New("cannot use tor address")
ErrTorAddress represents an error tor address is used.
View Source
var Version = "unreleased"
Version is the version of aknode var Version = "r0.0.0"
Functions ¶
Types ¶
type Setting ¶
type Setting struct { Version string `json:"-"` Debug bool `json:"debug"` Testnet byte `json:"testnet"` Blacklists []string `json:"blacklists"` RootDir string `json:"root_dir"` UseTor bool `json:"-"` //disabled MyHostPort string `json:"my_host_port"` DefaultNodes []string `json:"default_nodes"` Bind string `json:"bind"` Port uint16 `json:"port"` MaxConnections uint16 `json:"max_connections"` Proxy string `json:"proxy"` UseWalletRPC bool `json:"use_wallet_rpc"` UsePublicRPC bool `json:"use_public_rpc"` RPCBind string `json:"rpc_bind"` RPCPort uint16 `json:"rpc_port"` RPCUser string `json:"rpc_user"` RPCPassword string `json:"rpc_password"` RPCMaxConnections uint16 `json:"rpc_max_connections"` RPCTxTag string `json:"rpc_tx_tag"` RPCAllowPublicPoW bool `json:"rpc_allow_public_pow"` WalletNotify string `json:"wallet_notify"` RunValidator bool `json:"run_validator"` ValidatorSecret string `json:"validator_secret"` TrustedNodes []string `json:"-"` RunExplorer bool `json:"run_explorer"` ExplorerBind string `json:"explorer_bind"` ExplorerPort uint16 `json:"explorer_port"` ExplorerMaxConnections uint16 `json:"explorer_max_connections"` MinimumFee float64 `json:"minimum_fee"` RunFeeMiner bool `json:"run_fee_miner"` RunTicketMiner bool `json:"run_ticket_miner"` RunTicketIssuer bool `json:"run_ticket_issuer"` MinerAddress string `json:"miner_address"` TrustAllNodes bool `json:"trust_all_nodes"` //only for debug aklib.DBConfig Cancel context.CancelFunc `json:"-"` Wg sync.WaitGroup `json:"-"` WgMsg sync.WaitGroup `json:"-"` }
Setting is a aknode setting.
func GetDefault ¶
GetDefault returns a default setting (mainnet/testnet/debugnet)
func (*Setting) CheckAddress ¶
CheckAddress checks an address adr.
func (*Setting) InBlacklist ¶
InBlacklist returns true if remote is in blacklist.
func (*Setting) ValidatorAddress ¶
ValidatorAddress returns the validator address from ValidatorSecret
func (*Setting) ValidatorsHash ¶
ValidatorsHash returns a hash of validators.
Click to show internal directories.
Click to hide internal directories.