These are chat archives for Nethereum/Nethereum

29th
Nov 2017
Babu Pillai
@b-pillai
Nov 29 2017 03:59
I have a function that does not take any argument. How can I call this function?
Babu Pillai
@b-pillai
Nov 29 2017 04:29
//read the 'name' value by calling the get function.
var getFunction = contract.GetFunction("get");
// this part is not working, the function dont take any arguments and returns a string.
var getResult = getFunction.CallAsync<String>();//??? help please'
Juan Blanco
@juanfranblanco
Nov 29 2017 06:21
quick glance at the code, it should be fine
@b-pillai have you checked your contract was deployed succesfully?
Kirankumar
@kiranbasvaraj
Nov 29 2017 07:07
Hi all, i am facing issue while fetching token balance using nethereum nuget package for xamarin it is not returning token balance can any one help me out in this.
Nethereum.StandardTokenEIP20.StandardTokenService x = new Nethereum.StandardTokenEIP20.StandardTokenService(_web3,walletAdress);
var result= await x.GetBalanceOfAsync<BigInteger>(_ContratAddress);
Juan Blanco
@juanfranblanco
Nov 29 2017 07:08
that is because you are using the contract address
Ganesh Prasad Kumble
@0zAND1z
Nov 29 2017 07:16
@kiranbasvaraj , Maybe interchange the walletAddress and _ConrtactAddress ?
Juan Blanco
@juanfranblanco
Nov 29 2017 07:17
^^ further analysis :D
Kirankumar
@kiranbasvaraj
Nov 29 2017 07:19
it works @kggp1995 . thanks
thanks @juanfranblanco .
Babu Pillai
@b-pillai
Nov 29 2017 10:17
Yes, contract deployed successfully
nikhilsingh8
@nikhilsingh8
Nov 29 2017 10:50
hi This is Nikhil pls provide us guidance for Ethereum cryptocurrency using asp.net
Juan Blanco
@juanfranblanco
Nov 29 2017 10:50
a good sample is the faucet
nikhilsingh8
@nikhilsingh8
Nov 29 2017 10:53
thanks but its for MVC framework
Art1987
@Art1987
Nov 29 2017 13:18
Hi guys, is it possible to unlock multiple accounts?
Devedse
@devedse
Nov 29 2017 14:57
I'm trying to connect to the Ethereum network using an Infura node
However, no matter what call I do, my C# application crashes without message
Juan Blanco
@juanfranblanco
Nov 29 2017 14:57
what environment are you using?
Devedse
@devedse
Nov 29 2017 14:58
Win10
Juan Blanco
@juanfranblanco
Nov 29 2017 14:58
(ie mobile, console, unit test, etc)
Devedse
@devedse
Nov 29 2017 14:58
        var web3 = new Web3(acc.Account, Constants.Url);


        var blah = await web3.Eth.Blocks.GetBlockNumber.SendRequestAsync(50);
In a .net core app
Juan Blanco
@juanfranblanco
Nov 29 2017 15:01
you don't need to pass any parameter
the id is the rpc routing ide
id*
Devedse
@devedse
Nov 29 2017 15:04
To what you mean?
Juan Blanco
@juanfranblanco
Nov 29 2017 15:04
web3.Eth.Blocks.GetBlockNumber.SendRequestAsync()
it shouldn't be crashing
Devedse
@devedse
Nov 29 2017 15:05
Same issue
Juan Blanco
@juanfranblanco
Nov 29 2017 15:05
what is your url?
Devedse
@devedse
Nov 29 2017 15:06
https://mainnet.infura.io/ followed by an access token
Juan Blanco
@juanfranblanco
Nov 29 2017 15:06
yes that should be fine
Devedse
@devedse
Nov 29 2017 15:08
Is there like a way to activate any debug stuff?
Juan Blanco
@juanfranblanco
Nov 29 2017 15:08
you should not need to for this
it is a simple rpc call
although there is not debugging as such (logs if you mean)
image.png
quick test on a workbook
Devedse
@devedse
Nov 29 2017 15:13
The thing is is that I've had everything working like a month ago
And now I just started a new project and am running into this :|
Juan Blanco
@juanfranblanco
Nov 29 2017 15:13
@devedse yes I remember you :)
is this a console application? Have you check the threading?
Console applications do not start as async
well until c# 7.1
Devedse
@devedse
Nov 29 2017 15:22
Ok I fixed it
I was doing stupid
And didn't await my function
:|
Juan Blanco
@juanfranblanco
Nov 29 2017 15:24
:) it happens to all of us
Devedse
@devedse
Nov 29 2017 15:25
:D
Devedse
@devedse
Nov 29 2017 15:40
Do you know any nodes that allow filters?
Juan Blanco
@juanfranblanco
Nov 29 2017 15:40
public nodes no
i think infura is working on that, but imagine having millions of requests and manage the filters
what you can use is GetLogs
just keep track of your blocknumbers
Devedse
@devedse
Nov 29 2017 15:42
Not really sure how that works? but would you then request every block at infura?
Or will it mean running geth myself?
Juan Blanco
@juanfranblanco
Nov 29 2017 15:42
you will mainly request logs from infura
but using a range of blocks (not all)
Getlogs accepts a filter input
so it is similar to Filters but the server does not keep track of your previous request
Devedse
@devedse
Nov 29 2017 15:43
Hmm
Is there like some sample code you know of?
Devedse
@devedse
Nov 29 2017 15:52
How do I get the topic for a specific event? :o
Juan Blanco
@juanfranblanco
Nov 29 2017 15:52
get the event from the contract
and create new filter input
the object not the registration in the client
Devedse
@devedse
Nov 29 2017 15:53
ahh
Ok I was manually creating the new filter input
So now I need to parse the Data into a DTO, is that also possible?
Juan Blanco
@juanfranblanco
Nov 29 2017 15:54
yes for topics that will be a bit hard
the results?
Devedse
@devedse
Nov 29 2017 15:54
DecodeAllEventsForEvent
Juan Blanco
@juanfranblanco
Nov 29 2017 15:54
yes
that is the one
and pass the logs
Devedse
@devedse
Nov 29 2017 15:57
Hmm I do get 3200 log rows but when I decode them all values are set as 0 or null
Let me see what that could be :)
Devedse
@devedse
Nov 29 2017 16:06
Hmm doesn't really make sense to me
Apparently indexed should've been false :)
Devedse
@devedse
Nov 29 2017 16:57
@juanfranblanco I'm getting a 405 whenever I send a transaction
Is that also a known thing? (That Infura doesn't support sending transactions)?
Juan Blanco
@juanfranblanco
Nov 29 2017 17:17
you need to sing your transactions
you cannot use a normal account username / password
you need to create an Account with your privatekey
sign**
Devedse
@devedse
Nov 29 2017 17:18
var realTransaction = await theFunction.SendTransactionAsync(acc.PublicAddress, gasToProvide, priceOfGas, id);
Is what I have now
Juan Blanco
@juanfranblanco
Nov 29 2017 17:18
yeah but how you have created an instance of Web3?
check this
Devedse
@devedse
Nov 29 2017 17:18
ah
I changed that code
to not include the account
:D
Devedse
@devedse
Nov 29 2017 17:26
Ok, I need a tiny bit more help ;)
SendTransactionAsync(acc.PublicAddress, gasToProvide, null, id);
I want to set the gasprice to 12 gwei
and the gas limit to 300.000
How do I do that?
Juan Blanco
@juanfranblanco
Nov 29 2017 17:29
web3.TransactionManager.DefaultGasPrice
top of my head
Devedse
@devedse
Nov 29 2017 17:29
ah and that gastoprovide is the limit?
Juan Blanco
@juanfranblanco
Nov 29 2017 17:30
yeah
oh yes you can do that already on the overloads
i skip 20 steps :D
Devedse
@devedse
Nov 29 2017 17:30
:D
Why don't you have to provide the gasprice as an overload too?
If I want to provide 1.2 gwei
Should I do this:
web3.TransactionManager.DefaultGasPrice = new BigInteger(1200000000);
Or does it need more 0's
or less
you can already
yes that should be fine
check the 0s
Devedse
@devedse
Nov 29 2017 18:43
It's all working
Woo :)
thanks a lot
Juan Blanco
@juanfranblanco
Nov 29 2017 18:43
:fire: