These are chat archives for Nethereum/Nethereum

12th
Jun 2018
Juan Blanco
@juanfranblanco
Jun 12 2018 08:52
@DaChampR_twitter it seems you are creating a block / transaction filter instead (like pending transactions)
@wtlab you can replace it using the same nonce
ChinhP
@Chinh-P
Jun 12 2018 08:58
Juan, do you know what could be the problem of hanging when I tried to call a function
my function just like this one
txId = await openFnc.SendTransactionAsync(from: newAccount.Address, gas: new HexBigInteger(300000), value: new HexBigInteger(0));
Juan Blanco
@juanfranblanco
Jun 12 2018 08:59
what environment are you using
ChinhP
@Chinh-P
Jun 12 2018 08:59
first I thought because of gas, then I called:
var gas = await openFnc.EstimateGasAsync(from: newAccount.Address, gas: new HexBigInteger(300000), value: new HexBigInteger(0));
Im using Ropsten
Juan Blanco
@juanfranblanco
Jun 12 2018 08:59
and still hanging?
when gettting the gas?
ChinhP
@Chinh-P
Jun 12 2018 08:59
yes
the 2nd one also hanging
Juan Blanco
@juanfranblanco
Jun 12 2018 09:00
Console?
ChinhP
@Chinh-P
Jun 12 2018 09:00
like, nothing response, even exception
Juan Blanco
@juanfranblanco
Jun 12 2018 09:00
Are you using the Console
is it a Console app?
ChinhP
@Chinh-P
Jun 12 2018 09:00
Im using webapp
Juan Blanco
@juanfranblanco
Jun 12 2018 09:00
ah..
ChinhP
@Chinh-P
Jun 12 2018 09:00
but interestingly, calling from unit test successfully
Juan Blanco
@juanfranblanco
Jun 12 2018 09:00
yeah
is your entry point async?
ChinhP
@Chinh-P
Jun 12 2018 09:02
It isn't, service.OpenDrawSession(true).Result.ToString();
Juan Blanco
@juanfranblanco
Jun 12 2018 09:02
make the method async
ChinhP
@Chinh-P
Jun 12 2018 09:02
ok, let me try
Juan Blanco
@juanfranblanco
Jun 12 2018 09:03
cool
let me know how it goes
also ConfigureAwait(false); will help on your calls (which I might need to do a good pass)
ChinhP
@Chinh-P
Jun 12 2018 09:05
thanks, sure, one moment, I will update the result
wtlab
@wtlab
Jun 12 2018 09:10
@juanfranblanco ok, thanks! hmm.. how it work? web3.Eth.Transactions.GetTransactionReceipt
ChinhP
@Chinh-P
Jun 12 2018 09:10
Thank Juan, yes, the hanging is because of calling for non-async method
wtlab
@wtlab
Jun 12 2018 09:10
after sending is await while tx is not get status?
or return null if tx pending right now?
Juan Blanco
@juanfranblanco
Jun 12 2018 09:11
in that scenario and your transaction is not in the pending queue
it might have been an issue and got actually lost ?
I have not had that problem...
But if you get an issue trying to submit it again
then yeah..
you can replace it sending it again using the same nonce
and a higher price
"an issue" meaning, the transaction is still pending and you want to speed it up or replace it :)
wtlab
@wtlab
Jun 12 2018 09:15
@juanfranblanco so while transaction is in pending this method return null(Receipt)? or will await fail or success?
Juan Blanco
@juanfranblanco
Jun 12 2018 09:16
GetTransactionReceipt will return null until it is in the chain
wtlab
@wtlab
Jun 12 2018 09:16
ok) i just want to get receipt after tx is included in block
Juan Blanco
@juanfranblanco
Jun 12 2018 09:17
sure then you can use that
wtlab
@wtlab
Jun 12 2018 09:17
send transaktion
transaction
Juan Blanco
@juanfranblanco
Jun 12 2018 09:18
that is what all the examples do or the SendTransactionAndWaitForReceipt
wtlab
@wtlab
Jun 12 2018 09:18
then task delay
SendTransactionAndWaitForReceipt how i can use it in this case?
Screen Shot 2018-06-12 at 14.18.54.png
Juan Blanco
@juanfranblanco
Jun 12 2018 09:20
just poll for the receipt
wtlab
@wtlab
Jun 12 2018 09:22
And how long this method waits until it recognizes receipt completely as a failure?
Juan Blanco
@juanfranblanco
Jun 12 2018 09:22
well a transaction with low price can stay there for a long time
wtlab
@wtlab
Jun 12 2018 09:22
For those cases when the hash after some time is not available at all and transactions are as unknown
for polling internally
wtlab
@wtlab
Jun 12 2018 09:28
And how i can store nonce for future to resending? It's generated automaticaly when i call var transactionHash = await transferHandler.SendRequestAsync(transactionMessage,
Juan Blanco
@juanfranblanco
Jun 12 2018 09:28
and you can also have a look
at
if you want to replace a transaction
you can get the pending transaction information using the hash
going to a meeting ...
wtlab
@wtlab
Jun 12 2018 09:32
thanks, luck.
gm23
@DaChampR_twitter
Jun 12 2018 10:01
@juanfranblanco hmm, well I wanted to get a specific block (that is that filter variable - it has a fromBlock and toBlock property set). Then I wanted to get all logs in that block that are token transfers - that's why i have Nethereum.StandardTokenEIP20.Events.DTO.Transferin the decode.
Basically I want to get all the token transfers in a block, but it appears I'm getting something else in as well, but I'm still not sure why.
Because this txhash: 0x400bf067489548ab8e46c29c3187ca0f790ed1dfc3ee641c08feca0b2ab06852 doesn't look like a token transfer to me...
Lucas Adlerstein
@lukeamelej
Jun 12 2018 14:44
Hi, I'm new in this world. I want to interact with my smart contract with MVC .NET
Can I take methods from my own contract with Nethereum web3?
For example if I have the method setText or getText, can I use it on the ButtonClick?
Can someone help me with an example?
Thanks!
Juan Blanco
@juanfranblanco
Jun 12 2018 14:56
@lukeamelej yes you can, but transactions might take a while to be put in the chain.
it is a workbook so you can execute with Xamarin Workbooks
you can code generate the "interface" using vscode
we will be releasing shortly other tools to code generate the code
wtlab
@wtlab
Jun 12 2018 14:58
i get Unhandled Exception: Nethereum.JsonRpc.Client.RpcResponseException: replacement transaction underpriced
can i add nonce manualy to transaction message?
i get this error when send on same adвress difeаrent amount of tokens
every 5 sec
or I misunderstand something?
Juan Blanco
@juanfranblanco
Jun 12 2018 15:32
@DaChampR_twitter how do you create the Filter?
@wtlab that is exactly the error you see when you want to replace the transaction using the same nonce
and need to supply a bigger price to replace it
ie.. from 2 gwei to 2.5
gm23
@DaChampR_twitter
Jun 12 2018 16:07
image.png
@juanfranblanco this is the relevant code for this
block is a Nethereum.Hex.HexTypes.HexBigInteger
Juan Blanco
@juanfranblanco
Jun 12 2018 16:11
right.. so what is the problem again sorry
gm23
@DaChampR_twitter
Jun 12 2018 16:12
i only want to get token transfers from the ETH blockchain
Juan Blanco
@juanfranblanco
Jun 12 2018 16:12
ahhh
Juan Blanco
@juanfranblanco
Jun 12 2018 16:13
??
so you want to get other events
gm23
@DaChampR_twitter
Jun 12 2018 16:13
no, only the transfers
but the problem is, i apparently do get other events as well (an example is the previous link) but i do not want that
Juan Blanco
@juanfranblanco
Jun 12 2018 16:14
so create a Event of the token you are interested
and create a filter
gm23
@DaChampR_twitter
Jun 12 2018 16:14
i want to get transfers of all tokens
i thought this code: var transfers = Nethereum.Contracts.Event.DecodeAllEvents<Nethereum.StandardTokenEIP20.Events.DTO.Transfer>(new Nethereum.RPC.Eth.DTOs.FilterLog[] { log }); filters for Transfer events for all ERC20 tokens?
Juan Blanco
@juanfranblanco
Jun 12 2018 16:20
yes that decodes all the events for a specific event signature
gm23
@DaChampR_twitter
Jun 12 2018 16:21
so if the event doesn't meet the specified event signature, it is ignored, right?
Juan Blanco
@juanfranblanco
Jun 12 2018 16:21
yep
gm23
@DaChampR_twitter
Jun 12 2018 16:21
so if that "mint" event gets through... That would mean it has the same signature as a transfer event, right?
Juan Blanco
@juanfranblanco
Jun 12 2018 16:21
well that "mint" is a function
ah sorry and an event too :)
gm23
@DaChampR_twitter
Jun 12 2018 16:24
... which actually has the same signature?
Juan Blanco
@juanfranblanco
Jun 12 2018 16:27
ah my fault i just realised you are using the static method so that will try to decode everything
DecodeAllEvents
it is assumed that you have already all the events of that type
The instance method DecodeAllEventsForEvent does what you want
gm23
@DaChampR_twitter
Jun 12 2018 16:28
oh my, i just realised as well that you linked that method yes
thank you very much!
Is that already working?
(I assume it's for generating c# classes from an Abi)
And another question I already asked a while back, is deploying and linking library contracts already supported, and if not, what's the suggested alternative/guidance for this?
Devedse
@devedse
Jun 12 2018 23:53
Another question, can nethereum decide transaction data to readable stuff based on an ABI? as done here in a javascript project I worked on: https://github.com/devedse/DeveEtherscanParser
And more, what does this mean on the readme.md: "Code generation of smart contracts services"