Skip to content

Commit

Permalink
test: attempt multiple stackers per signing key
Browse files Browse the repository at this point in the history
  • Loading branch information
zone117x committed Mar 7, 2024
1 parent 68770d0 commit 8de4e04
Show file tree
Hide file tree
Showing 3 changed files with 33 additions and 4 deletions.
9 changes: 8 additions & 1 deletion docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -161,7 +161,14 @@ services:
STACKS_CORE_RPC_HOST: stacks-node
STACKS_CORE_RPC_PORT: 20443
STACKING_CYCLES: 2
STACKING_KEYS: 08c14a1eada0dd42b667b40f59f7c8dedb12113613448dc04980aea20b268ddb01,ce109fee08860bb16337c76647dcbc02df0c06b455dd69bcf30af74d4eedd19301,e75dcb66f84287eaf347955e94fa04337298dbd95aa0dbb985771104ef1913db01
# Format is "STACKING_KEYS: <stacker_account_key>:<signer_key>,<stacker_account_key>:<signer_key>,..."
STACKING_KEYS: >
e75dcb66f84287eaf347955e94fa04337298dbd95aa0dbb985771104ef1913db01:e75dcb66f84287eaf347955e94fa04337298dbd95aa0dbb985771104ef1913db01,
ce109fee08860bb16337c76647dcbc02df0c06b455dd69bcf30af74d4eedd19301:ce109fee08860bb16337c76647dcbc02df0c06b455dd69bcf30af74d4eedd19301,
08c14a1eada0dd42b667b40f59f7c8dedb12113613448dc04980aea20b268ddb01:08c14a1eada0dd42b667b40f59f7c8dedb12113613448dc04980aea20b268ddb01,
2e1bcb6fad6f026038fe1f5013b376414ccc2cecb31c33f2d54e8861a6df785501:08c14a1eada0dd42b667b40f59f7c8dedb12113613448dc04980aea20b268ddb01,
5709e36c48398e95bf16bcd0abfc678e58d94ac61867fc1508b0eba15169fa4801:08c14a1eada0dd42b667b40f59f7c8dedb12113613448dc04980aea20b268ddb01,
55ddf5ca60007d73916d7994a5e7208a824c6b7ef8e6e8a507962f59bd1aec5c01:08c14a1eada0dd42b667b40f59f7c8dedb12113613448dc04980aea20b268ddb01
depends_on:
- stacks-node

Expand Down
7 changes: 4 additions & 3 deletions stacking/stacking.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,11 @@ const stackingCycles = parseInt(process.env.STACKING_CYCLES ?? '1');
const url = `http://${process.env.STACKS_CORE_RPC_HOST}:${process.env.STACKS_CORE_RPC_PORT}`;
const network = new StacksTestnet({ url });

const accounts = process.env.STACKING_KEYS!.split(',').map((privKey, index) => {
const accounts = process.env.STACKING_KEYS!.split(',').map((line, index) => {
const [privKey, signerKey] = line.split(':').map(s => s.trim());
const pubKey = getPublicKeyFromPrivate(privKey);
const stxAddress = getAddressFromPrivateKey(privKey, TransactionVersion.Testnet);
const signerPrivKey = createStacksPrivateKey(privKey);
const signerPrivKey = createStacksPrivateKey(signerKey);
const signerPubKey = getPublicKeyFromPrivate(signerPrivKey.data);
return {
privKey, pubKey, stxAddress,
Expand Down Expand Up @@ -100,7 +101,7 @@ async function run() {
async function stackStx(poxInfo: PoxInfo, account: typeof accounts[0]) {
// Bump min threshold by 50% to avoid getting stuck if threshold increases
const minStx = Math.floor(poxInfo.next_cycle.min_threshold_ustx * 1.5);
const amountToStx = Math.round(minStx * account.targetSlots);
const amountToStx = BigInt(minStx) * BigInt(account.targetSlots);
const authId = randInt();
const sigArgs = {
topic: 'stack-stx',
Expand Down
21 changes: 21 additions & 0 deletions stacks-krypton-miner.toml
Original file line number Diff line number Diff line change
Expand Up @@ -146,17 +146,38 @@ address = "ST29V10QEA7BRZBTWRFC4M70NJ4J6RJB5P1C6EE84"
amount = 10000000000000000
# secretKey = "0d2f965b472a82efd5a96e6513c8b9f7edc725d5c96c7d35d6c722cedeb80d1b01"

# Signer 1
[[ustx_balance]]
address = "STRYYQQ9M8KAF4NS7WNZQYY59X93XEKR31JP64CP"
amount = 10000000000000000
# secretKey = "e75dcb66f84287eaf347955e94fa04337298dbd95aa0dbb985771104ef1913db01"

# Signer 2
[[ustx_balance]]
address = "STF9B75ADQAVXQHNEQ6KGHXTG7JP305J2GRWF3A2"
amount = 10000000000000000
# secretKey = "ce109fee08860bb16337c76647dcbc02df0c06b455dd69bcf30af74d4eedd19301",

# Signer 3
[[ustx_balance]]
address = "ST18MDW2PDTBSCR1ACXYRJP2JX70FWNM6YY2VX4SS"
amount = 10000000000000000
# secretKey = "08c14a1eada0dd42b667b40f59f7c8dedb12113613448dc04980aea20b268ddb01",

# Delegated stacker 1
[[ustx_balance]]
address = "ST3VT897F17TGQS2ETSQNS97SQCTD1X9BX88PBJWN"
amount = 10000000000000000
# secretKey = "2e1bcb6fad6f026038fe1f5013b376414ccc2cecb31c33f2d54e8861a6df785501",

# Delegated stacker 2
[[ustx_balance]]
address = "ST2CS0KPFAA4FSH4ER78BEXCPAJKD385JBTBHTS5"
amount = 10000000000000000
# secretKey = "5709e36c48398e95bf16bcd0abfc678e58d94ac61867fc1508b0eba15169fa4801",

# Delegated stacker 3
[[ustx_balance]]
address = "ST1BT797XQ891GQ5EZDNN4WMGEF63QFCB12WEZVCY"
amount = 10000000000000000
# secretKey = "55ddf5ca60007d73916d7994a5e7208a824c6b7ef8e6e8a507962f59bd1aec5c01",

0 comments on commit 8de4e04

Please sign in to comment.