Wallet

Use wallet command to perform various wallet management operations.

USAGE:
   metalo wallet command [command options] [arguments...]

COMMANDS:
   ls                    list wallet records
   sync                  sync local data wallet with the ledger
   export                export data wallet
   purge-deleted-assets  purge deleted data assets
   help, h               Shows a list of commands or help for one command

Sync Wallet

Before users can explore their data wallet, the wallet needs to be synced with the MetaLocker ledger. Syncing basically means scanning the ledger, identifying records that belong to the user’s lockers, and saving these records into a local index.

Use the sync command to sync the local wallet with MetaLocker ledger.

METAPASS=<password> metalo --user <email> wallet sync

List Wallet Records

Use the ls command to list all records in the account’s locker.

METAPASS=<password> metalo --user <email> wallet ls

Sample Output

|                    LOCKER                    |            PARTICIPANT             |                      ID                      | TYPE |                  IMPRESSION                  |    CONTENT TYPE    |  STATUS   |
|----------------------------------------------|------------------------------------|----------------------------------------------|------|----------------------------------------------|--------------------|-----------|
| 13tK7TkmUJgxyaByVGgiYApoAMLDDHTzwteVsKU8Kve3 | did:sequel:7kNEj2is1qCVpttc9emCAy  | 4NSZYh4hKGrZKgru9qFcwi8Y3fCdmx7sWge5vFWRMct7 |    1 | FdDNRF1wTPh6KjpdAKvxLdh58yiawKk2a8ZrirALTPgP | Person             | published |

Export Wallet

Use the export command to export all records and its contents into a local folder.

Options

--locker value       Locker ID. If specified, only the given locker will be exported
--participant value  Participant ID. If specified, only the given locker participant will be exported
--mode value         'user' or 'full' (default). 'User' mode skips internal metadata and prettifies JSON for graphs (default: "full")
--force-rewrite      if true, export records even when they already exist on disk (default: false)
--help, -h           show help (default: false)

Examples

# export everything in the wallet into a folder
METAPASS=<password> metalo --user <email> wallet export <path-to-folder>
# export only records from the given locker into a folder
METAPASS=<password> metalo --user <email> wallet export  --locker <locker-id> <path-to-folder>

Purge Deleted Assets

When the user revokes a lease for a dataset, MetaLocker saves a revocation record to its ledger, thus preventing any further access to the underlying dataset. However, the contents of the dataset still remain in the MetaLocker vaults, as well as the lease itself remains in the off-chain storage.

purge-deleted-assets command physically deletes the underlying data assets from the vaults.

Options

--locker value       Locker ID. If not specified, records from all lockers will be displayed
--max-records value  Maximum number of records to be displayed (default: 20)
--sync               sync data wallet before reading the data set (default: false)

Examples

# purge underlying assets for the first 20 revoked leases found in the wallet
METAPASS=<password> metalo --user <email> wallet purge-deleted-assets
# purge underlying assets for the first 10000 revoked leases found in the wallet
METAPASS=<password> metalo --user <email> wallet purge-deleted-assets --max-records 10000
# purge underlying assets for the first 10000 revoked leases found in the given locker
METAPASS=<password> metalo --user <email> wallet purge-deleted-assets --max-records 10000 --locker <locker-id>
# sync the wallet, then purge underlying assets for the first 20 revoked leases found in the wallet
METAPASS=<password> metalo --user <email> wallet purge-deleted-assets --sync