These are chat archives for Nethereum/Nethereum

2nd
Aug 2017
meralahid
@meralahid
Aug 02 2017 01:46
Hi Everyone
I am a iOS developer with experience in Ethereum
but I have never integrated Ethereum and .Net backend
it is iOS app
look for someone has experience in Ethereum + .Net
I will be appreciate if provide any sample or tutorial for it
kai
@kaista82_twitter
Aug 02 2017 06:58
google nethereum samples/examples and nethereum.readthesocs.io its all available on github
nethereum.readthedocs.io
Juan Blanco
@juanfranblanco
Aug 02 2017 07:17
@meralahid check the Nethereum.Wallet.Sample
it demonstrates how to create a iOS, Android, Windows UWP (windows, windows phone and xbox) application
you might want to check the Nethereum.DappHybrid
Scot Wallace
@nestforce
Aug 02 2017 08:30
Hi, does anyone know how to call a contract method on mainnet with NEthereum ?
So far I only know that for mainnet, Personal.UnlockAccount API is not allowed
Juan Blanco
@juanfranblanco
Aug 02 2017 08:31
if you sync geth locally yes you can
Scot Wallace
@nestforce
Aug 02 2017 08:32
what if I don't want to have my own geth and connect to mainnet via Infura ?
Juan Blanco
@juanfranblanco
Aug 02 2017 08:32
but you can instantiate it like this:
Scot Wallace
@nestforce
Aug 02 2017 08:32
?
Juan Blanco
@juanfranblanco
Aug 02 2017 08:32
need to find the link :)
Scot Wallace
@nestforce
Aug 02 2017 08:32
sure, thank you
or check the Console project
mainly just create an Account object
using your private key
this can be loaded as per first example using your password
if stored using the web3 storage definition (ie the same as parity and geth)
or just use it directly
Scot Wallace
@nestforce
Aug 02 2017 08:35
and how should I do to call a contract function afterward?
Juan Blanco
@juanfranblanco
Aug 02 2017 08:35
ah just follow the tutorials
check the videos or
or .. (two ticks)
Scot Wallace
@nestforce
Aug 02 2017 08:36
May I have the direct link to the tutorial or article ?
so many articles to go through ...
Scot Wallace
@nestforce
Aug 02 2017 08:37
Thank you so much !
work with the account
Scot Wallace
@nestforce
Aug 02 2017 08:46
Hi, Nethereum.Web3.Accounts is not found
Juan Blanco
@juanfranblanco
Aug 02 2017 08:46
use 2.0.0 rc6
Scot Wallace
@nestforce
Aug 02 2017 08:46
I am using that
Juan Blanco
@juanfranblanco
Aug 02 2017 08:46
what package
Scot Wallace
@nestforce
Aug 02 2017 08:50
Sorry, I am using rc5
Juan Blanco
@juanfranblanco
Aug 02 2017 08:50
should be the same
but better upgrade to rc6
Scot Wallace
@nestforce
Aug 02 2017 08:50
but how to install rc6 from nuget ? 2.0.0-rc6 is not found on nuget
Juan Blanco
@juanfranblanco
Aug 02 2017 08:51
oh if you are not using portable
you need rc6-2
Scot Wallace
@nestforce
Aug 02 2017 08:51
-Version rc6-2 ?
Juan Blanco
@juanfranblanco
Aug 02 2017 08:51
2.0.0 rc6-2
Scot Wallace
@nestforce
Aug 02 2017 08:51
I found it ! Installing
Juan Blanco
@juanfranblanco
Aug 02 2017 08:52
but still the Web3.Accounts should be there
Scot Wallace
@nestforce
Aug 02 2017 08:52
this channel is really better than web3.js ^^
noted, I will try it.
@weitaolee
Aug 02 2017 12:28
@juanfranblanco I find a problem,but I can find how to solve it : I use nethereum rc6-2,I send transaction out ,and I can see the submit message in geth console(098d319d6b10ef91166e81cc28d9517e86340d1bc7f253f4d45d24b962 recipient=0xcc43decc8af578a629bf6976e6c91f9857e7fce3), but only sometime can send sucess, many times failed
It can success somtime ,so I think my code has no problem. But geth is same for everybody, I can not find out the key. who can help?
I'm using geth 1.6.7 and nethereum 2.0 rc6-2
@weitaolee
Aug 02 2017 12:38
failed mean: I can see the submit message in geth console(098d319d6b10ef91166e81cc28d9517e86340d1bc7f253f4d45d24b962 recipient=0xcc43decc8af578a629bf6976e6c91f9857e7fce3),but tx can not find on etherscan.io
kai
@kaista82_twitter
Aug 02 2017 13:00
Sure you're not on TESTNET ?
I mean, practicing on LIVE is a bit dangerous
My experience of RC6 is that it works great, I've tested many transactions, are you sure gas/limit are set right too? has the balance gone from the sending adress?
@weitaolee
Aug 02 2017 13:02
using mainnet
the transaction not include in blockchain ,so balance not gone from the sending address
kai
@kaista82_twitter
Aug 02 2017 13:03
https://etherscan.io/address/0xcc43decc8af578a629bf6976e6c91f9857e7fce3#internaltx yeah looks like you sent some internals and normal ones
@weitaolee
Aug 02 2017 13:05
yes, I test it 20+ times, but less then 10 time sucess
Juan Blanco
@juanfranblanco
Aug 02 2017 13:05
@weitaolee only time i have seen this, when you don't have enough ether to pay for the transaction
so if you send 10 transactions
@weitaolee
Aug 02 2017 13:05
I have check the ether balance
kai
@kaista82_twitter
Aug 02 2017 13:06
yeah, but it normally tells you via error
Juan Blanco
@juanfranblanco
Aug 02 2017 13:06
yep
but if you send 10 txn at the same time
kai
@kaista82_twitter
Aug 02 2017 13:06
also if you kept clicking send before being included in a block, it may have been overwritten
Juan Blanco
@juanfranblanco
Aug 02 2017 13:06
yep
@weitaolee
Aug 02 2017 13:07
Not send 10 txn at the same time
kai
@kaista82_twitter
Aug 02 2017 13:07
imo, get txid, setup a thread that polls the gettransactionreceipt before sending more
same time as in, before a block was mined
Juan Blanco
@juanfranblanco
Aug 02 2017 13:07
^^
@weitaolee
Aug 02 2017 13:07
at least one minute between every txn
kai
@kaista82_twitter
Aug 02 2017 13:07
current block time for eth?
Juan Blanco
@juanfranblanco
Aug 02 2017 13:07
ok did you get a receipt
for each one?
@weitaolee
Aug 02 2017 13:07
yes get a receipt
Juan Blanco
@juanfranblanco
Aug 02 2017 13:07
hmmm
kai
@kaista82_twitter
Aug 02 2017 13:07
22sec
so if low gas could take several minutes to be mined
Juan Blanco
@juanfranblanco
Aug 02 2017 13:08
yes but the txn might have not been included in a block
kai
@kaista82_twitter
Aug 02 2017 13:08
yup exactly, if low gas almost certainly did not hit first block
Juan Blanco
@juanfranblanco
Aug 02 2017 13:08
so you could have a nonce issue
or low ether
kai
@kaista82_twitter
Aug 02 2017 13:09
yes the transaction count could have incremented too good point
Juan Blanco
@juanfranblanco
Aug 02 2017 13:09
so when a txn was committed you dont have enough ether to pay for the next one
kai
@kaista82_twitter
Aug 02 2017 13:09
imo setup testnet with etherium wallet geth and your code
Juan Blanco
@juanfranblanco
Aug 02 2017 13:10
yeah that can be a bit misleading as the block times and gas price requirements are different
best thing is to ensure to get a receipt
kai
@kaista82_twitter
Aug 02 2017 13:11
that reminds me, did I see a gas estimator class somewhere or am I going crazy
well method
Juan Blanco
@juanfranblanco
Aug 02 2017 13:11
actually i was going to do it
mainly get an average cost
of the latest blocks
the estimate gas uses geth (or parity)
@weitaolee
Aug 02 2017 13:12
I use the web3.Eth.GasPrice to get best gasprice
Juan Blanco
@juanfranblanco
Aug 02 2017 13:12
but at least geth is not very reliable
kai
@kaista82_twitter
Aug 02 2017 13:12
you have default properties on the send transaction gas/limit so it could be used there instead of hard coded defaults, that would be smooth
well optional parameters
sorry my terminology today is terribad
Juan Blanco
@juanfranblanco
Aug 02 2017 13:12
you can also set them in the TransactionManager
web3.TransactionManager.DefaultGasPrice
kai
@kaista82_twitter
Aug 02 2017 13:12
yeah I manually set them but they are optional which is nice too
Juan Blanco
@juanfranblanco
Aug 02 2017 13:13
yep
pain in the butt to code the 100 overloads
:D
kai
@kaista82_twitter
Aug 02 2017 13:13
yeah, i didnt see if you wrote overloads or just used optional params
but if its bigint, im not sure how you do optional params
because BigInteger gasPrice = new BigInteger(blah) isnt a compile time constant
Juan Blanco
@juanfranblanco
Aug 02 2017 13:14
yes, it will get confused
kai
@kaista82_twitter
Aug 02 2017 13:14
overrides can definately be a pain
Juan Blanco
@juanfranblanco
Aug 02 2017 13:14
with the input parameters for the function
kai
@kaista82_twitter
Aug 02 2017 13:14
and also optionals
Juan Blanco
@juanfranblanco
Aug 02 2017 13:14
re web3.Eth.GasPrice @weitaolee
you might want to use the gas price average for a few blocks as it will change
and also wait for your receipt
if you are not in a hurry, just wait for receipt
in here when I try to transfer the whole balance to new accounts
it waits for the latest txn to be mined
(receipt)
kai
@kaista82_twitter
Aug 02 2017 13:18
Juan do you work for your self btw?
Juan Blanco
@juanfranblanco
Aug 02 2017 13:18
and deducts from the total amount, the price
no i worked at Consensys
work*
kai
@kaista82_twitter
Aug 02 2017 13:20
wow quite a big company
nice
@weitaolee
Aug 02 2017 13:20
I think sucess or fail not matter if you get receipt
the tx send to geth ,so the next work will do by geth
Juan Blanco
@juanfranblanco
Aug 02 2017 13:21
there are two steps
one you submit the transaction
the next the transaction needs to be mined
that is when you get the receipt
geth will do a validation before hand to ensure is correct
but at the time of mining might be rejected (hence lost)
kai
@kaista82_twitter
Aug 02 2017 13:22
tx -> geth -> network -> geth -> you, you're resending when its out there in the network
Juan Blanco
@juanfranblanco
Aug 02 2017 13:22
due to not having enough ethere
as an example
the receipt is when it is committed
@weitaolee
Aug 02 2017 13:23
I can send it ,and I see I have submit it (the submited message in geth console) , and the sender address have enought ether
maybe some reason made geth reject it?
Juan Blanco
@juanfranblanco
Aug 02 2017 13:24
so there is an issue from geth to being mined
yeah or the miner
and the reasons we are thinking
conflicting nonces, or cost
@weitaolee
Aug 02 2017 13:25
Thanks ,I try use different eth client ,geth /parity
Juan Blanco
@juanfranblanco
Aug 02 2017 13:25
have you tried connecting to infura?
@weitaolee
Aug 02 2017 13:26
No ,I'm not well know infura
Juan Blanco
@juanfranblanco
Aug 02 2017 13:26
Infura is a public node, so you don't have to sync locally using geth or parity
@weitaolee
Aug 02 2017 13:27
I have 2 node , full sync, one geth, another parity
Juan Blanco
@juanfranblanco
Aug 02 2017 13:27
ah well
then you are sorted :D
infura is what metamask uses
(if it helps)
@weitaolee
Aug 02 2017 13:29
I'm try it on geth and parity ,and I get the same problem
sometimes sucess,but otherwise not
I need use the full client @juanfranblanco
Juan Blanco
@juanfranblanco
Aug 02 2017 13:30
you are using 21 shannon / gwei
in your txn
which should be fine
the polling service per each transaction and see how it goes
another thing is that when they txn are rejected
they apperar briefly in the network
including etherscan
kai
@kaista82_twitter
Aug 02 2017 13:34
erm, TransactionReceiptPollingService that's what I was on about Juan, is that in the main lib? can I use that for my polling or do I write own
Juan Blanco
@juanfranblanco
Aug 02 2017 13:35
it is a simple one, you can use it
@weitaolee
Aug 02 2017 13:35
Yes,getreceipt only get result of this txn
Juan Blanco
@juanfranblanco
Aug 02 2017 13:35
if you want, is part of Web3
@weitaolee
Aug 02 2017 13:35
But can not help the txn done
Do I understand it correct?
kai
@kaista82_twitter
Aug 02 2017 13:36
oh nice, soo good
@weitaolee you are mining on your local geth to push this out arn't you?
disregard that, you must be if you had some work
Juan Blanco
@juanfranblanco
Aug 02 2017 13:37
I did not wanted to make a complex one, ie using RX as it will bring difficulties in a cross platform situation. (you might want to use a backgroundworker)
kai
@kaista82_twitter
Aug 02 2017 13:37
RX?
Juan Blanco
@juanfranblanco
Aug 02 2017 13:37
reactive extensions
@weitaolee
Aug 02 2017 13:37
@kaista82_twitter I do not mining
I send it and pay ether
Juan Blanco
@juanfranblanco
Aug 02 2017 13:38
yes it is a client node connected to mainnet, no need to mine
@weitaolee
Aug 02 2017 13:38
other miner will process it ,include it into block
kai
@kaista82_twitter
Aug 02 2017 13:38
ahh ok, I'll stick with async/await tpl stuff at moment for same reason (compatibility)
@weitaolee
Aug 02 2017 13:38
Yes
kai
@kaista82_twitter
Aug 02 2017 13:38
oh sorry, I thought you had to mine a bit just to push the tx as I've had problems just sending the tx before
but tbh that was private net so... i will shut up
Juan Blanco
@juanfranblanco
Aug 02 2017 13:39
yes that is what the transactionpolling does.. it just adds cancellationtoken
@weitaolee
Aug 02 2017 13:41
I have no idea to find out the key problem, guys
@weitaolee
Aug 02 2017 14:35
Maybe I should wait for the first txn, I restart my parity, there two account in it
I use parity UI, send from the main account , nerver sucess. But I use other account to send txn,sucess
kai
@kaista82_twitter
Aug 02 2017 15:44
@weitaolee are you using offline signing?
kai
@kaista82_twitter
Aug 02 2017 16:03
I don't see how one fails and one don't, does fail mean you dont see the transaction id at the end when sending from the primary account?
or just that it doesn't get mined