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
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 0 additions & 2 deletions packages/dashmate/docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,6 @@ services:
- ${DASHMATE_HOME_DIR:?err}/${CONFIG_NAME:?err}/core/dash.conf:/dash/.dashcore/dash.conf
command:
- dashd
- -masternodeblsprivkey=${CORE_MASTERNODE_OPERATOR_PRIVATE_KEY}

volumes:
core_data:

Expand Down
27 changes: 17 additions & 10 deletions packages/dashmate/src/core/startCoreFactory.js
Original file line number Diff line number Diff line change
Expand Up @@ -29,24 +29,32 @@ function startCoreFactory(
...options,
};

// Run Core service
const isMasternode = config.get('core.masternode.enable');

if (isMasternode) {
Comment thread
shumkov marked this conversation as resolved.
// Check operatorPrivateKey is set (error will be thrown if not)
config.get('core.masternode.operator.privateKey', true);
}

// Run Core service
const coreCommand = [
'dashd',
];
const isMasternode = config.get('core.masternode.enable');
const operatorKey = config.get('core.masternode.operator.privateKey');

if (options.wallet) {
coreCommand.push('--disablewallet=0');
} else if (isMasternode && Boolean(operatorKey)) {
coreCommand.push(`-masternodeblsprivkey=${operatorKey}`);
}

if (options.addressIndex) {
coreCommand.push('--addressindex=1');
}

if (options.wallet) {
if (isMasternode) {
throw new Error('You cannot run masternode with wallet mode on')
}

coreCommand.push('--disablewallet=0');
} else {
coreCommand.push('--disablewallet=1');
}

const coreContainer = await dockerCompose.runService(
config.toEnvs(),
'core',
Expand All @@ -72,7 +80,6 @@ function startCoreFactory(
);

// Wait Core to start

await waitForCoreStart(coreService);

return coreService;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ function waitForNodeToBeReadyTaskFactory(
async function waitForNodeToBeReadyTask(config) {
return new Listr([
{
title: `Wait for node ${config.getName()} to be ready`,
task: async () => {
const port = config.get('platform.drive.tenderdash.rpc.port');

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -158,6 +158,10 @@ function configureCoreTaskFactory(

config.set('core.masternode.operator.privateKey', ctx.operator.privateKey);

// Write configs
const configFiles = renderServiceTemplates(config);
writeServiceConfigs(config.getName(), configFiles);

// eslint-disable-next-line no-param-reassign
task.output = `Public key: ${ctx.operator.publicKey}\nPrivate key: ${ctx.operator.privateKey}`;
},
Expand Down
5 changes: 5 additions & 0 deletions packages/dashmate/templates/core/dash.conf.dot
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,10 @@ zmqpubrawchainlocksig=tcp://0.0.0.0:29998
zmqpubrawchainlock=tcp://0.0.0.0:29998
zmqpubrawtxlocksig=tcp://0.0.0.0:29998

{{? it.core.masternode.enable === true}}
masternodeblsprivkey={{=it.core.masternode.operator.privateKey}}
{{?}}

{{? it.network === 'testnet'}}testnet=1
[test]
{{?? it.network === 'local'}}
Expand Down Expand Up @@ -69,3 +73,4 @@ port={{=it.core.p2p.port}}
bind=0.0.0.0
rpcbind=0.0.0.0
rpcport={{=it.core.rpc.port}}