Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: use xud default ports like 8886, 18886, 28886 #395

Merged
merged 5 commits into from
Apr 20, 2020

Conversation

reliveyy
Copy link
Collaborator

@reliveyy reliveyy commented Apr 9, 2020

This PR let xud image use ports 8885, 8886, 8887, 8080 for mainnet; 18885, 18886, 18887, 8080 for testnet; and 28885, 28886, 28887, 8080 for simnet.

Closes #380
Reopen previous PR #383

@reliveyy reliveyy requested a review from kilrau April 9, 2020 22:38
@reliveyy reliveyy self-assigned this Apr 9, 2020
sed -i "s/<onion_address>/$XUD_ONION_ADDRESS/g" ~/.xud/xud.conf
}
echo "xud.conf not found - creating a new one..."
cp /app/sample-xud.conf $XUD_CONF
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why??? You shouldn't create any xud.conf file because this would overwrite defaults in future when we change them on xud side! We always want to use xud defaults so you can't hardcode them.

You can pull the current xud defaults from the sample config files here: https://github.com/ExchangeUnion/xud-docker/tree/master/images/utils/launcher/config, I am maintaining them there.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We create xud.conf to config xud for a long history. And this config file is updated when xud image updated. And I do modify sample-xud.conf from xud source. I'm not sure about your concerning.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just don't create it, it will cause troubles overwriting things. We had that in multiple places before. xud has default values without any config and we assume these.

Copy link
Collaborator Author

@reliveyy reliveyy Apr 10, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We used to use command line options to customize xud configuration at the very beginning like other nodes. But later we changed to xud.conf file. So we are going to change it back? I remember we use this xud.conf becuase it's easy to change xud configuration by just editing host data/xud/xud.conf file and restarting xud container. And in case of xud container upgrading with old xud.conf file, we do override this file everytime. But if you specify --xud.preserve-config you could remain the old config file.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let's have a call.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Here is a full list of what we changed from sample-xud.conf:

  • network
  • http.host
  • http.port
  • lnd.BTC.host
  • lnd.BTC.certpath
  • lnd.LTC.host
  • lnd.LTC.port
  • lnd.LTC.certpath
  • p2p.addresses
  • p2p.port
  • p2p.tor
  • p2p.torport
  • raiden.host
  • raiden.keystorepath
  • rpc.host
  • rpc.port

I think we can leave http.port, p2p.port and rpc.port out becuase there is no change to their default value now.

Copy link
Collaborator Author

@reliveyy reliveyy Apr 14, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Since these 3 options are in sample-xud.conf. And their values are for simnet. If we want to use default values, we need to delete these 3 options from xud.conf. So I'll leave it as it was.

@reliveyy reliveyy marked this pull request as draft April 10, 2020 12:59
@kilrau
Copy link
Contributor

kilrau commented Apr 11, 2020

Ok all clarified, I'll test once travis tests passed.

@kilrau kilrau mentioned this pull request Apr 11, 2020
@reliveyy
Copy link
Collaborator Author

Currently the xucli create responses with an error:

xud is running and unlocked, try checking its status with 'xucli getinfo'

I think it is related to the lnd error

❯ docker exec testnet_lndbtc_1 lncli -n testnet -c bitcoin getinfo
[lncli] unable to read macaroon path (check the network setting!): open /root/.lnd/data/chain/bitcoin/testnet/admin.macaroon: no such file or directory

@reliveyy reliveyy marked this pull request as ready for review April 14, 2020 05:57
@reliveyy
Copy link
Collaborator Author

reliveyy commented Apr 14, 2020

Currently the xucli create responses with an error:

xud is running and unlocked, try checking its status with 'xucli getinfo'

Resolved. It's becuase I forgot to change noencrypt value to false.

@reliveyy reliveyy requested a review from kilrau April 14, 2020 06:02
@kilrau kilrau added the P2 mid priority label Apr 14, 2020
@kilrau kilrau requested a review from peartobear April 14, 2020 09:16
@kilrau
Copy link
Contributor

kilrau commented Apr 14, 2020

This depends on ExchangeUnion/xud#1462. Can you please run it with this xud branch and see if it works? @reliveyy @peartobear

@peartobear
Copy link

peartobear commented Apr 14, 2020

It is picking up port 18886 when running this branch instead of 8886

Screenshot 2020-04-14 at 3 21 42 PM

@kilrau
Copy link
Contributor

kilrau commented Apr 14, 2020

It is picking up port 18886 when running this branch instead of 8886

Yeah that is correct.. Mainnet - 8886, Testnet 18886, Simnet - 28886. In order for it to work, changes on xud side were required: ExchangeUnion/xud#1462. Since testing without this being merged is complicated, let's wait for @sangaman to get this in first. Once it's in and travis build new images you can test again.

@sangaman
Copy link
Contributor

Are we good to merge ExchangeUnion/xud#1462? It shouldn't cause any issues if we are setting the ports explicitly via xucli, setting --rpcport will work as it currently does.

I do wonder if it makes sense to also use network-specific ports for the grpc web proxy instead of only 8080, but since we're not using that for the time being we can revisit it later.

@kilrau
Copy link
Contributor

kilrau commented Apr 15, 2020

Needs @erkarl to approve to unblock the merge button.

@@ -40,7 +40,14 @@ class Xud(Node):
def __init__(self, name, ctx):
super().__init__(name, ctx)

self._cli = "xucli"
self._cli = None
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is not needed anymore since ExchangeUnion/xud#1462. Please remove @reliveyy

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yep

@kilrau kilrau self-requested a review April 20, 2020 08:05
Copy link
Contributor

@kilrau kilrau left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

One lil typo fix, other than that working as expected. LGTM 💯

Co-Authored-By: Kilian Rausch ⚡️ <kilian.rausch@gmail.com>
@reliveyy reliveyy merged commit aceb72b into master Apr 20, 2020
@reliveyy reliveyy deleted the xud-default-ports branch April 23, 2020 03:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
P2 mid priority
Projects
None yet
Development

Successfully merging this pull request may close these issues.

use xud default ports
4 participants