These are chat archives for Nethereum/Nethereum

28th
Mar 2018
AdamMacDon
@AdamMacDon
Mar 28 2018 01:07
So I entered this into my link.xml, now there are no more errors, but the Nethereum-based parts of my code don't seem to function properly. Gonna keep looking into it.
<assembly fullname="Nethereum.JsonRpc.Client">
           <type fullname="Nethereum.JsonRpc.Client.RpcMessages.RpcParametersJsonConverter" preserve="all"/>
     </assembly>

     <assembly fullname="Nethereum.Unity">
           <type fullname="Nethereum.Unity.RpcModel.RpcParametersJsonConverter" preserve="all"/>
     </assembly>
Nhat Nguyen
@tieudieudu
Mar 28 2018 01:44
Hi! I'm newbie on ethereum. I using Nethereum to deploy my contract. I'm sorry for my dummy question. I installed Geth on my local VPS: 192.168.77.25. My question is how to use WEB3 nethereum to connect to my VPS. I used var web3 = Nethereum.Web3.Web3("http://192.168.77.25:8545") but it not work. Thanks.
Ryo
@ryoichirooka_twitter
Mar 28 2018 01:52
@juanfranblanco Following up with the issue above -- Adding a couple of random properties to KdfParams class made everything serialized (I don't know how) so KeyStoreService.EncryptAndGenerateDefaultKeyStoreAsJson() works with that. Now KeyStoreService.DecryptKeyStoreFromJson() gives a null argument exception, because the json library somehow attempts to instantiate KdfParams and CryptoInfo with constructor parameters, which include a byte[] which obviously becomes null. Adding JsonConstrutorattribute to their parameterless constructor didn't solve it. Tried using Unity's JsonUtility but the generics around the data structure didn't allow it to serialize things like CryptoInfo, so that failed. I'll use KeyStore in Editor (it works there) and switch to a swift plugin in iOS build
Juan Blanco
@juanfranblanco
Mar 28 2018 07:00
Thanks @ryoichirooka_twitter ill look into that, can you raise an issue?
part of the roadmap is to simplify more the "wallet / key management" for all type of devices, including multi-signature and uport integration
of course all of this won't happen tomorrow
@AdamMacDon there is an example link.xml file in all the unity3d sample repos
Enigmatic
@EnigmaticUnreal_twitter
Mar 28 2018 07:43

Hi guys - trying to return a struct from my smart contract to VB. Any chance could someone help with how do I do the equivalent of decorating FunctionOutput with the parameters on VB please?

Thanks in advance!

    [FunctionOutput]
    public class Document
    {
        [Parameter("string", "name", 1)]
        public string Name {get; set;}

        [Parameter("string", "description", 2)]
        public string Description {get; set;}

        [Parameter("address", "sender", 3)]
        public string Sender {get; set;}
    }
Enigmatic
@EnigmaticUnreal_twitter
Mar 28 2018 07:53
(Sorry for the open ended question - But I haven't tried decorating functions on VB.NET so I don't quite know how to even start)
Juan Blanco
@juanfranblanco
Mar 28 2018 08:30
@EnigmaticUnreal_twitter
like this:
<Author("P. Ackerman", Version:=1.1)>
Class SampleClass
' P. Ackerman's code goes here...
End Class
from msdn
so the same but instead of using [
you use <>
it could not be the same, that will be far much easier eh :)
Enigmatic
@EnigmaticUnreal_twitter
Mar 28 2018 08:40

Thanks Juan! Appreciate it! Indeed it was only a swap from "[" to "<", though agree with your sentiments chuckles

Embarrassed to say I used telerik's C# to VB converter + your confirmation to figure it out. Much to learn I have.

Nearly there now, just need to figure out why CallDeserializingToObjectAsync complains about unknown types, but I'll get there.

Thanks as always Juan.

EKostan
@EKostan
Mar 28 2018 08:41
hello, anyone can send for me example for get all logs for specific contract events ?
I find this way, but what next ?
        var account = new Account(_apiSettings.FunderPrivateKey);
        var web3 = new Web3(account, _apiSettings.EthereumAddress);
        var contract = web3.Eth.GetContract(abi, contractAddress);
        var events = contract.GetEvent("Transfer");
@EKostan that might help
(well download it and run it)
@EnigmaticUnreal_twitter no bother
CallDeserializingToObjectAsync should not complain regardless of the language
we will need to do a codegen for vb
once we finished with the re-write of the new one.. but pluggability of templates yes it is important
Enigmatic
@EnigmaticUnreal_twitter
Mar 28 2018 08:57
Ah the problem so far was me, Juan. :) Managed to work out the FunctionOutput class in VB as such - A bit slacky with the data types but I'll change them to HexBigInteger later I promise.
<FunctionOutput>
Public Class whiteList
    Private allowedAmount As Object
    Private remainder As Object
    Private check As Boolean

    <Parameter("uint256", "allowedAmount", 1)>
    Public Property allowance() As Object
        Get
            Return allowedAmount
        End Get
        Set(value As Object)
            allowedAmount = value
        End Set
    End Property

    <Parameter("uint256", "remainder", 2)>
    Public Property remainingAllowance() As Object
        Get
            Return remainder
        End Get
        Set(value As Object)
            remainder = value
        End Set
    End Property

    <Parameter("bool", "check", 3)>
    Public Property checkBool() As Boolean
        Get
            Return check
        End Get
        Set(value As Boolean)
            check = value
        End Set
    End Property
End Class
Juan Blanco
@juanfranblanco
Mar 28 2018 08:57
oh for this you want BigInteger
Enigmatic
@EnigmaticUnreal_twitter
Mar 28 2018 08:58
Ah noted with thanks. Ah yes that makes sense....
Juan Blanco
@juanfranblanco
Mar 28 2018 08:58
HexBigInteger is only for the RPC calls
Enigmatic
@EnigmaticUnreal_twitter
Mar 28 2018 08:59
image.png
Gotcha! :)
Juan Blanco
@juanfranblanco
Mar 28 2018 09:00
:)
if you know that is going to be a smaller type, you can use an int and it will cast it for you
(use an int as an example)
Nhat Nguyen
@tieudieudu
Mar 28 2018 10:21
@juanfranblanco I am using C# to invoke CallAsync<Int64> on ERC20 SmartContract but it requires UInt256. Do you have any suggestion on this?
Juan Blanco
@juanfranblanco
Mar 28 2018 10:22
if your return value is bigger than a int64
using CallAsync<BigInteger>
System.Numerics.BigInteger
Nhat Nguyen
@tieudieudu
Mar 28 2018 10:24
ok, i got it. Thanks
Jonathan Sheely
@jsheely
Mar 28 2018 15:19
This is more of an Ethereum question in general. But I keep sending transactions that never show up on the blockchain.
I never get a receipt back. Returns null after 30 minutes. Some transaction finish in a few seconds others just disappear. Is that normal?
Jonathan Sheely
@jsheely
Mar 28 2018 15:38
It seems like this is unusual otherwise the PollForReceiptAsync functions would just run forever getting nulls back forever and hammering the API