These are chat archives for Nethereum/Nethereum
@juanfranblanco please ignore what i said above, the problem was my node wasnt fully synced (duhhhh)
But now im back with the old problem (Nethereum/Nethereum#344)
This is with a Geth node provided by QuikNode
@Celestral - You meant you'd like to store the account as a keystore? Once you have generated a privatekey you can use EncryptAndGenerateDefaultKeyStoreAsJson, which has an override to take a password for the JSON file, private key, and address.
Quick example, you might need to work a few bits out. VB though...
Dim KeyStoreService As New KeyStore.KeyStoreService Dim JSONstring As String = KeyStoreService.EncryptAndGenerateDefaultKeyStoreAsJson(password, account.PrivateKey.Substring(account.PrivateKey.Length - 64).HexToByteArray, account.Address) Dim filename As String = KeyStoreService.GenerateUTCFileName(account.Address)
PS: An account isn't exactly "added" to the blockchain until you send a transaction to/from it, only then it gets "added". You could however generate an account and store it in a keystore file for your own use, just that the blockchain doesn't sees it as created until a transaction happens.
@ThatSlyGuy - You should be able to if you're querying from a full node. Off the top of my head there are JSON-RPC calls which can be done (eth_getbalance I think) which takes a parameter of blocknumber.
For Nethereum, you should be able to define a blockParameter when you do GetBalance.SendRequestAsync. Likewise for token balance checks, something like CallAsync<BigInteger>(new BlockParameter(blockNumber), address) should work.
PS: Sorry, typing off the top of my head. Let me see if I can get you some code examples.
@Celestral - Eeeh..... Let me know if I might be misunderstanding you (my apologies).
On second read, it looks more like you're trying to add a new account to your geth instance (something like var account = await web3.Personal.NewAccount.SendRequestAsync("password");). From there you should be able to load the keystore from %APPDATA%/Ethereum/keystore.