These are chat archives for Nethereum/Nethereum

1st
Jun 2018
Enigmatic
@EnigmaticUnreal_twitter
Jun 01 2018 05:22
@ajkagy - I was playing with this last night coincidentally. Have you tried contract.decodeinput(data)? Not sure if it helps...
Juan Blanco
@juanfranblanco
Jun 01 2018 05:30
As @EnigmaticUnreal_twitter says that does the default decoding of the input
ChinhP
@Chinh-P
Jun 01 2018 10:50
Im calling a simple function using CallAsync
var getSttFnc = contract.GetFunction("getBalanceOf"); var balance = getSttFnc.CallAsync<BigInteger>(queriedAddress).Result;
and currently getting the error:
Error occurred when trying to send rpc requests(s)
This function Im using it for a while now without any problem until today.
Anyone has any idea what could be the cause of problem
btw, im using infura.io to interact with eth mainchain contract
(same error with testnet too)
Juan Blanco
@juanfranblanco
Jun 01 2018 11:56
@ChinhPLQ maybe a problem with infura?
have you checked another public node?
Juan Blanco
@juanfranblanco
Jun 01 2018 12:07
if you are using infura of course
ChinhP
@Chinh-P
Jun 01 2018 12:49
Yes, i checked infura but didnt see any update information from them, let me try with another public node
hantosy
@hantosy
Jun 01 2018 14:06
Hi! Please check for me.I still get error "occurred when trying to send rpc requests(s)". Thanks
static public async Task<decimal> BalanceETH(string address,string privatekey)
{
try
{
var account = new Account(privatekey);
var web3 = new Nethereum.Web3.Web3(account, "https://mainnet.infura.io");
var currentBalance = await web3.Eth.GetBalance.SendRequestAsync(address);
return Nethereum.Web3.Web3.Convert.FromWei(currentBalance);
}
catch (Exception ex)
{
return 0;
}
    }
Enigmatic
@EnigmaticUnreal_twitter
Jun 01 2018 14:23

Hmmm. Two of the same reports in a single day... Might be something wrong with Infura then. Any chance you guys might be able to try Quiknode (https://quiknode.io/), or maybe a synced node?

I've tried Ropsten a couple hours earlier and seems to be fine though.

Juan Blanco
@juanfranblanco
Jun 01 2018 14:30
Check myetherapi and see if that fixes it
hantosy
@hantosy
Jun 01 2018 14:39
It's ok. Thanks!
Juan Blanco
@juanfranblanco
Jun 01 2018 15:16
There was a flying comment here regarding the update of Infura to Tls 2, if you are running your apps in .net 451 you need to specify it ServicePointManager.SecurityProtocol = SecurityProtocolType.Tls12
Enigmatic
@EnigmaticUnreal_twitter
Jun 01 2018 15:36
Thanks for the update @juanfranblanco
all fine btw
old fashion 4.6.1 ;)
Enigmatic
@EnigmaticUnreal_twitter
Jun 01 2018 15:41
Ah my projects were on 4.6.1 as well. That explains it. :) Tested 4.5.1 and there's the issue indeed.
@ChinhPLQ @hantosy
FYI
Juan Blanco
@juanfranblanco
Jun 01 2018 16:01
@EnigmaticUnreal_twitter you are a star man
Eduardo Guillermo
@EduPortuguesF_twitter
Jun 01 2018 16:24
thanks very much @juanfranblanco
Enigmatic
@EnigmaticUnreal_twitter
Jun 01 2018 16:31
:blush:
Adam Kagy
@ajkagy
Jun 01 2018 17:15
@EnigmaticUnreal_twitter where do you see the contract.decodeinput()? I'm not seeing it in Nethereum.Contracts namespace? This might be what I'm looking for though! I'm basically iterating through a blockchain and pulling out transactions that are sending to a certain contract and I need to decode the data that is being sent in that transaction.
Juan Blanco
@juanfranblanco
Jun 01 2018 17:16
it is in the Function
it returns a ParameterOutput List
i am creating a new way that deserialised to an object now
literally now :)
Adam Kagy
@ajkagy
Jun 01 2018 17:19
ah i see it, GetFunction().DecodeInput()
thanks Juan!
Pari Hoxha
@phoxha
Jun 01 2018 21:05
Any suggestions as to the best tool to help me generate solidity code? I am trying to create a smart contract for a certification. I.e Certified Microsoft Developer.
xeeshan74
@xeeshan74
Jun 01 2018 22:01
hey Juan .. under what circumstances we get this error occured- while trying to send remote rpc request . I have this simple test function
public async Task<ulong> GetBalanceERC20(string _walletid, string contractaddress, string networkaddress, string _privatekey)
{
try
{
var privateKey = _privatekey;
var account = new Account(privateKey);
var web3 = new Web3(account, networkaddress);
var eth = web3.Eth;
var transactions = eth.Transactions;
var transactionPolling = new TransactionReceiptPollingService(web3.TransactionManager);
var tokenService = new StandardTokenService(web3, contractaddress);
var ownerBalance = await tokenService.GetBalanceOfAsync<ulong>(_walletid);
return ownerBalance;
}
catch(Exception e)
{
        }
        return 0;
    }
above code works in console application with Portable 2.4.0 but does not work with WCF service project
any clues
??
xeeshan74
@xeeshan74
Jun 01 2018 22:06
btw I am connecting to infura ropsten