bnb-chain / bsc-relayer

An implementation of relay service to relay cross chain packages from BNB Beacon Chain to BNB Smart Chain
GNU Lesser General Public License v3.0
101 stars 51 forks source link

Relayer not starting #13

Closed razzbee closed 3 years ago

razzbee commented 4 years ago

Hello, after compiling and trying to run it, I get this error:

ERROR main websocket client is dialing or stopped, can't send any request

I have tried on about 3-4 ubuntu servers but same issue. Tested on Ubuntu Server 18.04 and mac book pro

yutianwu commented 4 years ago

what's your rpc address

razzbee commented 4 years ago

for bbc
"rpc_addr": "https://dataseed1.binance.org:443",

and bsc "provider": "https://bsc-dataseed1.binance.org:443",

razzbee commented 4 years ago

This is my config.json file

{
  "cross_chain_config": {
    "source_chain_id": 1,
    "dest_chain_id": 2,
    "monitor_channel_list": [1, 2, 3, 8, 9],
    "competition_mode": true,
    "protocol_config_type": "remote"
  },
  "bbc_config": {
    "rpc_addr": "https://dataseed1.binance.org:443",
    "mnemonic_type": "local_mnemonic",
    "aws_region": "",
    "aws_secret_name": "",
    "mnemonic": "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx",
    "sleep_millisecond_for_wait_block": 500,
    "clean_up_block_interval": 20,
    "block_interval_for_clean_up_undelivered_packages": 1000,
    "behind_block_threshold": 100
  },
  "bsc_config": {
    "key_type": "local_private_key",
    "aws_region": "",
    "aws_secret_name": "",
    "private_key": "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx",
    "provider": "https://bsc-dataseed1.binance.org:443",
    "gas_limit": 4700000,
    "gas_price": 20000000000,
    "monitor_data_seed_list": [
    "wss://bsc-dataseed1.binance.org:443",
        "wss://bsc-dataseed2.binance.org:443",
        "wss://bsc-dataseed3.binance.org:443",
        "wss://bsc-dataseed4.binance.org:443",
        "wss://bsc-dataseed1.defibit.io:443",
        "wss://bsc-dataseed2.defibit.io:443",
        "wss://bsc-dataseed3.defibit.io:443",
        "wss://bsc-dataseed4.defibit.io:443",
        "wss://bsc-dataseed1.ninicoin.io:443",
        "wss://bsc-dataseed2.ninicoin.io:443",
        "wss://bsc-dataseed3.ninicoin.io:443",
        "wss://bsc-dataseed4.ninicoin.io:443"
    ]
  },
  "log_config": {
    "level": "DEBUG",
    "filename": "",
    "max_file_size_in_mb": 0,
    "max_backups_of_log_files": 0,
    "max_age_to_retain_log_files_in_days": 0,
    "use_console_logger": true,
    "use_file_logger": false,
    "compress": false
  },
  "db_config": {
    "dialect": "sqlite3",
    "db_path": "/mnt/bsc.db"
  },
  "admin_config": {
    "listen_addr": "0.0.0.0:7070"
  },
  "alert_config": {
    "enable_alert": false,
    "enable_heart_beat": false,
    "interval": 300,
    "telegram_bot_id": "your_bot_id",
    "telegram_chat_id": "your_chat_id",
    "balance_threshold": "1000000000000000000",
    "sequence_gap_threshold": 10
  }
}
yutianwu commented 4 years ago

can you use tcp://dataseed1.binance.org:80 and try again

razzbee commented 4 years ago

okay

razzbee commented 4 years ago

Its starts fine but again another error shows:

2020-09-21 03:37:36 INFO main Starting relayer 2020-09-21 03:37:37 INFO registerRelayerHub This relayer has already been registered 2020-09-21 03:37:37 INFO cleanPreviousPackages Cleanup packages at height 114821515 2020-09-21 03:37:38 INFO cleanPreviousPackages channelID: 1, next deliver sequence 30 on BSC, next sequence 0 on BC 2020-09-21 03:37:39 INFO cleanPreviousPackages channelID: 2, next deliver sequence 4335 on BSC, next sequence 0 on BC 2020-09-21 03:37:39 INFO cleanPreviousPackages channelID: 3, next deliver sequence 0 on BSC, next sequence 0 on BC 2020-09-21 03:37:40 INFO cleanPreviousPackages channelID: 8, next deliver sequence 23 on BSC, next sequence 0 on BC 2020-09-21 03:37:41 INFO cleanPreviousPackages channelID: 9, next deliver sequence 0 on BSC, next sequence 0 on BC 2020-09-21 03:37:41 INFO relayerCompetitionDaemon Start relayer daemon in competition mode 2020-09-21 03:37:41 INFO Serve start admin server at 0.0.0.0:7070 panic: websocket: bad handshake (HTTP status 200 OK)

razzbee commented 4 years ago

It works fine if I remove ths config below

   "monitor_data_seed_list": [
    "wss://bsc-dataseed1.binance.org:443",
        "wss://bsc-dataseed2.binance.org:443",
        "wss://bsc-dataseed3.binance.org:443",
        "wss://bsc-dataseed4.binance.org:443",
        "wss://bsc-dataseed1.defibit.io:443",
        "wss://bsc-dataseed2.defibit.io:443",
        "wss://bsc-dataseed3.defibit.io:443",
        "wss://bsc-dataseed4.defibit.io:443",
        "wss://bsc-dataseed1.ninicoin.io:443",
        "wss://bsc-dataseed2.ninicoin.io:443",
        "wss://bsc-dataseed3.ninicoin.io:443",
        "wss://bsc-dataseed4.ninicoin.io:443"
    ]

Seems one of the node isnt working well

razzbee commented 4 years ago

Hello, its running but its strange that for the past 4 hours no transaction has been processed, I have posted a log of the console message below, kindly help me check if its normal because the same messages is showing over and over:

2020-09-21 06:29:41 INFO cleanPreviousPackages Cleanup packages at height 114845322
2020-09-21 06:29:42 INFO cleanPreviousPackages channelID: 1, next deliver sequence 30 on BSC, next sequence 0 on BC
2020-09-21 06:29:42 INFO cleanPreviousPackages channelID: 2, next deliver sequence 4342 on BSC, next sequence 0 on BC
2020-09-21 06:29:43 INFO cleanPreviousPackages channelID: 3, next deliver sequence 0 on BSC, next sequence 0 on BC
2020-09-21 06:29:44 INFO cleanPreviousPackages channelID: 8, next deliver sequence 23 on BSC, next sequence 0 on BC
2020-09-21 06:29:45 INFO cleanPreviousPackages channelID: 9, next deliver sequence 0 on BSC, next sequence 0 on BC

The admin log is below

{
    "total_tx": 0,
    "success_tx": 0,
    "failed_tx": 0,
    "sync_header_tx": 0,
    "deliver_package_tx": 0,
    "accumulated_total_tx_fee": "0:BNB",
    "accumulated_success_tx_fee": "0:BNB",
    "accumulated_failed_tx_fee": "0:BNB",
    "update_time": "2020-09-21 06:35:39 AM"
}
razzbee commented 4 years ago

Anyone here, help will be appreciated, it keeps running for days but nothing happens

{
    "total_tx": 0,
    "success_tx": 0,
    "failed_tx": 0,
    "sync_header_tx": 0,
    "deliver_package_tx": 0,
    "accumulated_total_tx_fee": "0:BNB",
    "accumulated_success_tx_fee": "0:BNB",
    "accumulated_failed_tx_fee": "0:BNB",
    "update_time": "2020-09-21 06:35:39 AM"
}
moesaleh commented 3 years ago

Any update regarding this issue? Basically the Eth go client is trying to execute the function dial and open a socket, but there is a bug with the version of the eth-go client that is shipped with this package, so it keeps returning panic: websocket: bad handshake (HTTP status 200 OK) when it's trying to open sockets with the BSCProviders list.

I wonder are can you guys fix this issue? I have it, it seems this version is not working! it just requires updating the eth-go client version.

moesaleh commented 3 years ago

@razzbee @yutianwu @cpzhao @ackratos did you guys manage to run BSC Relayer? I really appreciate your guidance and help in this case?