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

testing: Start app with seed. #1398

Merged
merged 2 commits into from
Jan 17, 2022
Merged

Conversation

JoeGruffins
Copy link
Member

@JoeGruffins JoeGruffins commented Jan 10, 2022

rpcserver: Add discoveracct endpoint.

Allows accounts that were previously paid for to be restored. This
should be used as apposed to Register when restoring from seed.

testing: Start app with seed. 

closes #1393

@JoeGruffins JoeGruffins marked this pull request as draft January 11, 2022 06:53
@JoeGruffins
Copy link
Member Author

Something must be missing when restoring an account. Looking into it...

@JoeGruffins
Copy link
Member Author

I believe we need to try and discover the account first. Adding that ability to the rpc server.

@JoeGruffins JoeGruffins force-pushed the startfromseed branch 2 times, most recently from 036d55a to 3a15bd4 Compare January 12, 2022 06:37
@JoeGruffins
Copy link
Member Author

JoeGruffins commented Jan 12, 2022

Did not add the exchange config to result because that can be fetched separately with getdexconfig.

@JoeGruffins JoeGruffins marked this pull request as ready for review January 12, 2022 06:43
@chappjc
Copy link
Member

chappjc commented Jan 12, 2022

I believe we need to try and discover the account first. Adding that ability to the rpc server.

For completeness, this makes sense to add. For the testing harness, I don't believe register would have created errors since it is supposed to discover as well, but I want to verify that you didn't run into an issue there.

@JoeGruffins
Copy link
Member Author

I don't believe register would have created errors

core's Register was giving an error on web login. Something about being unable to create an account bucket. I can look into it if that wasn't expected.

@chappjc
Copy link
Member

chappjc commented Jan 13, 2022

Not expected. You should be able to use Register instead and it will do (remote) account discovery just like DiscoverAccount. The difference between the two is just what happens after it does not find the account, where Register actually spends funds to register. If that's broken, we need to fix it.

Register being unable to create an app bucket sounds like the account existed locally already in the dexc.db.

@chappjc
Copy link
Member

chappjc commented Jan 13, 2022

It still seems to work as I described.

  • setup harness (registering an account)
  • get appseed with dexcctl
  • stop dexc, but keep dcrdex harness running
  • rm ~/.dexc/simnet/dexc.db ~/.dexc/simnet/backup/dexc.db && rm -r ~/.dexc/simnet/assetdb/btc/regtest
  • start dexc again
  • manually init with the seed via dexcctl --simnet -p abc appseed <seed>
  • ./dexcctl -p abc --simnet register 127.0.0.1:17273 100000000 42 ~/dextest/dcrdex/rpc.cert

@JoeGruffins
Copy link
Member Author

and can you login after that?

@chappjc
Copy link
Member

chappjc commented Jan 13, 2022

Well... after doing that it didn't show the DEX on the page. Then I restarted and I can login but it wants me to setup a DEX server. After I hard refreshed the page it showed though.

2022-01-12 19:08:19.822 [DBG] CORE: Authenticated connection to 127.0.0.1:17273, acct 71beeceddf39219fc2d5df285b1919e701d153c2dcfd91af628dc5fa884bd60e, 0 active orders, 0 active matches, score 0 (suspended = false)

@JoeGruffins
Copy link
Member Author

Oh, I clicked a lot of things and was able to get to trading. I was getting stuck at this
image

So, I guess it is an issue that the rpc server isn't setting some value web needs.

@chappjc
Copy link
Member

chappjc commented Jan 13, 2022

Hmm, yeah I think it changes state and the frontend doesn't know to do a fetchUser to get a completely updated state. I had to hard refresh to get it to recognize things

@JoeGruffins
Copy link
Member Author

Well, I guess the rpc endpoint wasn't necessary, although it does let you login right after.

@chappjc
Copy link
Member

chappjc commented Jan 13, 2022

It's good to have for sure. I'm curious why we cannot login right after with Register. We should get to the bottom of that. If we do the dexcctl steps I described prior to opening the browser page, it should let you login.

A couple things appear off. If you don't restart there are no exchanges in the /api/user response. When you do restart it keeps going to /register even though if you go to /markets it's all ready at the exchange registered via register...

@chappjc
Copy link
Member

chappjc commented Jan 13, 2022

@JoeGruffins pls try out #1407 when you are able

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 good. Would you please squash the first two rpcserver commits? I'll merge this PR via rebase with two separate commits, one for the rpcserver and one for the harness.

Allows accounts that were previously paid for to be restored. This
should be used as apposed to Register when restoring from seed.
@JoeGruffins
Copy link
Member Author

Merged the first two.

@chappjc chappjc merged commit d67edbd into decred:master Jan 17, 2022
@chappjc chappjc added this to the 0.5 milestone Apr 21, 2022
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.

testing: Init dexc from seed.
2 participants