Documentation ¶
Index ¶
- Variables
- type Manager
- func (m *Manager) Accounts() ([]gethcommon.Address, error)
- func (m *Manager) AccountsRPCHandler() rpc.Handler
- func (m *Manager) AddressToDecryptedAccount(address, password string) (accounts.Account, *keystore.Key, error)
- func (m *Manager) CreateAccount(password string) (address, pubKey, mnemonic string, err error)
- func (m *Manager) CreateChildAccount(parentAddress, password string) (address, pubKey string, err error)
- func (m *Manager) Logout() error
- func (m *Manager) ReSelectAccount() error
- func (m *Manager) RecoverAccount(password, mnemonic string) (address, pubKey string, err error)
- func (m *Manager) SelectAccount(address, password string) error
- func (m *Manager) SelectedAccount() (*common.SelectedExtKey, error)
- func (m *Manager) VerifyAccountPassword(keyStoreDir, address, password string) (*keystore.Key, error)
Constants ¶
This section is empty.
Variables ¶
var ( ErrAddressToAccountMappingFailure = errors.New("cannot retrieve a valid account for a given address") ErrAccountToKeyMappingFailure = errors.New("cannot retrieve a valid key for a given account") ErrWhisperIdentityInjectionFailure = errors.New("failed to inject identity into Whisper") ErrWhisperClearIdentitiesFailure = errors.New("failed to clear whisper identities") ErrNoAccountSelected = errors.New("no account has been selected, please login") ErrInvalidMasterKeyCreated = errors.New("can not create master extended key") )
errors
Functions ¶
This section is empty.
Types ¶
type Manager ¶
type Manager struct {
// contains filtered or unexported fields
}
Manager represents account manager interface
func NewManager ¶
func NewManager(nodeManager common.NodeManager) *Manager
NewManager returns new node account manager
func (*Manager) Accounts ¶
func (m *Manager) Accounts() ([]gethcommon.Address, error)
Accounts returns list of addresses for selected account, including subaccounts.
func (*Manager) AccountsRPCHandler ¶
AccountsRPCHandler returns RPC Handler for the Accounts() method.
func (*Manager) AddressToDecryptedAccount ¶
func (m *Manager) AddressToDecryptedAccount(address, password string) (accounts.Account, *keystore.Key, error)
AddressToDecryptedAccount tries to load decrypted key for a given account. The running node, has a keystore directory which is loaded on start. Key file for a given address is expected to be in that directory prior to node start.
func (*Manager) CreateAccount ¶
CreateAccount creates an internal geth account BIP44-compatible keys are generated: CKD#1 is stored as account key, CKD#2 stored as sub-account root Public key of CKD#1 is returned, with CKD#2 securely encoded into account key file (to be used for sub-account derivations)
func (*Manager) CreateChildAccount ¶
func (m *Manager) CreateChildAccount(parentAddress, password string) (address, pubKey string, err error)
CreateChildAccount creates sub-account for an account identified by parent address. CKD#2 is used as root for master accounts (when parentAddress is ""). Otherwise (when parentAddress != ""), child is derived directly from parent.
func (*Manager) ReSelectAccount ¶
ReSelectAccount selects previously selected account, often, after node restart.
func (*Manager) RecoverAccount ¶
RecoverAccount re-creates master key using given details. Once master key is re-generated, it is inserted into keystore (if not already there).
func (*Manager) SelectAccount ¶
SelectAccount selects current account, by verifying that address has corresponding account which can be decrypted using provided password. Once verification is done, decrypted key is injected into Whisper (as a single identity, all previous identities are removed).
func (*Manager) SelectedAccount ¶
func (m *Manager) SelectedAccount() (*common.SelectedExtKey, error)
SelectedAccount returns currently selected account