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

admin/api: RPC commands. #329

Closed
12 of 18 tasks
JoeGruffins opened this issue May 4, 2020 · 8 comments
Closed
12 of 18 tasks

admin/api: RPC commands. #329

JoeGruffins opened this issue May 4, 2020 · 8 comments

Comments

@JoeGruffins
Copy link
Member

JoeGruffins commented May 4, 2020

This issue tracks commands added and needed for operation of the admin server. Any who can, please feel free to update this list directly.

  • ping(): returns "pong"
  • config(): returns the current dex configuration file
  • log(): returns the newest log file
  • accounts(): returns all accounts
  • account(accountID): returns account details
  • ban(accountID): bans an account and returns id/time
  • unban(accountID): unbans an account and returns id/time
  • setFeePaid(accountID): sets an account as paid and returns id/time
  • notify(accountID, msgStr, severity): send a notification to client
  • notifyAll(msgStr, severity): send a notification to all clients
  • orders(marketID): returns all orders for a market
  • order(orderID): returns order details
  • match(matchID): returns order details
  • cancelorder(orderID): cancel's an order and returns id/time
  • markets(): returns market stats
  • suspendMarket(marketID, optional: time): suspends all activity in a market until time or indefinitely
  • resumeMarket(marketID): resumes a suspended market
  • reloadMarket(marketID): reloads market details from markets.json for marketID. can only be called while market is suspended
@JoeGruffins
Copy link
Member Author

ideas:

  • System wide notifications. For example, before shutting down a market, or the server.
  • banning/unbanning users
  • user stats
  • market stats
  • particular trade stats
  • retrieve server log file (as a convinience, not really needed though)

Not sure if these should be allowed or are worth implementing. Maybe better to require these be done manually by altering the markets.json file after shutting down the server for complexity's sake.

  • Shut down certain markets, in order to update their parameters, or remove them.
  • Adding markets.
  • Removing markets.
  • Updating market parameters.

@chappjc
Copy link
Member

chappjc commented May 4, 2020

  • ban/unban accounts
  • fee override / set paid
  • manually cancel (revoke) orders - may be needed if there is a bug that causes lingering orders in whatever state, not just booked orders, as this keeps coins locked. A coin lock/unlock function might also be practical even if it should not be necessary.
  • suspend (w/ persist book option, and maybe resume time option)
  • get order data
  • get user data (status, booked order counts per market, completed orders, etc.)
  • get match/swap data (by match id [1] and by order id [N])
  • reload market settings (identifying what has changed and reconciling with what is running/suspended/created/removed). This one is not trivial. Some more below.

There is some discussion going on about market suspend, resume, and config changes. I've drafted #287 starting with market suspend, either indefinite (like a shutdown but for markets, not the whole process) or with a resume time. The resume time idea is something that I foresee being useful for investigating market issues but do not necessarily want to change any parameters or stop it entirely. But maybe this kind of resume will not prove useful in practice, or a separate resume command will be better.

I think changing market parameters without stopping dcrdex would be done by suspending/halting a market with no resume, thus stopping the market's Run goroutine, and then signaling dcrdex to reload markets.json. Adding and removing markets would be done by the same mechanism I think.

@JoeGruffins
Copy link
Member Author

Notes about accounts endpoint from @chappjc :

Suggestions for future work:
and endpoint account/{accountid}
active order count (just the count) and active swaps list (match IDs)
maybe further details in endpoints like account/{accountid}/swaps

@JoeGruffins
Copy link
Member Author

There are some complications to adding a setfeepaid endpoint. One is that it is only useful if a client has already attempted to pay and that for some reason failed. A client is added during register, which requires a fee payment attempt. Another is that the client must be listening for the fee notification in order to save the registration proof. So, adding setfeepaid may require changes in the client as well.

@JoeGruffins
Copy link
Member Author

notifyall added but does not inclued a severity option. Severity is currently set to db.Warning level.

@JoeGruffins
Copy link
Member Author

I believe orders and matches provides all the info we have on an order or match, and one could use jq to pinpoint the order or match they need. Maybe still want the singular returns as well though?

@chappjc
Copy link
Member

chappjc commented Nov 30, 2020

The singular returns will be helpful. Also, another TODO that came up in your latest admin PR is returning the decoded swap and redeem txns with the match data. This might only for matches by account, or a singular match query.

@ukane-philemon
Copy link
Contributor

A lot of Todo here, however seems most if not all of this have been taken care of?

@chappjc chappjc closed this as completed Mar 12, 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

No branches or pull requests

3 participants