These are chat archives for Nethereum/Nethereum

29th
Aug 2017
Andres G. Aragoneses
@knocte
Aug 29 2017 03:59
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
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
how can create offline signer in Nethereum?
Juan Blanco
@juanfranblanco
Aug 29 2017 08:31
@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
@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
@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
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
maybe he's not using the proper nuget package version? @amjadDev you on 2.0?
amjadDev
@amjadDev
Aug 29 2017 09:02
@knocte its 1.0.6438.15575
Andres G. Aragoneses
@knocte
Aug 29 2017 09:03
yeah IIRC that version has different API, mmm
Juan Blanco
@juanfranblanco
Aug 29 2017 09:03
you need to be on 2.0.0-rc7
amjadDev
@amjadDev
Aug 29 2017 09:04
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
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
@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
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
image.png
amjadDev
@amjadDev
Aug 29 2017 09:20

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
@juanfranblanco
image.png
ABI Tests build failed. Other tests do not build :)
image.png
Juan Blanco
@juanfranblanco
Aug 29 2017 09:25
actually your nonces are all random
Alexander Yarushin
@aayarushin
Aug 29 2017 09:26
I am back in 30 min
Juan Blanco
@juanfranblanco
Aug 29 2017 09:26
@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
What is cli?
@juanfranblanco would it be enough with the Personal Free version?
Juan Blanco
@juanfranblanco
Aug 29 2017 10:04
yes
command line
ie dotnet restore etc
Alexander Yarushin
@aayarushin
Aug 29 2017 10:04
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
yes and that
add*
Alexander Yarushin
@aayarushin
Aug 29 2017 10:11
thank you :) I will try
Сергей Тяпкин
@tyaps83_twitter
Aug 29 2017 15:28
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

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
ha ha yes you are correct :)
Alexander Yarushin
@aayarushin
Aug 29 2017 17:43
lol
Vishnu Pillai
@vishnulphb
Aug 29 2017 18:13
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
@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
@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
Do not need to push bin.
Vishnu Pillai
@vishnulphb
Aug 29 2017 18:45
:+1: ok
Juan Blanco
@juanfranblanco
Aug 29 2017 19:13
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
what would one use the project file for?
Juan Blanco
@juanfranblanco
Aug 29 2017 19:14
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
autocomplete is needed [end of sentence] :)
Juan Blanco
@juanfranblanco
Aug 29 2017 19:29
well it is still a bit rudimentary
Alexander Yarushin
@aayarushin
Aug 29 2017 19:29
dependencies are defined wth import.... is there anothe way?
Juan Blanco
@juanfranblanco
Aug 29 2017 19:29
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
BUT dappsys provides a more real example
Alexander Yarushin
@aayarushin
Aug 29 2017 19:35
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
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
what is the name of it again?
dappsys?
Juan Blanco
@juanfranblanco
Aug 29 2017 19:38
yes check the links above
Alexander Yarushin
@aayarushin
Aug 29 2017 19:56
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
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
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
oh no :D
Alexander Yarushin
@aayarushin
Aug 29 2017 19:57
Are you saying that when I hit F5 you support their git module structure?
Juan Blanco
@juanfranblanco
Aug 29 2017 19:58
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
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
yes
Alexander Yarushin
@aayarushin
Aug 29 2017 20:04
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
cool :)
Alexander Yarushin
@aayarushin
Aug 29 2017 20:05
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
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
Why would you separate them in the Integration tests and Unit tests folders? :)
Juan Blanco
@juanfranblanco
Aug 29 2017 20:09
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
all are impotant... it is just the question about the scope of testing
Vishnu Pillai
@vishnulphb
Aug 29 2017 20:12
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
yeah
Alexander Yarushin
@aayarushin
Aug 29 2017 20:12
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
@vishnulphb that is very valid
using inheritance
Vishnu Pillai
@vishnulphb
Aug 29 2017 20:13
YAY :smile:
Juan Blanco
@juanfranblanco
Aug 29 2017 20:14
@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
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
so if you use your password / unlocking
geth does the signing for you
Alexander Yarushin
@aayarushin
Aug 29 2017 20:17
ok, that is what I touhght ... cool
Juan Blanco
@juanfranblanco
Aug 29 2017 20:17
so it is "online"
Alexander Yarushin
@aayarushin
Aug 29 2017 20:17
super
Juan Blanco
@juanfranblanco
Aug 29 2017 20:18
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
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
you can do it too as per the discussion before
eth_sendRawTransaction
Alexander Yarushin
@aayarushin
Aug 29 2017 20:19
why is it called Raw?
it is not mined that is fine, but why raw?
Juan Blanco
@juanfranblanco
Aug 29 2017 20:19
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
excited :)