Skip to content

Commit

Permalink
feat(dashmate): configure tenderdash connections (dashpay#2048)
Browse files Browse the repository at this point in the history
  • Loading branch information
shumkov authored Aug 13, 2024
1 parent 319adc2 commit c4b4e02
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 3 deletions.
2 changes: 2 additions & 0 deletions packages/dashmate/configs/defaults/getBaseConfigFactory.js
Original file line number Diff line number Diff line change
Expand Up @@ -312,6 +312,8 @@ export default function getBaseConfigFactory(homeDir) {
maxPacketMsgPayloadSize: 10240,
sendRate: 5120000,
recvRate: 5120000,
maxConnections: 64,
maxOutgoingConnections: 30,
},
rpc: {
host: '127.0.0.1',
Expand Down
3 changes: 3 additions & 0 deletions packages/dashmate/configs/getConfigFileMigrationsFactory.js
Original file line number Diff line number Diff line change
Expand Up @@ -768,6 +768,9 @@ export default function getConfigFileMigrationsFactory(homeDir, defaultConfigs)
'1.1.0-dev.1': (configFile) => {
Object.entries(configFile.configs)
.forEach(([, options]) => {

options.platform.drive.tenderdash.p2p.maxConnections = 64;
options.platform.drive.tenderdash.p2p.maxOutgoingConnections = 30;
options.platform.drive.tenderdash.genesis
.consensus_params = base.get('platform.drive.tenderdash.genesis.consensus_params');
options.platform.drive.tenderdash.docker.image = base.get('platform.drive.tenderdash.docker.image');
Expand Down
10 changes: 9 additions & 1 deletion packages/dashmate/src/config/configJsonSchema.js
Original file line number Diff line number Diff line change
Expand Up @@ -939,8 +939,16 @@ export default {
type: 'integer',
minimum: 0,
},
maxConnections: {
type: 'integer',
minimum: 1,
},
maxOutgoingConnections: {
type: 'integer',
minimum: 1,
},
},
required: ['host', 'port', 'persistentPeers', 'seeds', 'flushThrottleTimeout', 'maxPacketMsgPayloadSize', 'sendRate', 'recvRate'],
required: ['host', 'port', 'persistentPeers', 'seeds', 'flushThrottleTimeout', 'maxPacketMsgPayloadSize', 'sendRate', 'recvRate', 'maxConnections', 'maxOutgoingConnections'],
additionalProperties: false,
},
mempool: {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -278,11 +278,11 @@ persistent-peers = "{{~it.platform.drive.tenderdash.p2p.persistentPeers :peer:in
upnp = false

# Maximum number of connections (inbound and outbound).
max-connections = 64
max-connections = {{=it.platform.drive.tenderdash.p2p.maxConnections}}

# Maximum number of connections reserved for outgoing
# connections. Must be less than max-connections
max-outgoing-connections = 12
max-outgoing-connections = {{=it.platform.drive.tenderdash.p2p.maxOutgoingConnections}}

# Rate limits the number of incoming connection attempts per IP address.
max-incoming-connection-attempts = 100
Expand Down

0 comments on commit c4b4e02

Please sign in to comment.