These are chat archives for Nethereum/Nethereum

19th
Aug 2018
Nicholas
@MrMonotone
Aug 19 2018 00:01
image.png
Enigmatic
@EnigmaticUnreal_twitter
Aug 19 2018 03:39
Hey Nicholas
Try await in front of the callasync line?
var electionType = await contract.GetFunction("electionType").CallAsync<string>().Result
Something like this i reckon
wedao1
@wedao1
Aug 19 2018 12:17
I forgot my domain name, what should I do?
But I know the namehash.
Anyone knows?
chitin4
@chitin4
Aug 19 2018 13:03
Guys can someone get a visualstudio noob started with creating an own project? I think I'm missing basics here, can't even get the Desktop.Sample to run
atm I'm stuck with transactionmanager - I try to deploy an ENSRegistry but I can't use the method DeployContractAndWaitForReceiptAsync - Nethereum.RPC.TransactionManagers doesn't know that method
alphasignal
@alphasignal
Aug 19 2018 13:10
hi guys, I was wondering if someone can help...just did the very basic call to unlock the account on a server that runs parity...the call I issue is:
var unlockResult = await web3.Personal.UnlockAccount.SendRequestAsync(senderAddress, password, 2);
and it just hands forever and never returns.
Any help would be much appreciated.
Nufflee
@Nufflee
Aug 19 2018 15:34
Hello, I tried building vscode-solidity but I'm getting these errors related to nethereum-codegen https://pastebin.com/H1n6jxYv
chitin4
@chitin4
Aug 19 2018 16:53
Which IDE is the recommended to work with nethereum anyway?
With Visual Studio I cannot compile all the tests without Errors
alphasignal
@alphasignal
Aug 19 2018 17:15
Definitely too buggy...any time there is an unexpected RPC response (ie. method not found) the async request just hangs...definitely needs upgrading and will be building my own framework in C++.
Dave Whiffin
@Dave-Whiffin
Aug 19 2018 17:25
@chitin4 - what compilation errors are you seeing? Visual Studio is the default IDE for developers contributing to Nethereum. However most devs simply use the Nethereum nuget packages rather than downloading and building the source.
Dave Whiffin
@Dave-Whiffin
Aug 19 2018 17:42
@alphasignal If you provide some source code which replicates the "method not found" and hanging issue I'll look in to it for you. The various ethereum nodes/clients behave differently, so results from geth can differ from ganache and other implementations. I would definitely recommend running against geth locally as a starting point (normally localhost:8545), just to iron out any obvious errors before moving on.
@chitin4 @alphasignal @wedao1 - apologies for the delay in response. It is holiday time for the Nethereum dev's, we're making best efforts to respond quickly.
@Nufflee - I concentrate more on the dot net side of Nethereum development and @juanfranblanco (the author) is away at the moment. May I ask why you're trying to build vs-code solidity?
Nufflee
@Nufflee
Aug 19 2018 17:45
I wanted to try to improve code completion
And contribute to it but I cannot build it
Dave Whiffin
@Dave-Whiffin
Aug 19 2018 17:46
ok - I'll see what I can do for you.
alphasignal
@alphasignal
Aug 19 2018 17:48
@Dave-Whiffin if you connect to a node that for instance does not have "personal" json RCP calls authorized, and you send personal_unlockAccount, it will just hang...and furthermore even if it is implemented, if you get an error message of any kind it will just hand...example, send personal_unlockAccount with a valid hexadecimal integer will give the following error:
{"jsonrpc":"2.0","error":{"code":-32000,"message":"Time-unlocking is only supported in --geth compatibility mode.","data":"Restart your client with --geth flag or use personal_sendTransaction instead."},"id":1}
The method that calls this has await, and will just sit there blocked.
Dave Whiffin
@Dave-Whiffin
Aug 19 2018 18:01
@alphasignal Thanks for the info - I'll take a look, at the very least I can add an issue to look at the error handling. @juanfranblanco can probably provide much more detail but he's away for another week or so.
Dave Whiffin
@Dave-Whiffin
Aug 19 2018 18:13
@Nufflee - I have cloned the repo and I am using Visual Studio code. I can launch the debugger without error. I can get similar errors if I a try to debug from a sub folder (i.e. not the root of the repo). I did an npm install before attempting to debug.
Nufflee
@Nufflee
Aug 19 2018 18:13
hmm
Did you get the language server compile too?
Because I get those errors when I run yarn compile/npm run compile
Dave Whiffin
@Dave-Whiffin
Aug 19 2018 18:27

I get the same errors if I run npm run compile from the root folder.

As stated I am no great expert in this, but Juan has taken me through it once before so something might come back to me.

Are you able to start a debugging session in visual studio code? I run "Launch Extension" which is configured in the .vscode folder. I am guessing there's path magic required for the compilation to work.

Nufflee
@Nufflee
Aug 19 2018 18:31
That just starts VS Code up but doesn't compile the lang server.
Dave Whiffin
@Dave-Whiffin
Aug 19 2018 20:08
Sorry for the delay, I think I am getting somewhere with it, but I have run out of time (and battery!). There’s definitely some type script import module issues which I am trying to work through. The difficulty is that the type script files themselves are code generated, so any fixes made in the ts files could be overwritten. I’ll try and get back to you later tonight or tomorrow morning with an update.
Nufflee
@Nufflee
Aug 19 2018 20:19
oh okay, thanks!
and please tag me when talking to me so I get a desktop notification
Dave Whiffin
@Dave-Whiffin
Aug 19 2018 20:30

@Nufflee - well npm run compile now works for me. I had to change a few typescript files in the node_modules\nethereum-codegen to fix the namespace issue. It's a workaround, like I said, these typescript files are code generated, so I haven't fixed the core issue yet. I'll need to discuss this with Juan when he returns - I'd imagine what we're doing here may not actually be necessary. But it may unblock you for the time being.

To get you going - you could download the nethereum-codegen folder below and replace your current folder (within ./node_modules).

The files I changed (from memory!):
AbiDeserialiser.ts
Nethereum.Generators.DuoCode.d.ts
app.ts

https://www.dropbox.com/s/vj5a39urzbmgtm4/nethereum-codegen.zip?dl=0

Nufflee
@Nufflee
Aug 19 2018 20:31
Thanks! But I'll need to monkey patch them using something because npm/yarn overwrite changed node module files
Dave Whiffin
@Dave-Whiffin
Aug 19 2018 20:33
yeah - sorry, I know it's not ideal. I need to sign off now I am afraid. I hope you get a little further.
Enigmatic
@EnigmaticUnreal_twitter
Aug 19 2018 20:35
Hey @chitin4, I did play with the Desktop.Sample before. What I done (using Visual Studio 2017) was a little lazy - Saved the project as a solution, used nuget to fetch all the packages, ensure the references are done correctly, and wala.
OH. And since it was compiled under 4.5.1 I think, you might want to rebuild it on 4.6 to prevent http host rejection (or use securityprotocoltype.tls12)
Just drop a beep if you're still having issues... I'll try to help once I am awake (4:30AM :))
image.png
chitin4
@chitin4
Aug 19 2018 21:56
Got most of it running - thx very much
now hanging at ens registerfunction - always getting "gas required exceeds allowance or always failing transaction"
am I doing this right on ropsten?
web3 = new Web3(account, "https://ropsten.infura.io/");
var fifsService = new TestRegistrarService(web3, "0x112234455c3a32fd11230c42e7bccd4a84e02010");
await fifsService.RegisterRequestAndWaitForReceiptAsync(new Nethereum.ENS.TestRegistrar.ContractDefinition.RegisterFunction()
{
Owner = senderAddress,
Subnode = ensUtil.GetLabelHash("test4321234").HexToByteArray()
});
chitin4
@chitin4
Aug 19 2018 22:29
Ah, the gasestimation doesn't work, had to fill in gas limit and gasprice
GetOrEstimateMaximumGasAsync returns null values