-
Notifications
You must be signed in to change notification settings - Fork 102
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: register dex account #140
Conversation
Nice, easy PR test instructions, thanks! I ran into the no cookie panic issue again though dcrdex/client/webserver/webserver.go Lines 334 to 343 in 6a76450
Looks like the nil and http.ErrNoCookie cases are swapped. |
Despite being in draft I just had to test this, with the great instructions and all. :) Anyway, to summarize our Matrix discussions from this morning, I was able to get it all working as described despite a couple failed attempts. One issue that was likely creating a problem was with the {dcr,btc}/harness.sh files were sending commands to the active session:window instead of explicitly specifying which one. This seems to be a problem with the two harness.sh scripts running simultaneously. Other than that, it was just dark mode cookie panic and extra replace statement I mentioned in my comments above. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good.
// txWaitExpiration is the longest the Swapper will wait for a coin waiter. | ||
// This could be thought of as the maximum allowable backend latency. | ||
txWaitExpiration = time.Minute |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Seems very similar to broacast timeout. Would the same value be appropriate here, or maybe a multiple of it?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The similarities are superficial, really. Network latency vs. community conduct. Linking the value to the broadcast timeout doesn't reflect its purpose very well, IMO. Could be an operator-set variable though.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let's make an issue then to track this. I think this PR is g2g.
Adds ability to register new DEX account through the web interface.
core.Core
gets aCreateWallet
method so that the fee-paying Decred exchange wallet can be created.core.Core
also get aRegister
method, that walks through the registration process with the server. This includes negotiation ofconfig
andnotifyfee
routes.Testing with live simnet server
This PR can be tested against a live instance of
dcrdex
on simnet with the following (possibly incomplete) steps.Configure server
Server requires PostgreSQL installed and running. Create a user named
dcrdex
psql -U postgres -c "CREATE USER dcrdex;"
and then create a DEX database
psql -U postgres -c "CREATE DATABASE dcrdex OWNER dcrdex;"
The server must be configured to point to the simnet testing harness nodes for Decred and Bitcoin. You'll need to create two configuration files.
btc/simnet.conf
dcr/simnet.conf
Replace
user
in therpccert
entry with your user name. dextest will be created in your home directory, if it doesn't already exist.Update or create ~/.dcrdex/markets.json so it is minimally
Update the
configPath
entries to point to the config files you just made.Finally, update or create the actual server configuration file at ~/.dcrdex/dcrdex.conf with the simnet harness alpha wallet's extended public key.
Configure Decred wallet
Create the wallet configuration file.
dcr/simnet-w.conf NOTE: Reference
~/dextest/dcr/alpha/w-alpha.conf
generated by the dcr harness.Update the
cafile
path with your system user name.You'll need to tell the wallet where to find the server's TLS certificate. You do that by creating a certs.json file in the
.dexclient
directory.~/.dexc/certs.json (was ~/.dexclient/certs.json)
updating the
.dcrdex
path as necessary.Build web assets
You must have
npm
installed.Go to dcrdex/client/webserver/site/ and run
npm install
, and thennpm run build
.Run the harnesses
In a new terminal, run
harness.sh
in dcrdex/dex/testing/dcr.In yet another terminal, run
harness.sh
in dcrdex/dex/testing/btc.The harnesses can be killed later by running
./quit
in the tmux terminals that are opened.Run the server and client
In yet another terminal, run
go build; ./dcrdex --simnet --debuglevel=trace
from the dcrdex repo directory.In yet another terminal, run
go build; ./dexc --simnet --notui --web --log trace
from the dcrdex/client/cmd/dexc directory.Register
Go to http://127.0.0.1:5758 in a browser on the same system. Complete the registration form with the following fields
DEX Address: https://127.0.0.1:7232
Create DEX Password: anything you want
Decred Wallet Config Filepath.: /path/to/simnet-w.conf
Decred Wallet Account Name: default
Decred Wallet Password: 123
Submit the form. If everything goes correctly, you should be sent to the markets page, which will show the single DCR-BTC market, but no order book data to show obviously
You should also have a notification. Click on the bell to read it.
The registration process is actually waiting on a confirmation. Go to the Decred tmux simnet harness and run
./alpha generate 1
. Back in your web browser, you should see another notification now confirming completion of the registration process.* tested on Chrome and Firefox