Nethereum.Workbooks icon indicating copy to clipboard operation
Nethereum.Workbooks copied to clipboard

Workbook explaining pending transactions

Open juanfranblanco opened this issue 7 years ago • 1 comments

https://github.com/Nethereum/Nethereum/issues/279

juanfranblanco avatar May 09 '18 10:05 juanfranblanco

public class PendingTransactionsSample { public static string PrivateKey = "0xb5b1870957d373ef0eeffecc6e4812c0fd08f554b37b233526acc331bf1544f7"; public static string Address = "0x12890d2cce102216644c59daE5baed380d84830c";

    public async Task RunAsync()
    {
        var web3 = new Web3Geth(new Account(PrivateKey), "http://localhost:8545");

        await web3.Miner.Stop.SendRequestAsync();

        var pendingFilter = await web3.Eth.Filters.NewPendingTransactionFilter.SendRequestAsync();
        

        var deploymentHandler = web3.Eth.GetContractDeploymentHandler<ArrayUint256DynamicDeployment>();
        var txn1 = await deploymentHandler.SendRequestAsync();
        var txn2 = await deploymentHandler.SendRequestAsync();
        var txn3 = await deploymentHandler.SendRequestAsync();

        var filterChanges = await web3.Eth.Filters.GetFilterChangesForBlockOrTransaction.SendRequestAsync(pendingFilter);
    }
}

juanfranblanco avatar Aug 07 '18 11:08 juanfranblanco