Skip to content

Commit f42be3a

Browse files
authored
feat: extract sync option to env (#34)
* feat: extract sync option to env Allows setting sync height option in a single location * docs: add optional step to readme for sync height * docs: align node version with the one on docs.dash.org/platform
1 parent 5501d75 commit f42be3a

16 files changed

Lines changed: 25 additions & 15 deletions

.env.example

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,11 @@
11
MNEMONIC='jewel pattern cry forget gown better agent celery nothing glove silk ill'
22
# Mnemonic's first address: ydinxECoSdvGkCMZFhrqY4fg3Jc3AbeS2z
3+
4+
# Core block height to begin syncing from
5+
# Allows syncing to complete faster than if syncing the entire chain from the first block
6+
# Set to a height below where your first wallet transaction occurred
7+
# See current height at: https://testnet-insight.dashevo.org/insight/
8+
SYNC_START_HEIGHT=875000
39
# IDENTITY_ID comes from the "$id" found in the "identity-register.js" response
410
IDENTITY_ID='6cSbshXPYDA2CmBtD31X4uo7YLwtef4mVDt15zRok8Xg'
511
# CONTRACT_ID comes from the "$id" found in the "contract-register-minimal.js" response

1-Identities-and-Names/identity-register.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ const clientOpts = {
88
wallet: {
99
mnemonic: process.env.MNEMONIC, // A Dash wallet mnemonic with testnet funds
1010
unsafeOptions: {
11-
skipSynchronizationBeforeHeight: 875000, // only sync from mid-2023
11+
skipSynchronizationBeforeHeight: process.env.SYNC_START_HEIGHT, // sync starting at this Core block height
1212
},
1313
},
1414
};

1-Identities-and-Names/identity-retrieve-account-ids.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ const client = new Dash.Client({
88
wallet: {
99
mnemonic: process.env.MNEMONIC, // A Dash wallet mnemonic with testnet funds
1010
unsafeOptions: {
11-
skipSynchronizationBeforeHeight: 875000, // only sync from mid-2023
11+
skipSynchronizationBeforeHeight: process.env.SYNC_START_HEIGHT, // sync starting at this Core block height
1212
},
1313
},
1414
});

1-Identities-and-Names/identity-topup.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ const clientOpts = {
88
wallet: {
99
mnemonic: process.env.MNEMONIC, // A Dash wallet mnemonic with testnet funds
1010
unsafeOptions: {
11-
skipSynchronizationBeforeHeight: 875000, // only sync from mid-2023
11+
skipSynchronizationBeforeHeight: process.env.SYNC_START_HEIGHT, // sync starting at this Core block height
1212
},
1313
},
1414
};

1-Identities-and-Names/identity-update-add-key.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ const clientOpts = {
1111
wallet: {
1212
mnemonic: process.env.MNEMONIC, // A Dash wallet mnemonic with testnet funds
1313
unsafeOptions: {
14-
skipSynchronizationBeforeHeight: 875000, // only sync from mid-2023
14+
skipSynchronizationBeforeHeight: process.env.SYNC_START_HEIGHT, // sync starting at this Core block height
1515
},
1616
},
1717
};

1-Identities-and-Names/identity-update-disable-key.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ const clientOpts = {
88
wallet: {
99
mnemonic: process.env.MNEMONIC, // A Dash wallet mnemonic with testnet funds
1010
unsafeOptions: {
11-
skipSynchronizationBeforeHeight: 875000, // only sync from mid-2023
11+
skipSynchronizationBeforeHeight: process.env.SYNC_START_HEIGHT, // sync starting at this Core block height
1212
},
1313
},
1414
};

1-Identities-and-Names/name-register-alias.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ const clientOpts = {
1010
wallet: {
1111
mnemonic: process.env.MNEMONIC, // A Dash wallet mnemonic with testnet funds
1212
unsafeOptions: {
13-
skipSynchronizationBeforeHeight: 875000, // only sync from mid-2023
13+
skipSynchronizationBeforeHeight: process.env.SYNC_START_HEIGHT, // sync starting at this Core block height
1414
},
1515
},
1616
};

1-Identities-and-Names/name-register.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ const clientOpts = {
1010
wallet: {
1111
mnemonic: process.env.MNEMONIC, // A Dash wallet mnemonic with testnet funds
1212
unsafeOptions: {
13-
skipSynchronizationBeforeHeight: 875000, // only sync from mid-2023
13+
skipSynchronizationBeforeHeight: process.env.SYNC_START_HEIGHT, // sync starting at this Core block height
1414
},
1515
},
1616
};

2-Contracts-and-Documents/contract-register-history.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ const clientOpts = {
88
wallet: {
99
mnemonic: process.env.MNEMONIC, // A Dash wallet mnemonic with testnet funds
1010
unsafeOptions: {
11-
skipSynchronizationBeforeHeight: 875000, // only sync from mid-2023
11+
skipSynchronizationBeforeHeight: process.env.SYNC_START_HEIGHT, // sync starting at this Core block height
1212
},
1313
},
1414
};

2-Contracts-and-Documents/contract-register-minimal.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ const clientOpts = {
88
wallet: {
99
mnemonic: process.env.MNEMONIC, // A Dash wallet mnemonic with testnet funds
1010
unsafeOptions: {
11-
skipSynchronizationBeforeHeight: 875000, // only sync from mid-2023
11+
skipSynchronizationBeforeHeight: process.env.SYNC_START_HEIGHT, // sync starting at this Core block height
1212
},
1313
},
1414
};

0 commit comments

Comments
 (0)