If I add a new api /newAddress to the Controller.java, and this API makes use of WalletUtils.generateFullNewWalletFile(), then I realize that my RESTful server have to access the keystore directory, which means my RESTful server has to run on the full node, am I correct?
@RequestMapping(value = "/newAddress")
String newAccount() throws Exception {
// wallet file is named like `UTC--2018-03-16T05-09-05.79000000Z--3ae52004fd3e16c3b70b92ca0a9b382c786bf27e.json`
String walletFileName = WalletUtils.generateFullNewWalletFile(getEncryptPassphrase(),
new File(getKeystoreDir()));
// in which `3ae52004fd3e16c3b70b92ca0a9b382c786bf27e` is address
String[] fetchAddress = walletFileName.split("--");
String address = "0x" + fetchAddress[fetchAddress.length-1].split("\\.")[0];
return address;
}
If I add a new api
/newAddress
to theController.java
, and this API makes use ofWalletUtils.generateFullNewWalletFile()
, then I realize that my RESTful server have to access the keystore directory, which means my RESTful server has to run on the full node, am I correct?