These are chat archives for Nethereum/Nethereum

7th
Dec 2018
hessam94
@hessam94
Dec 07 2018 04:54
@hessam94
can anyone connect to one of the infura tests nets like Ropsten and deploy a contract? could you put the code here? I tried a lot of codes but it does not connect .
I also prefer to create a private network and deploy my contract on, but it is multiplayer contract So I expect it the contract propagated to all peers and every node can work with it,
turtlewen
@turtlewen
Dec 07 2018 05:53
hi
may i ask about
how i connect my nethereum to other people nodes??
i want to do something like , my second nodes is mining, and my asp.net using nethereum to specific the ipaddress of that nodes and submit transaction through that nodes.
RevVivek
@RevVivek
Dec 07 2018 06:11

@juanfranblanco

Can I have demo for usage of Nethereum.Signer for Trezor.

RevVivek
@RevVivek
Dec 07 2018 06:29
And one more thing Can I use this for the testnet
MANOJKUMARCH
@MANOJKUMARCH
Dec 07 2018 07:29

@juanfranblanco , I am still not able to connect to Quorumchain using Nethereum. Below is my code and error response.

I have verified and the port is open in the machine. I am running on a Linux machine, Ubuntu 18.04

Code:

using Nethereum.Quorum;
using Nethereum.RPC.Eth.DTOs;
using Nethereum.Web3;
using Nethereum.Web3.Accounts;
using System;
using System.Threading.Tasks;

namespace QuorumTest
{
class Program
{
public static async Task Main(string[] args)
{
Console.WriteLine("Hello.. This is the Quorum Test!");
try
{
var web3Quorum = new Web3Quorum("http://localhost/8001");
var coinbaseAcct = await web3Quorum.Eth.CoinBase.SendRequestAsync();
Console.WriteLine("Coinbase is: {0}", coinbaseAcct);
}
catch(Exception e)
{
Console.Write(e);
}

    }
}

}

Response:

gethadmin@manojpoc2:~/dotnetapps/QuorumTest/QuorumTest$ dotnet run
Hello.. This is the Quorum Test!
Nethereum.JsonRpc.Client.RpcClientUnknownException: Error occurred when trying to send rpc requests(s) ---> System.Net.Http.HttpRequestException: Connection refused ---> System.Net.Sockets.SocketException: Connection refused
at System.Net.Http.ConnectHelper.ConnectAsync(String host, Int32 port, CancellationToken cancellationToken)
--- End of inner exception stack trace ---
at System.Net.Http.ConnectHelper.ConnectAsync(String host, Int32 port, CancellationToken cancellationToken)
at System.Threading.Tasks.ValueTask1.get_Result() at System.Net.Http.HttpConnectionPool.CreateConnectionAsync(HttpRequestMessage request, CancellationToken cancellationToken) at System.Threading.Tasks.ValueTask1.get_Result()
at System.Net.Http.HttpConnectionPool.WaitForCreatedConnectionAsync(ValueTask1 creationTask) at System.Threading.Tasks.ValueTask1.get_Result()
at System.Net.Http.HttpConnectionPool.SendWithRetryAsync(HttpRequestMessage request, Boolean doRequestAuth, CancellationToken cancellationToken)
at System.Net.Http.RedirectHandler.SendAsync(HttpRequestMessage request, CancellationToken cancellationToken)
at System.Net.Http.HttpClient.FinishSendAsyncBuffered(Task`1 sendTask, HttpRequestMessage request, CancellationTokenSource cts, Boolean disposeCts)
at Nethereum.JsonRpc.Client.RpcClient.SendAsync(RpcRequestMessage request, String route)
--- End of inner exception stack trace ---
at Nethereum.JsonRpc.Client.RpcClient.SendAsync(RpcRequestMessage request, String route)
at Nethereum.JsonRpc.Client.ClientBase.SendInnerRequestAsyncT
at Nethereum.JsonRpc.Client.ClientBase.SendInnerRequestAsyncT
at Nethereum.JsonRpc.Client.ClientBase.SendRequestAsyncT
at QuorumTest.Program.Main(String[] args) in /home/gethadmin/dotnetapps/QuorumTest/QuorumTest/Program.cs:line 18

Dave Whiffin
@Dave-Whiffin
Dec 07 2018 09:01

@MANOJKUMARCH Please check Juan's earlier responses - the url you are using does not appear to be correct.

var web3Quorum = new Web3Quorum("http://localhost/8001");

SHOULD BE

var web3Quorum = new Web3Quorum("http://localhost:8001");
turtlewen
@turtlewen
Dec 07 2018 09:03
hi @Dave-Whiffin
Nethereum.JsonRpc.Client.RpcClientUnknownException: 'Error occurred when trying to send rpc requests(s)'
i meet this error
i trying to use quorum
and specify my second nodes with ip address and port number
the geth cmd i also got modify --rpcapi quorum
but still appear this error
var url = "http://192.168.43.13" + ":" + "30303";
var web3 = new Web3Quorum(url);
this is the code i trying to specify the ip address
Dave Whiffin
@Dave-Whiffin
Dec 07 2018 09:07
From the machine you are running your .net code - have you tested any other means of connecting to that IP and port - to ensure that something is listening and that there are no firewall issues?
turtlewen
@turtlewen
Dec 07 2018 09:09
i try close firewall
Test-NetConnection -ComputerName 192.168.43.13 -Port 30303
when i using window power shell to run testing to the port
actually is ping succeed

there are 2 inner exception also

HttpRequestException: An error occurred while sending the request.
WebException: The underlying connection was closed: The connection was closed unexpectedly.

this 2 error
i tested close firewall , but still having this issue
Dave Whiffin
@Dave-Whiffin
Dec 07 2018 09:20
@turtlewen The inner exception is a standard .net connectivity exception. What version of .Net are you running? Is it full framework or .net core?
turtlewen
@turtlewen
Dec 07 2018 09:22
asp.net framework 4.5.3
no core
Dave Whiffin
@Dave-Whiffin
Dec 07 2018 09:38

@turtlewen Try a simple test app - on the same machine as your app - but not using any Nethereum code. This is to ensure that the underlying .Net code can connect to the ethereum node.

Below is sample code that I have just ran on 4.5.2 to demonstrate a connectivity test. (You will need to change the host and port).

When geth is running the app runs fine.
When I stop geth - I receive a WebException with the message "Unable to connect to the remote server".

using System;
using System.Net;

namespace TestDotNet452
{
    class Program
    {
        static void Main(string[] args)
        {
            try
            {
                using(var client = new WebClient())
                {
                    using (var stream = client.OpenRead("http://localhost:8545"))
                    {
                        Console.WriteLine("OpenRead succeeded");
                    }
                }
            }
            catch (Exception x)
            {
                Console.WriteLine("OpenRead failed");
                Console.WriteLine(x.Message);
            }

            Console.ReadLine();
        }
    }
}
MANOJKUMARCH
@MANOJKUMARCH
Dec 07 2018 09:40
@Dave-Whiffin & @juanfranblanco , Thanks for correcting me Dave and Juan, I am really sorry for posting again. I have ovelooked it and my bad :(. Thanks very much for correcting me :)
Dave Whiffin
@Dave-Whiffin
Dec 07 2018 09:40
@MANOJKUMARCH No problem - it is easily done!
Stef Heyenrath
@StefH
Dec 07 2018 16:13
Hi @juanfranblanco . I'm currently upgrading my Solidity code to 0.5.0. Which version from NEthereum do you advice?
Juan Blanco
@juanfranblanco
Dec 07 2018 16:23
well 3.0 for sure
it has more stuff
Tom Ryan
@a7coretryan
Dec 07 2018 16:49
@juanblanco Do you know of any issues using Azure-Parity POA and using Events filters when attempting to return changes with an indexed parameter? I can successfully return all changes without using any parameters but once I try to create a filter with the indexed parameter I consistently get nothing returned. BTW I am using v3.0.
Juan Blanco
@juanfranblanco
Dec 07 2018 16:56
i dont know of any issues
is it working locally with a parity poa?
Tom Ryan
@a7coretryan
Dec 07 2018 16:57
I haven't attempted that yet -- just wanted to check before I dug deeper.
followed your sample in the docs using IEventDTO and just can't get it to return anything.
Juan Blanco
@juanfranblanco
Dec 07 2018 17:00
let point the workbook to it
Tom Ryan
@a7coretryan
Dec 07 2018 17:02
@juanfranblanco -- can you clarify your statement - not sure I understand?
Juan Blanco
@juanfranblanco
Dec 07 2018 17:02
oh sorry i am launching a poa
and poiting the Xamarin worbook of the documentation
to it
Tom Ryan
@a7coretryan
Dec 07 2018 17:03
oh Ok -- didn't expect you to do that -- but I appreciate your willingness!
well it mainly answers your question and many to come :)
Stef Heyenrath
@StefH
Dec 07 2018 17:05
@juanfranblanco : in visual code ; i get warnings about line length > 145 : how to disable that ?
Juan Blanco
@juanfranblanco
Dec 07 2018 17:05
if you are using solium as the linter change the rule
you can change it in user settings
or using a solium configuration file
max-len
Stef Heyenrath
@StefH
Dec 07 2018 17:13
can you provide an complete example for that solium config file please?
Juan Blanco
@juanfranblanco
Dec 07 2018 17:16
.soliumrc.json
{
  "custom-rules-filename": null,
  "rules": {
    "imports-on-top": false,
    "variable-declarations": false,
    "array-declarations": true,
    "operator-whitespace": true,
    "lbrace": true,
    "mixedcase": true,
    "camelcase": true,
    "uppercase": true,
    "no-empty-blocks": true,
    "no-unused-vars": true,
    "quotes": true,
    "indentation": true,
    "whitespace": true,
    "deprecated-suicide": true,
    "pragma-on-top": true
  }
}
Stef Heyenrath
@StefH
Dec 07 2018 17:26
ok
Now I get this:
SyntaxError: Source file requires different compiler version (current compiler is 0.4.24+commit.e67f0147.Emscripten.clang - note that nightly builds are considered to be strictly less than the released version
pragma solidity ^0.5.0;
Juan Blanco
@juanfranblanco
Dec 07 2018 18:20
have you configured it to use a different version?
the current one included is 0.5.0
@StefH ^^
Stef Heyenrath
@StefH
Dec 07 2018 18:31
it seems that truffle does still have 0.4.24 ?
Juan Blanco
@juanfranblanco
Dec 07 2018 18:52
ah i did not know that
you can point a specific target in the user settings
@a7coretryan apologies I will continue checking that tomorrow it is late here
took a while to launch the poa
Stef Heyenrath
@StefH
Dec 07 2018 19:15
I switch to truffle version 5.0.0-next.18 to get support for 0.5.0
Juan Blanco
@juanfranblanco
Dec 07 2018 19:16
ah thanks I could have asked :)
i didn't know if it was released when you mentioned it
Tom Ryan
@a7coretryan
Dec 07 2018 19:20
@juanfranblanco Thanks Juan - no problem.
Stef Heyenrath
@StefH
Dec 07 2018 19:38
@juanfranblanco : I've trying to get the solc compiler working for version 0.5.0 ; however the abi is always an [] ???
Juan Blanco
@juanfranblanco
Dec 07 2018 19:39
what version of vscode you are using?
oh solc uses the new input
check in the compiler docs
"new" well enforces the new input
Stef Heyenrath
@StefH
Dec 07 2018 19:42
btw i'm using the javascript solc
Juan Blanco
@juanfranblanco
Dec 07 2018 19:43
yeah is the same
check the solidity docs (read the docs) in the compilation input
Stef Heyenrath
@StefH
Dec 07 2018 19:46
reading now....
Stef Heyenrath
@StefH
Dec 07 2018 19:56
a lot has changes in input & output since 0.4.xxx
Juan Blanco
@juanfranblanco
Dec 07 2018 19:59
yeah
Stef Heyenrath
@StefH
Dec 07 2018 20:06
ok; I got the solc working again...
Tomorrow I'll take a look at truffle to see if I can still unit-test
I doubt all does work in one go... (already saw some GAS errors...)
Juan Blanco
@juanfranblanco
Dec 07 2018 20:27
Forgot to mention to stringfy the input