Skip to content

Commit

Permalink
fix: stacking with latest version of stack-stx
Browse files Browse the repository at this point in the history
  • Loading branch information
rafaelcr committed Jan 24, 2024
1 parent 3d65412 commit 5ced1f6
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
2 changes: 1 addition & 1 deletion stacking/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,6 @@
"author": "",
"license": "ISC",
"dependencies": {
"@stacks/stacking": "^6.10.0"
"@stacks/stacking": "6.11.2-pr.3560789.0"
}
}
3 changes: 3 additions & 0 deletions stacking/stacking.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ const { StackingClient } = require('@stacks/stacking');
const { StacksTestnet } = require('@stacks/network');
const { getAddressFromPrivateKey, TransactionVersion } = require('@stacks/transactions');
const { getPublicKeyFromPrivate, publicKeyToBtcAddress } = require('@stacks/encryption');
const crypto = require('crypto');

const stackingInterval = process.env.STACKING_INTERVAL ?? 2;
const postTxWait = process.env.POST_TX_WAIT ?? 10;
Expand All @@ -15,6 +16,7 @@ const accounts = process.env.STACKING_KEYS.split(',').map(privKey => {
return {
privKey, pubKey, stxAddress,
btcAddr: publicKeyToBtcAddress(pubKey),
signerKey: crypto.randomBytes(33).toString('hex'),
client: new StackingClient(stxAddress, network),
};
});
Expand Down Expand Up @@ -52,6 +54,7 @@ async function run() {
burnBlockHeight: poxInfo.current_burnchain_block_height,
cycles: stackingCycles,
fee: 1000,
signerKey: account.signerKey,
};
console.log('Stacking with args:', { addr: account.stxAddress, ...stackingArgs });
const stackResult = await account.client.stack(stackingArgs)
Expand Down

0 comments on commit 5ced1f6

Please sign in to comment.