Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
3,020 changes: 2,862 additions & 158 deletions .pnp.cjs

Large diffs are not rendered by default.

Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
8 changes: 4 additions & 4 deletions package.json
Original file line numberDiff line numberDiff line change
Expand Up@@ -4,9 +4,9 @@
"private": true,
"scripts": {
"setup": "yarn install && yarn run build && yarn run configure",
"start": "yarn run dashmate group:start --verbose -w",
"restart": "yarn run dashmate group:restart --verbose",
"stop": "yarn run dashmate group:stop --verbose",
"start": "yarn run dashmate groupstart --verbose -w",
"restart": "yarn run dashmate grouprestart --verbose",
"stop": "yarn run dashmate groupstop --verbose",
"reset": "yarn run clean:data --force && yarn run setup",
"test": "ultra -r $* test",
"test:dapi": "ultra -r --filter \"packages/@(dapi|platform-test-suite)\" test",
Expand All@@ -28,7 +28,7 @@
"configure:tests": "yarn exec ./scripts/configure_test_suite.sh",
"configure:dotenv": "yarn exec ./scripts/configure_dotenv.sh",
"configure": "yarn run configure:dashmate && yarn run configure:network && yarn run configure:tests && yarn run configure:dotenv",
"clean:data": "yarn run dashmate group:reset --verbose --group=local --hard",
"clean:data": "yarn run dashmate groupreset --verbose --group=local --hard",
"clean": "yarn run clean:data && yarn run build",
"dashmate": "yarn exec packages/dashmate/bin/dashmate",
"release": "yarn exec ./scripts/release/release.sh"
Expand Down
30 changes: 15 additions & 15 deletions packages/dashmate/README.md
Original file line numberDiff line numberDiff line change
Expand Up@@ -116,7 +116,7 @@ The `config` command is used to manage your node configuration before starting t
- local - template for local node configs
- testnet - testnet node configuration

You can modify and use the system configs directly, or create your own. You can base your own configs on one of the system configs using the `dashmate config:create CONFIG [FROM]` command. You must set a default config with `dashmate config:default CONFIG` or specify a config with the `--config=<config>` option when running commands. The `base` config is initially set as default.
You can modify and use the system configs directly, or create your own. You can base your own configs on one of the system configs using the `dashmate configcreate CONFIG [FROM]` command. You must set a default config with `dashmate configdefault CONFIG` or specify a config with the `--config=<config>` option when running commands. The `base` config is initially set as default.

```
USAGE
Expand DownExpand Up@@ -211,7 +211,7 @@ COMMANDS

To show the host status:
```bash
$ dashmate status:host
$ dashmate statushost
```

### Reset node data
Expand DownExpand Up@@ -241,7 +241,7 @@ $ dashmate reset
It is also possible to start a full node instead of a masternode. Modify the config setting as follows:

```bash
dashmate config:set core.masternode.enable false
dashmate configset core.masternode.enable false
```

### Node groups
Expand All@@ -254,7 +254,7 @@ The [setup](#setup-node) command set corresponding group as default. To output t

```
USAGE
$ dashmate group:default [GROUP]
$ dashmate groupdefault [GROUP]

ARGUMENTS
GROUP group name
Expand All@@ -269,7 +269,7 @@ The `group:list` command outputs a list of group configs.

```
USAGE
$ dashmate group:list
$ dashmate grouplist

OPTIONS
-v, --verbose use verbose mode for output
Expand All@@ -282,7 +282,7 @@ The `group:start` command is used to start a group of nodes belonging to the def

```
USAGE
$ dashmate group:start
$ dashmate groupstart

OPTIONS
-v, --verbose use verbose mode for output
Expand All@@ -296,7 +296,7 @@ The `group:stop` command is used to stop group nodes belonging to the default gr

```
USAGE
$ dashmate group:stop
$ dashmate groupstop

OPTIONS
-v, --verbose use verbose mode for output
Expand All@@ -309,7 +309,7 @@ The `group:restart` command is used to restart group nodes belonging to the defa

```
USAGE
$ dashmate group:restart
$ dashmate grouprestart

OPTIONS
-v, --verbose use verbose mode for output
Expand All@@ -322,7 +322,7 @@ The `group:status` command outputs group status information.

```
USAGE
$ dashmate group:status
$ dashmate groupstatus

OPTIONS
-v, --verbose use verbose mode for output
Expand All@@ -335,7 +335,7 @@ The `group:reset` command removes all data corresponding to the specified group

```
USAGE
$ dashmate group:reset
$ dashmate groupreset

OPTIONS
-h, --hard reset config as well as data
Expand All@@ -353,14 +353,14 @@ To group nodes together, set a group name to `group` option in corresponding con
Create a group of two testnet nodes:
```bash
# create a new config using `testnet` config as template
dashmate config:create testnet_2 testnet
dashmate configcreate testnet_2 testnet

# combine configs into the group
dashmate config:set --config=testnet group testnet
dashmate config:set --config=testnet_2 group testnet
dashmate configset --config=testnet group testnet
dashmate configset --config=testnet_2 group testnet

# set the group as default
dashmate group:default testnet
dashmate groupdefault testnet
```

To start the group of nodes, ports and other required options need to be updated.
Expand All@@ -376,7 +376,7 @@ To allow developers quickly test changes to DAPI and Drive, a local path for thi
If you want to use Docker Compose directly, you will need to pass a configuration as a dotenv file. You can output a config to a dotenv file for Docker Compose as follows:

```bash
$ dashmate config:envs --config=testnet --output-file .env.testnet
$ dashmate configenvs --config=testnet --output-file .env.testnet
```

Then specify the created dotenv file as an option for the `docker-compose` command:
Expand Down
6 changes: 3 additions & 3 deletions packages/dashmate/bin/dashmate
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
#!/usr/bin/env node

require('@oclif/command').run()
.then(require('@oclif/command/flush'))
require('@oclif/core').run()
.then(require('@oclif/core/flush'))
// eslint-disable-next-line import/no-extraneous-dependencies
.catch(require('@oclif/errors/handle'));
.catch(require('@oclif/core/handle'));
21 changes: 12 additions & 9 deletions packages/dashmate/package.json
Original file line numberDiff line numberDiff line change
Expand Up@@ -6,8 +6,9 @@
"scripts": {
"lint": "eslint .",
"postpack": "rm -f oclif.manifest.json",
"prepack": "oclif-dev manifest && oclif-dev readme",
"version": "oclif-dev readme && git add README.md"
"posttest": "yarn lint",
"prepack": "oclif manifest && oclif readme",
"version": "oclif readme && git add README.md"
},
"repository": {
"type": "git",
Expand DownExpand Up@@ -52,10 +53,8 @@
"@dashevo/dpp": "workspace:~",
"@dashevo/feature-flags-contract": "workspace:~",
"@dashevo/wallet-lib": "workspace:~",
"@oclif/command": "^1.8.9",
"@oclif/config": "^1.18.2",
"@oclif/errors": "^1.3.5",
"@oclif/plugin-help": "^3.2.14",
"@oclif/core": "^1.0.10",
"@oclif/plugin-help": "^5",
"ajv": "^8.6.0",
"ajv-formats": "^2.1.1",
"awilix": "^4.2.6",
Expand DownExpand Up@@ -89,11 +88,11 @@
"table": "^5.4.6"
},
"devDependencies": {
"@oclif/dev-cli": "^1.22.2",
"eslint": "^7.32.0",
"eslint-config-airbnb-base": "^14.2.1",
"eslint-plugin-import": "^2.24.2",
"globby": "^10.0.2"
"globby": "^11",
"oclif": "^2.1.0"
},
"files": [
"bin",
Expand All@@ -106,6 +105,9 @@
"npm-shrinkwrap.json"
],
"oclif": {
"additionalHelpFlags": [
"-h"
],
"commands": "./src/commands",
"bin": "dashmate",
"plugins": [
Expand All@@ -121,6 +123,7 @@
"status": {
"description": "Show node status details"
}
}
},
"topicSeparator": " "
}
}
4 changes: 2 additions & 2 deletions packages/dashmate/src/commands/config/envs.js
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
const fs = require('fs');
const path = require('path');

const { flags: flagTypes } = require('@oclif/command');
const { Flags } = require('@oclif/core');

const { HOME_DIR_PATH } = require('../../constants');

Expand DownExpand Up@@ -47,7 +47,7 @@ Export configuration options as Docker Compose envs

ConfigEnvsCommand.flags = {
...ConfigBaseCommand.flags,
'output-file': flagTypes.string({
'output-file': Flags.string({
char: 'o',
description: 'output to file',
default: null,
Expand Down
8 changes: 4 additions & 4 deletions packages/dashmate/src/commands/group/reset.js
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
const { Listr } = require('listr2');

const { flags: flagTypes } = require('@oclif/command');
const { Flags } = require('@oclif/core');

const GroupBaseCommand = require('../../oclif/command/GroupBaseCommand');
const MuteOneLineError = require('../../oclif/errors/MuteOneLineError');
Expand DownExpand Up@@ -134,16 +134,16 @@ GroupResetCommand.description = 'Reset group nodes';

GroupResetCommand.flags = {
...GroupBaseCommand.flags,
hard: flagTypes.boolean({
hard: Flags.boolean({
description: 'reset config as well as data',
default: false,
}),
force: flagTypes.boolean({
force: Flags.boolean({
char: 'f',
description: 'reset even running node',
default: false,
}),
'platform-only': flagTypes.boolean({
'platform-only': Flags.boolean({
char: 'p',
description: 'reset platform data only',
default: false,
Expand Down
4 changes: 2 additions & 2 deletions packages/dashmate/src/commands/group/start.js
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
const { Listr } = require('listr2');

const { flags: flagTypes } = require('@oclif/command');
const { Flags } = require('@oclif/core');

const GroupBaseCommand = require('../../oclif/command/GroupBaseCommand');
const MuteOneLineError = require('../../oclif/errors/MuteOneLineError');
Expand DownExpand Up@@ -61,7 +61,7 @@ GroupStartCommand.description = 'Start group nodes';

GroupStartCommand.flags = {
...GroupBaseCommand.flags,
'wait-for-readiness': flagTypes.boolean({ char: 'w', description: 'wait for nodes to be ready', default: false }),
'wait-for-readiness': Flags.boolean({ char: 'w', description: 'wait for nodes to be ready', default: false }),
};

module.exports = GroupStartCommand;
6 changes: 3 additions & 3 deletions packages/dashmate/src/commands/reset.js
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
const { Listr } = require('listr2');

const { flags: flagTypes } = require('@oclif/command');
const { Flags } = require('@oclif/core');

const ConfigBaseCommand = require('../oclif/command/ConfigBaseCommand');

Expand DownExpand Up@@ -70,8 +70,8 @@ Reset node data

ResetCommand.flags = {
...ConfigBaseCommand.flags,
hard: flagTypes.boolean({ char: 'h', description: 'reset config as well as data', default: false }),
'platform-only': flagTypes.boolean({ char: 'p', description: 'reset platform data only', default: false }),
hard: Flags.boolean({ char: 'h', description: 'reset config as well as data', default: false }),
'platform-only': Flags.boolean({ char: 'p', description: 'reset platform data only', default: false }),
};

module.exports = ResetCommand;
18 changes: 8 additions & 10 deletions packages/dashmate/src/commands/setup.js
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
const { Listr } = require('listr2');

const { flags: flagTypes } = require('@oclif/command');
const { Flags } = require('@oclif/core');

const BaseCommand = require('../oclif/command/BaseCommand');

Expand DownExpand Up@@ -129,15 +129,13 @@ SetupCommand.args = [{
}];

SetupCommand.flags = {
'debug-logs': flagTypes.boolean({
char: 'd', description: 'enable debug logs', allowNo: true, default: null,
}),
'external-ip': flagTypes.string({ char: 'i', description: 'external ip' }),
'operator-bls-private-key': flagTypes.string({ char: 'k', description: 'operator bls private key' }),
'funding-private-key': flagTypes.string({ char: 'p', description: `private key with more than ${MASTERNODE_DASH_AMOUNT} dash for funding collateral` }),
'node-count': flagTypes.integer({ description: 'number of nodes to setup', default: null }),
'miner-interval': flagTypes.string({ char: 'm', description: 'interval between blocks', default: null }),
verbose: flagTypes.boolean({ char: 'v', description: 'use verbose mode for output', default: false }),
'debug-logs': Flags.boolean({ char: 'd', description: 'enable debug logs', allowNo: true }),
'external-ip': Flags.string({ char: 'i', description: 'external ip' }),
'operator-bls-private-key': Flags.string({ char: 'k', description: 'operator bls private key' }),
'funding-private-key': Flags.string({ char: 'p', description: `private key with more than ${MASTERNODE_DASH_AMOUNT} dash for funding collateral` }),
'node-count': Flags.integer({ description: 'number of nodes to setup' }),
'miner-interval': Flags.string({ char: 'm', description: 'interval between blocks' }),
verbose: Flags.boolean({ char: 'v', description: 'use verbose mode for output', default: false }),
};

module.exports = SetupCommand;
4 changes: 2 additions & 2 deletions packages/dashmate/src/commands/start.js
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
const { Listr } = require('listr2');

const { flags: flagTypes } = require('@oclif/command');
const { Flags } = require('@oclif/core');

const ConfigBaseCommand = require('../oclif/command/ConfigBaseCommand');

Expand DownExpand Up@@ -67,7 +67,7 @@ Start node

StartCommand.flags = {
...ConfigBaseCommand.flags,
'wait-for-readiness': flagTypes.boolean({ char: 'w', description: 'wait for nodes to be ready', default: false }),
'wait-for-readiness': Flags.boolean({ char: 'w', description: 'wait for nodes to be ready', default: false }),
};

module.exports = StartCommand;
4 changes: 2 additions & 2 deletions packages/dashmate/src/commands/status/core.js
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
const fetch = require('node-fetch');
const chalk = require('chalk');

const { flags: flagTypes } = require('@oclif/command');
const { Flags } = require('@oclif/core');
const { OUTPUT_FORMATS } = require('../../constants');

const ConfigBaseCommand = require('../../oclif/command/ConfigBaseCommand');
Expand DownExpand Up@@ -205,7 +205,7 @@ CoreStatusCommand.description = 'Show core status details';

CoreStatusCommand.flags = {
...ConfigBaseCommand.flags,
format: flagTypes.string({
format: Flags.string({
description: 'display output format',
default: OUTPUT_FORMATS.PLAIN,
options: Object.values(OUTPUT_FORMATS),
Expand Down
4 changes: 2 additions & 2 deletions packages/dashmate/src/commands/status/host.js
Original file line numberDiff line numberDiff line change
Expand Up@@ -3,7 +3,7 @@ const publicIp = require('public-ip');
const prettyMs = require('pretty-ms');
const prettyByte = require('pretty-bytes');

const { flags: flagTypes } = require('@oclif/command');
const { Flags } = require('@oclif/core');
const { OUTPUT_FORMATS } = require('../../constants');

const ConfigBaseCommand = require('../../oclif/command/ConfigBaseCommand');
Expand DownExpand Up@@ -34,7 +34,7 @@ HostStatusCommand.description = 'Show host status details';

HostStatusCommand.flags = {
...ConfigBaseCommand.flags,
format: flagTypes.string({
format: Flags.string({
description: 'display output format',
default: OUTPUT_FORMATS.PLAIN,
options: Object.values(OUTPUT_FORMATS),
Expand Down
4 changes: 2 additions & 2 deletions packages/dashmate/src/commands/status/index.js
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
const { flags: flagTypes } = require('@oclif/command');
const { Flags } = require('@oclif/core');
const { OUTPUT_FORMATS } = require('../../constants');

const ConfigBaseCommand = require('../../oclif/command/ConfigBaseCommand');
Expand All@@ -25,7 +25,7 @@ StatusCommand.description = 'Show status overview';

StatusCommand.flags = {
...ConfigBaseCommand.flags,
format: flagTypes.string({
format: Flags.string({
description: 'display output format',
default: OUTPUT_FORMATS.PLAIN,
options: Object.values(OUTPUT_FORMATS),
Expand Down
Loading