These are chat archives for Nethereum/Nethereum

9th
Jan 2019
farzad-salimijazi
@farzad-salimijazi
Jan 09 05:21
Hi @juanfranblanco I am trying to open the game scene in unity in unity 2018.3 but I get error, is it supported there ? I get this error
farzad-salimijazi
@farzad-salimijazi
Jan 09 05:30
error CS1704: An assembly with the same name UnityEngine has already been imported. Consider removing one of the references or sign the assembly /Applications/Unity/Unity.app/Contents/Managed/UnityEngine/UnityEngine.dll (Location of the symbol related to previous error) Assets/Plugins/UnityEngine.dll (Location of the symbol related to previous error)
I appreciate any help
Juan Blanco
@juanfranblanco
Jan 09 09:01
@farzad-salimijazi just remove the UnityEngine.dll
included in the Zip
Trycoder
@Trycoder
Jan 09 12:22
@juanfranblanco The codes after 'web3.Eth.DeployContract.SendRequestAndWaitForReceiptAsync().Result' executes without blocking the thread and the resposne comes after a while
Trycoder
@Trycoder
Jan 09 12:37
should we use aysnc await to wait for the result?
Dave Whiffin
@Dave-Whiffin
Jan 09 12:42
@Trycoder - That seems very strange - I wouldn't imagine using async await versus .result would make any difference. What version of .net are you using? What client are you running (geth, parity, infura, etc)?
Trycoder
@Trycoder
Jan 09 13:09
infura
Im using .net core 2.0
Dave Whiffin
@Dave-Whiffin
Jan 09 14:23
@Trycoder Apologies, but I am not 100% sure I understand the issue. Are you saying that you are calling "Result()" and not getting a result? Is the result null?
Trycoder
@Trycoder
Jan 09 18:13
@Dave-Whiffin since
@Dave-Whiffin since SendRequestAndWaitForReceiptAsync returns Task<object> I used SendRequestAndWaitForReceiptAsync().Result to run it as a synchronous call.but often the codes after this executes and fails after which the actual expected response call returns ..Even this looks strange for me.
magik-chorne
@magik-chorne
Jan 09 20:18
is anyone using infura v3 yet? I keep getting "401 - Unauthorized Access" since switching over and can't figure out what's different
i've whitelisted my contract. I'm using the correct application key for the endpoint. I'm curious if there's something I need to do with my "project secret"
magik-chorne
@magik-chorne
Jan 09 20:29
a stripped down version of what I'm doing:
        private string serverURL = "https://rinkeby.infura.io/v3/APPLICATION_KEY";
            var account = new Nethereum.Web3.Accounts.Managed.ManagedAccount(userId, passkey);
            var byteArray = Encoding.ASCII.GetBytes(userId + ":" + passkey);
            System.Net.Http.Headers.AuthenticationHeaderValue myAuth = 
        new System.Net.Http.Headers.AuthenticationHeaderValue("Basic", Convert.ToBase64String(byteArray));

            var web3 = new Nethereum.Web3.Web3(account, serverURL, null, myAuth);
            contractHandler = web3.Eth.GetContractHandler(contractAddress);

...
        [Function("mint", "uint256")]
        public class MintFunction : FunctionMessage
        {
        //all the data
    }

...

            var transactionMessage = new MintFunction
            {
        //data
            };
            var task = contractHandler.SendRequestAndWaitForReceiptAsync(transactionMessage);
            var receipt = await task;
Roy
@Shammah
Jan 09 20:35
application key is the same as your project ID I suppose?
I can't find any documentation on how to actually enter the secret; I'm not sure if a "Basic" authentication header is sufficient
Roy
@Shammah
Jan 09 20:42
Q: What is the Project Secret? How do I use it?
A: The Project Secret provides another layer of security when sending API requests to Infura. It should only be used when sending requests from a private backend system or server as the Project Secret should never be human readable in your client facing application. There is currently no requirement to use the Project Secret. We will provide more information in future updates and release new documentation to show exactly how the Project Secret can be used when sending requests.
I'm not sure where your logic for myAuth came from
magik-chorne
@magik-chorne
Jan 09 20:59
@Shammah - yeah that's my project ID
im pretty sure I stole the myAuth example from some test deep in nethereum itself
magik-chorne
@magik-chorne
Jan 09 21:38
it used to work. not so much anymore. I've tried removing the authheader and I'm getting "400 - Bad Request" now. still sniffing around as to what's up.
Roy
@Shammah
Jan 09 21:45
I suppose you could simply remove the secret key portion?
Seems to be a work in progress, and not required anyway
magik-chorne
@magik-chorne
Jan 09 21:46
yeah the secret key isn't in there. still having issues.
Roy
@Shammah
Jan 09 21:46
doh
Apparently the given link, with v3, is broken?
oh nvm, it was a trailing /, which you don't have
magik-chorne
@magik-chorne
Jan 09 21:53
sad. im wondering if SendRequestAndWaitForReceipt() is the wrong tool for this situation. still digging
Georg Schneider
@GeorgSchneider
Jan 09 22:01
Hey guys, I'm checking out the library for the first time and trying to get this simplest request to work but to no avail
            var web3 = new Web3("https://mainnet.infura.io/v3/my-project-id");
            var blocknr = web3.Eth.Blocks.GetBlockNumber.SendRequestAsync();
            Task.WaitAll(blocknr);
            Console.WriteLine("Block Nr: {0}", blocknr.Result.Value);
getting an aggregate exception with the innermost being "RpcClientUnknownException: Error occurred when trying to send rpc requests(s)"
tried the call using curl and that worked, so doesn't seem to be an issue on infura side. any idea what I'm doing wrong?
Roy
@Shammah
Jan 09 22:05
Not sure, seems to work here fine.
Georg Schneider
@GeorgSchneider
Jan 09 22:07
what .net version are you using?
Roy
@Shammah
Jan 09 22:09
4.7.1
I'm looking at the source now. It's a rather generic exception, sadly
the exception has an inner exception, can you take a look?
As in, RpcClientUnknownException has an inner exception as well
Georg Schneider
@GeorgSchneider
Jan 09 22:14
argh, seems .net version related :/ worked now with 4.7.1
sry for the confusion
Roy
@Shammah
Jan 09 22:19
np
seems a bit odd though, I think it's supposed to even work with 3.5?
Georg Schneider
@GeorgSchneider
Jan 09 22:20
so .net 4.6.1 is the lowest this works for me (nuget pkg version 3.0)
doesn't for 4.5.1 or 4.5
anyway, thanks for the hint