-
Notifications
You must be signed in to change notification settings - Fork 0
/
HOWTORUN.txt
48 lines (41 loc) · 1.42 KB
/
HOWTORUN.txt
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
35
36
37
38
39
40
41
42
43
44
45
46
47
48
Open a terminal
unzip the folder
cd into the node_api folder
Install the files
npm i
npm run env
How to run:
npm run startRegtest (if it gives error "npm run stop" and retry)
In another window
npm run initRegtest
Open the file btc.js
Replace "Zed Rocks!" on line 14 with message of your choice. Don't forget the ""
Save the file
now issue the command
network=regtest node btc.js
The code should now sign a transaction and send it to the network
It also fetches the transaction from the network and decodes the Hex string in OP_RETURN and displays it to the screen.
If you need to send another transaction.
npm run stop
npm run bitcoindRegtest
npm run initRegtest
put your message
network=regtest node btc.js
You can also run the code on the testnet and mainnet
for testnet
if you have run the code before
npm run stop
Heads up: It would take a some GBs of space.
npm run bitcoindTestnet
npm run startRegtest
Now you should wait for sometime for the node to sync up.
Once in sync get a Testnet address
Fund it with TestCoin from a testnet Faucet
get the TransactionID and put it in bitcoin-0.19.0.1/bin/txid
put the privatekey and the address in wallet.js
Kindly observe and maintain the formatting
Donot miss the "quotes" or skip the ,
now run
network=testnet node btc.js
It should now sign and send the transaction from the privateKey you provided and send to the network
You may check this transaction on a Blockexplorer of your choice.