org.web3j.crypto.WalletUtils.getTestnetKeyDirectory()方法的使用及代码示例

x33g5p2x  于2022-02-03 转载在 其他  
字(1.9k)|赞(0)|评价(0)|浏览(162)

本文整理了Java中org.web3j.crypto.WalletUtils.getTestnetKeyDirectory()方法的一些代码示例,展示了WalletUtils.getTestnetKeyDirectory()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。WalletUtils.getTestnetKeyDirectory()方法的具体详情如下:
包路径:org.web3j.crypto.WalletUtils
类名称:WalletUtils
方法名:getTestnetKeyDirectory

WalletUtils.getTestnetKeyDirectory介绍

暂无

代码示例

代码示例来源:origin: web3j/web3j

String getDestinationDir() {
  String defaultDir = WalletUtils.getTestnetKeyDirectory();
  String destinationDir = console.readLine(
      "Please enter a destination directory location [" + defaultDir + "]: ");
  if (destinationDir.equals("")) {
    return defaultDir;
  } else if (destinationDir.startsWith("~")) {
    return System.getProperty("user.home") + destinationDir.substring(1);
  } else {
    return destinationDir;
  }
}

代码示例来源:origin: web3j/web3j

@Test
public void testGetTestnetKeyDirectory() {
  assertTrue(WalletUtils.getMainnetKeyDirectory()
      .endsWith(String.format("%skeystore", File.separator)));
  assertTrue(WalletUtils.getTestnetKeyDirectory()
      .endsWith(String.format("%stestnet%skeystore", File.separator, File.separator)));
  assertTrue(WalletUtils.getRinkebyKeyDirectory()
      .endsWith(String.format("%srinkeby%skeystore", File.separator, File.separator)));
  
}

代码示例来源:origin: adridadou/eth-contract-api

public static List<SecureKey> listRopstenKeystores() {
  return listKeystores(new File(WalletUtils.getTestnetKeyDirectory()));
}

代码示例来源:origin: ethjava/web3j-sample

public static void main(String[] args) {
  web3j = Web3j.build(new HttpService(Environment.RPC_URL));
  exportPrivateKey("/Users/yangzhengwei/Library/Ethereum/testnet/keystore/UTC--2018-03-03T03-51-50.155565446Z--7b1cc408fcb2de1d510c1bf46a329e9027db4112",
      "yzw");
  importPrivateKey(new BigInteger("", 16),
      "yzw",
      WalletUtils.getTestnetKeyDirectory());
  exportBip39Wallet(WalletUtils.getTestnetKeyDirectory(),
      "yzw");
}

相关文章