Browse Source

Current data model description comment

Leszek Wiesner 4 years ago
parent
commit
1a70985247
1 changed files with 11 additions and 0 deletions
  1. 11 0
      cli/src/base/AccountsCommandBase.ts

+ 11 - 0
cli/src/base/AccountsCommandBase.ts

@@ -13,6 +13,17 @@ import { AccountBalances, NamedKeyringPair } from '../Types';
 
 type StateObject = { selectedAccountFilename: string };
 
+/**
+ * Abstract base class for account-related commands.
+ *
+ * All the accounts available in the CLI are stored in the form of json backup files inside:
+ * { this.config.dataDir }/{ ACCOUNTS_DIRNAME } (ie. ~/.local/share/joystream-cli/accounts on Ubuntu)
+ * Where: this.config.dataDir is provided by oclif and ACCOUNTS_DIRNAME is a static of AccountsCommandBase.
+ *
+ * Additionally, there is a state.json file kept inside the data directory (this.config.dataDir).
+ * Currently it just stores information about the default account that can be choosen by the user
+ * by executing account:choose command (see "StateObject" type above).
+ */
 export default abstract class AccountsCommandBase extends Command {
     static ACCOUNTS_DIRNAME = '/accounts';
     static STATE_FILE = '/state.json';