Advertisement
Guest User

initWeb3

a guest
Jan 2nd, 2018
173
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.72 KB | None | 0 0
  1. private void initWeb3j() {
  2.      final String url = rinkebyUrl;
  3.      Thread t = new Thread(new Runnable() {
  4.         @Override
  5.         public void run() {
  6.             HttpService infuraHttpService;
  7.             String result = "Success initializing web3j/infura";
  8.             try {
  9.                 infuraHttpService = new HttpService(url);
  10.                 web3j = Web3j.build(new HttpService(url));
  11.             } catch (Exception wtf) {
  12.                 String exception = wtf.toString();
  13.                 Log.d("wat", "Error initializing web3j/infura. Error: " + exception);
  14.             }
  15.             // Use callback function e.g. publishResult(result)
  16.             //return result;
  17.          }
  18.      });
  19.      t.start();
  20. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement