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

Added qrcode-terminal to generate code for easier terminal UI #4

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
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
5 changes: 5 additions & 0 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
"author": "SpendBCH",
"license": "MIT",
"dependencies": {
"bitbox-cli": "1.2.0"
"bitbox-cli": "1.2.0",
"qrcode-terminal": "^0.12.0"
}
}
7 changes: 6 additions & 1 deletion stresstest-shared.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
let BITBOXCli
let BITBOX

let qrcode = require('qrcode-terminal')

// Interactive stuff - contributed by sploit BIP47
const readline = require('readline')
function askQuestion(query) {
Expand Down Expand Up @@ -157,6 +159,7 @@ class StresstestShared {
let node0WIF = BITBOX.ECPair.toWIF(BITBOX.HDNode.toKeyPair(node0))
let msg = "stresstestbitcoin.cash";
let signature = BITBOX.BitcoinCash.signMessageWithPrivKey(node0WIF, msg);
let qrcodeCashAddress = qrcode.generate(node0CashAddress)

console.log("Write down your mnemonic in case of a problem where a manual recovery is required")
console.log("Your mnemonic: " + mnemonic)
Expand All @@ -165,6 +168,8 @@ class StresstestShared {
console.log("Write down the following message, address and signature to prove you sent these transactions")
console.log(`Message: ${msg}, signed from address: ${node0CashAddress}, signature: ${signature}`)

console.log(qrcodeCashAddress)

// Wait for utxo to arrive to build starting wallet
let utxo = await this.pollForUtxo(node0LegacyAddress)

Expand Down Expand Up @@ -393,4 +398,4 @@ class StresstestShared {
}
}

module.exports = StresstestShared
module.exports = StresstestShared