Skip to content

Commit

Permalink
Improved logging
Browse files Browse the repository at this point in the history
  • Loading branch information
fboucquez committed Jan 18, 2021
1 parent 811d6b2 commit 350a62d
Show file tree
Hide file tree
Showing 8 changed files with 13 additions and 8 deletions.
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@ The changelog format is based on [Keep a Changelog](https://keepachangelog.com/e
---|---|---
Symbol Bootstrap | v0.4.1 | [symbol-bootstrap](https://www.npmjs.com/package/symbol-bootstrap)

- Added `--backupSync` to `config` and `start` commands. It downloads a backup with the Mongo and RocksDb databases for faster synchronization.
- Added `backup` command. The command backups the Mongo and RocksDb data folder into a Zip file that can be used for `--backupSync` feature.
- Improved --password. It's only required when private keys need to be read.
- Added `database` service to server and broker `depends_on` compose services.
- Fixed `link --unlink` command for Voting Key Link transactions.
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -264,7 +264,7 @@ General users should install this tool like any other node module.
<!-- commands -->
# Command Topics

* [`symbol-bootstrap backup`](docs/backup.md) - It backups the mongo and data folder into a Zip file that can be used for --backupSync feature. Bootstrap compose services must be stopped before calling this command.
* [`symbol-bootstrap backup`](docs/backup.md) - The command backups the Mongo and RocksDb data folder into a Zip file that can be used for --backupSync feature. Bootstrap compose services must be stopped before calling this command.
* [`symbol-bootstrap clean`](docs/clean.md) - It removes the target folder deleting the generated configuration and data
* [`symbol-bootstrap compose`](docs/compose.md) - It generates the `docker-compose.yml` file from the configured network.
* [`symbol-bootstrap config`](docs/config.md) - Command used to set up the configuration files and the nemesis block for the current network
Expand Down
4 changes: 2 additions & 2 deletions docs/backup.md
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
`symbol-bootstrap backup`
=========================

It backups the mongo and data folder into a Zip file that can be used for --backupSync feature. Bootstrap compose services must be stopped before calling this command.
The command backups the Mongo and RocksDb data folder into a Zip file that can be used for --backupSync feature. Bootstrap compose services must be stopped before calling this command.

Note: this command is designed for NGL to be used when running public main or public test networks. It's not backing up any node specific information.

* [`symbol-bootstrap backup`](#symbol-bootstrap-backup)

## `symbol-bootstrap backup`

It backups the mongo and data folder into a Zip file that can be used for --backupSync feature. Bootstrap compose services must be stopped before calling this command.
The command backups the Mongo and RocksDb data folder into a Zip file that can be used for --backupSync feature. Bootstrap compose services must be stopped before calling this command.

```
USAGE
Expand Down
2 changes: 1 addition & 1 deletion docs/config.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ OPTIONS
-u, --user=user [default: current] User used to run docker images when creating configuration files
like certificates or nemesis block. "current" means the current user.
--backupSync It downloads a backup with the mongo and rockdb databases for faster
--backupSync It downloads a backup with the Mongo and RocksDb databases for faster
synchronization.
--pullImages It pulls the utility images from DockerHub when running the configuration. It only
Expand Down
2 changes: 1 addition & 1 deletion docs/start.md
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ OPTIONS
Add extra arguments to the docker-compose up command. Check out https://docs.docker.com/compose/reference/up.
--backupSync
It downloads a backup with the mongo and rockdb databases for faster synchronization.
It downloads a backup with the Mongo and RocksDb databases for faster synchronization.
--healthCheck
It checks if the services created with docker compose are up and running.
Expand Down
2 changes: 1 addition & 1 deletion src/commands/backup.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ import { Command, flags } from '@oclif/command';
import { BootstrapService, BootstrapUtils } from '../service';

export default class Backup extends Command {
static description = `It backups the mongo and data folder into a Zip file that can be used for --backupSync feature. Bootstrap compose services must be stopped before calling this command.
static description = `The command backups the Mongo and RocksDb data folder into a Zip file that can be used for --backupSync feature. Bootstrap compose services must be stopped before calling this command.
Note: this command is designed for NGL to be used when running public main or public test networks. It's not backing up any node specific information.`;

Expand Down
2 changes: 1 addition & 1 deletion src/commands/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ export default class Config extends Command {
}),

backupSync: flags.boolean({
description: 'It downloads a backup with the mongo and rockdb databases for faster synchronization.',
description: 'It downloads a backup with the Mongo and RocksDb databases for faster synchronization.',
default: ConfigService.defaultParams.backupSync,
}),

Expand Down
5 changes: 4 additions & 1 deletion src/service/BackupSyncService.ts
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,9 @@ export class BackupSyncService {
await this.unzip(fileLocation, 'data', destinationFolder);
}),
);
logger.info(
`Zip backup '${fileLocation}' has been restored. HINT: You can remove this file if you want to reclaim the disk space for future use.`,
);
}

private unzip(globalDestination: string, innerFolder: string, targetFolder: string): Promise<void> {
Expand Down Expand Up @@ -208,7 +211,7 @@ export class BackupSyncService {

public async createBackup(passedPresetData?: ConfigPreset): Promise<void> {
const configLoader = new ConfigLoader();
const presetData = passedPresetData ?? configLoader.loadExistingPresetData(this.params.target, '');
const presetData = passedPresetData ?? configLoader.loadExistingPresetData(this.params.target, false);

const node = presetData.nodes?.find((node) => (!this.params.nodeName || node.name == this.params.nodeName) && node.api);
if (!node && this.params.nodeName) {
Expand Down

0 comments on commit 350a62d

Please sign in to comment.