These are chat archives for Nethereum/Nethereum

26th
Sep 2017
radWorx
@radWorx
Sep 26 2017 00:46
Nethereumcode error-Task.PNG
Hello all, Thank you for your work Juan.
Using VS Community 2017. Following Tutorial but can't get rid of errors. any ideas?
radWorx
@radWorx
Sep 26 2017 00:56
Nethereumcode-errolist.PNG
Andres G. Aragoneses
@knocte
Sep 26 2017 02:19
what's gether?
Juan Blanco
@juanfranblanco
Sep 26 2017 09:43
@radWorx i have updated the tutorials to the latest rc7 please have a look now https://github.com/Nethereum/Nethereum/tree/master/src/Nethereum.Tutorials
although not able to use Task etc is rather strange
@knocte ?
Andres G. Aragoneses
@knocte
Sep 26 2017 09:45
@juanfranblanco I know what's geth, but I don't know what's "gether"? :)
Juan Blanco
@juanfranblanco
Sep 26 2017 09:46
is it me making a spelling mistake? or is a general comment you heard
obviously im confused
ahhhh
ha ha ha
it is a unit of conversion
@knocte
Andres G. Aragoneses
@knocte
Sep 26 2017 09:51
yeah I saw it in a commit of yours x-)
what do you mean 'a unit of conversion'?
Juan Blanco
@juanfranblanco
Sep 26 2017 09:53
like wei, ether, etc
wei = 1
ether = 1000000000000000000 (10 power 18)
kai
@kaista82_twitter
Sep 26 2017 09:54
ether has lots of decimal places, each place is named
sup Juan, hows things mate
Juan Blanco
@juanfranblanco
Sep 26 2017 09:55
gether = 1000000000000000000000000000
which i need to count :)
kai
@kaista82_twitter
Sep 26 2017 09:56
hehe
Juan Blanco
@juanfranblanco
Sep 26 2017 09:56
not bad yourself?
kai
@kaista82_twitter
Sep 26 2017 09:56
yeah up and down but generally up haha
although
im getting hungry
1 hour till food
Juan Blanco
@juanfranblanco
Sep 26 2017 09:57
ha ha KFC?
kai
@kaista82_twitter
Sep 26 2017 09:57
i wish mate, that was last night
bargain bucket
so good
today im on site (1 day a week)
so tesco and a wrap or a chicken salad thing with noodles
im in worcester, in the sticks so im nowhere near any kfc etc
and if i goto the pub again and have a 3 meat sandwich from carvery im gonna be falling asleep by 2pm
Juan Blanco
@juanfranblanco
Sep 26 2017 09:58
yes for some reason all the offices are normally in the middle of nowhere
damn im hungry now too
kai
@kaista82_twitter
Sep 26 2017 09:59
lol im sorry
i dont think I even have backup crisps in the drawer
nope
Andres G. Aragoneses
@knocte
Sep 26 2017 10:00
oh, didn't know, thanks @juanfranblanco, I've always found these unit names to be super weird
kai
@kaista82_twitter
Sep 26 2017 10:00
ill make up for it with some thins biscuits at dinner time
Juan Blanco
@juanfranblanco
Sep 26 2017 10:00
@knocte oh yes, and they also changed magically like 6 months ago
Andres G. Aragoneses
@knocte
Sep 26 2017 10:00
omg xD
Juan Blanco
@juanfranblanco
Sep 26 2017 10:01
there were some corrections, some got removed others move to another unit
Andres G. Aragoneses
@knocte
Sep 26 2017 10:01
and there's tether unit as well?
kai
@kaista82_twitter
Sep 26 2017 10:01
yup
Juan Blanco
@juanfranblanco
Sep 26 2017 10:01
yes
Andres G. Aragoneses
@knocte
Sep 26 2017 10:01
like the tether project?
omg
Juan Blanco
@juanfranblanco
Sep 26 2017 10:01
ha ha ha
yes to add to the confusion, actually when you asked out of context I thought there was another testchain
Andres G. Aragoneses
@knocte
Sep 26 2017 10:02
xDDD
Juan Blanco
@juanfranblanco
Sep 26 2017 10:02
so it was G Ether
like Kether for kovan
i was like wtf another testchain?
Andres G. Aragoneses
@knocte
Sep 26 2017 10:03
hahaha
Juan Blanco
@juanfranblanco
Sep 26 2017 10:04
from that commit we now have bigdecimal in c#
so it might help you as you deal with billions of ether
;)
Alexander Yarushin
@aayarushin
Sep 26 2017 10:05
oh, sounds very useful! :) @juanfranblanco
Juan Blanco
@juanfranblanco
Sep 26 2017 10:07
the main issue with decimal is that once you pass the 19 digits, it will lose precission to acommodate for more relevant units
Andres G. Aragoneses
@knocte
Sep 26 2017 10:18
oh yeah, I don't need to split my fortune anymore into different buckets of millions of ether, thanks Juan!
Juan Blanco
@juanfranblanco
Sep 26 2017 10:19
:)
typo above, decimal is 29 digits
Aidan Fray
@AidanFray
Sep 26 2017 10:50
Juan Blanco. Love the work, I'm just having trouble when I try and deploy a contract; it just hangs and doesn't continue?
hak
@hakart_twitter
Sep 26 2017 11:11
Hi Guys,
I wonder why Nethereum solution is not build-able ?
I just pull from Git try to build
Juan Blanco
@juanfranblanco
Sep 26 2017 11:12
@AidanFray are you mining?
@hakart_twitter you need the latest vs2017
use the nuget if you cannot build
hak
@hakart_twitter
Sep 26 2017 11:13
@juanfranblanco yes i have with latest patch
Juan Blanco
@juanfranblanco
Sep 26 2017 11:13
then you should be fine
on 15.3.4 and above
hak
@hakart_twitter
Sep 26 2017 11:14
image.png
Juan Blanco
@juanfranblanco
Sep 26 2017 11:14
ignore portable
that needs to be build separate
radWorx
@radWorx
Sep 26 2017 11:16
@juanfranblanco Thank you.
Juan Blanco
@juanfranblanco
Sep 26 2017 11:16
ill push it later
hak
@hakart_twitter
Sep 26 2017 11:16
ok thanks
Juan Blanco
@juanfranblanco
Sep 26 2017 11:17
portable is just for compatibility (also is more "portable" as it is one dll) but netstandard is the way
Aidan Fray
@AidanFray
Sep 26 2017 11:24
Yes @juanfranblanco, I can process account to account transactions perfectly fine
var result = await function.SendTransactionAsync(senderAddress, 10);
It hangs on that line. It's just trying to change a value in a test contract
Juan Blanco
@juanfranblanco
Sep 26 2017 11:25
just hangs?
you have deployed the contract before hand I guess
Aidan Fray
@AidanFray
Sep 26 2017 11:27
Yes, I deployed it through mist
So the line: " var con = web3.Eth.GetContract(abi, conAddress);"
Works absolutly fine
Juan Blanco
@juanfranblanco
Sep 26 2017 11:39
yes that does not connect to anything
can you a simple
web3.Eth.GetAccounts.SendRequestAsync()
(top of my head.. might be a typo there)
Aidan Fray
@AidanFray
Sep 26 2017 11:48
Which line does not connect?
And I can't fine GetAccounts in Eth
Juan Blanco
@juanfranblanco
Sep 26 2017 11:49
var con = web3.Eth.GetContract(abi, conAddress);
it just creates an instance of contract based on the abi and contract address so it does not connect to geth / parity
Aidan Fray
@AidanFray
Sep 26 2017 11:50
Ah okay, that makes sense. So you'd only use that for calls not transaction?
Juan Blanco
@juanfranblanco
Sep 26 2017 11:51
well the contract class allows you to simply interact with functions
and events
so you can do calls and / or transaction from a function
functions need to have a reference to the contract name etc
BUT..
if you do
var accounts = web3.Eth.Accounts.SendRequestAsync();
what do you get?
does it hang?
have you started geth with rpc enabled?
Aidan Fray
@AidanFray
Sep 26 2017 11:53
Yeah, geth is all sorted. It's your testchain
I'll run the command now and check
The command doesn't hang
And I get:
Id = 29, Status = WaitingForActivation, Method = "{null}", Result = "{Not yet computed}"
Juan Blanco
@juanfranblanco
Sep 26 2017 11:55
sorry i missed the obvious await
Aidan Fray
@AidanFray
Sep 26 2017 11:55
Yeah just added it
Yeah I get a list of all the accounts
Juan Blanco
@juanfranblanco
Sep 26 2017 11:56
cool so you are ok connecting then
so if you are sure you are mining
Aidan Fray
@AidanFray
Sep 26 2017 11:57
image.png
Juan Blanco
@juanfranblanco
Sep 26 2017 11:57
no i mean with geth
or parity
Aidan Fray
@AidanFray
Sep 26 2017 11:58
I get "null" return from geth when mining
image.png
Juan Blanco
@juanfranblanco
Sep 26 2017 11:58
yes that is fine
ok
so if you type eth
on the console
Aidan Fray
@AidanFray
Sep 26 2017 12:00
Yeah, I get a nice list of functions
Juan Blanco
@juanfranblanco
Sep 26 2017 12:00
what is the blockNumber
i am asking this, just in case you are building your dag
and that takes time to get started mining
Aidan Fray
@AidanFray
Sep 26 2017 12:01
I'm getting "undefined"
Juan Blanco
@juanfranblanco
Sep 26 2017 12:01
eth.blockNumber
Aidan Fray
@AidanFray
Sep 26 2017 12:02
Sorry "466"
Juan Blanco
@juanfranblanco
Sep 26 2017 12:02
ok cool so you should be fine :)
paste your gist here
I load in my abi from a text file
So I don't have to add extra "
Juan Blanco
@juanfranblanco
Sep 26 2017 12:06
sure
so where do you have the problem?
you deployed the contract using mist and then you are calling it
Aidan Fray
@AidanFray
Sep 26 2017 12:11
Sorry, let me add the line back in
I'll update the gist
Updated, it when I use the SendTransactionAsync()
Juan Blanco
@juanfranblanco
Sep 26 2017 12:15
what is the abi
like?
it should not hang
Aidan Fray
@AidanFray
Sep 26 2017 12:15
ABI
[{"constant":false,"inputs":[{"name":"x","type":"uint256"}],"name":"change","outputs":[],"payable":false,"type":"function"},{"constant":false,"inputs":[{"name":"a","type":"uint256"}],"name":"multiply","outputs":[{"name":"d","type":"uint256"}],"payable":false,"type":"function"}]
That didn't work, I'll put the sol code in a gist
Juan Blanco
@juanfranblanco
Sep 26 2017 12:16
is ok
Thanks for the help btw
you are missing t.Wait();
@AidanFray
Aidan Fray
@AidanFray
Sep 26 2017 12:38
Ah okay, I'll add it in
Juan Blanco
@juanfranblanco
Sep 26 2017 12:38
just added your abi and bytecode plus deployment
you will need to add gas to your transaction
also included a managed account so you dont need to unlock
have fun
Aidan Fray
@AidanFray
Sep 26 2017 12:41
Brilliant, thank you
Why is the t.Wait() so important?
Juan Blanco
@juanfranblanco
Sep 26 2017 13:21
you have started a thread but you have to wait for it to finish
when you use Result it does a wait and returns you the output
when using Task (void) you just wait for completion
you could have started many tasks and wait for all
mainly the issue is that you cannot start a console async, but they are working on it if not done already
(at least for core)
Aidan Fray
@AidanFray
Sep 26 2017 13:24
Ah I understand, I'm going to use a WPF form anyway, the console was just to get the functionality laid out
Chandra Sekhar
@tcsekhar
Sep 26 2017 13:24
Need some help start coding with nethereum. I created the sample smart contract, compiled, migrated, deployed to TestRPC, and I'm able to use the console to call my methods. I now need to call the same methods through ASP.NET C# code. Can someone please point me to some documentation around how to get this to work?
Juan Blanco
@juanfranblanco
Sep 26 2017 13:24
@AidanFray you can use the code generator that will help you
for services
either in vscode or a console
the console is on the releases in github compiled
the videos included
or just have a browse at the tutorial code
samples
if you are using vscode
to compile solidity
use that to generate your service
from the json output
"service" = c# service
that will help you :)
Chandra Sekhar
@tcsekhar
Sep 26 2017 13:39
thank you so much.
Ruben Murillo
@Ru_Murillo_twitter
Sep 26 2017 15:47
Is there any change to collect the logs of a custom event, say "Error(address account, string errorMsg)", from a ERC20 token?
Juan Blanco
@juanfranblanco
Sep 26 2017 15:48
you will just need the
Ruben Murillo
@Ru_Murillo_twitter
Sep 26 2017 15:48

I've managed to do this for standard events such as Transfer, by applying a filter:

var filter = token.GetTransferEvent().CreateFilterInput();

Juan Blanco
@juanfranblanco
Sep 26 2017 15:49
ah.. the same then
Ruben Murillo
@Ru_Murillo_twitter
Sep 26 2017 15:49
And then web3.Eth.Filters.GetLogs.SendRequestAsync(..., filter)
Juan Blanco
@juanfranblanco
Sep 26 2017 15:49
you can inherit the erc20 service class (if that is what you are using)
and add your extra methods if helps
Ruben Murillo
@Ru_Murillo_twitter
Sep 26 2017 15:50
token is an instance of StandardTokenService, yeah
Juan Blanco
@juanfranblanco
Sep 26 2017 15:50
let me see.. 2 seconds
Ruben Murillo
@Ru_Murillo_twitter
Sep 26 2017 15:51
Sure! Thanks, @juanfranblanco
Juan Blanco
@juanfranblanco
Sep 26 2017 15:55
Ok I have changed the StandardTokenService to have web3 and contract as protected values
you can inherit and use GetEvent etc
It will hopefull be in nuget today
Ruben Murillo
@Ru_Murillo_twitter
Sep 26 2017 15:57
Awesome!
Thanks, @juanfranblanco
I'll be checking nuget constantly
Juan Blanco
@juanfranblanco
Sep 26 2017 15:57
ha ha :) no pressure
Ruben Murillo
@Ru_Murillo_twitter
Sep 26 2017 15:57
At all, mate! lol
Thanks for the support! :D
Juan Blanco
@juanfranblanco
Sep 26 2017 15:58
that was an easy one
should have thought that myself
before hand
Ruben Murillo
@Ru_Murillo_twitter
Sep 26 2017 15:59
Oh geez! I'm feeling special, now!
lol
Chandra Sekhar
@tcsekhar
Sep 26 2017 16:28

I'm trying to create my first Nethereum project. I was following the youtube tutorial https://www.youtube.com/watch?v=4t5Z3eX59k4

I'm getting a compile error:

Error CS0426 The type name 'Web3' does not exist in the type 'Web3' \Program.cs 26 Active

Can anyone please help me with resolving this error?

I have installed Nethereum.Web3
Pls Ignore me. Got it resolved.
I had to change
var web3 = new Web3.Web3(); to
var web3 = new Nethereum.Web3.Web3();
Juan Blanco
@juanfranblanco
Sep 26 2017 16:33
in the tutorial needs Web3.Web3() as it is called Nethereum already, so the namespace has been already set
Chandra Sekhar
@tcsekhar
Sep 26 2017 16:33
cool. Thanks
Chandra Sekhar
@tcsekhar
Sep 26 2017 16:58

I have geth running under the testchain, and when I run my Visual Studio code (as per the same above video), I get an exception on this line:

var unlockAccountResult = await web3.Personal.UnlockAccount.SendRequestAsync(address, password, new HexBigInteger(120));
Exception thrown: 'Nethereum.JsonRpc.Client.RpcResponseException' in mscorlib.dll
Exception thrown: 'System.AggregateException' in mscorlib.dll

Can you please let me know what I'm doing wrong? Or if I'm missing something?

Juan Blanco
@juanfranblanco
Sep 26 2017 17:18
yes geth was updated to only allow integers when unlocking so pass 120 instead
nevertheless the best thing to do is to use a ManagedAccount with the username and password
if using geth to manage your accounts
in the background it uses personal_sendTransaction
using your password to unlock the only for this transaction
Chandra Sekhar
@tcsekhar
Sep 26 2017 17:20
yes that worked. CHanged from hex to int, it works.
Juan Blanco
@juanfranblanco
Sep 26 2017 17:21
@/all new nuget is out for 2.0.0
i will post the unity3d files for the release tomorrow
Chandra Sekhar
@tcsekhar
Sep 26 2017 17:45
@juanfranblanco Can you please let me know how to create and use a "ManagedAccount with the username and password"
kai
@kaista82_twitter
Sep 26 2017 17:52
Nice one Juan
Enable personal on geth if not on by default
Chandra Sekhar
@tcsekhar
Sep 26 2017 17:56
Thank you!
There should be the methods you need
check usage ^^
@tcsekhar
Ruben Murillo
@Ru_Murillo_twitter
Sep 26 2017 18:06
@juanfranblanco Nice one, Juan! Thank you!
Juan Blanco
@juanfranblanco
Sep 26 2017 18:16
np :)
Chandra Sekhar
@tcsekhar
Sep 26 2017 18:39

I'm running the sample code and this line has been running for the past 41 minutes and still hasn't got the receipt:

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

Is this normal?

Juan Blanco
@juanfranblanco
Sep 26 2017 18:40
are you mining?
Chandra Sekhar
@tcsekhar
Sep 26 2017 18:40
I have the geth running in the background
Juan Blanco
@juanfranblanco
Sep 26 2017 18:40
ok if you check geth
Chandra Sekhar
@tcsekhar
Sep 26 2017 18:40
but I don't see any action on the geth window
Juan Blanco
@juanfranblanco
Sep 26 2017 18:40
if you started the testnet
using the batch / sh file
you should not see anything
type
eth.blockNumber
and see what you get
and
Chandra Sekhar
@tcsekhar
Sep 26 2017 18:41
I get undefined
Juan Blanco
@juanfranblanco
Sep 26 2017 18:41
two ticks
Chandra Sekhar
@tcsekhar
Sep 26 2017 18:41

sorry typo - case sensitive

16

Juan Blanco
@juanfranblanco
Sep 26 2017 18:42
ah cool
try again
just checking if is mining
you can also do
Chandra Sekhar
@tcsekhar
Sep 26 2017 18:42
still 16
Juan Blanco
@juanfranblanco
Sep 26 2017 18:42
is
eth.mining returning false?
Chandra Sekhar
@tcsekhar
Sep 26 2017 18:43
its true
eth.blockNumber
16
eth.mining
true
Juan Blanco
@juanfranblanco
Sep 26 2017 18:43
after 15 seconds or less
it should have moved to another block
ie 17
Chandra Sekhar
@tcsekhar
Sep 26 2017 18:44
hmm
Juan Blanco
@juanfranblanco
Sep 26 2017 18:44
has eth.pendingTransactions
returned you something?
like your last transaction :)
Chandra Sekhar
@tcsekhar
Sep 26 2017 18:44
[{
blockHash: null,
blockNumber: null,
from: "0x12890d2cce102216644c59dae5baed380d84830c",
gas: 90000,
gasPrice: 20000000000,
hash: "0x35f60cacc7802070531db8f367ac9acd822ccc835e5957587155bc15ce24b5dc",
input: "0x60606040526040516020806052833950608060405251600081905550602b8060276000396000f3606060405260e060020a60003504631df4f1448114601a575b005b600054600435026060908152602090f30000000000000000000000000000000000000000000000000000000000000007",
nonce: 1,
r: "0x7c753ad2fe596e2647d86e0e96bffb7af136ef9ef1f60636d28d9bf0d65f9804",
s: "0x38b0251676745cfad932fac102a71c7bececbbe1f97893ee27a2af4e7289923b",
to: null,
transactionIndex: 0,
v: "0x1c",
value: 0
}]
>
yes I see mine
Juan Blanco
@juanfranblanco
Sep 26 2017 18:45
ok. so that is waiting to be mined
but your miner is not processing blocks
Chandra Sekhar
@tcsekhar
Sep 26 2017 18:45
not sure why..
I see Antimalware service executable constantly at 40% - is it preventing it to run?
Juan Blanco
@juanfranblanco
Sep 26 2017 18:48
yes that might be
checking on something
Chandra Sekhar
@tcsekhar
Sep 26 2017 18:48
ok will try disabling or excluding my folders
Juan Blanco
@juanfranblanco
Sep 26 2017 18:48
it might be trying to build a new DAG
Chandra Sekhar
@tcsekhar
Sep 26 2017 18:49
ok
Juan Blanco
@juanfranblanco
Sep 26 2017 18:49
that takes a while too
Chandra Sekhar
@tcsekhar
Sep 26 2017 18:54
I killed it, excluded the folder from the virus scanner, started geth again and then ran the project and its working fine now.
Juan Blanco
@juanfranblanco
Sep 26 2017 18:55
ah awesome
Ruben Murillo
@Ru_Murillo_twitter
Sep 26 2017 20:49
By the way, @juanfranblanco . Inheriting StandardTokenService and then adding extra methos to interact with custom functions wouldn't work because the ABI has to be updated with the newly created function
radWorx
@radWorx
Sep 26 2017 23:55
MinerNoExist.PNG
Stuck here. Using 2.0.0. NuGet updated.