These are chat archives for Nethereum/Nethereum

7th
Aug 2018
Juan Blanco
@juanfranblanco
Aug 07 2018 07:31
@spied001 you could start with your current block
@mtbitcoin I have not forgotten you, looking at it now.. very long day yesterday
Andres G. Aragoneses
@knocte
Aug 07 2018 07:58
hey @juanfranblanco now my builds against myget's 2.5.2 CI version are failing, did you remove those artifacts or do they expire or what?
Juan Blanco
@juanfranblanco
Aug 07 2018 07:59
we moved to 3.0.0-rc1 on normal branch
let me see the CI.. as I may have not updated the numbering
(may have not.. I havent)
junbest
@junbest
Aug 07 2018 08:01
hi, i created a wallet address, how to make it fast to load the keystore? currently struggling 20 seconds to load the address, balance etc.
Andres G. Aragoneses
@knocte
Aug 07 2018 08:02
@juanfranblanco but I'm talking about myget, not nuget :)
Juan Blanco
@juanfranblanco
Aug 07 2018 08:02
@knocte yes I know
I have just triggered a build
with a newer version 3.0.0
Andres G. Aragoneses
@knocte
Aug 07 2018 08:03
but then I have to retarget from my side to use 3.x? the 2.5.x binaries don't live forever?
Juan Blanco
@juanfranblanco
Aug 07 2018 08:03
and yeah they expire..
Andres G. Aragoneses
@knocte
Aug 07 2018 08:03
ah fuck
ok no worries
Juan Blanco
@juanfranblanco
Aug 07 2018 08:03
yes try 3.x
mainly we cannot just keep the builds forever is just a CI build, I can trigger 20 a day some days
(others none :) )
@junbest Scrypt is slow to load by default, if you try 3.0.0-rc1 it has a faster version
junbest
@junbest
Aug 07 2018 08:07
Thank you, can you give a link that version please?
Juan Blanco
@juanfranblanco
Aug 07 2018 08:08
it is in nuget
already, although it is faster, it is not amazingly fast
Juan Blanco
@juanfranblanco
Aug 07 2018 08:08
Scrypt is designed to be slow to prevent attacks
yeah.. one of those packages
well KeyStore for you... or Web3
junbest
@junbest
Aug 07 2018 08:10
keystore, I created a wallet and it respond keystore file, then I save it in the local file, then load it to retrieve the info
I observe 20 seconds more to load so
is there any better way to fasten this?
Juan Blanco
@juanfranblanco
Aug 07 2018 08:12
so let me rephrase data..
you "open" a KeyStore file, (just text), then save it locally, and later on you load it
to retrieve theprivate key
yes it is slow
junbest
@junbest
Aug 07 2018 08:13
Yeah correct
do you have better way?
Juan Blanco
@juanfranblanco
Aug 07 2018 08:14
the best thing i have done is to to change the Scrypt algorithm
that is in 3.0.0-rc1
using unsafe and bulk (internals)
junbest
@junbest
Aug 07 2018 08:14
if I install the 3.0.0-rc1, it will update all in visual studio c#? via nuget
Juan Blanco
@juanfranblanco
Aug 07 2018 08:15
of course
although as usual things have changed slightly
in other areas (hence rc1)
Also if you control the wallet generation
junbest
@junbest
Aug 07 2018 08:16
Okay thank you for the help
Juan Blanco
@juanfranblanco
Aug 07 2018 08:16
you can change the kdf params for Scrypt to make it less costly
junbest
@junbest
Aug 07 2018 08:16
Okay got it
Juan Blanco
@juanfranblanco
Aug 07 2018 08:16
so it will be faster to load
simonemanneschi
@simonemanneschi
Aug 07 2018 08:17
There is any example on using websocket? i've downloaded the nuget preliminary but it's not workig
Juan Blanco
@juanfranblanco
Aug 07 2018 08:18
give me 10..
simonemanneschi
@simonemanneschi
Aug 07 2018 08:28
ok! thanks!!! :)
simonemanneschi
@simonemanneschi
Aug 07 2018 08:40
It seems missing websocket from the last CI https://www.myget.org/gallery/nethereum
Juan Blanco
@juanfranblanco
Aug 07 2018 08:40
it is
ill create a package
give me another 10 :)
simonemanneschi
@simonemanneschi
Aug 07 2018 08:41
OK Thanks so much!!! ;)
Juan Blanco
@juanfranblanco
Aug 07 2018 08:41
well i might aswell release a rc1 in normal nuget
simonemanneschi
@simonemanneschi
Aug 07 2018 08:42
oh ! Great ! and really thanks for your job!! have you a donation address?
p0isoN
@p0isoNz_twitter
Aug 07 2018 08:55
Is there an example of how to use it?
Juan Blanco
@juanfranblanco
Aug 07 2018 08:56
the websocket is the same as the ipc
so it is not the subscriptions websocket if that is what you are after
Matt.Tan
@mtbitcoin
Aug 07 2018 08:58
@juanfranblanco no worries, its not urgent just trying to understand why they are not working
Juan Blanco
@juanfranblanco
Aug 07 2018 08:59
thanks @mtbitcoin :) Ill do it after these sample on ww
ws*
junbest
@junbest
Aug 07 2018 09:07
I upgraded my nethereum library to 3.0.0.rcl but seems having error
Juan Blanco
@juanfranblanco
Aug 07 2018 09:08
what error
junbest
@junbest
Aug 07 2018 09:09
Untitled.png
please see picture
Juan Blanco
@juanfranblanco
Aug 07 2018 09:09
yes it is a breaking change
you need to use FunctionMessage
instead
hence rc1 I am documenting the changes
junbest
@junbest
Aug 07 2018 09:11
yeah no FunctionMessage, I tried ContractMessageBase
error is fixed
If i remove ContractMessage, it became worst, a lot errors
Juan Blanco
@juanfranblanco
Aug 07 2018 09:13
no
you need to use FunctionMessage
which is in the namespace Nethereum.Contracts
junbest
@junbest
Aug 07 2018 09:16
Okay I changed, one more error left
Juan Blanco
@juanfranblanco
Aug 07 2018 09:17
also Event DTOs need to implement IEventDTO
junbest
@junbest
Aug 07 2018 09:17
Untitled.png
Juan Blanco
@juanfranblanco
Aug 07 2018 09:18
ahhh
what sample are you using?
I need to port those
junbest
@junbest
Aug 07 2018 09:18
your sample wallet
Juan Blanco
@juanfranblanco
Aug 07 2018 09:18
which one
xamarin, avalonia, windows
junbest
@junbest
Aug 07 2018 09:19
windows
Juan Blanco
@juanfranblanco
Aug 07 2018 09:19
well mainly all of them need to be ported :)
junbest
@junbest
Aug 07 2018 09:20
means it will not work in my current solution?
Juan Blanco
@juanfranblanco
Aug 07 2018 09:20
i mean the samples need to be migrated to the new version of Nethereum
it should work on yours
i don't know what you are doing :) but all the code has been changed to not provide major issues porting
junbest
@junbest
Aug 07 2018 09:23
I didnt change any of the sample code, I just upgraded it 3.0.0cl, the 1 error left is in this file StandardTokenTransferViewModel .cs
Juan Blanco
@juanfranblanco
Aug 07 2018 09:24
if it cannot be found it is an issue with namespacing you have just changed that
junbest
@junbest
Aug 07 2018 09:25
Okay
thank you, I will dig it
junbest
@junbest
Aug 07 2018 09:32
Do you know this file? RxApp.cs
sorry it is a newtonsoft error
Juan Blanco
@juanfranblanco
Aug 07 2018 10:07
that is from reactive ui
ci now includes websockets it will be in rc2 on normal nuget
sample is now on the simple transfer
Juan Blanco
@juanfranblanco
Aug 07 2018 10:53
btw thanks for the donation offer .. :) not necessary
there was a typo on the issue as it wasnt using a PendingTransactions for Block or Transactions
and apologies it took a while as I was upgrading the Issues project to all the latest stuff
Juan Blanco
@juanfranblanco
Aug 07 2018 11:46
in ci
simonemanneschi
@simonemanneschi
Aug 07 2018 11:46
it gives me Nethereum.JsonRpc.Client.RpcClientUnknownException: Error occurred when trying to send web socket requests(s) ---> System.OperationCanceledException
but geth is connecting fine
address is in this format ws://192.168.3.13:32771
Juan Blanco
@juanfranblanco
Aug 07 2018 11:47
so it cannot connect / time out
try open for all addresses --ws --wsaddr "0.0.0.0" --wsapi "eth,web3,personal,net,miner,admin,debug" --wsorigins "*"
simonemanneschi
@simonemanneschi
Aug 07 2018 11:48
this one works geth attach ws://192.168.3.13:32771
Juan Blanco
@juanfranblanco
Aug 07 2018 11:49
try increasing the Timeout?
simonemanneschi
@simonemanneschi
Aug 07 2018 11:49
how?
but with geth connection is immediate
Juan Blanco
@juanfranblanco
Aug 07 2018 11:49
well you are getting a CanceledException which is due to a timeout
and yes should be inmediate
simonemanneschi
@simonemanneschi
Aug 07 2018 11:50
this one give me problems
public async Task<HexBigInteger> GetLastBlockNumber()
{
var web3 = GetConnectionFromConfig();
        return await web3.Eth.Blocks.GetBlockNumber.SendRequestAsync();
    }
i'll try other commands
Juan Blanco
@juanfranblanco
Aug 07 2018 11:51
you can use WebSocketClient.ConnectionTimeout
that should not be an issue
as you can see on the sample provided i do deployment / check balance and transfer
have you tried that one locally?
simonemanneschi
@simonemanneschi
Aug 07 2018 11:52
can you link the sample?
simonemanneschi
@simonemanneschi
Aug 07 2018 11:52
no i'll try locally but if geth is working fine i'll no expect any kind of network issues
Juan Blanco
@juanfranblanco
Aug 07 2018 11:53
you may have firewall issues on your test
app
simonemanneschi
@simonemanneschi
Aug 07 2018 11:54
i'll check and update you! thanks for your time
Juan Blanco
@juanfranblanco
Aug 07 2018 11:55
let me point to CI that sample to triple check
yes no problems
simonemanneschi
@simonemanneschi
Aug 07 2018 11:59
ok! ill check my network config!
simonemanneschi
@simonemanneschi
Aug 07 2018 12:20
quite strange, also in local the ganache log says "[14:19:58] eth_blockNumber" so the call is made but i have no result back and data stuck till timeout
is this sintax correct?
var url = "ws://192.168.3.143:7545";
        WebSocketClient.ConnectionTimeout = 20000;
        WebSocketClient.ForceCompleteReadTotalMilliseconds = 200000;
var web3 = new Web3(new WebSocketClient(url));
var balanceHandler =await web3.Eth.Blocks.GetBlockNumber.SendRequestAsync();
Juan Blanco
@juanfranblanco
Aug 07 2018 12:21
well you will the balance
sorry the blockNumber not the handler
simonemanneschi
@simonemanneschi
Aug 07 2018 12:22
the variable name is just a type
Juan Blanco
@juanfranblanco
Aug 07 2018 12:22
but yeah
simonemanneschi
@simonemanneschi
Aug 07 2018 12:24
it's not working , you can test it using ganache 1.2.1 as test server
but the same behaviour is on geth node
i'm using geth 1.8
Juan Blanco
@juanfranblanco
Aug 07 2018 12:24
yep using geth
have you tried it locally
simonemanneschi
@simonemanneschi
Aug 07 2018 12:25
yes on ganache
Juan Blanco
@juanfranblanco
Aug 07 2018 12:25
no i mean with geth
simonemanneschi
@simonemanneschi
Aug 07 2018 12:25
yes it's working
Juan Blanco
@juanfranblanco
Aug 07 2018 12:26
an then is cool
simonemanneschi
@simonemanneschi
Aug 07 2018 12:26

PS C:\Users\Simone Manneschi> geth attach ws://localhost:7545
Welcome to the Geth JavaScript console!

instance: EthereumJS TestRPC/v2.1.5/ethereum-js
coinbase: 0xc6e279b3e2586ec3e576d8ba6f0a0c260a1091c8
at block: 0 (Tue, 07 Aug 2018 14:22:52 CEST)
modules: eth:1.0 evm:1.0 net:1.0 personal:1.0 rpc:1.0 web3:1.0

Juan Blanco
@juanfranblanco
Aug 07 2018 12:26
no I mean
simonemanneschi
@simonemanneschi
Aug 07 2018 12:26

geth attach ws://192.168.3.143:7545
Welcome to the Geth JavaScript console!

instance: EthereumJS TestRPC/v2.1.5/ethereum-js
coinbase: 0xc6e279b3e2586ec3e576d8ba6f0a0c260a1091c8
at block: 0 (Tue, 07 Aug 2018 14:22:52 CEST)
modules: eth:1.0 evm:1.0 net:1.0 personal:1.0 rpc:1.0 web3:1.0

Juan Blanco
@juanfranblanco
Aug 07 2018 12:26
have you started geth
as the chain
simonemanneschi
@simonemanneschi
Aug 07 2018 12:27
i could try with a private chain right now
Juan Blanco
@juanfranblanco
Aug 07 2018 12:27
are you in windows?
simonemanneschi
@simonemanneschi
Aug 07 2018 12:27
yes
simonemanneschi
@simonemanneschi
Aug 07 2018 12:36
it seems working
on my pc using local private chain
so it's really strange
have you ever tried remote address?
Juan Blanco
@juanfranblanco
Aug 07 2018 12:38
yep but i have not experienced any issues
simonemanneschi
@simonemanneschi
Aug 07 2018 12:39
what version of geth are you using for the node?
Juan Blanco
@juanfranblanco
Aug 07 2018 12:40
1.8.13
Juan Blanco
@juanfranblanco
Aug 07 2018 12:48
actually not , i was running on my other test chain that needs updated..
let me run this again :) I might have the same problem
simonemanneschi
@simonemanneschi
Aug 07 2018 12:48
ok :)
simonemanneschi
@simonemanneschi
Aug 07 2018 13:02
ok , i can confirm you! using geth 1.8.2 your library is working fine, with version 1.8.12 it's not working
i'll check 1.8.13
Juan Blanco
@juanfranblanco
Aug 07 2018 13:02
yes is not working on 13
ill fix it now
simonemanneschi
@simonemanneschi
Aug 07 2018 13:04
ok thanks! if it can help, when you close the geth not it will give you the response. If not close it remain stuck
Juan Blanco
@juanfranblanco
Aug 07 2018 14:20
right now is all coming back to me (I should have raised an issue)
this is the reason i continued with 1.8.2 until further resolution
simonemanneschi
@simonemanneschi
Aug 07 2018 14:29
i moved to 1.8.2
but now i receive Il metodo di test BLL.Test.Ethereum.EthereumTest.TestContractEvents ha generato un'eccezione:
System.MissingMethodException: Impossibile trovare il metodo 'System.String Nethereum.ABI.Model.EventABI.get_Sha3Signature()'.
Juan Blanco
@juanfranblanco
Aug 07 2018 14:29
right the issue is that you are mixing versions
you need all the CI ones
ie Web3 from CI
simonemanneschi
@simonemanneschi
Aug 07 2018 14:30
oh let me check!
Juan Blanco
@juanfranblanco
Aug 07 2018 14:30
in your tests
I fixed that yesterday
there was a typo
simonemanneschi
@simonemanneschi
Aug 07 2018 14:32
yes! was my mistake thanks!!!
simonemanneschi
@simonemanneschi
Aug 07 2018 14:42
now it gives me Messaggio: Il metodo di test BLL.Test.Ethereum.EthereumTest.TestContractEvents ha generato un'eccezione:
System.ArgumentException: BLL.Ethereum.TransferredEvent is not a valid Event Type
are there any samples reading events with 3.0 version?
Juan Blanco
@juanfranblanco
Aug 07 2018 14:43
TransferredEvent needs to
be public class TransferredEvent : IEventDTO {
if you get the latest of vscode solidity extension you should be able to regenerate your message types (including FuctionMessage etc)
the generator has been improved so you get partial classes (for c# and vb.net) so you can regenerate if you add your own custom stuff
simonemanneschi
@simonemanneschi
Aug 07 2018 14:47
[FunctionOutput]
public class TransferredEvent : IEventDTO
{
[Parameter("address", "from", 1, true)]
public string From { get; set; }
    [Parameter("address", "to", 2, true)]
    public string To { get; set; }

    [Parameter("uint256", "value", 3, false)]
    public System.Numerics.BigInteger value { get; set; }

}
Juan Blanco
@juanfranblanco
Aug 07 2018 14:47
oh.. no
or yes depends of what you are doing
simonemanneschi
@simonemanneschi
Aug 07 2018 14:48
Juan Blanco
@juanfranblanco
Aug 07 2018 14:48
are you reusing the class as function ouput and event
simonemanneschi
@simonemanneschi
Aug 07 2018 14:48
var transferEvents = contract.GetEvent(eventName);
        var startBlock = new BlockParameter(startBlockNumber);
        var endBlock = new BlockParameter(endBlockNumber);

        var filterBlockRange = transferEvents.CreateFilterInput(startBlock, endBlock);
        var eventsList = await transferEvents.GetAllChanges<TransferredEvent>(filterBlockRange);
Juan Blanco
@juanfranblanco
Aug 07 2018 14:50
yes that should be fine
simonemanneschi
@simonemanneschi
Aug 07 2018 14:50
same error System.ArgumentException: BLL.Ethereum.TransferredEvent is not a valid Event Type
Juan Blanco
@juanfranblanco
Aug 07 2018 14:51
oh i forgot..
i got confused with the FunctionOuput
events need to be decorated with the
Event attribute
including the name
ie
[Event("transfer")]
and the interface IEventDTO
your function ouput
will be
[FunctionOuput]
and interfaced IFunctionOuputDTO
both could be the same type (hence i was confused)
and why you were mixing
simonemanneschi
@simonemanneschi
Aug 07 2018 14:53
it's working thanks! can i help you with the docs in the spare time?
Juan Blanco
@juanfranblanco
Aug 07 2018 15:08
sure i am going to start revamping them it will be great to get reviews
Juan Blanco
@juanfranblanco
Aug 07 2018 15:13
or any docs!! (forgot the obvious)
userid2018
@userid2018
Aug 07 2018 17:41
@simonemanneschi How do you get startBlockNumber and endBlockNumber