Skip to content

Commit

Permalink
fix(dashmate): configure devnet quorums
Browse files Browse the repository at this point in the history
  • Loading branch information
shumkov committed Jul 19, 2024
1 parent 4942906 commit c8d7e52
Show file tree
Hide file tree
Showing 5 changed files with 54 additions and 6 deletions.
6 changes: 6 additions & 0 deletions packages/dashmate/configs/defaults/getBaseConfigFactory.js
Original file line number Diff line number Diff line change
Expand Up @@ -152,6 +152,12 @@ export default function getBaseConfigFactory(homeDir) {
name: null,
minimumDifficultyBlocks: 0,
powTargetSpacing: 150,
llmq: {
chainLocks: 'llmq_devnet',
instantSend: 'llmq_devnet',
platform: 'llmq_devnet_platform',
mnhf: 'llmq_devnet',
},
},
log: {
file: {
Expand Down
7 changes: 7 additions & 0 deletions packages/dashmate/configs/getConfigFileMigrationsFactory.js
Original file line number Diff line number Diff line change
Expand Up @@ -688,6 +688,13 @@ export default function getConfigFileMigrationsFactory(homeDir, defaultConfigs)
});
return configFile;
},
'1.0.0-beta.4': (configFile) => {
Object.entries(configFile.configs)
.forEach(([, options]) => {
options.core.devnet.llmq = base.get('core.devnet.llmq');
});
return configFile;
},
};
}

Expand Down
33 changes: 33 additions & 0 deletions packages/dashmate/src/config/configJsonSchema.js
Original file line number Diff line number Diff line change
Expand Up @@ -127,6 +127,20 @@ export default {
required: ['llmqType', 'dkgInterval', 'activeSigners', 'rotation'],
additionalProperties: false,
},
quorumName: {
type: 'string',
enum: [
'llmq_devnet',
'llmq_devnet_dip0024',
'llmq_devnet_platform',
'llmq_50_60',
'llmq_60_75',
'llmq_400_60',
'llmq_400_85',
'llmq_100_67',
'llmq_25_67',
],
},
},
properties: {
description: {
Expand Down Expand Up @@ -361,6 +375,25 @@ export default {
type: 'integer',
minimum: 1,
},
llmq: {
type: 'object',
properties: {
chainLocks: {
$ref: '#/definitions/quorumName',
},
instantSend: {
$ref: '#/definitions/quorumName',
},
platform: {
$ref: '#/definitions/quorumName',
},
mnhf: {
$ref: '#/definitions/quorumName',
},
},
required: ['chainLocks', 'instantSend', 'platform', 'mnhf'],
additionalProperties: false,
},
},
additionalProperties: false,
required: ['name', 'minimumDifficultyBlocks', 'powTargetSpacing'],
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,11 @@ import generateTenderdashNodeKey from '../../tenderdash/generateTenderdashNodeKe
*/
export default function createPlatformNodeKeyInput(options = {}) {
let { initial } = options;
let additionalMessage = '';
if (initial === null || initial === undefined) {
initial = generateTenderdashNodeKey();
additionalMessage = ' You can provide a key, or a new key will be\n automatically generated'
+ ' for you.';
}

return {
Expand All @@ -19,8 +22,7 @@ export default function createPlatformNodeKeyInput(options = {}) {
This key is used to uniquely identify your Dash Platform node. The node key is
derived from a standard Ed25519 cryptographic key pair, presented in a cached
format specific to Tenderdash. You can provide a key, or a new key will be
automatically generated for you.\n`,
format specific to Tenderdash.${additionalMessage}\n`,
message: 'Enter Ed25519 node key',
hint: 'Base64 encoded',
initial,
Expand Down
8 changes: 4 additions & 4 deletions packages/dashmate/templates/core/dash.conf.dot
Original file line number Diff line number Diff line change
Expand Up @@ -89,10 +89,10 @@ powtargetspacing={{=it.core.devnet.powTargetSpacing}}
minimumdifficultyblocks={{=it.core.devnet.minimumDifficultyBlocks}}
highsubsidyblocks=500
highsubsidyfactor=10
llmqchainlocks=llmq_devnet
llmqinstantsend=llmq_devnet
llmqinstantsenddip0024=llmq_devnet_dip0024
llmqplatform=llmq_devnet_platform{{?}}
llmqchainlocks={{=it.core.devnet.llmq.chainLocks}}
llmqinstantsenddip0024={{=it.core.devnet.llmq.instantSend}}
llmqplatform={{=it.core.devnet.llmq.platform}}
llmqmnhf={{=it.core.devnet.llmq.mnhf}} {{?}}


{{~it.core.p2p.seeds :seed}}
Expand Down

0 comments on commit c8d7e52

Please sign in to comment.