本文主要是介绍始料未及的COVID-19、延期的考试、又可以瞎倒腾的喜悦,希望对大家解决编程问题提供一定的参考价值,需要的开发者们随着小编来一起学习吧!
Hmmm,真的本来下定决心不要东摸西摸专心功课,但是确实发生了本次人类历史上的大事件(当然可能在以后的日子里这个也就是洒洒水水平)导致了考试的延期,我又再一次的东张西望起来。
hmmm,好吧为了庆祝又可以自由活动,特此献上抄来的小程序一篇。以下可以用在ledge nano x上面查阅ETH。ledger的椭圆曲线弧度做了修改,更加细化了。
# List accounts from the Ledger Nano X
# Works in OS/X and Linux. May work in Windows with Cygwin.
#
# How to use:
# 1. Save into a file, e.g., ~/bin/getNanoAccounts
# 2. Set the executable bit - `chmod 700 ~/bin/getNanoAccounts`
# 3. Run the script - `~/bin/getNanoAccounts`
#
# (c) BokkyPooBah - Aug 13 2017. The MIT Licence.
# ------------------------------------------------------------------------------geth attach << EOF | grep "RESULT: " | sed "s/RESULT: //"function padLeft(s, n) {var result = s.toString();while (result.length < n) {result = " " + result;}return result;
}function listNanoAccounts(from, to) {if (from == null) {from = 0;}if (to == null) {to = 9;}var nanoUrl=personal.listWallets[personal.listWallets.length-1].url;var nanoPathPrefix="m/44'/60'/0'/0/";var total = new BigNumber(0);console.log("RESULT: # Account Ethers");console.log("RESULT: --- ------------------------------------------ --------------------------");for (var i = from; i <= to; i++) {var account = personal.deriveAccount(nanoUrl, nanoPathPrefix + i, true).address;var balance = eth.getBalance(account);total = total.add(balance);console.log("RESULT: " + padLeft(i, 3) + " " + account + " " + padLeft(balance.toFixed(18), 26));}console.log("RESULT: --- ------------------------------------------ --------------------------");console.log("RESULT: Total " + padLeft(total, 26));console.log("RESULT: --- ------------------------------------------ --------------------------");
}listNanoAccounts()EOF
这篇关于始料未及的COVID-19、延期的考试、又可以瞎倒腾的喜悦的文章就介绍到这儿,希望我们推荐的文章对编程师们有所帮助!