Refactor RPC bitcoin client #447

Closed
opened 2022-09-19 12:12:36 +00:00 by hirunda · 12 comments
hirunda commented 2022-09-19 12:12:36 +00:00 (Migrated from gitlab.com)

Refactor RPC bitcoin client to achieve unique architecture which should support RPC bitcoin client and libbitcoin client

Refactor RPC bitcoin client to achieve unique architecture which should support RPC bitcoin client and libbitcoin client
hirunda commented 2022-09-19 12:12:36 +00:00 (Migrated from gitlab.com)

assigned to @hirunda

assigned to @hirunda
hirunda commented 2022-09-28 16:38:18 +00:00 (Migrated from gitlab.com)
  1. Checkout qa/453/libbictoin_client for peerplays QA env.
    [The branch is able to build libbitcoin client and it also checkout the branch with libbitcoin implementation]
  2. docker-compose build
  3. docker-compose up bitcoin-for-peerplays
  4. docker exec -it peerplays-qa-environment_bitcoin-for-peerplays_1 /bin/bash
  5. run init network in bitcoin shell : ./init-network.sh
  6. docker-compose up libbitcoinserver-for-peerplays
  7. docker-compose up hive-for-peerplays
  8. docker-compose up peerplays-all-in-one
  9. docker exec -it peerplays-qa-environment_peerplays-all-in-one_1 /bin/bash
  10. run init network in peerplays shell: ./init-network.sh
  11. Wait for SONs to be scheduled and first heartbeat
  12. run ./cli_wallet in peerplays shell
  13. unlock password
  14. get_sidechain_address_by_account_and_sidechain account01 1

Once the system is ready for performing deposit and withdrawal transaction the output of previous command should be as:

get_sidechain_address_by_account_and_sidechain account01 1
{
  "id": "1.38.0",
  "sidechain_address_account": "1.2.52",
  "sidechain": "bitcoin",
  "deposit_public_key": "0368dc31b2b547c74f52abfc67c7fc768c68115d8ab96430d9bb4996fa660121cd",
  "deposit_address": "2N84SkmB5JfgGCvZ7QpSF43wWEbQ2EsLoMY",
  "deposit_address_data": "{ \"redeemScript\": \"210368dc31b2b547c74f52abfc67c7fc768c68115d8ab96430d9bb4996fa660121cdac635167007c2103456772301e221026269d3095ab5cb623fc239835b583ae4632f99a15107ef275ac635193687c2102d67c26cf20153fe7625ca1454222d3b3aeb53b122d8a0f7d32a3dd4b2c2016f4ac635193687c21025f7cfda933516fd590c5a34ad4a68e3143b6f4155a64b3aab2c55fb851150f61ac635193687c210228155bb1ddcd11c7f14a2752565178023aa963f84ea6b6a052bddebad6fe9866ac635193687c21037500441cfb4484da377073459511823b344f1ef0d46bac1efd4c7c466746f666ac6351936854a268\", \"witnessScript\": \"0020a3252a2204813812e990fdb50656dafb15211a68b94aacd76d78c203a6f2994c\" }",
  "withdraw_public_key": "02743d4f24f88095de7921b8a8486cb46f009b7c034daa931821fb688c9c1e42a2",
  "withdraw_address": "2MtTPtraZawsvNGc8eCdx98hXbi4gaYy8L6",
  "valid_from": "2022-09-28T13:02:15",
  "expires": "2106-02-07T06:28:15"
}
  1. Note in this case that deposit_address has P2SH address format ( 2N84SkmB5JfgGCvZ7QpSF43wWEbQ2EsLoMY ) which is different than P2WPKH which is used with bitcoind. This is P2SH-P2WPKH
16) Test deposit
    Example:
    a) Go to bitcoin console and run the command: 
      ./bitcoin-cli -rpcuser=1 -rpcwallet="default"   -rpcpassword=1 sendtoaddress
        2N84SkmB5JfgGCvZ7QpSF43wWEbQ2EsLoMY    10 "" "" false
        Please refer on the address you got in 14)
    b) Mine one block:```
 ./bitcoin-cli -rpcuser=1 -rpcwallet="default" -rpcpassword=1 generatetoaddress 1
       2MtTPtraZawsvNGc8eCdx98hXbi4gaYy8L6
    c) Go to peerplays cli_wallet shell and check the balance of account01 :` list_account_balances account01`
    d) You should see that BTC is settled on the account

17) Test withdrawal 
    Example:
    a) Go to peerplays cli_wallet and run command:` transfer account01 son-account 3 BTC "" true`
    b) Check the balance of son-account it should has 3 BTC
    c) Go to bitcoin shell and mine one block:  ```
./bitcoin-cli -rpcuser=1 -rpcwallet="default" -rpcpassword=1       
       generatetoaddress 1 2MtTPtraZawsvNGc8eCdx98hXbi4gaYy8L6
    d) Check the balance of son-account. It should be 0 BTC once the withdrawal is settled 
		

In the next steps we should validate old code path which uses bitcoind without libbitcoin

  1. docker-compose down
  2. Change the Dockerfile00 by adding --use-bitcoind-client parameter in command. It should look like this:
    CMD ["./witness_node", "-d", "./witness_node_data_dir", "--replay-blockchain", "--use-bitcoind-client", "true"]
  3. docker-compose build peerplays-all-in-one
  4. Repeat 3) - 5)
  5. Repeat 7) - 14)

Observe the output of 14) it should look like this:

get_sidechain_address_by_account_and_sidechain account01 1
{
  "id": "1.38.0",
  "sidechain_address_account": "1.2.52",
  "sidechain": "bitcoin",
  "deposit_public_key": "0368dc31b2b547c74f52abfc67c7fc768c68115d8ab96430d9bb4996fa660121cd",
  "deposit_address": "bcrt1q5vjj5gsysyup96vslk6sv4k6lv2jzxngh992e4md0rpq8fhjn9xqxc63hg",
  "deposit_address_data": "{ \"redeemScript\": \"210368dc31b2b547c74f52abfc67c7fc768c68115d8ab96430d9bb4996fa660121cdac635167007c2103456772301e221026269d3095ab5cb623fc239835b583ae4632f99a15107ef275ac635193687c2102d67c26cf20153fe7625ca1454222d3b3aeb53b122d8a0f7d32a3dd4b2c2016f4ac635193687c21025f7cfda933516fd590c5a34ad4a68e3143b6f4155a64b3aab2c55fb851150f61ac635193687c210228155bb1ddcd11c7f14a2752565178023aa963f84ea6b6a052bddebad6fe9866ac635193687c21037500441cfb4484da377073459511823b344f1ef0d46bac1efd4c7c466746f666ac6351936854a268\", \"witnessScript\": \"0020a3252a2204813812e990fdb50656dafb15211a68b94aacd76d78c203a6f2994c\" }",
  "withdraw_public_key": "02743d4f24f88095de7921b8a8486cb46f009b7c034daa931821fb688c9c1e42a2",
  "withdraw_address": "2MtTPtraZawsvNGc8eCdx98hXbi4gaYy8L6",
  "valid_from": "2022-09-28T16:00:21",
  "expires": "2106-02-07T06:28:15"
}

Note that deposit address is now in P2WPKH format: bcrt1q5vjj5gsysyup96vslk6sv4k6lv2jzxngh992e4md0rpq8fhjn9xqxc63hg

23) Test deposit
    Example: 
    a) Go to bitcoin console and run the command: ```
./bitcoin-cli -rpcuser=1 -rpcwallet="default"
      -rpcpassword=1
       sendtoaddress  bcrt1q5vjj5gsysyup96vslk6sv4k6lv2jzxngh992e4md0rpq8fhjn9xqxc63hg 10 "" "" false
    Please refer on the address you got in 14)
    b) Mine one or more blocks: ```
./bitcoin-cli -rpcuser=1 -rpcwallet="default" -rpcpassword=1   generatetoaddress 1
       2MtTPtraZawsvNGc8eCdx98hXbi4gaYy8L6
    c) Go to peerplays cli_wallet shell and check the balance of account01 :` list_account_balances account01`
    d) You should see that BTC is settled on the account
24) Test withdrawal:
    Example:
    a) Go to peerplays cli_wallet and run command:` transfer account01 son-account 3 BTC "" true`
    b) Check the balance of son-account it should has 3 BTC
    c) Go to bitcoin shell and mine one block: ```
 ./bitcoin-cli -rpcuser=1 -rpcwallet="default" -rpcpassword=1
       generatetoaddress 1 2MtTPtraZawsvNGc8eCdx98hXbi4gaYy8L6
    d) Check the balance of son-account. It should be 0 BTC once the withdrawal is settled
1) Checkout qa/453/libbictoin_client for peerplays QA env. [The branch is able to build libbitcoin client and it also checkout the branch with libbitcoin implementation] 2) docker-compose build 3) docker-compose up bitcoin-for-peerplays 4) docker exec -it peerplays-qa-environment_bitcoin-for-peerplays_1 /bin/bash 5) run init network in bitcoin shell : ./init-network.sh 6) docker-compose up libbitcoinserver-for-peerplays 7) docker-compose up hive-for-peerplays 8) docker-compose up peerplays-all-in-one 9) docker exec -it peerplays-qa-environment_peerplays-all-in-one_1 /bin/bash 10) run init network in peerplays shell: ./init-network.sh 11) Wait for SONs to be scheduled and first heartbeat 12) run ./cli_wallet in peerplays shell 13) unlock password 14) get_sidechain_address_by_account_and_sidechain account01 1 Once the system is ready for performing deposit and withdrawal transaction the output of previous command should be as: ``` get_sidechain_address_by_account_and_sidechain account01 1 { "id": "1.38.0", "sidechain_address_account": "1.2.52", "sidechain": "bitcoin", "deposit_public_key": "0368dc31b2b547c74f52abfc67c7fc768c68115d8ab96430d9bb4996fa660121cd", "deposit_address": "2N84SkmB5JfgGCvZ7QpSF43wWEbQ2EsLoMY", "deposit_address_data": "{ \"redeemScript\": \"210368dc31b2b547c74f52abfc67c7fc768c68115d8ab96430d9bb4996fa660121cdac635167007c2103456772301e221026269d3095ab5cb623fc239835b583ae4632f99a15107ef275ac635193687c2102d67c26cf20153fe7625ca1454222d3b3aeb53b122d8a0f7d32a3dd4b2c2016f4ac635193687c21025f7cfda933516fd590c5a34ad4a68e3143b6f4155a64b3aab2c55fb851150f61ac635193687c210228155bb1ddcd11c7f14a2752565178023aa963f84ea6b6a052bddebad6fe9866ac635193687c21037500441cfb4484da377073459511823b344f1ef0d46bac1efd4c7c466746f666ac6351936854a268\", \"witnessScript\": \"0020a3252a2204813812e990fdb50656dafb15211a68b94aacd76d78c203a6f2994c\" }", "withdraw_public_key": "02743d4f24f88095de7921b8a8486cb46f009b7c034daa931821fb688c9c1e42a2", "withdraw_address": "2MtTPtraZawsvNGc8eCdx98hXbi4gaYy8L6", "valid_from": "2022-09-28T13:02:15", "expires": "2106-02-07T06:28:15" } ``` 15) Note in this case that deposit_address has P2SH address format `( 2N84SkmB5JfgGCvZ7QpSF43wWEbQ2EsLoMY )` which is different than P2WPKH which is used with bitcoind. This is P2SH-P2WPKH ``` 16) Test deposit Example: a) Go to bitcoin console and run the command: ./bitcoin-cli -rpcuser=1 -rpcwallet="default" -rpcpassword=1 sendtoaddress 2N84SkmB5JfgGCvZ7QpSF43wWEbQ2EsLoMY 10 "" "" false Please refer on the address you got in 14) b) Mine one block:``` ./bitcoin-cli -rpcuser=1 -rpcwallet="default" -rpcpassword=1 generatetoaddress 1 2MtTPtraZawsvNGc8eCdx98hXbi4gaYy8L6 c) Go to peerplays cli_wallet shell and check the balance of account01 :` list_account_balances account01` d) You should see that BTC is settled on the account ``` ``` 17) Test withdrawal Example: a) Go to peerplays cli_wallet and run command:` transfer account01 son-account 3 BTC "" true` b) Check the balance of son-account it should has 3 BTC c) Go to bitcoin shell and mine one block: ``` ./bitcoin-cli -rpcuser=1 -rpcwallet="default" -rpcpassword=1 generatetoaddress 1 2MtTPtraZawsvNGc8eCdx98hXbi4gaYy8L6 d) Check the balance of son-account. It should be 0 BTC once the withdrawal is settled ``` In the next steps we should validate old code path which uses bitcoind without libbitcoin 18) docker-compose down 19) Change the Dockerfile00 by adding `--use-bitcoind-client` parameter in command. It should look like this: `CMD ["./witness_node", "-d", "./witness_node_data_dir", "--replay-blockchain", "--use-bitcoind-client", "true"]` 20) docker-compose build peerplays-all-in-one 21) Repeat 3) - 5) 22) Repeat 7) - 14) Observe the output of 14) it should look like this: ``` get_sidechain_address_by_account_and_sidechain account01 1 { "id": "1.38.0", "sidechain_address_account": "1.2.52", "sidechain": "bitcoin", "deposit_public_key": "0368dc31b2b547c74f52abfc67c7fc768c68115d8ab96430d9bb4996fa660121cd", "deposit_address": "bcrt1q5vjj5gsysyup96vslk6sv4k6lv2jzxngh992e4md0rpq8fhjn9xqxc63hg", "deposit_address_data": "{ \"redeemScript\": \"210368dc31b2b547c74f52abfc67c7fc768c68115d8ab96430d9bb4996fa660121cdac635167007c2103456772301e221026269d3095ab5cb623fc239835b583ae4632f99a15107ef275ac635193687c2102d67c26cf20153fe7625ca1454222d3b3aeb53b122d8a0f7d32a3dd4b2c2016f4ac635193687c21025f7cfda933516fd590c5a34ad4a68e3143b6f4155a64b3aab2c55fb851150f61ac635193687c210228155bb1ddcd11c7f14a2752565178023aa963f84ea6b6a052bddebad6fe9866ac635193687c21037500441cfb4484da377073459511823b344f1ef0d46bac1efd4c7c466746f666ac6351936854a268\", \"witnessScript\": \"0020a3252a2204813812e990fdb50656dafb15211a68b94aacd76d78c203a6f2994c\" }", "withdraw_public_key": "02743d4f24f88095de7921b8a8486cb46f009b7c034daa931821fb688c9c1e42a2", "withdraw_address": "2MtTPtraZawsvNGc8eCdx98hXbi4gaYy8L6", "valid_from": "2022-09-28T16:00:21", "expires": "2106-02-07T06:28:15" } ``` Note that deposit address is now in P2WPKH format: `bcrt1q5vjj5gsysyup96vslk6sv4k6lv2jzxngh992e4md0rpq8fhjn9xqxc63hg` ``` 23) Test deposit Example: a) Go to bitcoin console and run the command: ``` ./bitcoin-cli -rpcuser=1 -rpcwallet="default" -rpcpassword=1 sendtoaddress bcrt1q5vjj5gsysyup96vslk6sv4k6lv2jzxngh992e4md0rpq8fhjn9xqxc63hg 10 "" "" false Please refer on the address you got in 14) b) Mine one or more blocks: ``` ./bitcoin-cli -rpcuser=1 -rpcwallet="default" -rpcpassword=1 generatetoaddress 1 2MtTPtraZawsvNGc8eCdx98hXbi4gaYy8L6 c) Go to peerplays cli_wallet shell and check the balance of account01 :` list_account_balances account01` d) You should see that BTC is settled on the account ``` ``` 24) Test withdrawal: Example: a) Go to peerplays cli_wallet and run command:` transfer account01 son-account 3 BTC "" true` b) Check the balance of son-account it should has 3 BTC c) Go to bitcoin shell and mine one block: ``` ./bitcoin-cli -rpcuser=1 -rpcwallet="default" -rpcpassword=1 generatetoaddress 1 2MtTPtraZawsvNGc8eCdx98hXbi4gaYy8L6 d) Check the balance of son-account. It should be 0 BTC once the withdrawal is settled ```
hirunda commented 2022-09-28 16:52:33 +00:00 (Migrated from gitlab.com)

assigned to @wsalloum

assigned to @wsalloum
hirunda commented 2022-09-28 16:52:40 +00:00 (Migrated from gitlab.com)

assigned to @prandnum

assigned to @prandnum
hirunda commented 2022-09-28 16:54:40 +00:00 (Migrated from gitlab.com)

mentioned in issue #448

mentioned in issue #448
hirunda commented 2022-09-28 16:56:26 +00:00 (Migrated from gitlab.com)

mentioned in issue #449

mentioned in issue #449
prandnum commented 2022-09-30 04:30:34 +00:00 (Migrated from gitlab.com)

@hirunda deposit is failing with the following error:

unlocked >>> get_sidechain_address_by_account_and_sidechain account01 1
get_sidechain_address_by_account_and_sidechain account01 1
{
  "id": "1.38.0",
  "sidechain_address_account": "1.2.52",
  "sidechain": "bitcoin",
  "deposit_public_key": "0368dc31b2b547c74f52abfc67c7fc768c68115d8ab96430d9bb4996fa660121cd",
  "deposit_address": "2N84SkmB5JfgGCvZ7QpSF43wWEbQ2EsLoMY",
  "deposit_address_data": "{ \"redeemScript\": \"210368dc31b2b547c74f52abfc67c7fc768c68115d8ab96430d9bb4996fa660121cdac635167007c2103456772301e221026269d3095ab5cb623fc239835b583ae4632f99a15107ef275ac635193687c2102d67c26cf20153fe7625ca1454222d3b3aeb53b122d8a0f7d32a3dd4b2c2016f4ac635193687c21025f7cfda933516fd590c5a34ad4a68e3143b6f4155a64b3aab2c55fb851150f61ac635193687c210228155bb1ddcd11c7f14a2752565178023aa963f84ea6b6a052bddebad6fe9866ac635193687c21037500441cfb4484da377073459511823b344f1ef0d46bac1efd4c7c466746f666ac6351936854a268\", \"witnessScript\": \"0020a3252a2204813812e990fdb50656dafb15211a68b94aacd76d78c203a6f2994c\" }",
  "withdraw_public_key": "02743d4f24f88095de7921b8a8486cb46f009b7c034daa931821fb688c9c1e42a2",
  "withdraw_address": "2MtTPtraZawsvNGc8eCdx98hXbi4gaYy8L6",
  "valid_from": "2022-09-29T19:23:12",
  "expires": "2106-02-07T06:28:15"
}
unlocked >>> 
root@b5dde6c9c986:~/bitcoin-network# ./bitcoin-cli -rpcuser=1 -rpcwallet="default" -rpcpassword=1 sendtoaddress 2N84SkmB5JfgGCvZ7QpSF43wWEbQ2EsLoMY 10 "" "" false
5d73e1856db2064bd1ba078d252a247269a94ba2051ecf37830db39e2267575b
root@b5dde6c9c986:~/bitcoin-network# ./bitcoin-cli -rpcuser=1 -rpcwallet="default" -rpcpassword=1 generatetoaddress 1 2MtTPtraZawsvNGc8eCdx98hXbi4gaYy8L6
[
  "5e0b870d6a04844c0bb4262b04b98cb19f2742f801967457c52d6cc9bf0e6ae1"
]
root@b5dde6c9c986:~/bitcoin-network# 
peerplays-all-in-one_1            | 1559699ms th_a       peerplays_sidechain_plugin.cpp:462 heartbeat_loop       ] Sending heartbeat for SON 1.33.4
peerplays-all-in-one_1            | 1560000ms th_a       witness.cpp:267               maybe_produce_block  ] slot: 1 scheduled_witness: 1.6.5 scheduled_time: 2022-09-30T04:26:00 now: 2022-09-30T04:26:00 
peerplays-all-in-one_1            | 1560002ms th_a       witness.cpp:191               block_production_loo ] Generated block #10793 with timestamp 2022-09-30T04:26:00 at time 2022-09-30T04:26:00
peerplays-all-in-one_1            | 1560502ms th_�       peerplays_sidechain_plugin.cpp:520 son_processing       ] Scheduled SON: 1.33.4 Sidechain: bitcoin Now: 2022-09-30T04:25:57
peerplays-all-in-one_1            | 1560502ms th_�       peerplays_sidechain_plugin.cpp:520 son_processing       ] Scheduled SON: 1.33.4 Sidechain: hive Now: 2022-09-30T04:25:57
peerplays-all-in-one_1            | 1560503ms th_�       sidechain_net_handler.cpp:567 operator()           ] Sidechain transaction to settle: 1.39.1
peerplays-all-in-one_1            | 1560504ms th_�       libbitcoin_client.cpp:86      operator()           ] error on fetch_trx_by_hash: ca1cff3addec2dd22124046e898a266fc01c8837571f987ec887cfdcb441ddff object does not exist
peerplays-all-in-one_1            | 1560504ms th_�       sidechain_net_handler.cpp:573 operator()           ] Sidechain transaction not settled: 1.39.1
peerplays-all-in-one_1            | 1563000ms th_a       witness.cpp:267               maybe_produce_block  ] slot: 1 scheduled_witness: 1.6.7 scheduled_time: 2022-09-30T04:26:03 now: 2022-09-30T04:26:03 
peerplays-all-in-one_1            | 1563001ms th_a       witness.cpp:191               block_production_loo ] Generated block #10794 with timestamp 2022-09-30T04:26:03 at time 2022-09-30T04:26:03
peerplays-all-in-one_1            | 1563501ms th_�       peerplays_sidechain_plugin.cpp:520 son_processing       ] Scheduled SON: 1.33.0 Sidechain: hive Now: 2022-09-30T04:26:00
peerplays-all-in-one_1            | 1563501ms th_�       peerplays_sidechain_plugin.cpp:520 son_processing       ] Scheduled SON: 1.33.0 Sidechain: bitcoin Now: 2022-09-30T04:26:00
peerplays-all-in-one_1            | 1563501ms th_�       sidechain_net_handler.cpp:567 operator()           ] Sidechain transaction to settle: 1.39.1
peerplays-all-in-one_1            | 1563502ms th_�       libbitcoin_client.cpp:86      operator()           ] error on fetch_trx_by_hash: ca1cff3addec2dd22124046e898a266fc01c8837571f987ec887cfdcb441ddff object does not exist
peerplays-all-in-one_1            | 1563502ms th_�       sidechain_net_handler.cpp:573 operator()           ] Sidechain transaction not settled: 1.39.1
peerplays-all-in-one_1            | 1566000ms th_a       witness.cpp:267               maybe_produce_block  ] slot: 1 scheduled_witness: 1.6.2 scheduled_time: 2022-09-30T04:26:06 now: 2022-09-30T04:26:06 
peerplays-all-in-one_1            | 1566001ms th_a       witness.cpp:191               block_production_loo ] Generated block #10795 with timestamp 2022-09-30T04:26:06 at time 2022-09-30T04:26:06
peerplays-all-in-one_1            | 1566501ms th_�       peerplays_sidechain_plugin.cpp:520 son_processing       ] Scheduled SON: 1.33.3 Sidechain: hive Now: 2022-09-30T04:26:03
peerplays-all-in-one_1            | 1566501ms th_�       peerplays_sidechain_plugin.cpp:520 son_processing       ] Scheduled SON: 1.33.3 Sidechain: bitcoin Now: 2022-09-30T04:26:03
peerplays-all-in-one_1            | 1566502ms th_�       sidechain_net_handler.cpp:567 operator()           ] Sidechain transaction to settle: 1.39.1
peerplays-all-in-one_1            | 1566502ms th_�       libbitcoin_client.cpp:86      operator()           ] error on fetch_trx_by_hash: ca1cff3addec2dd22124046e898a266fc01c8837571f987ec887cfdcb441ddff object does not exist
peerplays-all-in-one_1            | 1566502ms th_�       sidechain_net_handler.cpp:573 operator()           ] Sidechain transaction not settled: 1.39.1
peerplays-all-in-one_1            | 1569000ms th_a       witness.cpp:267               maybe_produce_block  ] slot: 1 scheduled_witness: 1.6.9 scheduled_time: 2022-09-30T04:26:09 now: 2022-09-30T04:26:09 
peerplays-all-in-one_1            | 1569001ms th_a       witness.cpp:191               block_production_loo ] Generated block #10796 with timestamp 2022-09-30T04:26:09 at time 2022-09-30T04:26:09
peerplays-all-in-one_1            | 1569501ms th_�       peerplays_sidechain_plugin.cpp:520 son_processing       ] Scheduled SON: 1.33.2 Sidechain: hive Now: 2022-09-30T04:26:06
peerplays-all-in-one_1            | 1569501ms th_�       peerplays_sidechain_plugin.cpp:520 son_processing       ] Scheduled SON: 1.33.2 Sidechain: bitcoin Now: 2022-09-30T04:26:06
peerplays-all-in-one_1            | 1569502ms th_�       sidechain_net_handler.cpp:567 operator()           ] Sidechain transaction to settle: 1.39.1
peerplays-all-in-one_1            | 1569502ms th_�       libbitcoin_client.cpp:86      operator()           ] error on fetch_trx_by_hash: ca1cff3addec2dd22124046e898a266fc01c8837571f987ec887cfdcb441ddff object does not exist
peerplays-all-in-one_1            | 1569502ms th_�       sidechain_net_handler.cpp:573 operator()           ] Sidechain transaction not settled: 1.39.1
peerplays-all-in-one_1            | 1572000ms th_a       witness.cpp:267               maybe_produce_block  ] slot: 1 scheduled_witness: 1.6.6 scheduled_time: 2022-09-30T04:26:12 now: 2022-09-30T04:26:12 
peerplays-all-in-one_1            | 1572000ms th_a       witness.cpp:191               block_production_loo ] Generated block #10797 with timestamp 2022-09-30T04:26:12 at time 2022-09-30T04:26:12
peerplays-all-in-one_1            | 1572500ms th_�       peerplays_sidechain_plugin.cpp:520 son_processing       ] Scheduled SON: 1.33.1 Sidechain: hive Now: 2022-09-30T04:26:09
peerplays-all-in-one_1            | 1572500ms th_�       peerplays_sidechain_plugin.cpp:520 son_processing       ] Scheduled SON: 1.33.1 Sidechain: bitcoin Now: 2022-09-30T04:26:09
peerplays-all-in-one_1            | 1572501ms th_�       sidechain_net_handler.cpp:567 operator()           ] Sidechain transaction to settle: 1.39.1
peerplays-all-in-one_1            | 1572502ms th_�       libbitcoin_client.cpp:86      operator()           ] error on fetch_trx_by_hash: ca1cff3addec2dd22124046e898a266fc01c8837571f987ec887cfdcb441ddff object does not exist
peerplays-all-in-one_1            | 1572502ms th_�       sidechain_net_handler.cpp:573 operator()           ] Sidechain transaction not settled: 1.39.1
peerplays-all-in-one_1            | 1575000ms th_a       witness.cpp:267               maybe_produce_block  ] slot: 1 scheduled_witness: 1.6.4 scheduled_time: 2022-09-30T04:26:15 now: 2022-09-30T04:26:15 
peerplays-all-in-one_1            | 1575000ms th_a       witness.cpp:191               block_production_loo ] Generated block #10798 with timestamp 2022-09-30T04:26:15 at time 2022-09-30T04:26:15
peerplays-all-in-one_1            | 1575500ms th_�       peerplays_sidechain_plugin.cpp:520 son_processing       ] Scheduled SON: 1.33.0 Sidechain: hive Now: 2022-09-30T04:26:12
peerplays-all-in-one_1            | 1575500ms th_�       peerplays_sidechain_plugin.cpp:520 son_processing       ] Scheduled SON: 1.33.0 Sidechain: bitcoin Now: 2022-09-30T04:26:12
peerplays-all-in-one_1            | 1575501ms th_�       sidechain_net_handler.cpp:567 operator()           ] Sidechain transaction to settle: 1.39.1
peerplays-all-in-one_1            | 1575502ms th_�       libbitcoin_client.cpp:86      operator()           ] error on fetch_trx_by_hash: ca1cff3addec2dd22124046e898a266fc01c8837571f987ec887cfdcb441ddff object does not exist
peerplays-all-in-one_1            | 1575502ms th_�       sidechain_net_handler.cpp:573 operator()           ] Sidechain transaction not settled: 1.39.1
unlocked >>> list_account_balances account01
list_account_balances account01
49999950 TEST
1000000 PBTC
1000000 PEOS
1000000 PETH

unlocked >>> 
root@1ccb3d6b82e7:~/src/peerplays# git log -3
commit 3fa3ff200b54001d7ab1acd10aaff3e0478a8f2e (HEAD -> feature/libbitcoin-son, origin/feature/libbitcoin-son)
Author: hirunda <mdmdavor@gmail.com>
Date:   Tue Sep 27 20:56:13 2022 +0200

    Align wallet name config with develop changes

commit 52b40fd6c0de1a6a91c53613b42535859d948ff6
Merge: 8fbe62b4 42250d66
Author: Davor Hirunda <mdmdavor@gmail.com>
Date:   Fri Sep 23 23:21:17 2022 +0000

    Merge branch 'revert-1a160275' into 'feature/libbitcoin-son'
    
    Revert "Merge branch 'develop' into feature/libbitcoin-son"
    
    See merge request PBSA/peerplays!156

commit 42250d6666e585e38412d901e18086d927bb8c7b
Author: Davor Hirunda <mdmdavor@gmail.com>
Date:   Fri Sep 23 23:21:17 2022 +0000

    Revert "Merge branch 'develop' into feature/libbitcoin-son"
root@1ccb3d6b82e7:~/src/peerplays# 
@hirunda deposit is failing with the following error: ``` unlocked >>> get_sidechain_address_by_account_and_sidechain account01 1 get_sidechain_address_by_account_and_sidechain account01 1 { "id": "1.38.0", "sidechain_address_account": "1.2.52", "sidechain": "bitcoin", "deposit_public_key": "0368dc31b2b547c74f52abfc67c7fc768c68115d8ab96430d9bb4996fa660121cd", "deposit_address": "2N84SkmB5JfgGCvZ7QpSF43wWEbQ2EsLoMY", "deposit_address_data": "{ \"redeemScript\": \"210368dc31b2b547c74f52abfc67c7fc768c68115d8ab96430d9bb4996fa660121cdac635167007c2103456772301e221026269d3095ab5cb623fc239835b583ae4632f99a15107ef275ac635193687c2102d67c26cf20153fe7625ca1454222d3b3aeb53b122d8a0f7d32a3dd4b2c2016f4ac635193687c21025f7cfda933516fd590c5a34ad4a68e3143b6f4155a64b3aab2c55fb851150f61ac635193687c210228155bb1ddcd11c7f14a2752565178023aa963f84ea6b6a052bddebad6fe9866ac635193687c21037500441cfb4484da377073459511823b344f1ef0d46bac1efd4c7c466746f666ac6351936854a268\", \"witnessScript\": \"0020a3252a2204813812e990fdb50656dafb15211a68b94aacd76d78c203a6f2994c\" }", "withdraw_public_key": "02743d4f24f88095de7921b8a8486cb46f009b7c034daa931821fb688c9c1e42a2", "withdraw_address": "2MtTPtraZawsvNGc8eCdx98hXbi4gaYy8L6", "valid_from": "2022-09-29T19:23:12", "expires": "2106-02-07T06:28:15" } unlocked >>> ``` ``` root@b5dde6c9c986:~/bitcoin-network# ./bitcoin-cli -rpcuser=1 -rpcwallet="default" -rpcpassword=1 sendtoaddress 2N84SkmB5JfgGCvZ7QpSF43wWEbQ2EsLoMY 10 "" "" false 5d73e1856db2064bd1ba078d252a247269a94ba2051ecf37830db39e2267575b root@b5dde6c9c986:~/bitcoin-network# ./bitcoin-cli -rpcuser=1 -rpcwallet="default" -rpcpassword=1 generatetoaddress 1 2MtTPtraZawsvNGc8eCdx98hXbi4gaYy8L6 [ "5e0b870d6a04844c0bb4262b04b98cb19f2742f801967457c52d6cc9bf0e6ae1" ] root@b5dde6c9c986:~/bitcoin-network# ``` ``` peerplays-all-in-one_1 | 1559699ms th_a peerplays_sidechain_plugin.cpp:462 heartbeat_loop ] Sending heartbeat for SON 1.33.4 peerplays-all-in-one_1 | 1560000ms th_a witness.cpp:267 maybe_produce_block ] slot: 1 scheduled_witness: 1.6.5 scheduled_time: 2022-09-30T04:26:00 now: 2022-09-30T04:26:00 peerplays-all-in-one_1 | 1560002ms th_a witness.cpp:191 block_production_loo ] Generated block #10793 with timestamp 2022-09-30T04:26:00 at time 2022-09-30T04:26:00 peerplays-all-in-one_1 | 1560502ms th_� peerplays_sidechain_plugin.cpp:520 son_processing ] Scheduled SON: 1.33.4 Sidechain: bitcoin Now: 2022-09-30T04:25:57 peerplays-all-in-one_1 | 1560502ms th_� peerplays_sidechain_plugin.cpp:520 son_processing ] Scheduled SON: 1.33.4 Sidechain: hive Now: 2022-09-30T04:25:57 peerplays-all-in-one_1 | 1560503ms th_� sidechain_net_handler.cpp:567 operator() ] Sidechain transaction to settle: 1.39.1 peerplays-all-in-one_1 | 1560504ms th_� libbitcoin_client.cpp:86 operator() ] error on fetch_trx_by_hash: ca1cff3addec2dd22124046e898a266fc01c8837571f987ec887cfdcb441ddff object does not exist peerplays-all-in-one_1 | 1560504ms th_� sidechain_net_handler.cpp:573 operator() ] Sidechain transaction not settled: 1.39.1 peerplays-all-in-one_1 | 1563000ms th_a witness.cpp:267 maybe_produce_block ] slot: 1 scheduled_witness: 1.6.7 scheduled_time: 2022-09-30T04:26:03 now: 2022-09-30T04:26:03 peerplays-all-in-one_1 | 1563001ms th_a witness.cpp:191 block_production_loo ] Generated block #10794 with timestamp 2022-09-30T04:26:03 at time 2022-09-30T04:26:03 peerplays-all-in-one_1 | 1563501ms th_� peerplays_sidechain_plugin.cpp:520 son_processing ] Scheduled SON: 1.33.0 Sidechain: hive Now: 2022-09-30T04:26:00 peerplays-all-in-one_1 | 1563501ms th_� peerplays_sidechain_plugin.cpp:520 son_processing ] Scheduled SON: 1.33.0 Sidechain: bitcoin Now: 2022-09-30T04:26:00 peerplays-all-in-one_1 | 1563501ms th_� sidechain_net_handler.cpp:567 operator() ] Sidechain transaction to settle: 1.39.1 peerplays-all-in-one_1 | 1563502ms th_� libbitcoin_client.cpp:86 operator() ] error on fetch_trx_by_hash: ca1cff3addec2dd22124046e898a266fc01c8837571f987ec887cfdcb441ddff object does not exist peerplays-all-in-one_1 | 1563502ms th_� sidechain_net_handler.cpp:573 operator() ] Sidechain transaction not settled: 1.39.1 peerplays-all-in-one_1 | 1566000ms th_a witness.cpp:267 maybe_produce_block ] slot: 1 scheduled_witness: 1.6.2 scheduled_time: 2022-09-30T04:26:06 now: 2022-09-30T04:26:06 peerplays-all-in-one_1 | 1566001ms th_a witness.cpp:191 block_production_loo ] Generated block #10795 with timestamp 2022-09-30T04:26:06 at time 2022-09-30T04:26:06 peerplays-all-in-one_1 | 1566501ms th_� peerplays_sidechain_plugin.cpp:520 son_processing ] Scheduled SON: 1.33.3 Sidechain: hive Now: 2022-09-30T04:26:03 peerplays-all-in-one_1 | 1566501ms th_� peerplays_sidechain_plugin.cpp:520 son_processing ] Scheduled SON: 1.33.3 Sidechain: bitcoin Now: 2022-09-30T04:26:03 peerplays-all-in-one_1 | 1566502ms th_� sidechain_net_handler.cpp:567 operator() ] Sidechain transaction to settle: 1.39.1 peerplays-all-in-one_1 | 1566502ms th_� libbitcoin_client.cpp:86 operator() ] error on fetch_trx_by_hash: ca1cff3addec2dd22124046e898a266fc01c8837571f987ec887cfdcb441ddff object does not exist peerplays-all-in-one_1 | 1566502ms th_� sidechain_net_handler.cpp:573 operator() ] Sidechain transaction not settled: 1.39.1 peerplays-all-in-one_1 | 1569000ms th_a witness.cpp:267 maybe_produce_block ] slot: 1 scheduled_witness: 1.6.9 scheduled_time: 2022-09-30T04:26:09 now: 2022-09-30T04:26:09 peerplays-all-in-one_1 | 1569001ms th_a witness.cpp:191 block_production_loo ] Generated block #10796 with timestamp 2022-09-30T04:26:09 at time 2022-09-30T04:26:09 peerplays-all-in-one_1 | 1569501ms th_� peerplays_sidechain_plugin.cpp:520 son_processing ] Scheduled SON: 1.33.2 Sidechain: hive Now: 2022-09-30T04:26:06 peerplays-all-in-one_1 | 1569501ms th_� peerplays_sidechain_plugin.cpp:520 son_processing ] Scheduled SON: 1.33.2 Sidechain: bitcoin Now: 2022-09-30T04:26:06 peerplays-all-in-one_1 | 1569502ms th_� sidechain_net_handler.cpp:567 operator() ] Sidechain transaction to settle: 1.39.1 peerplays-all-in-one_1 | 1569502ms th_� libbitcoin_client.cpp:86 operator() ] error on fetch_trx_by_hash: ca1cff3addec2dd22124046e898a266fc01c8837571f987ec887cfdcb441ddff object does not exist peerplays-all-in-one_1 | 1569502ms th_� sidechain_net_handler.cpp:573 operator() ] Sidechain transaction not settled: 1.39.1 peerplays-all-in-one_1 | 1572000ms th_a witness.cpp:267 maybe_produce_block ] slot: 1 scheduled_witness: 1.6.6 scheduled_time: 2022-09-30T04:26:12 now: 2022-09-30T04:26:12 peerplays-all-in-one_1 | 1572000ms th_a witness.cpp:191 block_production_loo ] Generated block #10797 with timestamp 2022-09-30T04:26:12 at time 2022-09-30T04:26:12 peerplays-all-in-one_1 | 1572500ms th_� peerplays_sidechain_plugin.cpp:520 son_processing ] Scheduled SON: 1.33.1 Sidechain: hive Now: 2022-09-30T04:26:09 peerplays-all-in-one_1 | 1572500ms th_� peerplays_sidechain_plugin.cpp:520 son_processing ] Scheduled SON: 1.33.1 Sidechain: bitcoin Now: 2022-09-30T04:26:09 peerplays-all-in-one_1 | 1572501ms th_� sidechain_net_handler.cpp:567 operator() ] Sidechain transaction to settle: 1.39.1 peerplays-all-in-one_1 | 1572502ms th_� libbitcoin_client.cpp:86 operator() ] error on fetch_trx_by_hash: ca1cff3addec2dd22124046e898a266fc01c8837571f987ec887cfdcb441ddff object does not exist peerplays-all-in-one_1 | 1572502ms th_� sidechain_net_handler.cpp:573 operator() ] Sidechain transaction not settled: 1.39.1 peerplays-all-in-one_1 | 1575000ms th_a witness.cpp:267 maybe_produce_block ] slot: 1 scheduled_witness: 1.6.4 scheduled_time: 2022-09-30T04:26:15 now: 2022-09-30T04:26:15 peerplays-all-in-one_1 | 1575000ms th_a witness.cpp:191 block_production_loo ] Generated block #10798 with timestamp 2022-09-30T04:26:15 at time 2022-09-30T04:26:15 peerplays-all-in-one_1 | 1575500ms th_� peerplays_sidechain_plugin.cpp:520 son_processing ] Scheduled SON: 1.33.0 Sidechain: hive Now: 2022-09-30T04:26:12 peerplays-all-in-one_1 | 1575500ms th_� peerplays_sidechain_plugin.cpp:520 son_processing ] Scheduled SON: 1.33.0 Sidechain: bitcoin Now: 2022-09-30T04:26:12 peerplays-all-in-one_1 | 1575501ms th_� sidechain_net_handler.cpp:567 operator() ] Sidechain transaction to settle: 1.39.1 peerplays-all-in-one_1 | 1575502ms th_� libbitcoin_client.cpp:86 operator() ] error on fetch_trx_by_hash: ca1cff3addec2dd22124046e898a266fc01c8837571f987ec887cfdcb441ddff object does not exist peerplays-all-in-one_1 | 1575502ms th_� sidechain_net_handler.cpp:573 operator() ] Sidechain transaction not settled: 1.39.1 ``` ``` unlocked >>> list_account_balances account01 list_account_balances account01 49999950 TEST 1000000 PBTC 1000000 PEOS 1000000 PETH unlocked >>> ``` ``` root@1ccb3d6b82e7:~/src/peerplays# git log -3 commit 3fa3ff200b54001d7ab1acd10aaff3e0478a8f2e (HEAD -> feature/libbitcoin-son, origin/feature/libbitcoin-son) Author: hirunda <mdmdavor@gmail.com> Date: Tue Sep 27 20:56:13 2022 +0200 Align wallet name config with develop changes commit 52b40fd6c0de1a6a91c53613b42535859d948ff6 Merge: 8fbe62b4 42250d66 Author: Davor Hirunda <mdmdavor@gmail.com> Date: Fri Sep 23 23:21:17 2022 +0000 Merge branch 'revert-1a160275' into 'feature/libbitcoin-son' Revert "Merge branch 'develop' into feature/libbitcoin-son" See merge request PBSA/peerplays!156 commit 42250d6666e585e38412d901e18086d927bb8c7b Author: Davor Hirunda <mdmdavor@gmail.com> Date: Fri Sep 23 23:21:17 2022 +0000 Revert "Merge branch 'develop' into feature/libbitcoin-son" root@1ccb3d6b82e7:~/src/peerplays# ```
hirunda commented 2022-09-30 11:38:16 +00:00 (Migrated from gitlab.com)

Hi @prandnum ,

I missed one step in instruction for executing deposit.
You have to mine twice. The same as you did before for confirming deposit and withdrawal.

Let me try to explain:

  1. When you send the funds to address and mine one block we are getting the transaction to peerplays
  2. We are signing the transaction from 1) and we are sending that transaction to bitcoin block chain for confirmations
  3. We are entering in settle down state within peerplays by querying the transaction that we sent in 2)
  4. You will get error on fetching transaction which is normal since the transaction is not confirmed
    **5) You have to mine again in bitcoin so transaction get confirmed and included in blockchain. **
    After 5) querying from 3) should pass and settle down should pass.

Please take into consideration this ... and repeat the tests.

Thanks,
Davor

Hi @prandnum , I missed one step in instruction for executing deposit. You have to mine twice. The same as you did before for confirming deposit and withdrawal. Let me try to explain: 1) When you send the funds to address and mine one block we are getting the transaction to peerplays 2) We are signing the transaction from 1) and we are sending that transaction to bitcoin block chain for confirmations 3) We are entering in settle down state within peerplays by querying the transaction that we sent in 2) 4) You will get error on fetching transaction which is normal since the transaction is not confirmed **5) You have to mine again in bitcoin so transaction get confirmed and included in blockchain. ** After 5) querying from 3) should pass and settle down should pass. Please take into consideration this ... and repeat the tests. Thanks, Davor
prandnum commented 2022-09-30 17:22:25 +00:00 (Migrated from gitlab.com)

Deposit and Withdrawal were successful with the steps mentioned. Closing the ticket.

Deposit and Withdrawal were successful with the steps mentioned. Closing the ticket.
prandnum (Migrated from gitlab.com) closed this issue 2022-09-30 17:22:25 +00:00
wsalloum (Migrated from gitlab.com) reopened this issue 2022-10-10 12:30:43 +00:00
prandnum commented 2022-10-10 14:35:26 +00:00 (Migrated from gitlab.com)

@wsalloum Is this not working? Would be helpful if you put in the comments while reopening to be clear on the reason of reopening. Also put in the appropriate label, this now having state as completed. Thanks.

@wsalloum Is this not working? Would be helpful if you put in the comments while reopening to be clear on the reason of reopening. Also put in the appropriate label, this now having state as completed. Thanks.
wsalloum commented 2022-10-10 14:42:38 +00:00 (Migrated from gitlab.com)

retest it again as request by @hirunda

retest it again as request by @hirunda
serkixenos (Migrated from gitlab.com) closed this issue 2022-10-10 23:29:35 +00:00
hirunda commented 2022-10-11 11:45:42 +00:00 (Migrated from gitlab.com)

Hi @wsalloum please use this ticket : https://gitlab.com/PBSA/peerplays/-/issues/449.

This should be used only as reference regarding instructions.

Hi @wsalloum please use this ticket : https://gitlab.com/PBSA/peerplays/-/issues/449. This should be used only as reference regarding instructions.
Sign in to join this conversation.
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference: Peerplays_Blockchain/peerplays_migrated#447
No description provided.