These are chat archives for Nethereum/Nethereum

30th
Jul 2018
Juan Blanco
@juanfranblanco
Jul 30 2018 06:24 UTC
@boehla is easier to use Messages (like the ones generated) as this issues don't occur
@winsteadworks any steps you are using to import?
@Duanthse03268 what type of Account are you using? check http://nethereum.readthedocs.io/en/latest/accounts/
@25yuanzijian if you have a local geth or parity use a ManagedAccount
see the above link
Trần Huy Duẫn
@DuanTranHuy
Jul 30 2018 07:32 UTC
I have solved my issue thanks you. Looking for using Nethereum.Blockchain.Storage
Juan Blanco
@juanfranblanco
Jul 30 2018 07:33 UTC
@Duanthse03268 great :)
@guytp yes I am looking to make it a simpler extension, too many internals exposed there
Trần Huy Duẫn
@DuanTranHuy
Jul 30 2018 07:34 UTC
Nethereum.BlockChain.Storage will auto sync my private node to azure storage table right ?
Juan Blanco
@juanfranblanco
Jul 30 2018 07:34 UTC
yep that is the idea
Trần Huy Duẫn
@DuanTranHuy
Jul 30 2018 07:37 UTC
Thank you.
which was the simpler original thougth for end users
Schalk Dormehl
@sjalq
Jul 30 2018 13:20 UTC
Hey guys
How can I load another set of Accounts without having to re-instantiate the Web3 object I'm using?
I need to load a set of 10 accounts and can't really load them all one by one.
Juan Blanco
@juanfranblanco
Jul 30 2018 13:25 UTC
what do you mean by Load
you mean loading them from the keyStore?
Schalk Dormehl
@sjalq
Jul 30 2018 13:26 UTC
Afaikt I can only load one from a keystore at a time
Juan Blanco
@juanfranblanco
Jul 30 2018 13:27 UTC
multithreading?
Schalk Dormehl
@sjalq
Jul 30 2018 13:27 UTC
No
Juan Blanco
@juanfranblanco
Jul 30 2018 13:27 UTC
well you need to decrypt them
Schalk Dormehl
@sjalq
Jul 30 2018 13:27 UTC
I simply have a bunch of tests written against Truffle Develop
I know how to access one
Juan Blanco
@juanfranblanco
Jul 30 2018 13:28 UTC
now I am lost
Juan Blanco
@juanfranblanco
Jul 30 2018 13:28 UTC
sure
i understand that :)
Schalk Dormehl
@sjalq
Jul 30 2018 13:28 UTC
That indicates that to use an external account I need to init Web3 with the account and the node address
Juan Blanco
@juanfranblanco
Jul 30 2018 13:28 UTC
yes
Schalk Dormehl
@sjalq
Jul 30 2018 13:28 UTC
Afaikt I can only use one account at a time?
Juan Blanco
@juanfranblanco
Jul 30 2018 13:29 UTC
yes because you are signing the transactions using that account
if you are not signing anything you can use web3 readonly
mainly don't pass any account
Schalk Dormehl
@sjalq
Jul 30 2018 13:29 UTC
I need to be signing things.
Juan Blanco
@juanfranblanco
Jul 30 2018 13:29 UTC
with different accounts
Schalk Dormehl
@sjalq
Jul 30 2018 13:30 UTC
Yes
Juan Blanco
@juanfranblanco
Jul 30 2018 13:30 UTC
then yeah have different web3s
Schalk Dormehl
@sjalq
Jul 30 2018 13:30 UTC
It's a test suite that I wrote against TestRPC (Truffle Develop) before I knew about this constraint.
Juan Blanco
@juanfranblanco
Jul 30 2018 13:30 UTC
but you don't have any "constraint"
Schalk Dormehl
@sjalq
Jul 30 2018 13:30 UTC
Is there no other way of loading them and attaching them to an existing W3?
Juan Blanco
@juanfranblanco
Jul 30 2018 13:31 UTC
why can you not create a new web3
Schalk Dormehl
@sjalq
Jul 30 2018 13:31 UTC
The constraint I'm referring to is being able to use only 1 account in a Web3 instance vs being able to access the 1 0internal accounts on TestRPC
Juan Blanco
@juanfranblanco
Jul 30 2018 13:31 UTC
that is mainly the wrapper to the rpccliet
but your testrpc
is just an http request
so you can create multiple instances of web3
Schalk Dormehl
@sjalq
Jul 30 2018 13:32 UTC
The tests jut already exist with the assumtion that Web3 is part of the init of the test cases.
Juan Blanco
@juanfranblanco
Jul 30 2018 13:32 UTC
ok
Schalk Dormehl
@sjalq
Jul 30 2018 13:32 UTC
So I'd need to change that to rebuild W3s in the tests for tests that sometimes use as many as 6 signatures
Juan Blanco
@juanfranblanco
Jul 30 2018 13:33 UTC
so ...
Schalk Dormehl
@sjalq
Jul 30 2018 13:33 UTC
If there's no other way there's no other way I guess
Juan Blanco
@juanfranblanco
Jul 30 2018 13:33 UTC
what are you trying to do
yes there are plenty ways
Schalk Dormehl
@sjalq
Jul 30 2018 13:33 UTC
I just have some very straight forward tests, that use Account(0..10) quite actively to simulate different actors.
It works 100% against TestRPC
I need to get it working against our private Testnet now
Juan Blanco
@juanfranblanco
Jul 30 2018 13:34 UTC
well you can do the following
Schalk Dormehl
@sjalq
Jul 30 2018 13:34 UTC
and against a public testnet after that
Juan Blanco
@juanfranblanco
Jul 30 2018 13:34 UTC
var web3x = new Web3(originalweb3.Client, accountx);
(or change the params order)
if you want to go low level
you can use the contractHandlers
for example QueryHandler
creating a new Account and assingning to the transactionManager the web3original.Client to it
you have QueryHandlers, TransactionHandlers and DeploymentHandlers
Schalk Dormehl
@sjalq
Jul 30 2018 13:37 UTC
Do you mean assign the account to the transactionManager?
Juan Blanco
@juanfranblanco
Jul 30 2018 13:38 UTC
no more like..
create a new one of those (if you want to send a transaction ;) )
you will mainly do the following
var account = new Account("PrivateKey");
var transactionManager = account.TransactionManager;
transactionManager.Client = web3.Client;
var transactionSenderHandler = new TrasactionSenderHandler(transactionManager);
and you are done.. easier to mock
Schalk Dormehl
@sjalq
Jul 30 2018 13:43 UTC
So will Web3.Eth.Accounts.SendRequestAsync())[Index] then contain the account that I've added?
Juan Blanco
@juanfranblanco
Jul 30 2018 13:44 UTC
no
Schalk Dormehl
@sjalq
Jul 30 2018 13:44 UTC
Or if I use it in one of the from: "0xMyAccount" parameters?
Juan Blanco
@juanfranblanco
Jul 30 2018 13:45 UTC
well that depends on testrpc
:)
the idea is this returns the accounts that is in your client keystore (Geth / parity)
Top Nguyễn
@topnguyen
Jul 30 2018 14:00 UTC
Hi @juanfranblanco , I would like to receive "Event" created time, is it possible ?
    var changedDataEvent = contract.GetEvent<MotibikeChangedDataModel>("ChangedData");

     var filterInput = changedDataEvent.CreateFilterInput(new BlockParameter(blockNumber), new BlockParameter(blockNumber));

     var changedDatas = await changedDataEvent.GetAllChanges<MotibikeChangedDataModel>(filterInput);

    var changedData = changedDatas?.FirstOrDefault();
Currently, EventLog<T> return FilterLog and Event Data => is it possible to get the "event created time" from "FilterLog"? If not, how can I receive Event Created time @juanfranblanco
Top Nguyễn
@topnguyen
Jul 30 2018 14:06 UTC
How i can receive timestamp from "blocknumber"via NEthereum @juanfranblanco
:D I can resolve by myself, please don't mind it
        var blockWithTransactionHashes = await contract.Eth.Blocks.GetBlockWithTransactionsHashesByNumber.SendRequestAsync(blockNumber);
(should have read your resolution before hand :) )
Juan Blanco
@juanfranblanco
Jul 30 2018 14:47 UTC
@sjalq answering your question From parameter will use your account in the TransactionManager for signed transactions
and for Queries will use that too if not set
if you create a QueryHandler you can pass the fromAccount
Top Nguyễn
@topnguyen
Jul 30 2018 15:16 UTC
:D thank @juanfranblanco
Juan Blanco
@juanfranblanco
Jul 30 2018 15:25 UTC
@sjalq i see now what you are driving to, (bit slow sometimes), so your idea is that web3 would have multiple accounts and depending of which account is selected in the from you will select the rigth private key for it to signed the transaction
at the moment the transaction manager is one 2 one with an Account + Client
you can have plenty accounts associated with one transaction manager and a single client
web3 just sits as a simple wrapper
i do need to create a simple factory for TransactionManagers probably for r2
before creating different types of TransactionManagers
also just to note those handlers i mentioned are there to allow for simple DI, mocking, different implementations etc
so eventually a web3 will resolve those
Schalk Dormehl
@sjalq
Jul 30 2018 15:39 UTC
OK, yes, that is close to what I want to achieve.
I have a deadline for tomorrow, so I've parked getting the tests to run on our testnet, but when I'll have open time again, I'll swing by again and I'll ask the points I don't get.
Thank you very much for your help so far
Juan Blanco
@juanfranblanco
Jul 30 2018 15:40 UTC
sure :) I don't think multiple accounts will be a top priority, but remember you have your client in web3
just recreate a new web3 with that client and a new account
if you want to maintain all the same accounts with nonces in memory etc do something similar to what I have done with Nethereum, Geth and XUnit
--
one thing is that users dont like to type, so the From account is normally defaulted to the Acccount
although in some scenarios it is important when you are querying
as you might want to act like another account
--
more important is multisig, so that might be a driver for this.. but i was expecting that will be an extension for a specific handler
ie contract specific
Juan Blanco
@juanfranblanco
Jul 30 2018 15:45 UTC
same as mutiple querying
Schalk Dormehl
@sjalq
Jul 30 2018 17:44 UTC
Something you guys might be able to answer for me
Transaction Receipts, do they become immediately available or only once the block the preceding transaction is in, is mined?