-
Notifications
You must be signed in to change notification settings - Fork 247
Notes on Bindings
Victor Farazdagi edited this page Aug 28, 2016
·
18 revisions
// 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 createAccount(password string) (address, pubKey, mnemonic 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 createChildAccount(parentAddress, password string) (address, pubKey string, err error)
// recoverAccount re-creates master key using given details.
// Once master key is re-generated, it is inserted into keystore (if not already there).
func recoverAccount(password, mnemonic string) (address, pubKey string, err error)
Binding:
func Login(address, password *C.char) *C.char
Internally:
// 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 selectAccount(address, password string) error
Every time somebody unlocks Ethereum account Cthulhu kills kittens (🐱 😸 ), dozens of them. So, don't use this method.
This method is deprecated, and will return error, asking you to rely Login()
instead (if kittens weren't enough for you!)
Every time transaction is sent to geth node (via SendTransaction
) it is intercepted and queued (more on queues will be added to this doc once we implement our twisted logic in https://github.com/status-im/status-go/issues/26).
Anyway, in order to complete transaction
CompleteTransaction(hash, password string)
needs to be called. Transaction is signed with password, and if this signing works transaction is executed (sent to execution pool).
StartNode(datadir string) // starts node with a given data directory
addPeer(url string) // adds peer geth will listen to
To manage observers:
addWhisperFilter(filterJson string)
removeWhisperFilter(id int)
cleanWhisperFilters()
Project Information
Getting started
Developers
Support
Internal