These are chat archives for Nethereum/Nethereum

18th
Jan 2018
She Jong Shon
@kkagill
Jan 18 2018 01:10
I assume it might be related to IIS? I'm running it locally btw.
bluuman
@bluuman
Jan 18 2018 05:43
I am trying to send a transaction on the Rinkeby testnet using geth.
If there is an unmined transaction that I sent earlier, I get: replacement transaction underpriced
" var account = Account.LoadFromKeyStore(keyStoreEncryptedJson, password);
var web3 = new Web3(account);
var transactionPolling = web3.TransactionManager.TransactionReceiptService;
var transactionReceipt = await transactionPolling.SendRequestAsync(() =>
web3.TransactionManager.SendTransactionAsync(account.Address, addressTo, new HexBigInteger(1))
);"
JEN
@chukwuemekanweke
Jan 18 2018 09:07
Hey, i want to be able to present the information that metamask provides when making a transaction such as gas limit and gas price . i know how to get the gas limit using EstimateGasAsync() function. But how do i estimate the gas price
Juan Blanco
@juanfranblanco
Jan 18 2018 10:01
@jonathansmirnoff can you raise an issue, this is due to encoding requests
not that i have tested with RSK
maybe they could create a pull ;)
@kkagill are you in a console? Did you use Result? Wait?
@bluuman yes you need to change the noce, or increase the price to replace the previous one
@chukwuemekanweke well that depends on the current status of the network. You could check the price average
Brennan Hatton
@BrennanHatton_twitter
Jan 18 2018 15:48

Hey all, Im trying to get setup in Unity2017. The only example I can find is pretty outdated (https://github.com/Nethereum/Nethereum.Hololens.Sample), but I noticed the last update was pretty a recent. Can anyone point me to the best resource to getting started?

(Sorry if this isn't the best place to ask this, I'm new to gitter)

Juan Blanco
@juanfranblanco
Jan 18 2018 15:54
@BrennanHatton_twitter the sample is really simple as it just writes the current blocknumber
in the origami desktop
so it wont be much difference
Brennan Hatton
@BrennanHatton_twitter
Jan 18 2018 16:00
Thanks for getting back so quick! I'm struggling to get it working. I've done a heap of hacking to try and fix the issues I've been facing. I'll go back to the original of the example and see what the original problem is I was running into.
Juan Blanco
@juanfranblanco
Jan 18 2018 16:01
ok, when I did that sample it was in the early days of Hololens
so i will hope is easier now
Brennan Hatton
@BrennanHatton_twitter
Jan 18 2018 16:02
So after removing all the hololens related errors (I'm not interested in Hololens anyway), I'm getting "ArgumentException: The Assembly crypto is referenced by Nethereum.Portable ('Assets/Plugins/Nethereum.Portable.dll'). But the dll is not allowed to be included or could not be found."

The full error is

ArgumentException: The Assembly crypto is referenced by Nethereum.Portable ('Assets/Plugins/Nethereum.Portable.dll'). But the dll is not allowed to be included or could not be found.
UnityEditor.AssemblyHelper.AddReferencedAssembliesRecurse (System.String assemblyPath, System.Collections.Generic.List1 alreadyFoundAssemblies, System.String[] allAssemblyPaths, System.String[] foldersToSearch, System.Collections.Generic.Dictionary2 cache, BuildTarget target) (at C:/buildslave/unity/build/Editor/Mono/AssemblyHelper.cs:156)
UnityEditor.AssemblyHelper.AddReferencedAssembliesRecurse (System.String assemblyPath, System.Collections.Generic.List1 alreadyFoundAssemblies, System.String[] allAssemblyPaths, System.String[] foldersToSearch, System.Collections.Generic.Dictionary2 cache, BuildTarget target) (at C:/buildslave/unity/build/Editor/Mono/AssemblyHelper.cs:162)
UnityEditor.AssemblyHelper.FindAssembliesReferencedBy (System.String[] paths, System.String[] foldersToSearch, BuildTarget target) (at C:/buildslave/unity/build/Editor/Mono/AssemblyHelper.cs:196)
UnityEngine.GUIUtility:ProcessEvent(Int32, IntPtr)

Juan Blanco
@juanfranblanco
Jan 18 2018 16:02
oh so you don't want hololens
what do you want?
Brennan Hatton
@BrennanHatton_twitter
Jan 18 2018 16:02
I just want to get it running in Unity
Juan Blanco
@juanfranblanco
Jan 18 2018 16:03
which unity version?
Brennan Hatton
@BrennanHatton_twitter
Jan 18 2018 16:03
Im on 2017.3
Juan Blanco
@juanfranblanco
Jan 18 2018 16:03
are you planning to do webgl
Brennan Hatton
@BrennanHatton_twitter
Jan 18 2018 16:03
No
Juan Blanco
@juanfranblanco
Jan 18 2018 16:03
ios?
Brennan Hatton
@BrennanHatton_twitter
Jan 18 2018 16:03
VR/AR I can stick to Window UP if necessary, but Windows/Andorid are my biggest interests
Juan Blanco
@juanfranblanco
Jan 18 2018 16:04
ah ok so you should be able to work with Nethereum vanilla
Brennan Hatton
@BrennanHatton_twitter
Jan 18 2018 16:04
iOS if it is easier, but I rather andoird.
Great
Juan Blanco
@juanfranblanco
Jan 18 2018 16:04
Then you need the dlls :)
this is a bit of an annoyance as I have not released dlls
mainly nuget packages
But you can get the dlls from the nuget with all dependencies
Brennan Hatton
@BrennanHatton_twitter
Jan 18 2018 16:05
Sorry to be an annoyance!
Juan Blanco
@juanfranblanco
Jan 18 2018 16:06
oh not you
mainly myseld not releasing the dlls :)
Brennan Hatton
@BrennanHatton_twitter
Jan 18 2018 16:06
Good :). How do I get the dlls from the nuget?
Juan Blanco
@juanfranblanco
Jan 18 2018 16:06
never thought about that option (was no need)
i think the simplest way will be to create a console application
.net 4.61
and a reference to Nethereum.Portable (as it will have less dependencies)
compile the app
and all the dlls will be in the bin folder
Brennan Hatton
@BrennanHatton_twitter
Jan 18 2018 16:08
Do this in Visual Studio?
Juan Blanco
@juanfranblanco
Jan 18 2018 16:08
including dependencies
yeah
Brennan Hatton
@BrennanHatton_twitter
Jan 18 2018 16:08
I will give it a go, thanks!
Juan Blanco
@juanfranblanco
Jan 18 2018 16:08
nb ill put that in the todo
Brennan Hatton
@BrennanHatton_twitter
Jan 18 2018 16:08
Great
Juan Blanco
@juanfranblanco
Jan 18 2018 16:27
note you should be able to compile targetting now 4.6.1 in Unity
Brennan Hatton
@BrennanHatton_twitter
Jan 18 2018 16:32
Yep. Thanks. I have the dll's. Couldnt get the UWP to build. Should it work in the editor with 4.6.1?
Juan Blanco
@juanfranblanco
Jan 18 2018 16:32
yep
i would ignore uwp all together
and just mainly create an script from unity
put the portable library (and other dependent dlls) in the assets
and target 4.6.1 in the editor
Brennan Hatton
@BrennanHatton_twitter
Jan 18 2018 16:36

I'm getting this in the 3D text file

"One or more errors occurred. at System.Threading.Tasks.Task.ThrowIfExceptional (System.Boolean includeTaskCanceledExceptions) [0x00011] in <c95265f74fdf4905bfb0d5a4b652216c>:0
at System.Threading.Tasks.Task1[TResult].GetResultCore (System.Boolean waitCompletionNotification) [0x0002b] in <c95265f74fdf4905bfb0d5a4b652216c>:0 at System.Threading.Tasks.Task1[TResult].get_Result () [0x0000f] in <c95265f74fdf4905bfb0d5a4b652216c>:0
at BlockNumber.Update () [0x00046] in D:\D-Documents\Crypto Dev\Nethereum.Hololens.Sample-master\Origami\Assets\Scripts\BlockNumber.cs:25 "

I had to add to the BlockNumber.cs
using System.Runtime;

and copy to the plugin folder
-System.Runtime
-System.Runtime.Numerics
-System.Numerics
-System.Threading
-System.Threading.Tasks

@BrennanHatton_twitter
She Jong Shon
@kkagill
Jan 18 2018 17:33

@juanfranblanco no, i'm not using result and wait. I'm testing this using .net core 2.0 web api

      public async Task<IEnumerable<string>> Get()
        {
            TestClass test = new TestClass();
            await test.TestDeployContract();

            return new string[] { "value1", "value2" };
        }
    public class TestClass
    {              
        public async Task TestDeployContract()
        {
            var senderAddress = "0x1e06f100f1b13d69d2edd9cec6ed53e3e6f66211";
            var password = "P@$$w0rd";
            var abi = @"[{""constant"":false,""inputs"":[{""name"":""val"",""type"":""int256""}],""name"":""multiply"",""outputs"":[{""name"":""d"",""type"":""int256""}],""payable"":false,""stateMutability"":""nonpayable"",""type"":""function""},{""inputs"":[{""name"":""multiplier"",""type"":""int256""}],""payable"":false,""stateMutability"":""nonpayable"",""type"":""constructor""}]";
            var byteCode = "0x6060604052341561000f57600080fd5b6040516020806100cf833981016040528080516000555050609a806100356000396000f300606060405260043610603e5763ffffffff7c01000000000000000000000000000000000000000000000000000000006000350416631df4f14481146043575b600080fd5b3415604d57600080fd5b60566004356068565b60405190815260200160405180910390f35b506000905600a165627a7a72305820b5f50780088314a911e350ceb893b82d6201da10f5399de0d35b8597dbf3296f0029";
            var multiplier = 7;           
            var web3 = new Web3Geth();          

            var unlockAccountResult = await web3.Personal.UnlockAccount.SendRequestAsync(senderAddress, password, 1200);          
            var transactionHash =  await web3.Eth.DeployContract.SendRequestAsync(abi, byteCode, senderAddress, new HexBigInteger(900000), multiplier);
            var mineResult = await web3.Miner.Start.SendRequestAsync(6);
            var receipt = await web3.Eth.Transactions.GetTransactionReceipt.SendRequestAsync(transactionHash);

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

            var contractAddress = receipt.ContractAddress;
            var contract = web3.Eth.GetContract(abi, contractAddress);
            var multiplyFunction = contract.GetFunction("multiply");
            var result = await multiplyFunction.CallAsync<int>(7);
        }
    }

var result returns 0.