These are chat archives for Nethereum/Nethereum

20th
Nov 2018
JEN
@chukwuemekanweke
Nov 20 2018 06:29
Hello @juanfranblanco . So we kind of ran into a problem with multiple transactions originating from the same ethereum address. These transactions keep using the same nonce value and rplacing each other
I'm wondering if there is a way to manually set the nonce value before propagating those transactions to a node, as well as getting the count of transactions i have on the network, that's including transactions in the pending block as well as the txpool
Enigmatic
@EnigmaticUnreal_twitter
Nov 20 2018 06:38
Hmm. Seems like there are a few queries about this lately... How are you maintaining your Web3 object? It should have a nonce counter which keeps track of it, so if you have a global Web3 object for the account it should be fine.
keepbreath
@keepbreath
Nov 20 2018 09:22
hello @EnigmaticUnreal_twitter ,Do you know the source of the parameter key in this method(EncryptAndGenerateDefaultKeyStoreAsJson)?How can I get this parameter?
Enigmatic
@EnigmaticUnreal_twitter
Nov 20 2018 09:25
Ah. You'll need to pass in a few parameters - a password, an account's private key in byte, and the address.
Hmm. Let me get you a sample...
keepbreath
@keepbreath
Nov 20 2018 09:25
em...I'm waiting for you
Thank you
Enigmatic
@EnigmaticUnreal_twitter
Nov 20 2018 09:27
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)
In VB though. :D but I think you just need to change the dims into var, add the semicolons.... etc. From there, you can use streamwriter to write the jsonstring
Juan Blanco
@juanfranblanco
Nov 20 2018 09:29
@chukwuemekanweke if you use the same instance of Web3 / Account the InMemoryNonceService keeps track of your nonces
if you are using the same account in different executables, the best thing is to create your own nonce tracker microservice
keepbreath
@keepbreath
Nov 20 2018 09:46
emmm...I just don't know how to generate the key to get into that method, or what's in the content that generates this key?QAQ......
Enigmatic
@EnigmaticUnreal_twitter
Nov 20 2018 09:55

Hmm. I basically pass in an account object so I could access the private key in byte format.

account = New Web3.Accounts.Account(privKey)

So the workflow will be like - Create a private key, initialise the account and store it as a JSON file. Or if I misunderstood you just let me know ya.

For example, one of the things I've done is to convert private key to JSON file (some wallets I use only accept import of JSON file instead of private key text) - So I would use the private key, create an account object, pass it to KeyStoreService.EncryptAndGenerateDefaultKeyStoreAsJson, and generate a JSON file for myself.
keepbreath
@keepbreath
Nov 20 2018 10:24
I don't think I can explain my intentions, but the example you said is what I want to achieve.
Enigmatic
@EnigmaticUnreal_twitter
Nov 20 2018 10:33
Sure - Give the above a try, drop us a note if you might need any more help. :)
skosara
@skosara1_twitter
Nov 20 2018 10:54
@juanfranblanco yes, i use infura, sorry
Juan Blanco
@juanfranblanco
Nov 20 2018 12:07
i think that might be an issue when estimating, is it always the same solidity contract function?
@skosara1_twitter
Dave Whiffin
@Dave-Whiffin
Nov 20 2018 12:47

@VoR0220 I have pushed the early stage code in to master which includes a sample of event log processing. That should get you going quickly.

It's all very much a work in progress, the design is evolving. You may be best forking the existing code to avoid breaking changes.

Link to the samples below - focus on the "event log processing (excluding transactions)".

https://github.com/Nethereum/Nethereum.BlockchainProcessing/tree/master/Nethereum.BlockchainProcessing.Samples#event-log-processing-excludes-transactions

If you have any questions just ask!

JEN
@chukwuemekanweke
Nov 20 2018 17:04
@juanfranblanco thank you