These are chat archives for Nethereum/Nethereum

12th
Nov 2018
Grey007
@Grey007
Nov 12 2018 08:11

Hi @juanfranblanco & @Dave-Whiffin

I'm busy playing around with Blockchain Storage to store all transactions related to specific addresses. Could you point me in the right direction where I can have a list of address that are checked instead of all address transactions recorded and stored?

To be specific, I'm using the Nethereum.BlockchainStore.EFCore.SqlServer.Console project. Thanks in advance!

Juan Blanco
@juanfranblanco
Nov 12 2018 10:15
@Grey007 you have this filter for the transaction
that includes from and to addresses
if you use parity and have a very small range of addresses you can use the parity filter (just a thought)
Dave Whiffin
@Dave-Whiffin
Nov 12 2018 10:32

@Grey007 Apologies for the delay - just got back from holiday. The ProcessorConsole.Execute method accepts a filter container. You can easily construct a filter container with a one or more filters. There are static TransactionFilter methods which create common filters or you can construct your own filter/s easily. It may be worth pulling down the latest code if you haven't already.

FYI - The storage solution is gradually being split between the processing logic and the storage specific logic. There are repos for each (see below). Currently the processing logic is duplicated between the two solutions. Shortly the processing code will be removed from the storage solution and replaced by a nuget reference.

https://github.com/Nethereum/Nethereum.BlockchainProcessing/
https://github.com/Nethereum/Nethereum.BlockchainStorage/

vinayakmali84
@vinayakmali84
Nov 12 2018 13:45
Hi, I am trying to create multiple transactions between two accounts using SendTransactionAsync method. But I am getting "replacement transaction underpriced" message. I found some links which says we need to increase nonce to create new transactions in loop. But I am not able to find Nethereum function where I can mention nonce value while creating transaction. Can anybody guide me with solution to this?
vinayakmali84
@vinayakmali84
Nov 12 2018 13:52
 HexBigInteger gas = new HexBigInteger(25000);
 HexBigInteger value = new HexBigInteger(100);
 for (int i = 0; i < 1000; i++)
 {
    var privateKey1 = "0x5083ff34a6610ad0d08d5e568fcee84e29a1391a6fffa8cf96484388f57de731";
    var account = new Account(privateKey1);
    var web3 = new Web3(account, "http://127.0.0.1:8001/", null, null);
    var addressTo = "0x12890D2cce102216644c59daE5baed380d84830c";
    string data = "ASDF";
    var transaction = await web3.TransactionManager.SendTransactionAsync(new TransactionInput(data.ToHexUTF8(), addressTo, account.Address,new HexBigInteger(gas.Value + (gas.Value * 20) / 100), new HexBigInteger(value.Value + (value.Value * 20) / 100)));
 }
Juan Blanco
@juanfranblanco
Nov 12 2018 13:54
hi @vinayakmali84
The TransactionInput has the nonce
nevertheless the nonce will be retrieve for you if not set
but.. you will need to move your creation of the Web3 instance outside of your loop
so the nonces can be managed in memory, because there is a delay to record in the client the nonce
vinayakmali84
@vinayakmali84
Nov 12 2018 14:12
@juanfranblanco Thanks, I declared web3 instance outside loop & increased gas price & value by 20% & it worked.
Juan Blanco
@juanfranblanco
Nov 12 2018 14:12
no need to increase the gas price and value
the error was mainly to override the transaction by increasing the price
but what you are doing now is mainly creating 1000 transactions
vinayakmali84
@vinayakmali84
Nov 12 2018 14:22
@juanfranblanco I gave fixed value for gas price & created 200 transactions in loop. But these transactions are in pool in pending status. These are not getting mined. What might be the case here?
        97: "0x12890D2cce102216644c59daE5baed380d84830c: 177562508 wei + 45002848868 gas × 1 wei",
        98: "0x12890D2cce102216644c59daE5baed380d84830c: 213075009 wei + 54003418641 gas × 1 wei",
        99: "0x12890D2cce102216644c59daE5baed380d84830c: 255690010 wei + 64804102369 gas × 1 wei"
      }
    },
    queued: {}
  },
  status: {
    pending: 245,
    queued: 0
  },
  getContent: function(callback),
  getInspect: function(callback),
  getStatus: function(callback)
}
Juan Blanco
@juanfranblanco
Nov 12 2018 14:23
I assume you are mining already, so they will be processed on another block
if all the transactions are waiting, i guess you are not mining
but these are pure guesses
vinayakmali84
@vinayakmali84
Nov 12 2018 14:47
@juanfranblanco
it is private chain & mining is started. still all transactions are in pending status.
hawthornetr
@hawthornetr
Nov 12 2018 15:39
Is there a way in nethereum to view erc-20 event logs to determine token id/to/from/value?
say I already have the logs json
is there some object I can load that into or a way to query that?
Juan Blanco
@juanfranblanco
Nov 12 2018 15:53
@vinayakmali84 probably one of the nonces is out of sync from the previous run
restart the chain and try again
(simpler)
@hawthornetr
you can create a: var x = new Event<TransferEventDTO>(); x.DecodeAllEventsForEvent(json array);
hawthornetr
@hawthornetr
Nov 12 2018 15:59
=]
thanks juan!
Tom Ryan
@a7coretryan
Nov 12 2018 17:44
@juanfranblanco I am using the data field in this method:
public string SignTransaction(string privateKey, string to, BigInteger amount, BigInteger nonce, string data)
Is there a reason why json isn't allowed to be signed?
Juan Blanco
@juanfranblanco
Nov 12 2018 18:01
all fields need to be in hex
@a7coretryan ^^
you can UTF8.GetBytes(..).ToHex()
Tom Ryan
@a7coretryan
Nov 12 2018 18:20
@juanfranblanco ahhh ok. Didn't expect that -- but makes sense. Thanks.
Astrovicis
@Astrovicis
Nov 12 2018 21:08
I’m trying to pass two structs as input to a smart contract function. Is this possible with the .NET 3.5 dlls for Unity?
Astrovicis
@Astrovicis
Nov 12 2018 21:26
@juanfranblanco