These are chat archives for Nethereum/Nethereum

27th
Dec 2017
Michael Herman (Toronto)
@mwherman2000
Dec 27 2017 00:08
What's the best Nethereum call to use from a .NET app to check if geth.exe is running (for local testing purposes ...I'm using rinkeby if it makes a difference).
Michael Herman (Toronto)
@mwherman2000
Dec 27 2017 01:03
Calling protocolVersion = await web3.Eth.ProtocolVersion.SendRequestAsync(); and checking for an exception seems to be a safe way to check if get.exe is running. Any better ideas?
Juan Blanco
@juanfranblanco
Dec 27 2017 08:38
@mwherman2000 that seems like a good idea
@rboelen I normally use getlogs, or yes one block, transaction at a time
never got duplicated stuff
Alex-Gorbach
@Alex-Gorbach
Dec 27 2017 09:37

Hello! I send a transaction that writes a value:

            var result = await setHash.SendTransactionAsync(senderAddress, new HexBigInteger(4700000), new HexBigInteger(UnitConversion.Convert.ToWei(20)), @"[{""asa""}]");

And I get the transactionhash, but the value of the parameter being passed is not written to the chain.
Maybe I'm passing the parameter wrong?
If anyone can, please help me. Thanks.

rboelen
@rboelen
Dec 27 2017 10:19
@devedse you were right! I did not specify the endblock in CreateFilterInput, so I got all events every time....duh
Juan Blanco
@juanfranblanco
Dec 27 2017 12:40
@Alex-Gorbach what is the abi of your function call?
I can see you are passing some ether, is the function payable?
Alex-Gorbach
@Alex-Gorbach
Dec 27 2017 12:42
abi=json presentation of a contract.
Juan Blanco
@juanfranblanco
Dec 27 2017 12:43
yeah the interface
of the contract in json
Alex-Gorbach
@Alex-Gorbach
Dec 27 2017 12:44
I passing ether because without explicit indication, I get an exception of "insufficient means"
In the end, I get a transaction hash, but the method that was called from the contract is not passed
Juan Blanco
@juanfranblanco
Dec 27 2017 12:46
oh do not pass any ether amount, that is a different error
like you don't have enough ether to pay for the transaction?
please post the abi so i can help
and / or solidity code
that you get a transaction hash, does not mean that there were no errors within the transaction that might prevent to store the value and later on retrieve it
Alex-Gorbach
@Alex-Gorbach
Dec 27 2017 12:51
ABI
          private string abi = @"[{""constant"":true,""inputs"":[],""name"":""getInstructor"",""outputs"":[{""name"":"""",""type"":""string""}],""payable"":false,""stateMutability"":""view"",""type"":""function""},{""constant"":false,""inputs"":[{""name"":""_fName"",""type"":""string""}],""name"":""setInstructor"",""outputs"":[],""payable"":false,""stateMutability"":""nonpayable"",""type"":""function""}]";

Solidity contract:
''
contract Coursetro {

string fName;

function setInstructor(string _fName) public {
fName = _fName;

}

function getInstructor() public constant returns (string) {
return (fName);
}

}""

khoren-git
@khoren-git
Dec 27 2017 13:21

Hi all,

I have deployed multisig smart conract (https://github.com/gnosis/MultiSigWallet/blob/master/contracts/MultiSigWallet.sol)
it was deployed succesfully https://ropsten.etherscan.io/address/0x87ff99be6d00934436e81d7efa4a55a56defaaef

I have try to call

 var contract = _web3.Eth.GetContract(abi, contractAddress);
 var multiplyFunction = contract.GetFunction("getOwners");
 var result = await multiplyFunction.CallAsync<object>(arguments);

but I got exception "Function not found:getOwners

do you have any idea, what I did wrong ? @juanfranblanco

Juan Blanco
@juanfranblanco
Dec 27 2017 13:35
@khoren-git that might be an issue with the abi you are using
"getOwners" is not part of the abi
Art1987
@Art1987
Dec 27 2017 13:43
Hi guys, do you have any idea how to obtain Actual Tx Cost/Fee from transaction? I was not able to find it in TransactionReceipt, but I can see it in ropsten.etherscan.io. thank you in advance
Juan Blanco
@juanfranblanco
Dec 27 2017 13:56
@Alex-Gorbach your function is not payeable, so you cannot send any ether to it
@Art1987 you can calculating using the total gas used * gas price
khoren-git
@khoren-git
Dec 27 2017 13:59
@juanfranblanco but I have "getOwners" is my abi
 {  
      "constant":true,
      "inputs":[  

      ],
      "name":"getOwners",
      "outputs":[  
         {  
            "name":"",
            "type":"address[]"
         }
      ],
      "payable":false,
      "stateMutability":"view",
      "type":"function"
   },
Juan Blanco
@juanfranblanco
Dec 27 2017 14:00
and that matches the abi you are passing the contract?
khoren-git
@khoren-git
Dec 27 2017 14:00
yes
Juan Blanco
@juanfranblanco
Dec 27 2017 14:01
there are no arguments
on that function
you don't need to pass any arguments
Art1987
@Art1987
Dec 27 2017 14:02
@juanfranblanco thanks
Juan Blanco
@juanfranblanco
Dec 27 2017 14:05
@khoren-git ill do a quick sample, it is in the todo list to create a gnosis wrapper / service anyway
khoren-git
@khoren-git
Dec 27 2017 14:06
I got exception here (when I try to get function by name )
var multiplyFunction = contract.GetFunction(methodName);
Juan Blanco
@juanfranblanco
Dec 27 2017 14:06
yeah.. it seems to be the abi you are using as the input on the contract
can you paste it here
var contract = _web3.Eth.GetContract(abi, contractAddress);
^^ that one
khoren-git
@khoren-git
Dec 27 2017 14:44
thanks @juanfranblanco I got "getOwners" result
João Matos
@tritao
Dec 27 2017 15:22
Hi fellow devs, can someone tell if me Nethereum supports using Geth pub/sub apis?
https://github.com/ethereum/go-ethereum/wiki/RPC-PUB-SUB#newheads
Juan Blanco
@juanfranblanco
Dec 27 2017 15:23
@tritao no
not yet :)
João Matos
@tritao
Dec 27 2017 15:24
ok guess I can try to implement it then
any tips on how to properly implement it? not very familiar with codebase yet
Juan Blanco
@juanfranblanco
Dec 27 2017 15:26
not really if not it would have been done
the dtos is simple, web sockets and ipc it is also simple
rpc dtos
and ipc is already implemented cross platform
websockets it will be the .netcore out of the box
João Matos
@tritao
Dec 27 2017 15:28
ok
Juan Blanco
@juanfranblanco
Dec 27 2017 15:30
mainly all the connections are implemented to be short lived
so for both ipc and websockets need a different type of client
João Matos
@tritao
Dec 27 2017 15:32
first i need to figure out why sln/projects fail to load on vs for mac
Juan Blanco
@juanfranblanco
Dec 27 2017 15:32
and probably using a subscription model for the end user (developer)
oh well
you need vs
in windows
i don't know how well will work on vs mac, with unity3d dependencies, 3.5 etc
and samples for desktop etc
João Matos
@tritao
Dec 27 2017 15:33
im already using nethereum on my app with vs for mac
its working ok
ok projects fails to load because its missing TargetFramework in msbuild, only DefaultFrameworks is present atm
if i add TargetFramework it loads ok
Juan Blanco
@juanfranblanco
Dec 27 2017 15:36
oh in mac will work, i don't know all the dependencies for the whole project
as in Nethereum as a whole
João Matos
@tritao
Dec 27 2017 15:37
i see yeah, i might have to disable some projects
Juan Blanco
@juanfranblanco
Dec 27 2017 15:37
wow TargetFramework is not available?
João Matos
@tritao
Dec 27 2017 15:38
its missing in Frameworks.prop
Juan Blanco
@juanfranblanco
Dec 27 2017 15:40
those are custom properties
so it should not be an issue
João Matos
@tritao
Dec 27 2017 15:43
TargetFramework needs to be define somewhere in project, else VS for Mac cannot know which version of .net to use
and fails to load projects
Juan Blanco
@juanfranblanco
Dec 27 2017 15:43
yeah so mainly it does not support to load external configuration
but .net core uses external configurations for everything
João Matos
@tritao
Dec 27 2017 15:44
it does but you need to define that variable somewhere
its just missing from the projects, you just need to add it
it can be defined in external configuration files
Juan Blanco
@juanfranblanco
Dec 27 2017 15:45
But the projects have TargetFrameworks
not TargetFramework
mainly there 3 types of frameworks targetted
normally
João Matos
@tritao
Dec 27 2017 15:45
yeah I guess VS for Mac does not know about TargetFrameworks
bug i think
Juan Blanco
@juanfranblanco
Dec 27 2017 15:45
netstandard1.1, net451 and unity3dnet351
ahhhh
João Matos
@tritao
Dec 27 2017 15:46
second issue i find, if i try to build with .net core: Nethereum/projects/Nethereum.Portable/Nethereum.Portable.csproj(1471,3): error MSB4019: The imported project "/usr/local/share/dotnet/sdk/2.1.3/Microsoft/Portable/v4.5/Microsoft.Portable.CSharp.targets" was not found. Confirm that the path in the <Import> declaration is correct, and that the file exists on disk.
Juan Blanco
@juanfranblanco
Dec 27 2017 15:46
that should be fixed by now, that was an issue with windows vs "fat" a few months ago
yes that is a portable library
which is autogenerated
João Matos
@tritao
Dec 27 2017 15:49
same problem with Web.Sample.csproj, weird, it is only project which has the same issue
Juan Blanco
@juanfranblanco
Dec 27 2017 15:49
ah well
then ignore that
João Matos
@tritao
Dec 27 2017 15:49
i see, its using old csproj format
Juan Blanco
@juanfranblanco
Dec 27 2017 15:50
yeah that was done on purpouse
mainly etherscan is built in vb.net so it was to ensure support
or validate it
João Matos
@tritao
Dec 27 2017 15:51
ok no problem, i can just remove it locally
but if you want sln to support .net core out of box we should figure out a fix
so it can work on .net framework and .net core too
i dont mind fixing it if you know the best way
Juan Blanco
@juanfranblanco
Dec 27 2017 15:52
out of the box in visual studio windows
you can see all the frameworks
João Matos
@tritao
Dec 27 2017 15:52
maybe we can add a new TargetNetCorevariable, and add if condition to those entire csprojs (Portable and Web.Sample)
Juan Blanco
@juanfranblanco
Dec 27 2017 15:53
i can switch between netstandard, net451, net351 and portable
it is actually rather good as it understands the linked files in the portable project
i would not change anything as this should be fixed in vs mac
i guess it will be in the works now
João Matos
@tritao
Dec 27 2017 15:54
this is not related to just vs for mac
but .net core which is future
.net core has no concept of .net framework
so the projects need to be fixed one way or another
Juan Blanco
@juanfranblanco
Dec 27 2017 15:54
well nethereum targets netstandard
João Matos
@tritao
Dec 27 2017 15:55
yeah but the solution has non .net standard projects
Juan Blanco
@juanfranblanco
Dec 27 2017 15:55
since it started
João Matos
@tritao
Dec 27 2017 15:55
so build just fails using provided sln
Juan Blanco
@juanfranblanco
Dec 27 2017 15:55
all of them are netstandrd
João Matos
@tritao
Dec 27 2017 15:56
Web.Sample is not, which is what fails to build
Juan Blanco
@juanfranblanco
Dec 27 2017 15:56
well that is a sample
like there is a Desktop sample
also i am creating a windows forms sample
João Matos
@tritao
Dec 27 2017 15:56
here is the current situation: you clone nethereum, you try to build with .net core, and it fails
Juan Blanco
@juanfranblanco
Dec 27 2017 15:56
using reactive ui
but that is because you are using a mac
there are also dependencies to unity3d
João Matos
@tritao
Dec 27 2017 15:57
ok but you can make it work on mac too with some fixes
Juan Blanco
@juanfranblanco
Dec 27 2017 15:57
i also use a mac to test ios
João Matos
@tritao
Dec 27 2017 15:57
that is what i am trying to say
Juan Blanco
@juanfranblanco
Dec 27 2017 15:57
yes samples could be moved
João Matos
@tritao
Dec 27 2017 15:57
unless you only want to support VS for Windows, which is fine i guess
Juan Blanco
@juanfranblanco
Dec 27 2017 15:58
well it is not much of a priority
as i want things to compile in multiple frameworks
nethereum has been built from the start with that idea, support old and new
which is a pain the **
but everyone company has different needs
João Matos
@tritao
Dec 27 2017 15:59
it really is a pain to support everything :(
Juan Blanco
@juanfranblanco
Dec 27 2017 15:59
for example mono does not support 4.7.1
but in Azure it is used in some places
same as Unity3d with net351
but if you want to target webgl and ios aot
i had to
so if you want to test on 4.7.1 you have to use windows
João Matos
@tritao
Dec 27 2017 16:01
yeah i work in mono team, we are trying to keep up, .net standard 2 was lots of work to implement
things should get better this year
Juan Blanco
@juanfranblanco
Dec 27 2017 16:01
not complaining :)
now is a road of roses
after the past 2 years
João Matos
@tritao
Dec 27 2017 16:02
hah yeah
Juan Blanco
@juanfranblanco
Dec 27 2017 16:02
the windows samples can be moved
João Matos
@tritao
Dec 27 2017 16:03
ok nice
Juan Blanco
@juanfranblanco
Dec 27 2017 16:03
but my idea for a "generic" ui is to code generate and create core view models using ReactiveUI
including Windows.Forms
i know old school, but will help to people understand xaml as that will be generated too
(well that is the idea / plan)
João Matos
@tritao
Dec 27 2017 16:04
sounds good
Juan Blanco
@juanfranblanco
Dec 27 2017 16:04
i assume that could be separated (winforms)
João Matos
@tritao
Dec 27 2017 16:04
i think we just need to add some if to windows specific projects
Juan Blanco
@juanfranblanco
Dec 27 2017 16:04
and uwp / wpf
João Matos
@tritao
Dec 27 2017 16:05
and it should work on VS, and VS for Mac / .net core
Juan Blanco
@juanfranblanco
Dec 27 2017 16:06
yeah, enterprises should not be alienated
which normally run 3 years behind or 20 :)
hence all the support
but having clear path towards xamarin.forms etc
on the pub / sub
João Matos
@tritao
Dec 27 2017 16:07
yeah we are working on desktop backends for xamarin.forms (and in future, maybe web), should be fun
Juan Blanco
@juanfranblanco
Dec 27 2017 16:07
yeah ooui looks good
and wasm (slowly)
but yes roadmap is to have the xamarin.forms mac, windows, linux, etc, etc
do dynamic loading of libraries same as good old MEF
obviously not for mobile
if you can xamarin.forms in wasm / webgl (not the unity3d renderers which are a just on top of unity3d and their ui controls are painful) will be great
João Matos
@tritao
Dec 27 2017 16:10
so if i understand, to add pub/sub, since i want to support remote node for now, i need to add websocket support to codebase, to connect to geth
them implement the dtos for json-rpc comms
but this needs to be subscribed
as it is slight different
so RX
was the plan (i don't want to pollute with dependencies, hence I have not put rx for anything else)
João Matos
@tritao
Dec 27 2017 17:33
@juanfranblanco please take a look when you have a chance Nethereum/Nethereum#226
now everything compiles in .net core, i can finally start look into pub/sub :)
Juan Blanco
@juanfranblanco
Dec 27 2017 17:34
oh
where to start
well if that works for you it is ok
but there are many issues in many places
João Matos
@tritao
Dec 27 2017 17:36
sorry i forgot to switch NetStandardVersion to netstandard1.1 as you were targetting before
apart from that, everything should work the same on VS
Juan Blanco
@juanfranblanco
Dec 27 2017 17:36
oh not that
removal of biginteger
removal on build to target .net
João Matos
@tritao
Dec 27 2017 17:37
where?
Juan Blanco
@juanfranblanco
Dec 27 2017 17:37
buildprojects
don't worry feel free to work on that
João Matos
@tritao
Dec 27 2017 17:37
i didnt remove everything, just switched to new csproj
you dont need to mention biginteger sources anymore
Juan Blanco
@juanfranblanco
Dec 27 2017 17:37
that is for .net352
351
those are custom
mixture of .net core and mono
as mono 351 biginteger was not valid for unity3d
don't worry about this
João Matos
@tritao
Dec 27 2017 17:39
ok maybe its easier to go commit by commit, i keep changes separate
Juan Blanco
@juanfranblanco
Dec 27 2017 17:39
it is ok
João Matos
@tritao
Dec 27 2017 17:39
just let me know what is wrong on that commit and i can fix
Juan Blanco
@juanfranblanco
Dec 27 2017 17:40
ill have a think after the xmas holidays
ill get the new starters to work on that
João Matos
@tritao
Dec 27 2017 17:40
right now the projects are big mess, some import dir.props, other not
some use old csproj, some new
Juan Blanco
@juanfranblanco
Dec 27 2017 17:40
that is done on purpouse
because some are unity3d
others not
big mess depends on the eyes of the beholder
not all the projects are going to support unity3d
for example
so now all of them do?
which they wont
João Matos
@tritao
Dec 27 2017 17:42
some target standard 1.1, others 1.6, others netcore2.0
Juan Blanco
@juanfranblanco
Dec 27 2017 17:42
as they wont compile on 351
yes
the ones that can support 1.1
do
João Matos
@tritao
Dec 27 2017 17:42
well ok
Juan Blanco
@juanfranblanco
Dec 27 2017 17:42
the applications eventually support
netcore2.0 bit by bit
they are unit tests or samples
all projects won't support 351
João Matos
@tritao
Dec 27 2017 17:43
ok no prob
i will just use this local
Juan Blanco
@juanfranblanco
Dec 27 2017 17:43
as 351 is unity3d specific
for lower versions
João Matos
@tritao
Dec 27 2017 17:44
guess you need to wait for unity to support new .net :)
Juan Blanco
@juanfranblanco
Dec 27 2017 17:44
no
it does already
but it does not support webgl
or aot
so the core libraries for unity3d
are not valid with new .net
the original idea was to wait, then when the preview release came out it was only compatible with some of the platforms
so better to support all than just newer
that kind of explains it
mainly if you are going to use .net threading model it will only work for windows
and android using mono
or hololens :)
João Matos
@tritao
Dec 27 2017 17:52
i should add new Nethereum.JsonRpc.WebSocketClient project right?
garyng2000
@garyng2000
Dec 27 2017 20:54
sendRequestAsync, gasLimit vs gasPrice. In the standard web3 interface, each request can have a gas limit(how much gas the transaction would probably use vs gas price(how much gas I wish to pay for each unit of gas used). How do I specify it in the sendRequestAsync, I only see one parameter in the function override that is related to 'gas', is that the gasLimit or gas Price ?
Michael Herman (Toronto)
@mwherman2000
Dec 27 2017 21:52
@juanfranblanco Thank you for your help. Over the Christmas holidays, I've been able to create a .NET Desktop Winforms app that implements a dashboard for an Ethereum node. Checkout https://hyperonomy.com/2017/12/27/ethereum-geth-exe-dashboard-built-with-nethereum/ for a screenshot and a few details about its implementation.
Juan Blanco
@juanfranblanco
Dec 27 2017 22:56
@mwherman2000 cool I am also creating a quick winforms app
winforms will get people going, I dont think many warm up to the idea of xaml
image.png
ill push something after / during the holidays. The idea is to create a reactive generic MVVM which can be code generated also for Xaml based apps
Juan Blanco
@juanfranblanco
Dec 27 2017 23:02
also convert people into Xaml once they see the structure similarities
Babu Pillai
@b-pillai
Dec 27 2017 23:04
@mwherman2000 well done... I started a small project with Nethereum - (a simple asset entry contract and try to interact with it) but I run into many issue and run out of time. End up using java script/html, but I would like re-built it with .net and c#...
Juan Blanco
@juanfranblanco
Dec 27 2017 23:07
feel free to push anything to the sample later on :D
@b-pillai what exactly made it hard as opposed to html / javascript?
a part from the obvious SPA in a browser? :)
Babu Pillai
@b-pillai
Dec 27 2017 23:38
Mainly on the web3 object part, my research assignment was to develop and demonstrate a DAPP using Ethereum platform and the plan was to have a simple contract deployed, and interact with it using an app (dapp). I have successfully deployed a contract on a local network using nethereum .net, But I could not figure it out how to interact with ‘Rinkeby/Rposten, test net? Using a webpage, we can inject a web3 object using metamask, then interact with the contract (with not running a local client on the machine).
Juan Blanco
@juanfranblanco
Dec 27 2017 23:39
Ah ok, so you missed this part
from the example above
how to connect to infura testnet
tahnks @b-pillai
it seems is the same with @mwherman2000 sample
if you see the winforms app is trying to explain the management of private keys (not multisignature yet)
also i do need new videos for that
Many thanks, great feedback
Juan Blanco
@juanfranblanco
Dec 27 2017 23:45
cool thanks
you might be interested in this https://github.com/Nethereum/Nethereum.DappHybrid
Babu Pillai
@b-pillai
Dec 27 2017 23:47
the web base dapp source code, remember to run this from a server when connecting Rinkeby/Rposten test net (I use a wampserver)
@juanfranblanco thanks I am also checking @mwherman2000's code samples...