These are chat archives for Nethereum/Nethereum

12th
Feb 2019
Juan Blanco
@juanfranblanco
Feb 12 04:15
@EgorovOleg you should not get a timeout from Infura,for 20 seconds, it might be an issue with your connection, there are not any reports of downtime.
Do you expect any output on block 55613
55613222?
Kevin Small
@KevinSmall
Feb 12 09:35
@EgorovOleg this code picks up one event ok:
var web3 = new Web3("https://mainnet.infura.io");
var receiverAddress2 = "0x8b88fce7bd28f0157ac6bb37a96723705d9f3123";
var transferEventHandlerAnyContract = web3.Eth.GetEvent<TransferEventDTO>();
BlockParameter fromBlock = new BlockParameter(5561322);
BlockParameter toBlock = new BlockParameter(5561322);
var filterTransferEventsForAllContractsReceiverAddress2 = transferEventHandlerAnyContract.CreateFilterInput<string, string>(null, receiverAddress2, fromBlock, toBlock);
var test = await transferEventHandlerAnyContract.GetAllChanges(filterTransferEventsForAllContractsReceiverAddress2);
if I remove the block from to parameters, then I also get a timeout Nethereum.JsonRpc.Client.RpcClientTimeoutException: 'Rpc timeout after 20000 milliseconds'
Juan Blanco
@juanfranblanco
Feb 12 09:56
@KevinSmall @EgorovOleg ah I see, mainly if you remove from you will be querying for Earliest, normally geth responded with a black value as the block range was too big
so yeah smaller block ranges
Kevin Small
@KevinSmall
Feb 12 10:04
ah I see, thanks Juan
Juan Blanco
@juanfranblanco
Feb 12 10:12
i meant blank value :)
Kevin Small
@KevinSmall
Feb 12 10:19
so infura is using geth, and it is geth that is deciding "block range too big", is that right?
same code without block range works just fine on a local geth
EgorovOleg
@EgorovOleg
Feb 12 10:36
@KevinSmall,I tried your code and it gives this error
" test error CS0103: The name 'test' does not exist in the current context"
maybe the problem is in this code?
[Event("Transfer")]
    public class TransferEventDTO : IEventDTO
    {
        [Parameter("address", "_from", 1, true)]
        public string From { get; set; }

        [Parameter("address", "_to", 2, true)]
        public string To { get; set; }

        [Parameter("uint256", "_value", 3, false)]
        public BigInteger Value { get; set; }
    }
Kevin Small
@KevinSmall
Feb 12 10:49
@EgorovOleg yes, that transfer event code is needed. Here is the whole console program that picks up the one event ok: https://gist.github.com/KevinSmall/59568e5bad5f7430dc9675e854b900ab