Solution for ZMQ connectivity of the Bitcoin nodes #269
Closed
opened 2022-02-04 06:37:10 +00:00 by bobinson
·
29 comments
No Branch/Tag specified
master
feature/579-enable-hardfork-check
develop
beatrice
feature/577-sidechain-plugin
hotfix/bookie2024
feature/568-static-libbitcoin
567-update-dockerfile
docs/readme-build-subdirectory
local_dev_subscribe_address
feature/release-automation-changelogs
feature/remove-image-e2e-tests
feature/installer-script
local_dev_manual_zmq_socet
local_test_block_events
develop-clang17-wip
feature/python-e2e-tests
bug/501-on_connection_closed
bug/513-num_son_init
bug/513-num_son_extension
docker-build-fix
libbitcoin-build-dependencies-cicd
feature/cicd-deployments-and-upgrades
feature/limit-NFT-objs-returned
sonarcloud-coverage
bug/api-doc-generation-hotfix
test/hot-fix-hardfork-changed
mint-testnet-sidechain-address-fix
hotfix/sidechain-address
feature/limits-for-nft_get_all_tokens
debug-transaction-signing
feature/libbitcoin-son
revert-1a160275
revert-f7aab6a8
peerup-clang14-new
feature/son-for-ethereum
peerup-clang14
feature/420-ethereum-unit-tests
bug/issue416_corrected
bug/issue-416
cicd-test
test/enable_disconnect_non_compatible_witness_nodes
395-verify-delayed_node-plugin
431-verify-debug_witness-plugin
461-handle-boost-system-system_error-exception
local_enable_logs_for_irona
merge-develop-to-beatrice-2022-06
bug/378/fix_for_restarting_node_without_replay_option
feature/368/implement_the_witness_capability_to_overwrite_last_hardfork
bug/issue317
issue317-traces
dapp-support
feature/274/redirect_transaction_fees_to_dividends
bug/issue34
bug/issue229
bug-235-update-2
Feature-Enable-parallel-build-testnet-mainnet-cmake
231-docker-with-artifacts
325-refactor-importing-btc-addresses-into-son-wallet
bug/235-stop_corrupts_chain_file-1
bug/empty-json-parsing-failure-2
bug/failure-on-son-related-test-1
bug/issue50
230-docker-image-from-ci-should-be-pushed-to-gitlab-registry-2
bug/issue-50-4
bug/issue50-trace-tid
bug/issue-50-2
bug/issue-50-3
bug/94-docker-build
bug/issue-50
bug/empty-json-parsing-failure
bug/rpc-client-crashes-on-empty-response
bug_fix_warnings
feature/all-in-one-build
feature/cli-activate-deregistered-son
hotfix/fix-sidechain-address-generation
revert-b875f0b8
hotfix/fix-memo-field-encryption
issue/son-for-hive-rpc-connection
hotfix/fix-plugin-cli-option
bug/35-blockchain_replay
merge-beatrice-to-master-2021-11
feature/son-for-hive
feature/son-for-hive-https-support
revert-b806eb85
feature/rel-mainnet-jul21
feature/mainnet-release-jul21
feature/reserve-tokens
feature/beatrice-changes-to-develop
feature/testnet-release-jun2021
feature/add-cliwallet-version
feature/son-wrong-weights
support/sonarcloud
feature/add-get-blocks
feature/sidechain-throttling
63-doc-son-docker-mainnet
issue/dex-crash
feature/port-dex-fixes
feature/hf-btc-flags-change
hotfix/build-warnings-210210
hotfix/master-son-vb-checks
hotfix/check-vesting-balances-for-son
feature/nft_lottery
hotfix/master-hotfixes
hotfix/gitlab
support/ci
hotfix/fix-get-full-accounts
feature/flush-db-during-replay
feature/cli-change-account-keys
feature/gpos-vesting-performance-decay-test
bugfix/374
hotfix/fix-witness-sons-multiple-ids-reading
feature/es-improvements
hotfix/cli-buy-sell-fix
merge_beatrice_to_develop_202012
merge_beatrice_to_master_202012
merge/master-to-beatrice-20201203
tests/code-coverage
feature/build-optimizations
hotfix/build-executables
merge/beatrice2develop
feature/sync-fc-OCT
hotfix/remove_fc_smart_ref
hotfix/remove_smart_ref
hotfix/remove_fc_smart_ref_develop
feature/api_limit_error_msg
hotfix/beatrice_compilation
feature/rl-editline
hotfix/release_build_fix_develop
hotfix/release_build_fix
feature/editline
hotfix/son_maxcount_fix
hotfix/son_fixes
hotfix/son_chain_params
merge/develop2beatrice
feature/SONs-base
feature/bts-210
feature/account_roles
issue375/public_key_type_fix
ws-updates
feature/rng
feature/beatrice_nft_merge
feature/marketplace
issue/mainnet_chain_halt_5050
issue/gpos_rolling_period_issue
issue/beatrice_chain_halt_gpos
feature/nft_market_rbac
feature/nft
feature/rbac
feature/GRPH-45
lottery_crash_reproduction
master_chain_halt_issue
son_deposit_address_enhancements
bitcoin_networktype_fix
SON-314
SON-363
SON-359
fix_tests
hotfix-rawtransaction
feature/SON-135
SON-215_SigningFix
issue_a_gitlab
SON-315
feature/SON-349
SON-BTCPxPlex-Tryouts
feature/SON-347
feature/SON-354
feature/SON-349_SON-350
feature/SON-353
beatrice_master_mar19
feature/SON-134-v4
feature/SON-333-gladcow
feature/beatrice_winner_id
feature/nh5050_winner_id
SON-337
SON-333-v2-sk
feature/SON-333-v2
feature/SON-348
feature/SON-346
feature/SON-344
feature/SON-341
feature/SON-325
feature/SON-320
feature/SON-322_SON-324
SON-291
SON-339
feature/SON-333
feature/SON-305
SON-297_SON-336
feature/SON-307
SON-313
feature/SON-134-alternate
son_account_fix_SON329
feature/SON-332
gitlab_test_clean_build
feature/SON-321_SON-323
feature/SON-288-update
feature/SON-271
feature/SON-311
SON-318_SON-319
feature/SON-312
feature/SON-304
feature/SON-295
SON-122
revert-312-sons_gpos_merge_mar19
SON-24
feature/SON-134
sons_gpos_merge_mar19
sons_gpos_merge_mar18
sons_gpos_merge_mar2
SON127
release/1.5.02
feature/SON-49
SON276
SON275
sync_fc_beatrice
plugins_enable_fix1
SON202_Update
SON118_Add_tx_metrics
feature/SON-270
SON269
SON200_Fix
es_update1
GRPH-160/fix
sync_fc_dev
feature/SON-264
SON261
feature/SON-260
feature/SON-242
unit_test_fixes
feature/SON-209-add
feature/SON-209
feature/SON-238
feature/snapshot
feature/GRPH-155
feature/GRPH-163
updates_from_mainnet
SON131
issue_github_277
2020_1_sync_fix
mainnet-sync-fix
mainet-sync
feature/SON-231
feature/SON-202-fix
SON214
feature/SON-98
SON233
SON232
SON165
SON206_Plugin_CrashFix_Reorg
GPOS-66
feature/SON-214
SON199-TestFailureFix
pbattu123-patch-1
feature/SON-202
feature/GRPH-205
support/gitlab-SONs-base
SON217
SON212_SON213_BuildError
SON212
SON206
SON194
sync-develop
hf-update
feature/SON-208
GPOS-1
beatrice_hf_1.4.1
SON207
feature/SON-203
GRPH-170
feature/GRPH-166
feature/SON-205
feature/BLOCKBACK-186-Bug-Fix
feature/GRPH-169
SON193
BLOCKBACK-186
feature/GRPH-152
BLOCKBACK-183
BLOCKCBACK-187
BLOCKBACK-187
feature/GRPH-168
feature/GRPH-167
feature/SON-196
203
feature/SON-195
feature/SON-158
GRPH-46
feature/GRPH-92
feature/GRPH-162
GRPH-159
feature/GRPH-160
update-submodule
BLOCKBACK-181
feature/BLOCKBACK-182
feature/GRPH-49-test-case
support/gitlab-develop
BLOCKBACK-177
GRPH-81
SON130
feature/GRPH-150
feature/SON-167
feature/SON-150
fc-commit-update
GRPH134
feature/GRPH-99
GRPH134_#198-HighCPU_Usage
qa_gpos_18.04
feature/BLOCKBACK-162
son_165
feature/SON-113-fix
feature/SON-160-fix
son_168
BLOCKBACK-155
feature/SON-142
BLOCKBACK-174
fix_flag
feature/BLOCKBACK-166
BLOCKBACK_164
feature/BLOCKBACK-165
SON126
feature/SON-113
BLOCKBACK-164
BLOCKBACK--164
oxarbitrage-patch-1
feature/SON-17
son_vesting
feature/GRPH-131
support/docker
SON118
feature/SON-115
son_wallet_clean
feature/GRPH-126
feature/GRPH-127
son_objects_operations
feature/SON-109
feature/SON-108
feature/SON-110
feature/SON-operations
feature/SON-137-GitModule-Update
feature/SON-83
feature/SON-107
feature/GRPH-2-GitModule-Update
jira-163-fix
153/fix-add-on
feature/GRPH-2-Git-Module-Update
feature/GRPH-79-Bug-Fix
feature/GRPH-3
feature/GRPH-117
gpos-testfix
feature/GRPH-90
feature/SON-84
feature/GRPH-114
feature/GRPH-95
118
feature/GRPH-112
issue/154-fix
GRPH-50-network_broadcast_api-fix-v2
BLOCKBACK-153
BLOCKBACK-154
feature/GRPH-94
feature/GRPH-111
feature/GRPH-83
feature/SON-5
feature/GRPH-93-v2
feature/GRPH-106
feature/GRPH-64
feature/GRPH-86
SON11
graphene-release1
GRPH-75
feature/GRPH-79
GRPH-73-fix-block-id-forks
feature/GRPH-88
pbsa-github-patch-1
feature/GRPH-80
feature/GRPH-93
feature/GRPH-87
feature/test-grph-3
feature/SON-83-plugins-option
GRPH-89
feature/SON-83-SON-plugin
support/gitlab-master
feature/SONs-base-build-1804
support/gitlab-beatrice
GRPH-4-update-submodule
feature/tweakes-README
GRPH-56-implement-tx-size-check-18.04
GRPH-56-implement-tx-size-check-master
github-issue-template1
support/gitlab
review-fixes
hardfork-50/50
cli_wallet_tests
rng_api
feature/GRPH-76
feature/GRPH-78
GRPH-59-Proposal-failure-handling
GRPH-71
feature/GRPH-61
feature/GRPH-77
issue-154
feature/GRPH-63
GRPH-3-cli-tests-18.04
GRPH-63-Authorize-Tx-Bug-18.04
GRPH-70
GRPH-51
pp_travis
WASM-49
GRPH-4
GRPH-53
feature/GRPH-54
GRPH-60
feature/GRPH-48
GRPH-48-Object-Database-18.04
GRPH-66
qa_gpos_18.04_gcc7_fix
GRPH-60-ProposalNestedRecursionGuard
GRPH-64-Variable-fix-18.04
GRPH-57-CompilerWarningFixesDBTests
GRPH-54-sign-transaction-fix-master
GRPH-54-sign-transaction-fix-18.04
qa_gpos_18.04_docker_img
GRPH-50-network_broadcast_api-fix
beatrice-5050-merge
Issue23-check-transaction-size
issue23-check-transaction-size
feature/5050
hotfix/readme
hotfix/readme-branch-from-gitlab
hotfix/docker
hotfix/docker-branch-from-gitlab
hotfix/unit-tests
hotfix/unit-tests-branch-from-gitlab
feature/manager-for-sports-and-underlying
feature-sidechain
1.6.1
1.6.0
1.5.25-beta
1.5.24-beta
1.5.23-beta
1.5.22-alpha
1.5.21-alpha
1.5.20-alpha
1.5.19
1.5.18
1.5.17
1.5.16
1.5.15
1.5.14
1.5.13
1.5.12
test-1.5.5
test-1.5.4
test-1.5.3
1.5.11
1.5.10
test-1.5.2
test-1.5.1
test-1.5.0
test-1.4.5
1.4.4
1.4.3
test-1.4.4
1.5.05
1.5.04
1.5.03
1.5.02
test-1.4.3
SON0.0.1
1.5.01
1.4.2
test-1.4.2
1.4.2-alpha
test-1.4.1
1.4.1-alpha
test-1.4.0
1.3.1
Ignore
1.3.0
1.2.0
1.1.0
1.0.0
Labels
Clear labels
Denotes a disruption to IT services and the associated issues require immediate attention
(optional) Issues that are marked as critical priority. Should be taken care of ASAP.
(optional) Issues that are marked as high priority.
(optional) Issues that are marked as low priority.
(optional) Issues that are marked as medium priority.
QA-Labels
QA-Labels
(optional) Issues that relate to the security of the project.
Issues that are newly created and have been accepted after review.
Issues that cannot be worked on due to other factors linked to it.
Issues that are closed with a working solution.
Issues that are currently being worked on.
Issues that require a proposed solution to be reviewed.
Issues that were at least accepted, that should not be worked on at the moment.
Issues that are newly created and haven't been reviewed.
Tickets are verified in the stage infra and needs to be deployed in the production
Issues that need to be revised before being accepted.
Task and issues which are out of scope due to change in requirements
(optional) Issues that are duplicates of existing issues in the same project.
Issues that bring new functionality to the project.
BUG
Issues that relate to the documentation of the project.
severe issues that require immediate response
Issues that require maintenance on the project.
Issues that are questions related to the project.
This label is used to track recurring tasks which may repeat daily, weekly or monthly.
confirmed
DevOps
documentation
enhancement
incident
Denotes a disruption to IT services and the associated issues require immediate attention
Medium
priority::Critical
(optional) Issues that are marked as critical priority. Should be taken care of ASAP.
priority::High
(optional) Issues that are marked as high priority.
priority::Low
(optional) Issues that are marked as low priority.
priority::Medium
(optional) Issues that are marked as medium priority.
QA-TestCases::Done
QA-Labels
QA-TestCases::InProgress
QA-Labels
RNG
security
(optional) Issues that relate to the security of the project.
severity:: Critical
severity:: High
severity:: Low
severity:: Medium
state:: Accepted
Issues that are newly created and have been accepted after review.
state:: Blocked
Issues that cannot be worked on due to other factors linked to it.
state:: Done
Issues that are closed with a working solution.
state:: in progress
Issues that are currently being worked on.
state:: in review
Issues that require a proposed solution to be reviewed.
state:: on hold
Issues that were at least accepted, that should not be worked on at the moment.
state:: Pending
Issues that are newly created and haven't been reviewed.
state:: Pushed to Prod
Tickets are verified in the stage infra and needs to be deployed in the production
state:: Revision Needed
Issues that need to be revised before being accepted.
state::out-of-scope
Task and issues which are out of scope due to change in requirements
suggestion
support
To Do
type :: Discussion
type :: Duplicate
(optional) Issues that are duplicates of existing issues in the same project.
type:: interaction-design
type:: New Feature
Issues that bring new functionality to the project.
type::bug
BUG
type::documentation
Issues that relate to the documentation of the project.
type::incident
severe issues that require immediate response
type::maintenance
Issues that require maintenance on the project.
type::question
Issues that are questions related to the project.
type::recurring-tasks
This label is used to track recurring tasks which may repeat daily, weekly or monthly.
vulnerability
No labels
confirmed
DevOps
documentation
enhancement
incident
Medium
priority::Critical
priority::High
priority::Low
priority::Medium
QA-TestCases::Done
QA-TestCases::InProgress
RNG
security
severity:: Critical
severity:: High
severity:: Low
severity:: Medium
state:: Accepted
state:: Blocked
state:: Done
state:: in progress
state:: in review
state:: on hold
state:: Pending
state:: Pushed to Prod
state:: Revision Needed
state::out-of-scope
suggestion
support
To Do
type :: Discussion
type :: Duplicate
type:: interaction-design
type:: New Feature
type::bug
type::documentation
type::incident
type::maintenance
type::question
type::recurring-tasks
vulnerability
Milestone
Clear milestone
No items
No milestone
Projects
Clear projects
No items
No project
Assignees
Clear assignees
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#269
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
We have 7 active sons on the mainnet and the HIVE / HBD deposits are working fine. However the Bitcoin deposit address creation is failing due to possible issues with the ZMQ node. The same error is seen in IRONA TESTNET as well. (@sivayavvari has further details, logs etc).
We need to provide a method to the SON operators and end users to identify the health of the Bitcoin node and also for end users. This can be perhaps achieved by adding queries / handshakes to the ZMQ node or using third party tools if any.
The first step must be providing this additional tool or instructions and as the second step we must explore ways to use additional Bitcoin nodes from a pool of nodes.
Deliverables: cli_wallet commands, other instructions required to inspect the health of the ZMQ node. The same must be possible via UI too. ie, we must provide PeerplaysJS and Python Support eventfully.
assigned to @sierra19XX
@serkixenos @Hiltos1 - Please share your thoughts if any.
From core dev side, QA environment is a reference when it comes to problems like this. Does the ZMQ works in QA env or not? If it works in QA, then @sivayavvari should double and triple check his configuration. If it works in QA, but later stops working, we want to look into this, but we should get at least some info on the local setup and actions performed when it stopped working. However, working in QA and not working in some local setup sounds like local configuration problem.
@sivayavvari can you share the output of your tests with the tool we recommended (https://github.com/flyte/zmcat) and forwarded instructions from @Hiltos1 on how to fix the tool?
I recently set up a quick zmq subscriber on my SON server using node.js to see if I could receive the zmq messages. It worked! I am able to view a stream of decoded raw transactions as they come into the chain. Note that I'm running my own bitcoin node on the same server. Here's what I did:
cd ~ && mkdir ./bitcoin-zmq/ && cd ./bitcoin-zmq/) and put the following file there:Now I can see all the incoming raw transactions. They look like this:
This can also be simplified to subscribe to another server running zmq:
Here are my observations so far. I've installed these test subscribers on three different servers (2x AWS EC2 instances and 1x Hetzner server).
The only scenario I haven't tested is going from a non-AWS server to another non-AWS server mostly due to lack of having another non-AWS server.
I figured it out... In my
./bitcoin/bitcoin.conffile, I was only publishing to the localhost like this:So, of course, it was only available on the same machine. All I had to do was to update the config to publish to any IP:
And now I've got ZMQ messaging working 😄
@sivayavvari Any feedback???
I have SON node running on the server 96.46.48.114

And bitcoin node running on the 96.46.48.225

The bitcoin.conf file has
The config.iniconfig.ini file on the SON node
Tried the below command on the bitcoin node
Received this on SON node where the script https://gitlab.com/PBSA/peerplays/-/issues/269#note_832438317 is running
please check ticket 276, i think it’s about the same
i posted what i found there
I've created a small ZMQ Utility for us located here: https://gitlab.com/PBSA/tools-libs/zmq-for-btc-sons
https://gitlab.com/PBSA/tools-libs/zmq-for-btc-sons/-/merge_requests/1
@sivayavvari dockerized @Hiltos1 tool. This is a good first step.
Now, I do not think that adding zmq check capabilities into cli_wallet is a way to go, because its just not the right place, and cli_wallet does not have access to witness config file, and therefore, is not able to get btc node address and zmq port.
We can eventually add api to witness node to return last btc tx hash received.
Bookie plugin can be used as a reference, on how to implement API in plugin.
unassigned @sierra19XX
assigned to @serkixenos
https://gitlab.com/PBSA/peerplays/-/merge_requests/94
In this MR. we introduce sidechain API. Sidechain API is accessible through cli wallet, and provides endpoint to retrieve SON listener logs. Son listener log will show a list of last blocks retrieved and transaction processed.
New cli wallet command
Output will be similar to the one bellow. It will show last few block hashes/numbers and transaction ids processed.
Block hash/number will be added to the log regardless of whether it contain deposit/withdrawal operation or not. Transaction id will be added only if the transaction contains withdrawal/deposit operation.
NOTE: SON listener log is local to a SON node. This means that user is not able to investigate a log of a SON not running on a node he is connected to. This information is not shared on chain.
assigned to @prandnum
Test steps:
assigned to @pavel.baykov
10 assert_exception: Assert Exception
itr != _by_name.end(): no method with name 'get_son_listner_log'
get_son_listener_log that’s correct name
Btc and Hive networks were initialized with init scripts
get_son_listner_log before deposits, looks weird for HIVE
Made 2 deposit of BTC, i see correct block numbers, and correct TRX numbers , however in json TRX twice more than expected, is it internal transfer ?
get_son_listener_log
[[
"bitcoin",[
"TRX : e737d717d433995cee2f81ee397e5c025add2927d9fb63e4eb3a976bfdf2bb9f",
"TRX : c24e402200db33f25954fe40fbc88b023dd121f879b9decce28498ded92eca4f",
"BLOCK : 4EDC5D671AAE6CF300AF1337A72C02DE821733DD3C5C7396944ECB76EC4380FD",
"TRX : 18bf8e0ba69f0051ec70b65ddf1af23a853bf6656e04d921151661a251c2e510",
"TRX : d32bd6d6bbdcdeaa9c734ff7f40bd1c3e5e9b0f598dffd326d5e519c7221abcb",
"BLOCK : 4B42BE4F8086F8B3903FE4CF185B277190E2058D01878A8A1C037425B42A3ABC"
]
],[
"hive",[
"BLOCK : 1593",
"BLOCK : 1592",
"BLOCK : 1591",
"BLOCK : 1590",
"BLOCK : 1589",
"BLOCK : 1588",
"BLOCK : 1587",
"BLOCK : 1586",
"BLOCK : 1585",
"BLOCK : 1584",
"BLOCK : 1583",
"BLOCK : 1582",
"BLOCK : 1581",
"BLOCK : 1580",
"BLOCK : 1579",
"BLOCK : 1578",
"BLOCK : 1577",
"BLOCK : 1576",
"BLOCK : 1575",
"BLOCK : 1574",
"BLOCK : 1573",
"BLOCK : 1572",
"BLOCK : 1571",
"BLOCK : 1570",
"BLOCK : 1569",
"BLOCK : 1568",
"BLOCK : 1567",
"BLOCK : 1566",
"BLOCK : 1565",
"BLOCK : 1564",
"BLOCK : 1563",
"BLOCK : 1562",
"BLOCK : 1561"
]
]
]
withdrawals does not show up as expected, however after 10 minutes son-account balance still have positive BTC/PBTC without bitcoin transactions
for HIVE it’s difficult to observe because BLOCKs are always rotating with new values
BTW 2nd BTC deposit lost, means Peerplays BTC balance did not adjust
No, it does not looks weird, it says that Hive listener follows Hive blocks as they are produced. In other words, it shows that Hive listener works properly.
"EVERY block id processed should show up in logs. ONLY transactions with deposit operations should show up in logs."
So, ideally, EVERY block produced by sidechain should be visible in this log, as it shows that sidechain listener did picked it up. For transactions, its different, as we will display ONLY transaction that contain the event of our interest, which is transfer to a deposit address
Depending on what address you used for generatetoaddress, this might happen. If you mined (generatetoaddress) to deposit address, this is same as making another deposit, because mining to address pays block reward to that address.
Did you executed few generatetoblock after deposits. We need at least two (one to move funds from deposit address to primary wallet, and another to settle the transfer)?
i only executed one generatetoblock based on XLS description, looks like 2nd one actually made transfer
ok understood, do you want automation for this in endtoendtests ?
i think it’s worthwhile to make a stress volume test with random deposits / withdrawals and then match automatically
potentially BTC withdrawals does not work correctly in latest develop branch, unless i don’t know correct procedure..
i made transfer from mapped Peerplays account to son-acconnt waited 10 min, no actual withdraw and no son-account balance adjustment
is it possible to have number of TRX in BTC the same as number of deposits ?