Skip to content
This repository has been archived by the owner on Nov 15, 2021. It is now read-only.

Wallet & np-api-server issues #1020

Open
5 tasks done
jseagrave21 opened this issue Sep 21, 2019 · 2 comments
Open
5 tasks done

Wallet & np-api-server issues #1020

jseagrave21 opened this issue Sep 21, 2019 · 2 comments

Comments

@jseagrave21
Copy link
Contributor

jseagrave21 commented Sep 21, 2019

Current behavior

When initializing np-api-server with a wallet,

  • 1. If the wallet does not exist, program does not automatically exit after displaying "Wallet file not found". The user must use "CTRL-C" to exit.

  • 2. If the wrong password is entered, "CTRL-C" does not initialize a shutdown, regardless of the number of times it is entered. A hard shutdown of the program is required.

  • 3. If the action is canceled before a password is entered, after "Wallet opening cancelled" is displayed, "CTRL-C" does not initialize a shutdown, regardless of the number of times it is entered. A hard shutdown of the program is required.

  • 4. Once the user successfully enters the wallet password, "CTRL-C" does not initialize a shutdown, regardless of the number of times it is entered. A hard shutdown of the program is required, which could corrupt the open databases.

  • NOTE: Similar behavior to issues 1-3 is exhibited when incorrectly setting minpeers and maxpeers.

Expected behavior

For issues 1-3, the program should automatically exit. For issue 4, "CTRL-C" should initialize a shutdown like it normally does.

How to reproduce

Initialize np-api-server as you normally would (i.e. np-api-server --privnet --port-rpc 20332 --port-rest 8080 --wallet <wallet path>) and try each of the scenarios listed above.

Your environment

Let us know in what environment you're running into the issue:

  • OS: Windows 10 Ubuntu 18.04
  • neo-python version: neo-python v0.9.2-dev
  • Python version: Python 3.7.0b3
@ixje
Copy link
Member

ixje commented Sep 23, 2019

Another issue I found while looking at your PR is:
When your privatenet database is different from the one you're connecting to (e.g. because you restarted your docker image or single node) then you used to get a warning saying

Chain database in Chains/privnet is for a different private network than the current container. Consider deleting the Chain directory with 'rm -rf /Users/user/.neopython/Chains/privnet*'.

Now it is silently muted and requires a ctrl+c. It can be fixed by changing

elif args.privnet:
settings.setup_privnet()

to

    elif args.privnet:
        try:
            settings.setup_privnet()
        except PrivnetConnectionError as e:
            print(e)
            raise SystemExit

@ixje ixje added the bug label Sep 23, 2019
@ixje
Copy link
Member

ixje commented Sep 23, 2019

I provided a solution for issue 4 in your PR

jseagrave21 pushed a commit to jseagrave21/neo-python that referenced this issue Sep 24, 2019
jseagrave21 pushed a commit to jseagrave21/neo-python that referenced this issue Sep 24, 2019
- restore warning in case privatenet database is different from the one you're connecting to (e.g. because you restarted your docker image or single node)
ixje pushed a commit that referenced this issue Sep 30, 2019
* add automatic system exits
- for all return cases when setting minpeers and maxpeers
- for all return cases when opening a wallet

* update Changelog

* fix Changelog

* update per #1021 (comment)
- resolves issue 4 from #1020

* closed wallet user alert
- housekeeping

* update per #1020 (comment)
- restore warning in case privatenet database is different from the one you're connecting to (e.g. because you restarted your docker image or single node)

* update Changelog
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

2 participants