Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore(dashmate): configure mainnet #2016

Merged
merged 9 commits into from
Jul 29, 2024
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: 1 addition & 1 deletion .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,7 @@ jobs:
image_name: drive
target: drive-abci

release-drive-dapi:
release-dapi-image:
name: Release DAPI image
secrets: inherit
uses: ./.github/workflows/release-docker-image.yml
Expand Down
16 changes: 8 additions & 8 deletions packages/dashmate/configs/defaults/getBaseConfigFactory.js
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ export default function getBaseConfigFactory(homeDir) {
port: 3001,
},
docker: {
image: 'dashpay/dashd:20',
image: 'dashpay/dashd:21',
commandArgs: [],
},
p2p: {
Expand Down Expand Up @@ -332,10 +332,10 @@ export default function getBaseConfigFactory(homeDir) {
cacheSize: 15000,
size: 5000,
maxTxsBytes: 1073741824,
timeoutCheckTx: '0',
txEnqueueTimeout: '0',
txSendRateLimit: 0,
txRecvRateLimit: 0,
timeoutCheckTx: '1s',
txEnqueueTimeout: '10ms',
txSendRateLimit: 10,
txRecvRateLimit: 12,
maxConcurrentCheckTx: 250,
},
consensus: {
Expand Down Expand Up @@ -388,16 +388,16 @@ export default function getBaseConfigFactory(homeDir) {
app_version: '1',
},
timeout: {
propose: '30000000000',
propose_delta: '1000000000',
propose: '40000000000',
propose_delta: '5000000000',
vote: '2000000000',
vote_delta: '500000000',
commit: '1000000000',
bypass_commit_timeout: false,
},
synchrony: {
message_delay: '32000000000',
precision: '500000000',
precision: '1000000000',
},
abci: {
recheck_tx: true,
Expand Down
4 changes: 0 additions & 4 deletions packages/dashmate/configs/defaults/getLocalConfigFactory.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,10 +24,6 @@ export default function getLocalConfigFactory(getBaseConfig) {
},
},
core: {
docker: {
image: 'dashpay/dashd:21.0.0-rc.2',
commandArgs: [],
},
p2p: {
port: 20001,
},
Expand Down
38 changes: 38 additions & 0 deletions packages/dashmate/configs/defaults/getMainnetConfigFactory.js
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,44 @@ export default function getMainnetConfigFactory(homeDir, getBaseConfig) {
network: NETWORK_MAINNET,
platform: {
enable: false,
drive: {
tenderdash: {
p2p: {
seeds: [
{
id: '069639dfceec5f7c86257e6e9c46407c16ad1eab',
host: '34.211.174.194',
port: 26656,
},
{
id: 'd46e2445642b2f94158ac3c2a6d90b88b83705b8',
host: '3.76.148.150',
port: 26656,
},
{
id: 'b08a650ecfac178939f21c0c12801eccaf18a5ea',
host: '3.0.60.103',
port: 26656,
},
{
id: '4cb4a8488eb1dbabda7fb79e47ac3c14eec73c4f',
host: '188.166.140.47',
port: 26656,
},
],
},
mempool: {
timeoutCheckTx: '3s',
txEnqueueTimeout: '30ms',
txSendRateLimit: 100,
txRecvRateLimit: 120,
},
genesis: {
chain_id: 'dash-1',
validator_quorum_type: 4,
},
},
},
},
};

Expand Down
10 changes: 0 additions & 10 deletions packages/dashmate/configs/defaults/getTestnetConfigFactory.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,10 +24,6 @@ export default function getTestnetConfigFactory(homeDir, getBaseConfig) {
},
},
core: {
docker: {
image: 'dashpay/dashd:21.0.0-rc.2',
commandArgs: [],
},
p2p: {
port: 19999,
},
Expand Down Expand Up @@ -95,12 +91,6 @@ export default function getTestnetConfigFactory(homeDir, getBaseConfig) {
],
port: 36656,
},
mempool: {
timeoutCheckTx: '1s',
txEnqueueTimeout: '10ms',
txSendRateLimit: 10,
txRecvRateLimit: 12,
},
rpc: {
port: 36657,
timeoutBroadcastTx: '1s',
Expand Down
23 changes: 23 additions & 0 deletions packages/dashmate/configs/getConfigFileMigrationsFactory.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ export default function getConfigFileMigrationsFactory(homeDir, defaultConfigs)
function getConfigFileMigrations() {
const base = defaultConfigs.get('base');
const testnet = defaultConfigs.get('testnet');
const mainnet = defaultConfigs.get('mainnet');

/**
* @param {string} name
Expand Down Expand Up @@ -733,6 +734,28 @@ export default function getConfigFileMigrationsFactory(homeDir, defaultConfigs)
});
return configFile;
},
'1.0.0': (configFile) => {
Object.entries(configFile.configs)
.forEach(([name, options]) => {
if (name === 'base') {
options.platform.drive.tenderdash.mempool = base.get('platform.drive.tenderdash.mempool');
options.platform.drive.tenderdash.genesis = base.get('platform.drive.tenderdash.genesis');
} else if (options.network === NETWORK_MAINNET) {
options.platform.drive.tenderdash.p2p = mainnet.get('platform.drive.tenderdash.p2p');
options.platform.drive.tenderdash.mempool = mainnet.get('platform.drive.tenderdash.mempool');
options.platform.drive.tenderdash.genesis = mainnet.get('platform.drive.tenderdash.genesis');

if (options.platform.drive.tenderdash.node.id !== null) {
options.platform.enable = true;
}
}

// Update tenderdash image
options.platform.drive.tenderdash.docker.image = base.get('platform.drive.tenderdash.docker.image');
options.core.docker.image = base.get('core.docker.image');
});
return configFile;
},
};
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ import chalk from 'chalk';
import {
NODE_TYPE_MASTERNODE,
NODE_TYPE_FULLNODE,
PRESET_MAINNET,
} from '../../../constants.js';

import {
Expand Down Expand Up @@ -83,8 +82,7 @@ export default function setupRegularPresetTaskFactory(

ctx.config = defaultConfigs.get(ctx.preset);

// TODO: We need to change this and enable platform on mainnet
ctx.config.set('platform.enable', ctx.isHP && ctx.config.get('network') !== PRESET_MAINNET);
ctx.config.set('platform.enable', ctx.isHP);
shumkov marked this conversation as resolved.
Show resolved Hide resolved
ctx.config.set('core.masternode.enable', ctx.nodeType === NODE_TYPE_MASTERNODE);

if (ctx.config.get('core.masternode.enable')) {
Expand Down
Loading