Documentation ¶
Index ¶
- Variables
- func HashMessage(message string) ([]byte, error)
- func RunAsync(f func() error) <-chan error
- type StatusBackend
- func (b *StatusBackend) AccountManager() *account.Manager
- func (b *StatusBackend) AppStateChange(state string)
- func (b *StatusBackend) CallPrivateRPC(inputJSON string) (string, error)
- func (b *StatusBackend) CallRPC(inputJSON string) (string, error)
- func (b *StatusBackend) ConnectionChange(typ string, expensive bool)
- func (b *StatusBackend) DisableInstallation(installationID string) error
- func (b *StatusBackend) EnableInstallation(installationID string) error
- func (b *StatusBackend) ExtractGroupMembershipSignatures(signaturePairs [][2]string) ([]string, error)
- func (b *StatusBackend) GetAccounts() ([]multiaccounts.Account, error)
- func (b *StatusBackend) GetNodesFromContract(rpcEndpoint string, contractAddress string) ([]string, error)
- func (b *StatusBackend) HashTransaction(sendArgs transactions.SendTxArgs) (transactions.SendTxArgs, gethcommon.Hash, error)
- func (b *StatusBackend) HashTypedData(typed typeddata.TypedData) (common.Hash, error)
- func (b *StatusBackend) InjectChatAccount(chatKeyHex, encryptionKeyHex string) error
- func (b *StatusBackend) IsNodeRunning() bool
- func (b *StatusBackend) Logout() error
- func (b *StatusBackend) OpenAccounts() error
- func (b *StatusBackend) Recover(rpcParams personal.RecoverParams) (gethcommon.Address, error)
- func (b *StatusBackend) ResetChainData() error
- func (b *StatusBackend) RestartNode() error
- func (b *StatusBackend) SaveAccount(account multiaccounts.Account) error
- func (b *StatusBackend) SaveAccountAndStartNodeWithKey(acc multiaccounts.Account, conf *params.NodeConfig, password string, ...) error
- func (b *StatusBackend) SelectAccount(loginParams account.LoginParams) error
- func (b *StatusBackend) SendTransaction(sendArgs transactions.SendTxArgs, password string) (hash gethcommon.Hash, err error)
- func (b *StatusBackend) SendTransactionWithSignature(sendArgs transactions.SendTxArgs, sig []byte) (hash gethcommon.Hash, err error)
- func (b *StatusBackend) SignGroupMembership(content string) (string, error)
- func (b *StatusBackend) SignHash(hexEncodedHash string) (string, error)
- func (b *StatusBackend) SignMessage(rpcParams personal.SignParams) (hexutil.Bytes, error)
- func (b *StatusBackend) SignTypedData(typed typeddata.TypedData, address string, password string) (hexutil.Bytes, error)
- func (b *StatusBackend) StartNode(config *params.NodeConfig) error
- func (b *StatusBackend) StartNodeWithAccount(acc multiaccounts.Account, password string) error
- func (b *StatusBackend) StartNodeWithAccountAndConfig(account multiaccounts.Account, password string, conf *params.NodeConfig, ...) error
- func (b *StatusBackend) StartNodeWithKey(acc multiaccounts.Account, password string, keyHex string) error
- func (b *StatusBackend) StatusNode() *node.StatusNode
- func (b *StatusBackend) StopNode() error
- func (b *StatusBackend) Transactor() *transactions.Transactor
- func (b *StatusBackend) UpdateMailservers(enodes []string) error
- func (b *StatusBackend) UpdateRootDataDir(datadir string)
Constants ¶
This section is empty.
Variables ¶
var ( // ErrWhisperClearIdentitiesFailure clearing whisper identities has failed. ErrWhisperClearIdentitiesFailure = errors.New("failed to clear whisper identities") // ErrWhisperIdentityInjectionFailure injecting whisper identities has failed. ErrWhisperIdentityInjectionFailure = errors.New("failed to inject identity into Whisper") // ErrUnsupportedRPCMethod is for methods not supported by the RPC interface ErrUnsupportedRPCMethod = errors.New("method is unsupported by RPC interface") // This is a normal situation when a node is stopped. ErrRPCClientUnavailable = errors.New("JSON-RPC client is unavailable") )
Functions ¶
func HashMessage ¶ added in v0.35.0
HashMessage calculates the hash of a message to be safely signed by the keycard The hash is calulcated as
keccak256("\x19Ethereum Signed Message:\n"${message length}${message}).
This gives context to the signed message and prevents signing of transactions.
Types ¶
type StatusBackend ¶
type StatusBackend struct {
// contains filtered or unexported fields
}
StatusBackend implements Status.im service
func NewStatusBackend ¶
func NewStatusBackend() *StatusBackend
NewStatusBackend create a new StatusBackend instance
func (*StatusBackend) AccountManager ¶
func (b *StatusBackend) AccountManager() *account.Manager
AccountManager returns reference to account manager
func (*StatusBackend) AppStateChange ¶
func (b *StatusBackend) AppStateChange(state string)
AppStateChange handles app state changes (background/foreground). state values: see https://facebook.github.io/react-native/docs/appstate.html
func (*StatusBackend) CallPrivateRPC ¶
func (b *StatusBackend) CallPrivateRPC(inputJSON string) (string, error)
CallPrivateRPC executes public and private RPC requests on node's in-proc RPC server.
func (*StatusBackend) CallRPC ¶
func (b *StatusBackend) CallRPC(inputJSON string) (string, error)
CallRPC executes public RPC requests on node's in-proc RPC server.
func (*StatusBackend) ConnectionChange ¶
func (b *StatusBackend) ConnectionChange(typ string, expensive bool)
ConnectionChange handles network state changes logic.
func (*StatusBackend) DisableInstallation ¶ added in v0.35.0
func (b *StatusBackend) DisableInstallation(installationID string) error
DisableInstallation disables an installation for multi-device sync.
func (*StatusBackend) EnableInstallation ¶ added in v0.35.0
func (b *StatusBackend) EnableInstallation(installationID string) error
EnableInstallation enables an installation for multi-device sync.
func (*StatusBackend) ExtractGroupMembershipSignatures ¶ added in v0.16.3
func (b *StatusBackend) ExtractGroupMembershipSignatures(signaturePairs [][2]string) ([]string, error)
ExtractGroupMembershipSignatures extract signatures from tuples of content/signature
func (*StatusBackend) GetAccounts ¶ added in v0.35.0
func (b *StatusBackend) GetAccounts() ([]multiaccounts.Account, error)
func (*StatusBackend) GetNodesFromContract ¶ added in v0.35.0
func (b *StatusBackend) GetNodesFromContract(rpcEndpoint string, contractAddress string) ([]string, error)
GetNodesFromContract returns a list of nodes from the contract
func (*StatusBackend) HashTransaction ¶ added in v0.35.0
func (b *StatusBackend) HashTransaction(sendArgs transactions.SendTxArgs) (transactions.SendTxArgs, gethcommon.Hash, error)
HashTransaction validate the transaction and returns new sendArgs and the transaction hash.
func (*StatusBackend) HashTypedData ¶ added in v0.35.0
HashTypedData generates the hash of TypedData.
func (*StatusBackend) InjectChatAccount ¶ added in v0.35.0
func (b *StatusBackend) InjectChatAccount(chatKeyHex, encryptionKeyHex string) error
InjectChatAccount selects the current chat account using chatKeyHex and injects the key into whisper.
func (*StatusBackend) IsNodeRunning ¶
func (b *StatusBackend) IsNodeRunning() bool
IsNodeRunning confirm that node is running
func (*StatusBackend) Logout ¶
func (b *StatusBackend) Logout() error
Logout clears whisper identities.
func (*StatusBackend) OpenAccounts ¶ added in v0.35.0
func (b *StatusBackend) OpenAccounts() error
func (*StatusBackend) Recover ¶ added in v0.11.0
func (b *StatusBackend) Recover(rpcParams personal.RecoverParams) (gethcommon.Address, error)
Recover calls the personalAPI to return address associated with the private key that was used to calculate the signature in the message
func (*StatusBackend) ResetChainData ¶
func (b *StatusBackend) ResetChainData() error
ResetChainData remove chain data from data directory. Node is stopped, and new node is started, with clean data directory.
func (*StatusBackend) RestartNode ¶
func (b *StatusBackend) RestartNode() error
RestartNode restart running Status node, fails if node is not running
func (*StatusBackend) SaveAccount ¶ added in v0.35.0
func (b *StatusBackend) SaveAccount(account multiaccounts.Account) error
func (*StatusBackend) SaveAccountAndStartNodeWithKey ¶ added in v0.35.0
func (b *StatusBackend) SaveAccountAndStartNodeWithKey(acc multiaccounts.Account, conf *params.NodeConfig, password string, keyHex string) error
func (*StatusBackend) SelectAccount ¶
func (b *StatusBackend) SelectAccount(loginParams account.LoginParams) error
SelectAccount selects current wallet and chat accounts, by verifying that each address has corresponding account which can be decrypted using provided password. Once verification is done, the decrypted chat key is injected into Whisper (as a single identity, all previous identities are removed).
func (*StatusBackend) SendTransaction ¶
func (b *StatusBackend) SendTransaction(sendArgs transactions.SendTxArgs, password string) (hash gethcommon.Hash, err error)
SendTransaction creates a new transaction and waits until it's complete.
func (*StatusBackend) SendTransactionWithSignature ¶ added in v0.35.0
func (b *StatusBackend) SendTransactionWithSignature(sendArgs transactions.SendTxArgs, sig []byte) (hash gethcommon.Hash, err error)
func (*StatusBackend) SignGroupMembership ¶ added in v0.15.1
func (b *StatusBackend) SignGroupMembership(content string) (string, error)
SignGroupMembership signs a piece of data containing membership information
func (*StatusBackend) SignHash ¶ added in v0.35.0
func (b *StatusBackend) SignHash(hexEncodedHash string) (string, error)
SignHash exposes vanilla ECDSA signing for signing a message for Swarm
func (*StatusBackend) SignMessage ¶ added in v0.11.0
func (b *StatusBackend) SignMessage(rpcParams personal.SignParams) (hexutil.Bytes, error)
SignMessage checks the pwd vs the selected account and passes on the signParams to personalAPI for message signature
func (*StatusBackend) SignTypedData ¶ added in v0.35.0
func (b *StatusBackend) SignTypedData(typed typeddata.TypedData, address string, password string) (hexutil.Bytes, error)
SignTypedData accepts data and password. Gets verified account and signs typed data.
func (*StatusBackend) StartNode ¶
func (b *StatusBackend) StartNode(config *params.NodeConfig) error
StartNode start Status node, fails if node is already started
func (*StatusBackend) StartNodeWithAccount ¶ added in v0.35.0
func (b *StatusBackend) StartNodeWithAccount(acc multiaccounts.Account, password string) error
func (*StatusBackend) StartNodeWithAccountAndConfig ¶ added in v0.35.0
func (b *StatusBackend) StartNodeWithAccountAndConfig(account multiaccounts.Account, password string, conf *params.NodeConfig, subaccs []accounts.Account) error
StartNodeWithAccountAndConfig is used after account and config was generated. In current setup account name and config is generated on the client side. Once/if it will be generated on status-go side this flow can be simplified.
func (*StatusBackend) StartNodeWithKey ¶ added in v0.35.0
func (b *StatusBackend) StartNodeWithKey(acc multiaccounts.Account, password string, keyHex string) error
func (*StatusBackend) StatusNode ¶
func (b *StatusBackend) StatusNode() *node.StatusNode
StatusNode returns reference to node manager
func (*StatusBackend) StopNode ¶
func (b *StatusBackend) StopNode() error
StopNode stop Status node. Stopped node cannot be resumed.
func (*StatusBackend) Transactor ¶
func (b *StatusBackend) Transactor() *transactions.Transactor
Transactor returns reference to a status transactor
func (*StatusBackend) UpdateMailservers ¶ added in v0.35.0
func (b *StatusBackend) UpdateMailservers(enodes []string) error
UpdateMailservers on ShhExtService.
func (*StatusBackend) UpdateRootDataDir ¶ added in v0.35.0
func (b *StatusBackend) UpdateRootDataDir(datadir string)