org.web3j.tx.ClientTransactionManager Java Examples

The following examples show how to use org.web3j.tx.ClientTransactionManager. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: DepositContractAccessor.java    From teku with Apache License 2.0 5 votes vote down vote up
public static DepositContractAccessor create(
    Eth1Provider eth1Provider, Web3j web3j, String address) {

  DepositContract contract =
      DepositContract.load(
          address, web3j, new ClientTransactionManager(web3j, address), new DefaultGasProvider());

  return new DepositContractAccessor(eth1Provider, contract);
}
 
Example #2
Source File: BankAccountSmartContractTests.java    From devops-blockchain-jenkins with MIT License 5 votes vote down vote up
@Before
public void before() throws IOException, InterruptedException, ExecutionException {
	web3j = Web3j.build(new HttpService());

	EthAccounts accounts = web3j.ethAccounts().send();
	Assert.assertNotEquals(0, accounts.getAccounts().size());

	// use the first account as the main account for the tests
	mainAccountAddress = accounts.getAccounts().get(0);

	// deploy the contract
	txManager = new ClientTransactionManager(web3j, mainAccountAddress);
	bankAccountContract = BankAccount.deploy(web3j, txManager, GAS_PRICE, GAS_LIMIT, BigInteger.valueOf(0))
			.get();
}
 
Example #3
Source File: EnsResolver.java    From etherscan-explorer with GNU General Public License v3.0 4 votes vote down vote up
public EnsResolver(Web3j web3j, long syncThreshold) {
    this.web3j = web3j;
    transactionManager = new ClientTransactionManager(web3j, null);  // don't use empty string
    this.syncThreshold = syncThreshold;
}
 
Example #4
Source File: EnsResolver.java    From web3j with Apache License 2.0 4 votes vote down vote up
public EnsResolver(Web3j web3j, long syncThreshold, int addressLength) {
    this.web3j = web3j;
    transactionManager = new ClientTransactionManager(web3j, null); // don't use empty string
    this.syncThreshold = syncThreshold;
    this.addressLength = addressLength;
}