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

client/core: put the core together #120

Merged
merged 2 commits into from
Jan 9, 2020
Merged

client/core: put the core together #120

merged 2 commits into from
Jan 9, 2020

Conversation

buck54321
Copy link
Member

@buck54321 buck54321 commented Jan 8, 2020

This incorporates the db and comms package functionality into client core application. This PR should hopefully add some clarity to the client structure and enable concurrent work. @dnldd can add in order book handling. @JoeGruffins can implement an RPC server that uses the core. I'll start into authentication via web interface.

All the core does right now is list the available markets, but I think future work can be done independently in the following rough categories.

  1. Order book subscription management
  2. Registration and authentication
  3. Order management
  4. Data access

Eventually reconnect handling and match auditing too.

Adds websocket and database handling to the client core.
Copy link
Member

@chappjc chappjc left a comment

Choose a reason for hiding this comment

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

Looks like a solid start to the client core. I'd be glad to get this in ASAP to open the door to parallel client work.

client/core/core.go Outdated Show resolved Hide resolved
client/core/core.go Outdated Show resolved Hide resolved
Logger dex.Logger
// Certs is a mapping of URL to filepaths of TLS Certificates for the server.
// This is intended for accomodating self-signed certificates, mostly for
// testing.
Copy link
Member

Choose a reason for hiding this comment

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

I expect self-signed TLS certs will be used in production for the server's RPC server. I suppose if the op wants to put up a website they would have certificates signed by a CA, but I wouldn't require that.

Copy link
Member Author

Choose a reason for hiding this comment

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

server's RPC server

As in the server in server/comms? If the server doesn't use a CA, wouldn't they need to supply the certificate to every client? I've always assumed operators would get a domain name and use a CA in production, though I could see cases for small groups sharing a certificate for a private DEX.

Copy link
Member

Choose a reason for hiding this comment

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

Right, certificate being provided to the client directly from the server operator, perhaps over a proper web server similar to how https://cspp.decred.org provides the pem cert for the actual CSPP server that listens on a different port. I don't think I would personally use a certificate signed by a CA for the server/comms.Server TLS RPC server. @jrick I'm using CSPP as an example, so perhaps you would have an opinion on whether it would make sense to use a CA signed certificate vs. self-signed as our services have done in the past, or even if it's possible or practical to use a CA for this.

Copy link
Member

Choose a reason for hiding this comment

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

As one example, how would a CA be usable if you wanted to run a service with just an IP address.

ReconnectSync: func() {
go c.handleReconnect(uri)
},
Ctx: c.ctx,
Copy link
Member

Choose a reason for hiding this comment

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

We've gotten even more pushback about this, but we can continue to feel it out. No need to change for the unexported methods of Core I say.

Copy link
Member Author

@buck54321 buck54321 Jan 9, 2020

Choose a reason for hiding this comment

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

This pattern was in client/comms before, just hasn't been updated yet. For core.Core, I've used the runner.Runner interface.

client/core/core.go Outdated Show resolved Hide resolved
Copy link
Member

@JoeGruffins JoeGruffins left a comment

Choose a reason for hiding this comment

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

Just two comments.

client/comms/wsconn_test.go Outdated Show resolved Hide resolved
client/core/core.go Outdated Show resolved Hide resolved
@chappjc chappjc merged commit 0462b1c into decred:master Jan 9, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants