ExchangeUnion / xud-docker

Streamlined setup of xud and all dependencies via docker 🐳
https://docs.exchangeunion.com
GNU Affero General Public License v3.0
5 stars 5 forks source link

feat: enable connext testnet #819

Closed erkarl closed 3 years ago

erkarl commented 3 years ago

This PR enables connext vector for testnet and makes some preparations for mainnet.

raladev commented 3 years ago

testnet > closechannel eth --amount 5 --destination 0x7bbaa13d73F35Df7A10FcBF9507EAE46E19D5aAd { "transactionIdsList": [ "0x526247613d320a6a0d981743ccd530f17e1086e6c0d44029d14f7fabda66a0d4" ]

Screenshot from 2020-12-10 00-54-11 testnet_closechannel_connext.log

Screenshot from 2020-12-10 01-34-11

xud maker:

09/12/2020 21:41:48.428 [LND-BTC] debug: new channel maximum outbound capacity: 1455115
09/12/2020 21:41:48.429 [LND-BTC] debug: new channel inbound capacity: 1454932
09/12/2020 21:41:48.429 [LND-BTC] debug: new channel total outbound capacity: 1455115
09/12/2020 21:41:48.430 [LND-BTC] debug: new channel total inbound capacity: 1454932
09/12/2020 21:45:44.849 [RPC] error: call /xudrpc.Xud/CloseChannel errored with code 3: destination account for the withdrawal is missing
09/12/2020 22:01:04.756 [P2P] error: Peer timed out waiting for response to packet 0247dae0-3a6a-11eb-b14d-eda7b8506247
09/12/2020 22:01:04.758 [P2P] debug: Peer 02e08f9ac1e61267484e1464829840c19f5223728887c6a2a58ac6bb3926c296c6 (TinyAhead): closing socket. reason: ResponseStalling
09/12/2020 22:01:04.760 [ORDERBOOK] debug: removed all orders for peer 02e08f9ac1e61267484e1464829840c19f5223728887c6a2a58ac6bb3926c296c6 (TinyAhead)
09/12/2020 22:01:04.761 [P2P] debug: attempting to reconnect to a disconnected peer 02e08f9ac1e61267484e1464829840c19f5223728887c6a2a58ac6bb3926c296c6 (TinyAhead)
09/12/2020 22:01:04.762 [P2P] debug: creating new outbound socket connection to 27t6lfnrv64mn2wqwwwrrxi4jhq2mruooq6j54jruarblfhxi25us5yd.onion:18885
09/12/2020 22:01:08.797 [P2P] debug: Connected pre-handshake to 02e08f9ac1e61267484e1464829840c19f5223728887c6a2a58ac6bb3926c296c6@27t6lfnrv64mn2wqwwwrrxi4jhq2mruooq6j54jruarblfhxi25us5yd.onion:18885
09/12/2020 22:01:09.073 [P2P] debug: Peer 02e08f9ac1e61267484e1464829840c19f5223728887c6a2a58ac6bb3926c296c6@27t6lfnrv64mn2wqwwwrrxi4jhq2mruooq6j54jruarblfhxi25us5yd.onion:18885 session in-encryption enabled
09/12/2020 22:01:09.204 [P2P] debug: Peer 02e08f9ac1e61267484e1464829840c19f5223728887c6a2a58ac6bb3926c296c6 (TinyAhead) session out-encryption enabled
09/12/2020 22:01:09.204 [P2P] verbose: opened connection to 02e08f9ac1e61267484e1464829840c19f5223728887c6a2a58ac6bb3926c296c6 (TinyAhead) at 27t6lfnrv64mn2wqwwwrrxi4jhq2mruooq6j54jruarblfhxi25us5yd.onion:18885
09/12/2020 22:01:09.723 [P2P] verbose: received 3 nodes (0 new) from 02e08f9ac1e61267484e1464829840c19f5223728887c6a2a58ac6bb3926c296c6 (TinyAhead)
09/12/2020 22:18:20.434 [P2P] debug: received swapRequest from 030326129d4d828d54cbe898f34e3c75bcef21bd0fbbddf1e273af5dd70ac121ff (ClarifyMad): {"proposedQuantity":75000000,"pairId":"ETH/BTC","orderId":"5142e6b0-3a6c-11eb-b14d-eda7b8506247","rHash":"ae8ca00246e70b263bc804a43caf21275025e176fe25f845fb3c24f87606c464","takerCltvDelta":200}
09/12/2020 22:18:20.456 [SWAPS] debug: trying to accept deal: {"quantity":75000000,"localId":"1]","price":0.0001,"isBuy":false} from xudPubKey: 030326129d4d828d54cbe898f34e3c75bcef21bd0fbbddf1e273af5dd70ac121ff
09/12/2020 22:18:20.457 [SWAPS] debug: New deal: {"rHash":"ae8ca00246e70b263bc804a43caf21275025e176fe25f845fb3c24f87606c464","pairId":"ETH/BTC","proposedQuantity":75000000,"orderId":"5142e6b0-3a6c-11eb-b14d-eda7b8506247","price":0.0001,"isBuy":false,"quantity":75000000,"makerAmount":7500,"takerAmount":75000000,"makerCurrency":"BTC","takerCurrency":"ETH","makerUnits":7500,"takerUnits":750000000000000000,"takerCltvDelta":200,"takerPubKey":"vector5Gk59YNTttBgLtYGtbnBg42s9tFZrs8qtyB8hZTznJ5BYzTtKA","destination":"vector5Gk59YNTttBgLtYGtbnBg42s9tFZrs8qtyB8hZTznJ5BYzTtKA","peerPubKey":"030326129d4d828d54cbe898f34e3c75bcef21bd0fbbddf1e273af5dd70ac121ff","localId":"1]","phase":0,"state":0,"role":1,"createTime":1607552300457}
09/12/2020 22:18:20.809 [SWAPS] debug: got ETH block height of 7691917
09/12/2020 22:18:20.813 [SWAPS] debug: found route to taker with total lock duration of 101 ETH blocks (~0h)
09/12/2020 22:18:20.817 [SWAPS] debug: calculated lock buffer for first leg: 22 BTC blocks (~4h)
09/12/2020 22:18:20.817 [SWAPS] debug: lock delta for final hop to maker: 62 BTC blocks (~10h)
09/12/2020 22:18:20.828 [LND-BTC] debug: added invoice of 7500 for ae8ca00246e70b263bc804a43caf21275025e176fe25f845fb3c24f87606c464 with cltvExpiry 62
09/12/2020 22:18:20.832 [SWAPS] debug: Setting SwapAccepted phase for deal ae8ca00246e70b263bc804a43caf21275025e176fe25f845fb3c24f87606c464
09/12/2020 22:18:20.835 [SWAPS] debug: sending swap accepted packet: {"rHash":"ae8ca00246e70b263bc804a43caf21275025e176fe25f845fb3c24f87606c464","makerCltvDelta":62,"quantity":75000000} to peer: 030326129d4d828d54cbe898f34e3c75bcef21bd0fbbddf1e273af5dd70ac121ff
09/12/2020 22:18:22.457 [LND-BTC] debug: accepted htlc for invoice ae8ca00246e70b263bc804a43caf21275025e176fe25f845fb3c24f87606c464
09/12/2020 22:18:22.459 [SWAPS] debug: Executing maker code to resolve hash
09/12/2020 22:18:22.459 [SWAPS] debug: Setting SendingPayment phase for deal ae8ca00246e70b263bc804a43caf21275025e176fe25f845fb3c24f87606c464
09/12/2020 22:18:22.808 [CONNEXT] debug: sending payment of 750000000000000000 with hash 0xae8ca00246e70b263bc804a43caf21275025e176fe25f845fb3c24f87606c464 to vector5Gk59YNTttBgLtYGtbnBg42s9tFZrs8qtyB8hZTznJ5BYzTtKA
09/12/2020 22:18:24.987 [LND-BTC] debug: new channel inbound capacity: 1447389
09/12/2020 22:18:24.988 [LND-BTC] debug: new channel total inbound capacity: 1447389
09/12/2020 22:18:53.418 [CONNEXT] error: received 500 response from /transfers/create: connext server error 500: Internal Server Error
09/12/2020 22:18:53.420 [SWAPS] debug: sendPayment in resolveHash for swap ae8ca00246e70b263bc804a43caf21275025e176fe25f845fb3c24f87606c464 failed due to connext server error 500: Internal Server Error
09/12/2020 22:18:53.434 [CONNEXT] error: received 404 response from /vector5onZWjQHXxLfJDHX27N2QjNbXQBLRDJKM2kwcJY8ceCx73RphY/channels/0xfd8aC4501D217F6625D4765CFDb27D6Ec66e155a/transfers/routing-id/0xa5ec56c571c1a4977a6367dfd9dadd1f283100cfd546f3e64b3de22c13d2ddd4: connext returned not found response
09/12/2020 22:18:53.435 [SWAPS] debug: deal ae8ca00246e70b263bc804a43caf21275025e176fe25f845fb3c24f87606c464 failed in state Active & phase SendingPayment due to UnknownError (ETH): connext server error 500: Internal Server Error
09/12/2020 22:18:53.435 [SWAPS] warn: swap failed due to unknown error: connext server error 500: Internal Server Error
09/12/2020 22:18:53.438 [SWAPS] debug: Sending UnknownError error to peer: {"rHash":"ae8ca00246e70b263bc804a43caf21275025e176fe25f845fb3c24f87606c464","failureReason":12,"errorMessage":"connext server error 500: Internal Server Error"}
09/12/2020 22:18:53.442 [SWAPS] error: could not resolve hash for deal ae8ca00246e70b263bc804a43caf21275025e176fe25f845fb3c24f87606c464: 7.9 - connext server error 500: Internal Server Error
09/12/2020 22:18:53.450 [LND-BTC] debug: canceled invoice for ae8ca00246e70b263bc804a43caf21275025e176fe25f845fb3c24f87606c464
09/12/2020 22:18:53.452 [LND-BTC] debug: deleted invoice subscription for ae8ca00246e70b263bc804a43caf21275025e176fe25f845fb3c24f87606c464
09/12/2020 22:18:54.993 [LND-BTC] debug: new channel inbound capacity: 1454932
09/12/2020 22:18:54.994 [LND-BTC] debug: new channel total inbound capacity: 1454932

connext maker: bad_swap.log

xud_taker:

09/12/2020 22:17:56.053 [CONNEXT] debug: collateral of 0 for ETH is insufficient for order amount 100000000
09/12/2020 22:17:56.060 [RPC] error: call /xudrpc.Xud/PlaceOrder errored with code 9: channel collateralization in progress, please try again in ~1 minute
09/12/2020 22:17:56.340 [CONNEXT] debug: completed collateral request of 1050000000000000000 ETH units
09/12/2020 22:18:07.028 [CONNEXT] debug: new inbound capacity (collateral) for ETH of 105000000
09/12/2020 22:18:20.260 [ORDERBOOK] debug: removed order 5142e6b0-3a6c-11eb-b14d-eda7b8506247 while matching order 71a6fc20-3a6c-11eb-a117-c3f46de8ec2f
09/12/2020 22:18:20.262 [ORDERBOOK] debug: matched with peer 03fe8eed12784d2bc532a6943bd0fb5c86c55b82802650a6f6240df22617689ab1 (MediaSolution), executing swap on taker 71a6fc20-3a6c-11eb-a117-c3f46de8ec2f and maker 5142e6b0-3a6c-11eb-b14d-eda7b8506247 for 75000000
09/12/2020 22:18:20.290 [LND-BTC] debug: found a route to 02f7f77fbda3cb846d8fa747a66aea747270f7f88b5b073ce82981d15b994bf81f for 7500 units with finalCltvDelta 40: 1896933,1,7501,2085606432131383296,2375564,7500,1,1896893,7500000,1007,03f060953bef5b777dc77e44afa3859d022fc1a77c55138deb232ad7255e869c00,true,2085605332627488768,,7500,,1896893,7500000,,02f7f77fbda3cb846d8fa747a66aea747270f7f88b5b073ce82981d15b994bf81f,1007,7501007
09/12/2020 22:18:20.291 [SWAPS] debug: New deal: {"takerCltvDelta":200,"rHash":"ae8ca00246e70b263bc804a43caf21275025e176fe25f845fb3c24f87606c464","orderId":"5142e6b0-3a6c-11eb-b14d-eda7b8506247","pairId":"ETH/BTC","proposedQuantity":75000000,"rPreimage":"c03a09f74a99826c847a7d4839643ae0b647e1f2d1cdfc617bfce8f002cced71","takerCurrency":"ETH","makerCurrency":"BTC","takerAmount":75000000,"makerAmount":7500,"takerUnits":750000000000000000,"makerUnits":7500,"destination":"02f7f77fbda3cb846d8fa747a66aea747270f7f88b5b073ce82981d15b994bf81f","peerPubKey":"03fe8eed12784d2bc532a6943bd0fb5c86c55b82802650a6f6240df22617689ab1","localId":"71a6fc20-3a6c-11eb-a117-c3f46de8ec2f","price":0.0001,"isBuy":false,"phase":0,"state":0,"role":0,"createTime":1607552300291}
09/12/2020 22:18:20.293 [SWAPS] debug: Requesting deal: {"takerCltvDelta":200,"rHash":"ae8ca00246e70b263bc804a43caf21275025e176fe25f845fb3c24f87606c464","orderId":"5142e6b0-3a6c-11eb-b14d-eda7b8506247","pairId":"ETH/BTC","proposedQuantity":75000000,"rPreimage":"c03a09f74a99826c847a7d4839643ae0b647e1f2d1cdfc617bfce8f002cced71","takerCurrency":"ETH","makerCurrency":"BTC","takerAmount":75000000,"makerAmount":7500,"takerUnits":750000000000000000,"makerUnits":7500,"destination":"02f7f77fbda3cb846d8fa747a66aea747270f7f88b5b073ce82981d15b994bf81f","peerPubKey":"03fe8eed12784d2bc532a6943bd0fb5c86c55b82802650a6f6240df22617689ab1","localId":"71a6fc20-3a6c-11eb-a117-c3f46de8ec2f","price":0.0001,"isBuy":false,"phase":0,"state":0,"role":0,"createTime":1607552300291}
09/12/2020 22:18:20.996 [P2P] debug: received swapAccepted from 03fe8eed12784d2bc532a6943bd0fb5c86c55b82802650a6f6240df22617689ab1 (MediaSolution): {"rHash":"ae8ca00246e70b263bc804a43caf21275025e176fe25f845fb3c24f87606c464","quantity":75000000,"makerCltvDelta":62}
09/12/2020 22:18:21.003 [SWAPS] debug: Setting SendingPayment phase for deal ae8ca00246e70b263bc804a43caf21275025e176fe25f845fb3c24f87606c464
09/12/2020 22:18:21.015 [LND-BTC] debug: sending payment of 7500 with hash ae8ca00246e70b263bc804a43caf21275025e176fe25f845fb3c24f87606c464
09/12/2020 22:18:21.878 [LND-BTC] debug: new channel maximum outbound capacity: 1156525
09/12/2020 22:18:21.879 [LND-BTC] debug: new channel inbound capacity: 1163801
09/12/2020 22:18:21.879 [LND-BTC] debug: new channel total outbound capacity: 1156525
09/12/2020 22:18:21.880 [LND-BTC] debug: new channel total inbound capacity: 1163801
09/12/2020 22:18:53.580 [P2P] debug: received swapFailed due to UnknownError from 03fe8eed12784d2bc532a6943bd0fb5c86c55b82802650a6f6240df22617689ab1 (MediaSolution): {"rHash":"ae8ca00246e70b263bc804a43caf21275025e176fe25f845fb3c24f87606c464","errorMessage":"connext server error 500: Internal Server Error","failureReason":12}
09/12/2020 22:18:53.583 [SWAPS] debug: deal ae8ca00246e70b263bc804a43caf21275025e176fe25f845fb3c24f87606c464 failed in state Active & phase SendingPayment due to UnknownError: connext server error 500: Internal Server Error
09/12/2020 22:18:53.584 [SWAPS] warn: swap failed due to unknown error: connext server error 500: Internal Server Error
09/12/2020 22:18:53.589 [ORDERBOOK] error: swap between orders 5142e6b0-3a6c-11eb-b14d-eda7b8506247 & 71a6fc20-3a6c-11eb-a117-c3f46de8ec2f failed due to UnknownError
09/12/2020 22:18:53.591 [ORDERBOOK] warn: swap for 75000000 failed during order matching due to UnknownError, will repeat matching routine for failed quantity
09/12/2020 22:18:53.594 [ORDERBOOK] debug: repeating matching routine for 71a6fc20-3a6c-11eb-a117-c3f46de8ec2f for failed quantity of 75000000
09/12/2020 22:18:53.609 [ORDERBOOK] verbose: no more matches found for order 71a6fc20-3a6c-11eb-a117-c3f46de8ec2f, remaining order will be discarded
09/12/2020 22:18:53.610 [ORDERBOOK] verbose: no more matches found for order 71a6fc20-3a6c-11eb-a117-c3f46de8ec2f, remaining order will be discarded
09/12/2020 22:18:53.615 [CONNEXT] error: received 404 response from /vector5Gk59YNTttBgLtYGtbnBg42s9tFZrs8qtyB8hZTznJ5BYzTtKA/channels/0x7bbaa13d73F35Df7A10FcBF9507EAE46E19D5aAd/transfers/routing-id/0xa5ec56c571c1a4977a6367dfd9dadd1f283100cfd546f3e64b3de22c13d2ddd4: connext returned not found response
09/12/2020 22:18:53.615 [CONNEXT] debug: canceled transfer with rHash ae8ca00246e70b263bc804a43caf21275025e176fe25f845fb3c24f87606c464
09/12/2020 22:18:54.882 [LND-BTC] debug: new channel maximum outbound capacity: 1164027
09/12/2020 22:18:54.883 [LND-BTC] debug: new channel inbound capacity: 1163844
09/12/2020 22:18:54.884 [LND-BTC] debug: new channel total outbound capacity: 1164027
09/12/2020 22:18:54.885 [LND-BTC] debug: new channel total inbound capacity: 1163844

connext_taker: bad_swap.log

erkarl commented 3 years ago

@raladev should be ready to test again. bash ~/xud.sh -b feat/connext-testnet

erkarl commented 3 years ago

@raladev I've bumped the vector_node to 0.0.37 version (for some reason the testnet router node was already running 0.0.37) and rebuilt the xud image to include higher channel timeout. With a a fresh environment, I was able to connect to the router.

Could please you give this another go? :pray:

raladev commented 3 years ago

Could please you give this another go?

Got the same problem for withdrawal (https://github.com/ExchangeUnion/xud-docker/pull/819#issuecomment-742095768), i tried to withdraw to my wallet and to another channel wallet - in both cases my funds are disappeared

Balance:
┌──────────┬───────────────┬───────────────────────────────┬────────────────────────────┐
│ Currency │ Total Balance │ Wallet Balance (Not Tradable) │ Channel Balance (Tradable) │
├──────────┼───────────────┼───────────────────────────────┼────────────────────────────┤
│ BTC      │ 0.01240262    │ 0.0024901                     │ 0.00991252                 │
├──────────┼───────────────┼───────────────────────────────┼────────────────────────────┤
│ ETH      │ 0.085         │ 0                             │ 0.085                      │
├──────────┼───────────────┼───────────────────────────────┼────────────────────────────┤
│ LTC      │ 0             │ 0                             │ 0                          │
└──────────┴───────────────┴───────────────────────────────┴────────────────────────────┘
testnet > walletdeposit ETH
{
  "address": "0x93d74A4a81A8979a1676504560212Aa8e901945F"
}
testnet > closechannel ETH --amount 0.020 --destination 0x93d74A4a81A8979a1676504560212Aa8e901945F
{
  "transactionIdsList": [
    "0xf6161ce0db6468ede79457a4088e4227f58da7348ac4e890f74851955bedf95c"
  ]
}
testnet > getbalance

Balance:
┌──────────┬───────────────┬───────────────────────────────┬────────────────────────────┐
│ Currency │ Total Balance │ Wallet Balance (Not Tradable) │ Channel Balance (Tradable) │
├──────────┼───────────────┼───────────────────────────────┼────────────────────────────┤
│ BTC      │ 0.01240262    │ 0.0024901                     │ 0.00991252                 │
├──────────┼───────────────┼───────────────────────────────┼────────────────────────────┤
│ ETH      │ 0.065         │ 0                             │ 0.065                      │
├──────────┼───────────────┼───────────────────────────────┼────────────────────────────┤
│ LTC      │ 0             │ 0                             │ 0                          │
└──────────┴───────────────┴───────────────────────────────┴────────────────────────────┘
testnet > closechannel ETH --amount 0.020 --destination 0x27A63CFE2d8F1Ae7fe97252178A275b4d91f3057
{
  "transactionIdsList": [
    "0x9ead063d924427c961fbb8c66deed23ba81c1c595d186c5832db5b2b23d06e86"
  ]
}
testnet > getbalance

Balance:
┌──────────┬───────────────┬───────────────────────────────┬────────────────────────────┐
│ Currency │ Total Balance │ Wallet Balance (Not Tradable) │ Channel Balance (Tradable) │
├──────────┼───────────────┼───────────────────────────────┼────────────────────────────┤
│ BTC      │ 0.01240262    │ 0.0024901                     │ 0.00991252                 │
├──────────┼───────────────┼───────────────────────────────┼────────────────────────────┤
│ ETH      │ 0.045         │ 0                             │ 0.045                      │
├──────────┼───────────────┼───────────────────────────────┼────────────────────────────┤
│ LTC      │ 0             │ 0                             │ 0                          │
└──────────┴───────────────┴───────────────────────────────┴────────────────────────────┘
testnet > getbalance

Balance:
┌──────────┬───────────────┬───────────────────────────────┬────────────────────────────┐
│ Currency │ Total Balance │ Wallet Balance (Not Tradable) │ Channel Balance (Tradable) │
├──────────┼───────────────┼───────────────────────────────┼────────────────────────────┤
│ BTC      │ 0.01240262    │ 0.0024901                     │ 0.00991252                 │
├──────────┼───────────────┼───────────────────────────────┼────────────────────────────┤
│ ETH      │ 0.045         │ 0                             │ 0.045                      │
├──────────┼───────────────┼───────────────────────────────┼────────────────────────────┤
│ LTC      │ 0             │ 0                             │ 0                          │
└──────────┴───────────────┴───────────────────────────────┴────────────────────────────┘
testnet >