forked from sCrypt-Inc/boilerplate
-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathprivateKey.js
More file actions
34 lines (26 loc) · 789 Bytes
/
Copy pathprivateKey.js
File metadata and controls
34 lines (26 loc) · 789 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
const { exit } = require('process')
const { bsv } = require('scryptlib');
// fill in private key on testnet in WIF here
const key = ''
const key2 = ''
const key3 = ''
if (!key) {
genPrivKey()
}
function genPrivKey() {
const newPrivKey = new bsv.PrivateKey.fromRandom('testnet')
console.log(`Missing private key, generating a new one ...
Private key generated: '${newPrivKey.toWIF()}'
You can fund its address '${newPrivKey.toAddress()}' from sCrypt faucet https://scrypt.io/#faucet`)
exit(-1)
}
const privateKey = new bsv.PrivateKey.fromWIF(key)
const privateKey2 = new bsv.PrivateKey.fromWIF(key2)
const privateKey3 = new bsv.PrivateKey.fromWIF(key3)
//console.log('' + privateKey.toAddress())
module.exports = {
privateKey,
privateKey2,
privateKey3,
genPrivKey
}