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

Support different xud networks #781

Closed
moshababo opened this issue Jan 7, 2019 · 5 comments
Closed

Support different xud networks #781

moshababo opened this issue Jan 7, 2019 · 5 comments
Assignees
Labels
infrastructure lightning Lightning network & lnd integration P1 top priority

Comments

@moshababo
Copy link
Collaborator

At the moment network config property is default to testnet, and its only usage is to derive the lnd macaroon file path.

This property usage need to be extended to support different xud networks (mainnet/testnet/simnet/regnet), where peers from different networks shouldn't be connected.

mainnet and testnet can refer to the underlying blockchains public networks, while simnet can refer to the xud controlled network. I'm not sure about regnet.

Each network will have a distinct value to be used in the wire protocol (following the values in bitcoin), both to identify the packet/peer origin network and as the socket stream delimiter (same as in bitcoin):

Network Magic value
mainnet 0xD9B4BEF9
testnet (bitcoin testnet3) 0x0709110B
simnet 0x12141C16
regnet 0xDAB5BFFA
@moshababo moshababo added this to the 1.0.0-alpha.9 milestone Jan 7, 2019
@kilrau
Copy link
Contributor

kilrau commented Jan 7, 2019

And i believe we need to additionally separate per coin. bitcoin testnet, litecoin testnet, different eth testnets

@kilrau kilrau modified the milestones: 1.0.0-alpha.9, 1.0.0-alpha.10 Feb 20, 2019
@kilrau kilrau assigned moshababo and unassigned kilrau Feb 20, 2019
@kilrau kilrau added lightning Lightning network & lnd integration infrastructure raiden P1 top priority labels Feb 20, 2019
@moshababo
Copy link
Collaborator Author

Suggestions:

  • Associate each node in the database with a specific xud network.
  • Associate our current seed nodes with simnet xud network, instead of testnet, although it’s a public network, because the coins are not testnet coins.
  • Start xud mainnet & testnet networks with empty list of configurable seed nodes.
  • Keep regnet xud network for a private network usage that will have no seed nodes.
  • Set regnet as the default xud network configuration.

And i believe we need to additionally separate per coin. bitcoin testnet, litecoin testnet, different eth testnets

If we’ll allow separation per currency, then xud nodes on the same network might use different underlying blockchains coins, no? I was thinking to allow to configure only the xud network:

  • mainnet (public) - real coins.
  • testnet(public) - pre-defined testnet for each currency (bitcoin: testnet3, litecoin: testnet4, eth: rinkeby).
  • simnet (public) - coins are minted by Exchange Union.
  • regnet (private) - coins are minted by the user.

The respective lnd configuration will be applied / expected.

Let me know what you think.

@kilrau
Copy link
Contributor

kilrau commented Feb 25, 2019

If we’ll allow separation per currency, then xud nodes on the same network might use different underlying blockchains coins, no? I was thinking to allow to configure only the xud network

Actually a global xud network config makes a lot of sense. Otherwise, we might end up with some real coins being swapped for testnet coins. xud in testnet mode should be 100% sure to only connect to and swap with other testnet xud.

  • mainnet (public) - real coins.
  • testnet(public) - pre-defined testnet for each currency (bitcoin: testnet3, litecoin: testnet4, eth: rinkeby).
  • simnet (public) - coins are minted by Exchange Union.
  • regnet (private) - coins are minted by the user.

The respective lnd configuration will be applied / expected.

Sounds good to me! Maybe ropsten for eth testnet since this seems to be preferred by the raiden team. What do you think? @sangaman

Others:

  • Associate each node in the database with a specific xud network.

Why do we need that? Would you store all in the same node table and then just e.g. read the testnet ones if xud is started in --testnet mode? If so, fine by me. Btw: starting xud will require an argument like --testnet, correct? Like lnd. Without argument: default to simnet (see last answer).

  • Associate our current seed nodes with simnet xud network, instead of testnet, although it’s a public network, because the coins are not testnet coins.

Sounds good!

  • Start xud mainnet & testnet networks with empty list of configurable seed nodes.

That doesn't sound like a very nice UX to me. Configurable yes, but not empty. There should always be some of our nodes in there. And we'll need to do some BD to also get nodes from other entities in there.

  • Keep regnet xud network for a private network usage that will have no seed nodes.

Sounds about right, but see answer below.

  • Set regnet as the default xud network configuration.

I'd prefer simnet to be the default. We are taking some load from the developer to setup & run regnet. Other opinions? @sangaman @offerm

@moshababo
Copy link
Collaborator Author

  • Associate each node in the database with a specific xud network.

Why do we need that? Would you store all in the same node table and then just e.g. read the testnet ones if xud is started in --testnet mode? If so, fine by me.

Yes, or use different tables. Main point is to have a separated p2p discovery for each network.

Btw: starting xud will require an argument like --testnet, correct? Like lnd. Without argument: default to simnet (see last answer).

Yes we can make it similar to that.


  • Start xud mainnet & testnet networks with empty list of configurable seed nodes.

That doesn't sound like a very nice UX to me. Configurable yes, but not empty. There should always be some of our nodes in there. And we'll need to do some BD to also get nodes from other entities in there.

For mainnet, do you want to have our nodes publicly available, but without any coin balance / open orders?


  • Set regnet as the default xud network configuration.

I'd prefer simnet to be the default. We are taking some load from the developer to setup & run regnet. Other opinions?

Sounds fine.

@kilrau
Copy link
Contributor

kilrau commented Feb 26, 2019

For mainnet, do you want to have our nodes publicly available, but without any coin balance / open orders?

Definitely publicly available and used to p2p bootstrap other nodes. We might even have some bots maintaining (real orders) on there.

Yes, or use different tables. Main point is to have a separated p2p discovery for each network.

Ok, both fine!

@kilrau kilrau modified the milestones: 1.0.0-alpha.11, 1.0.0-sprint.12 Mar 25, 2019
@kilrau kilrau modified the milestones: 1.0.0-sprint.12, 1.0.0-sprint.13 Apr 2, 2019
sangaman pushed a commit that referenced this issue Apr 9, 2019
This expands the support for separate XU networks to differentiate
between mainnet, testnet, simnet, and regtest.

- Each node is now associated with a specific XU network
- Mainnet & testnet seed nodes are empty for now

Closes #781.

BREAKING CHANGE: nodes database table & separate databases by network
@ghost ghost removed the in progress label Apr 9, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
infrastructure lightning Lightning network & lnd integration P1 top priority
Projects
None yet
Development

No branches or pull requests

2 participants