```
// accounts
get /api/accounts/ -> shared.getAccount //帐号主页
post /api/accounts/open -> shared.open //登录
get /api/accounts/getBalance -> shared.getBalance
get /api/accounts/getPublicKey -> shared.getPublickey
post /api/accounts/generatePublicKey -> shared.generatePublickey
// username
get /api/accounts/username/get -> shared.getUsername
get /api/accounts/username/fee -> shared.getUsernameFee
put /api/accounts/username -> shared.addUsername //注册用户名
// delegates
get /api/accounts/delegates -> shared.getDelegates
get /api/accounts/delegates/fee -> shared.getDelegatesFee
put /api/accounts/delegates -> shared.addDelegates
// count 对应431行单独定义
get /api/accounts/count -> private.accounts
```
// 455行
Accounts.prototype.generateAddressByPublicKey = function (publicKey) {
var publicKeyHash = crypto.createHash('sha256').update(publicKey, 'hex').digest();
var temp = new Buffer(8);
for (var i = 0; i < 8; i++) {
temp = publicKeyHash[7 - i];
}
var address = bignum.fromBuffer(temp).toString() + 'L';
if (!address) {
throw Error("wrong publicKey " + publicKey);
}
return address;
};
```
```
// logic/block.js 20行
private.getAddressByPublicKey = function (publicKey) {
var publicKeyHash = crypto.createHash('sha256').update(publicKey, 'hex').digest();
var temp = new Buffer(8);
for (var i = 0; i < 8; i++) {
temp = publicKeyHash[7 - i];
}
var address = bignum.fromBuffer(temp).toString() + "C";
return address;
}