These are chat archives for Nethereum/Nethereum

29th
Aug 2017
Andres G. Aragoneses
@knocte
Aug 29 2017 03:59 UTC
glad I help; nonetheless, take in account that HD-style address creation in Ethereum is not that useful as within bitcoin, because in Ethereum you cannot make a transaction that moves money from more than 1 address
helped*
Alexander Yarushin
@aayarushin
Aug 29 2017 06:18 UTC
image.png
@juanfranblanco IMHO it is unnecessary to hold reference to Web3 instance in the generated service client classes. There's less chance of memory leaks as well :)
amjadDev
@amjadDev
Aug 29 2017 08:27 UTC
how can create offline signer in Nethereum?
Juan Blanco
@juanfranblanco
Aug 29 2017 08:31 UTC
@aayarushin you could get away with just Eth + TransactionManager
@knocte @kaista82_twitter yes the only use case here, is to have many addresses generated from the same seed. Which is why mneumonic dictionaries are not helpful as you can target specic combination ranges and from there derivied all the 10k keys
Juan Blanco
@juanfranblanco
Aug 29 2017 08:48 UTC
@aayarushin or just hold the Account and create a new instance of web3 (for simplicity)
@amjadDev what you want to do?
you can simply use Web3.OfflineTransactionSigner
this creates a new instance for you..
amjadDev
@amjadDev
Aug 29 2017 08:54 UTC
@juanfranblanco i am trying to sign a transaction offline have include Nethereum.Portable from nuget but not getting OfflineTransactionSigner method in web3 instance except _transactionSigner.SignTransaction(.. is this debricated method or avlibale in other package?
@juanfranblanco transactionSigner.SignTransaction(.. avilable in TransactionSigner not in web3
image.png
Juan Blanco
@juanfranblanco
Aug 29 2017 08:58 UTC
well that is the class :)
you just need to pass your parameters to it
let me know which parameter you don't understand (if needed help)
Andres G. Aragoneses
@knocte
Aug 29 2017 09:01 UTC
maybe he's not using the proper nuget package version? @amjadDev you on 2.0?
amjadDev
@amjadDev
Aug 29 2017 09:02 UTC
@knocte its 1.0.6438.15575
Andres G. Aragoneses
@knocte
Aug 29 2017 09:03 UTC
yeah IIRC that version has different API, mmm
Juan Blanco
@juanfranblanco
Aug 29 2017 09:03 UTC
you need to be on 2.0.0-rc7
amjadDev
@amjadDev
Aug 29 2017 09:04 UTC
okay let me try this
@juanfranblanco i am using this overload see screenshot and brodcasting hex from ether scan for mean while i got tx but my transaction always in pending seems i am doing some mistake in transactuion cost ,gas limit and price
image.png
Juan Blanco
@juanfranblanco
Aug 29 2017 09:09 UTC
is that your right nonce?
also you can try using the default values for gas
and you could use the convert utils
try that overload, that has the default values
your nonce is soo high
it should be 3
number of transactions
Alexander Yarushin
@aayarushin
Aug 29 2017 09:14 UTC
@juanfranblanco I attempted to build NEthereum code, but the build has ailed. I see there are many consolidation conflicts in Nuget.
Juan Blanco
@juanfranblanco
Aug 29 2017 09:15 UTC
there are only about 3 dependencies
what problems are you having?
(a part from the unity stuff, that is a bit more complex :) )
Alexander Yarushin
@aayarushin
Aug 29 2017 09:20 UTC
image.png
amjadDev
@amjadDev
Aug 29 2017 09:20 UTC

public string SignTransaction(string privateKey, string to, BigInteger amount, BigInteger nonce)
{
return SignTransaction(privateKey.HexToByteArray(), to, amount, nonce);
}

same result in pending with nonce 3

https://ropsten.etherscan.io/tx/0xabb4fbb9e3966805fcacbf698b1c3b0705a1e0462abbf3d8d04cea6d37d003e3

Alexander Yarushin
@aayarushin
Aug 29 2017 09:20 UTC
@juanfranblanco
image.png
ABI Tests build failed. Other tests do not build :)
image.png
Juan Blanco
@juanfranblanco
Aug 29 2017 09:25 UTC
actually your nonces are all random
Alexander Yarushin
@aayarushin
Aug 29 2017 09:26 UTC
I am back in 30 min
Juan Blanco
@juanfranblanco
Aug 29 2017 09:26 UTC
@amjadDev
@aayarushin you need to install unity (obviously)
the rest shoul be fine
all libraries are included
but as usual cli is your friend on these messy visual studio times
Alexander Yarushin
@aayarushin
Aug 29 2017 10:00 UTC
What is cli?
@juanfranblanco would it be enough with the Personal Free version?
Juan Blanco
@juanfranblanco
Aug 29 2017 10:04 UTC
yes
command line
ie dotnet restore etc
Alexander Yarushin
@aayarushin
Aug 29 2017 10:04 UTC
oh ok :)
@juanfranblanco Unity 2017.1.0f3 would be fine?
Does the project needs Unity Game Development?
image.png
Juan Blanco
@juanfranblanco
Aug 29 2017 10:10 UTC
yes and that
add*
Alexander Yarushin
@aayarushin
Aug 29 2017 10:11 UTC
thank you :) I will try
Сергей Тяпкин
@tyaps83_twitter
Aug 29 2017 15:28 UTC
Hi guys. Please help me to find how can I sign a transaction offline if I want to call specific method in deployed contract. I've found web3.OfflineTransactionSigner.SignTransaction() method, but I can't understand how can I specify contract address and method and parameters.
Сергей Тяпкин
@tyaps83_twitter
Aug 29 2017 15:43 UTC

I've found the solution

var function = contract.GetFunction("changeMultiplier");
var data = function.GetData(value);
var encoded = web3.OfflineTransactionSigner.SignTransaction(PrivateKey, contractAddress, 0,
txCount.Value, 1000000000000L, 900000, data);

It always helps to ask - right after that moment chances to find solution by yourself enormously raise ))) Thx ))
Juan Blanco
@juanfranblanco
Aug 29 2017 16:49 UTC
ha ha yes you are correct :)
Alexander Yarushin
@aayarushin
Aug 29 2017 17:43 UTC
lol
Vishnu Pillai
@vishnulphb
Aug 29 2017 18:13 UTC
Hey guys, complete noob here. @juanfranblanco thanks for making the solidity support for Visual Studio Code. I've been trying to learn and understand blockchain and solidity for past 2 weeks.
To start with, I have a question, is this the right way to keep a deployed smart contract in github? Link : https://github.com/vishnulphb/solidityExamples
Thanks in advance :smile: If this is a wrong group to ask these type of questions, please suggest a chat group for noobs like me. haha.
Any help will be highly appreciated! Feel free to suggest me some links/resources
Alexander Yarushin
@aayarushin
Aug 29 2017 18:37 UTC
@vishnulphb Structure of a Solidity project is extremely simple. It is 1-1 to the folder structure. The only "fuzzy" part is the import keyword :)
there is no project file even :)
Vishnu Pillai
@vishnulphb
Aug 29 2017 18:42 UTC
@aayarushin ah I see, so I should be fine then? Do I need to ignore the bin files or push them as well? or doesn't matter? What do you really mean by 'import' in this case? (I am guessing its for referring to other contracts?) Thanks for the reply :smile:
Alexander Yarushin
@aayarushin
Aug 29 2017 18:43 UTC
Do not need to push bin.
Vishnu Pillai
@vishnulphb
Aug 29 2017 18:45 UTC
:+1: ok
Juan Blanco
@juanfranblanco
Aug 29 2017 19:13 UTC
the nexus / dappsys / daphub guys created a project file, which it is supported in the vscode extension
Alexander Yarushin
@aayarushin
Aug 29 2017 19:14 UTC
what would one use the project file for?
Juan Blanco
@juanfranblanco
Aug 29 2017 19:14 UTC
to put the name of the library, version, dependencies, structure etc
to simplify i default this to src (for solidity files) and lib (for external libraries)
so if you look at Dappsys
you can create generic libraries which they reference each other
Hence I thought that autocomplete was needed, when you have all that inheritance (and multiple some times) :D
Alexander Yarushin
@aayarushin
Aug 29 2017 19:28 UTC
autocomplete is needed [end of sentence] :)
Juan Blanco
@juanfranblanco
Aug 29 2017 19:29 UTC
well it is still a bit rudimentary
Alexander Yarushin
@aayarushin
Aug 29 2017 19:29 UTC
dependencies are defined wth import.... is there anothe way?
Juan Blanco
@juanfranblanco
Aug 29 2017 19:29 UTC
oh.. in the project file, can be defined as part of the lib
but if using the "default" format
imports will be resolved from the lib folders

simpler:
if you see: import "module1/test.sol"
is resolved with the lib/module1/src/test.sol
but that module also has a reference of module2
so as part of our hierachical dependency we can also reference it
and be resolved on that same file
Juan Blanco
@juanfranblanco
Aug 29 2017 19:35 UTC
BUT dappsys provides a more real example
Alexander Yarushin
@aayarushin
Aug 29 2017 19:35 UTC
I am missing some contextual information here.... are you saying that there is sort of speficiation that allows the compiler to find out what is supposed to be output from the build process?
But solidity projects entirely rely on source code, i.e. not built.
Juan Blanco
@juanfranblanco
Aug 29 2017 19:36 UTC
oh no this the extension doing this for you
yes
but you want to reuse the same code as part of your project
Alexander Yarushin
@aayarushin
Aug 29 2017 19:36 UTC
what is the name of it again?
dappsys?
Juan Blanco
@juanfranblanco
Aug 29 2017 19:38 UTC
yes check the links above
Alexander Yarushin
@aayarushin
Aug 29 2017 19:56 UTC
I need some help here @juanfranblanco From what I can see dapsys is a library of reusable solidity code.
They use git modules
Juan Blanco
@juanfranblanco
Aug 29 2017 19:56 UTC
yeah
mainly different libraries, and yes the use git to keep everything up to date
i just support the structure so it can be compiled
Alexander Yarushin
@aayarushin
Aug 29 2017 19:57 UTC
Provided I am new to VS Code I might be missing something, but I do not see extension for VS Code with name "dappsys "
Juan Blanco
@juanfranblanco
Aug 29 2017 19:57 UTC
oh no :D
Alexander Yarushin
@aayarushin
Aug 29 2017 19:57 UTC
Are you saying that when I hit F5 you support their git module structure?
Juan Blanco
@juanfranblanco
Aug 29 2017 19:58 UTC
kind of :), so if you F5 or autocomplete, etc
it will resolve all solidity files in different libraries
that are put in that structure
the git submodules (in the dappsys scenario) you just need to get all the submodules
Alexander Yarushin
@aayarushin
Aug 29 2017 19:59 UTC
I think I get it now
but that is applicable when git modules have independent lifecycle
it makes perfect sense for a larger projects I guess...
so when I have some "Core" library that I want to share between several other solidity project I can get away by using git submodules instead of copypasting the code?
Juan Blanco
@juanfranblanco
Aug 29 2017 20:03 UTC
yes
Alexander Yarushin
@aayarushin
Aug 29 2017 20:04 UTC
See it took some time for a noob :D but I finally made it there :)
thank you
The NEthereum solution is building btw
Juan Blanco
@juanfranblanco
Aug 29 2017 20:04 UTC
cool :)
Alexander Yarushin
@aayarushin
Aug 29 2017 20:05 UTC
Should I just start the test network in testchain directory to run the tests?
many of them are failing
Juan Blanco
@juanfranblanco
Aug 29 2017 20:05 UTC
of there are two types of tests
the rpc
which you need to start the rpc chain
and the others will run in either
failures are normally due to nonces (or running in parallel)
Alexander Yarushin
@aayarushin
Aug 29 2017 20:06 UTC
Why would you separate them in the Integration tests and Unit tests folders? :)
Juan Blanco
@juanfranblanco
Aug 29 2017 20:09 UTC
yes, need to do further separation. I refactored the projects, but the tests need some love
i need to add appveyor
and i clique in geth + parity poa for mulitiple and fast integration tests
bui overall, integration is the most important element
but*
Alexander Yarushin
@aayarushin
Aug 29 2017 20:11 UTC
all are impotant... it is just the question about the scope of testing
Vishnu Pillai
@vishnulphb
Aug 29 2017 20:12 UTC
I was able to call a function from another contract, dont know how correctly am i doing it haha
https://ibb.co/fJc3bk
Juan Blanco
@juanfranblanco
Aug 29 2017 20:12 UTC
yeah
Alexander Yarushin
@aayarushin
Aug 29 2017 20:12 UTC
Someone mentioned earlier today about offline signing. Is it Cold wallet functionality?
@vishnulphb congratulations. This is much joy
Juan Blanco
@juanfranblanco
Aug 29 2017 20:13 UTC
@vishnulphb that is very valid
using inheritance
Vishnu Pillai
@vishnulphb
Aug 29 2017 20:13 UTC
YAY :smile:
Juan Blanco
@juanfranblanco
Aug 29 2017 20:14 UTC
@aayarushin yes all tests have their needs (unit, integration, acceptance)
i love bdd
offline signing, yes cold wallet
Alexander Yarushin
@aayarushin
Aug 29 2017 20:16 UTC
Interesting topic to learn
So, is online signing automatic (implicit) and done ny web3 client when it has unlocked account?
Juan Blanco
@juanfranblanco
Aug 29 2017 20:17 UTC
so if you use your password / unlocking
geth does the signing for you
Alexander Yarushin
@aayarushin
Aug 29 2017 20:17 UTC
ok, that is what I touhght ... cool
Juan Blanco
@juanfranblanco
Aug 29 2017 20:17 UTC
so it is "online"
Alexander Yarushin
@aayarushin
Aug 29 2017 20:17 UTC
super
Juan Blanco
@juanfranblanco
Aug 29 2017 20:18 UTC
then if you have your private key you can sign it without relying on geth
still if using web3 it will in the background do the nonce for you
but if you want to do it totally offline
Alexander Yarushin
@aayarushin
Aug 29 2017 20:18 UTC
ok, but what would I do with the isgned transaction? how would I relay it to the ethereum client?!
Juan Blanco
@juanfranblanco
Aug 29 2017 20:18 UTC
you can do it too as per the discussion before
eth_sendRawTransaction
Alexander Yarushin
@aayarushin
Aug 29 2017 20:19 UTC
why is it called Raw?
it is not mined that is fine, but why raw?
Juan Blanco
@juanfranblanco
Aug 29 2017 20:19 UTC
this is what is happening in the background when you use "Account" in web3 with your private key
it is raw because it is mainly signed already
Alexander Yarushin
@aayarushin
Aug 29 2017 20:20 UTC
excited :)