These are chat archives for Nethereum/Nethereum

26th
Jun 2017
Juan Blanco
@juanfranblanco
Jun 26 2017 08:51
you can just compare a BigInteger instead of creating a Hex
also BigIntegers can be casted to lower value
Diogo Costa
@diogocosta123
Jun 26 2017 13:38
        var miningResult = await web3.Miner.Start.SendRequestAsync();
        Assert.True(miningResult);

        var receipt = await web3.Eth.Transactions.GetTransactionReceipt.SendRequestAsync(transactionHash);

        while(receipt == null){
            Thread.Sleep(1000);
            receipt = await web3.Eth.Transactions.GetTransactionReceipt.SendRequestAsync(transactionHash);
        }

        miningResult = await web3.Miner.Stop.SendRequestAsync();
        Assert.True(miningResult);
        return receipt;
    }
Hi Juan, I'm trying to start minig directly from the app, using the code above. I can get the receipt, but "web3.Miner" doesn't seem to be inlcuded in the API anymore. Is there another way of doing this? Thanks!
Juan Blanco
@juanfranblanco
Jun 26 2017 16:51
yes you need to add the package Nethereum.Geth if not using Portable
that includes a specific web3 Web3Geth which includes the adminstration tasks
@diogocosta123 ^^
olibd
@olibd
Jun 26 2017 17:18

@juanfranblanco When targeting mono android, why does this work:

            string ClientUrl = "http://urlToPrivateParityNode:port";
            RpcClient Client = new RpcClient(new Uri(ClientUrl));
            Web3 web3 = new Web3(Client);
            string addressFrom = (web3.Eth.Accounts.SendRequestAsync().Result)[0];

But this won't:

            string ClientUrl = "http://urlToPrivateParityNode:port";
            Web3 web3 = new Web3(Client);
            string addressFrom = (web3.Eth.Accounts.SendRequestAsync().Result)[0];

Note that the latter works in a Unit test project targetting .NET 4.6.1

Also, when using https both throw exception in mono android
it is mainly the same
so rather confusing
olibd
@olibd
Jun 26 2017 17:25
Yeah this is very confusing. It is exactly the same. Hang on i'll get the exception and stacktrace
Screen Shot 2017-06-26 at 1.28.10 PM.png
Exception hierarchy ^
olibd
@olibd
Jun 26 2017 17:31

for the system.exception the error message is:

  at System.Net.WebConnection.HandleError (System.Net.WebExceptionStatus st, System.Exception e, System.String where) [0x00000] in <d3ccbd93dbee45dc8aaf7ab7e7cdfe8d>:0 
  at System.Net.WebConnection.ReadDone (System.IAsyncResult result) [0x00000] in <d3ccbd93dbee45dc8aaf7ab7e7cdfe8d>:0 
  at System.Net.Sockets.SocketAsyncResult+<>c__DisplayClass27_0.<Complete>b__0 (System.Object _) [0x00000] in <d3ccbd93dbee45dc8aaf7ab7e7cdfe8d>:0 
  at System.Threading.QueueUserWorkItemCallback.System.Threading.IThreadPoolWorkItem.ExecuteWorkItem () [0x00000] in <abd9ee18f6114b4cae6c0d74712f64b5>:0 
  at System.Threading.ThreadPoolWorkQueue.Dispatch () [0x00000] in <abd9ee18f6114b4cae6c0d74712f64b5>:0 
  at System.Threading._ThreadPoolWaitCallback.PerformWaitCallback () [0x00000] in <abd9ee18f6114b4cae6c0d74712f64b5>:0

For the WebException the error message is:

Error getting response stream (ReadDone2): ReceiveFailure
That's what I get when running the second call
maybe is an issue with the old httpclient?
olibd
@olibd
Jun 26 2017 18:23
Well, I tried the solution suggested in the thread and it does not work. The only thing that help are breakpoints. Which leads me to believe that the request could be hanging prematurely before the node can respond. What do you think?
Juan Blanco
@juanfranblanco
Jun 26 2017 18:24
I have not seen that happen on android
what version of xamarin android are you using?
olibd
@olibd
Jun 26 2017 18:30
I FIXED IT!
ModernHttpClient does help
it does fix the problem. But it has to be referenced directly in the android project, not in the mvvmcross core project
That's why I thought it had no effect
cojax
@cojax
Jun 26 2017 20:49
hey
does anyone have any experience with the nethereum.ens ?
cojax
@cojax
Jun 26 2017 21:03
i'm trying to figure out how to check if a name is available.. i can't seem to find any documentation on it