These are chat archives for Nethereum/Nethereum

Nov 2018
Nov 13 2018 03:13

@Astrovicis - Hmm. Could you pass a struct to a smart contract function though? Off the top of my head, thought you'd need to define the types then assign to the struct within the function.

Oh. Maybe ABIEncoderV2?

Nov 13 2018 07:49

@Dave-Whiffin I'm busy playing with the execute message now. Does that execute function manage what gets recorded to the database? Here is my code where I want to record any transactions for two addresses. But when it runs it still adds all transactions to the db.

`public static async Task<int> Execute(
IBlockchainStoreRepositoryFactory repositoryFactory,
BlockchainSourceConfiguration configuration,
// FilterContainer filterContainer = null,
bool useGeth = false)
IWeb3Wrapper web3 = new Web3Wrapper(
? new Web3Geth(configuration.BlockchainUrl)
: new Web3.Web3(configuration.BlockchainUrl));

        var addresses = TransactionFilter.ToOrEmpty(new string[] { "0x908D6Cf08BE817B9a747D72C023B4dc86B42c748", "0x74C2CF9e8D8eB4688988c0Bbc642Ff2B18Bf364D" });
        FilterContainer filterContainer = new FilterContainer(xx);

        using (_strategy = new PersistenceStrategy(
            repositoryFactory, filterContainer, minimumBlockNumber: configuration.MinimumBlockNumber ?? 0))
            var blockProcessor = new BlockProcessorFactory()

            var blockchainProcessor = new BlockchainProcessor(_strategy, blockProcessor);

            //this should not really be necessary
            //but without it, when the process is killed early, some csv records where not being flushed
            AppDomain.CurrentDomain.ProcessExit += (s, e) =>

            var stopWatch = Stopwatch.StartNew();

            var result = await blockchainProcessor.ExecuteAsync(configuration.FromBlock, configuration.ToBlock)

            System.Console.WriteLine("Duration: " + stopWatch.Elapsed);

            Debug.WriteLine($"Finished With Success: {result}");
            System.Console.WriteLine("Finished. Success:" + result);

            return result ? 0 : 1;

Dave Whiffin
Nov 13 2018 08:22
@Grey007 I’ll have a closer look in a few hours. All blocks will continue to be written (it still processes each block sequentially) it’s just the transactions and related logs that would be filtered. The filter you have there will also catch contract creation transactions where the “to” address is empty.
Nov 13 2018 08:53
Yeah, I see now. If I just use "to" then it works.
Why can't "to" take a list of addresses?
Dave Whiffin
Nov 13 2018 08:59
It’s still a work in progress and the processing code is being moved to another repo. But if you have a look at the code that creates the filter it’s really simple to create your own. Add an issue if you want and I’ll make sure that method exists in the new repo.
Nov 13 2018 09:08
Just done that and got it working as expected Thanks :-)
Dave Whiffin
Nov 13 2018 09:23
@Grey007 excellent. If you have any suggestions then please don’t hesitate. Like I said, it’s early days and we’d be grateful for your input.
you will need to declare them manually (not code generator available yet)
the new libraries have full support for FunctionMessages and DeploymentMessages like in vanilla Nethereum
Nov 13 2018 11:12
When I try to do "using Nethereum.Contracts.Extensions;" it can't find the Extensions namespace. Any workaround?
Dave Whiffin
Nov 13 2018 11:12
@Uberflew what version of Nethereum are you using?
Nov 13 2018 11:13
NuGet Nethereum.Web3 2.5.1
Dave Whiffin
Nov 13 2018 11:18
@juanfranblanco may be able to confirm - but those extensions may have been added to the forthcoming v3. You can upgrade to an rc 3 version in nuget (you need to tick the pre release box in visual studio).
Nov 13 2018 11:20
Added in the pre-release. Thanks :)
Nov 13 2018 12:10

Can somebody explain why transactions are not mining for accounts created by Nethereum.Accounts.Account method, but works for accounts created by web3.Personal.NewAccount?

Transactions are not mining & in pending state for long time, for transactions with accounts created using Nethereum.Accounts.Account(privateKey).
But mining works for accounts created using web3.Personal.NewAccount.SendRequestAsync("password").

I am using below method to initiate transaction.
web3.TransactionManager.SendTransactionAsync(new TransactionInput(data.ToHexUTF8(), addressTo, senderAddress, gas, value))

Juan Blanco
Nov 13 2018 12:35
@vinayakmali84 are you using the same testnet as the ones we have provided, ie clique, parity poa?
also if you create an account using web3.Personal.NewAccount.. do you have any Ether on that account?
also did you reset your chain?
after experimenting?
Nov 13 2018 12:45
@juanfranblanco Account has sufficient balance. I am using private ethereum installed on my VM.
tested with new values, When I am creating loop of 10 transactions those gets mined, but when i create loop of 200 or more are not getting mined, they remain in pending status
Nov 13 2018 13:23
@juanfranblanco Can you please help me with code to get pending transactions in nethereum?
I think the underlying code calls the eth_newpendingtransactionfilter JSON RPC call.
Nov 13 2018 23:51
@juanfranblanco Thank you!