aliceとbobの環境を再作成

1. user02 : daemon stop
– bob daemon stop
– alice daemon stop

$  bitcoin-core.cli -regtest -rpcport=10002 stop
Bitcoin Core stopping
$  bitcoin-core.cli -regtest -rpcport=10001 stop
Bitcoin Core stopping

2. https://jlopp.github.io/bitcoin-core-rpc-auth-generator/
https://jlopp.github.io/bitcoin-core-rpc-auth-generator/
2.1
– username: alice
– password: keybordcat

rpcauth=alice:20924f2c9ed09e58d256b510ab2931ac$75e83a1b75057367117ffdbb5a696892dead2024e3ecbcb28234ac1ac6f62401

2.2
– username: bob
– password: keybordcat


rpcauth=bob:87fb0fbdd610473af0f18666f60c0311$7aac966ea1ef5a0f6b547dc7af4408ad8d262fc0a1c8c34924f653e19a64e789

3. pwd
$ pwd
/home/user02

4. rm alice wallet, bob wallet
4.1
rpcuser=alice
rpcpassword=20924f2c9ed09e58d256b510ab2931ac$75e83a1b75057367117ffdbb5a696892dead2024e3ecbcb28234ac1ac6f62401

$ rm -rf dev/alice
$ mkdir dev/alice
$ vi dev/alice/bitcoin.conf

4.2
rpcuser=alice
rpcpassword=87fb0fbdd610473af0f18666f60c0311$7aac966ea1ef5a0f6b547dc7af4408ad8d262fc0a1c8c34924f653e19a64e789

$ rm -rf dev/bob
$ mkdir dev/bob
$ vi dev/bob/bitcoin.conf

5. new login
5.1 login user02

$ bitcoin-core.daemon -regtest -conf=/home/user02/dev/alice/bitcoin.conf -datadir=./alice/ -rpcport=10001 -port=10011

5.2 login user02

$ bitcoin-core.daemon -regtest -conf=/home/user02/dev/bob/bitcoin.conf -datadir=./alice/ -rpcport=10002 -port=10011

6.
6.1

$ bitcoin-core.cli -conf=/home/user02/dev/alice/bitcoin.conf  createwallet "AliceWallet"
{
  "name": "AliceWallet",
  "warning": ""
}

6.2

$ bitcoin-core.cli -conf=/home/user02/dev/bob/bitcoin.conf  createwallet "BobWallet"
{
  "name": "BobWallet",
  "warning": ""
}

7.
7.1

$ bitcoin-core.cli -conf=/home/user02/dev/alice/bitcoin.conf getbalance
0.00000000

7.2

$ bitcoin-core.cli -conf=/home/user02/dev/bob/bitcoin.conf
 getbalance
0.00000000

8. Create address
8.1 alice

$ bitcoin-core.cli -regtest -conf=/home/user02/dev/alice/bitcoin.conf -rpcport=10001 getnewaddress
bcrt1qqtm00jv39e09uxgtrzwgvk2wyv0umq0tasnr8m

8.2 bob

$ bitcoin-core.cli -regtest -conf=/home/user02/dev/bob/bitcoin.conf -rpcport=10002 getnewaddress
bcrt1qj8mle4z5vw4pkx3mvjn9kkvqmrap55yd6gj4hk

9.Niming
– Mining does not increase balance

9.1
$ bitcoin-core.cli -regtest -conf=/home/user02/dev/alice/bitcoin.conf -datadir=. -rpcport=10001  generatetoaddress 101 bcrt1qqtm00jv39e09uxgtrzwgvk2wyv0umq0tasnr8m
9.2
$ node getBalanceByAlice.js
0