verifiablesoftware / vsw

Core project of VerifiableSoftware
Apache License 2.0
1 stars 0 forks source link

vsw returns prematurely #98

Closed wenjing closed 3 years ago

wenjing commented 3 years ago

version 0.0.10

When "vsw setup -n wallet-name" returns to OS prompt, the user may immediately enter the next vsw command. The vsw is returning before vsw-agent is fully functioning. This can cause error. Here is one such example. I think the correct behavior should be that the controller waits (or makes an adminAPI test) until it's sure that the agent is ready, then returns to the user.

root@bc05ac57d34e:/# vsw setup -n wallet1
Please enter wallet key: 2021-05-21 06:30:52 vsw.commands.setup INFO /usr/local/lib/python3.6/dist-packages/vsw/commands/setup.py seed:251d2c6efccf4b5e9aaf84bf05f52c1c 2021-05-21 06:30:52 vsw.commands.setup INFO /usr/local/lib/python3.6/dist-packages/vsw/commands/setup.py genesis_file: /usr/local/lib/python3.6/dist-packages/vsw/conf/genesis.txt 2021-05-21 06:30:52 vsw.commands.setup INFO /usr/local/lib/python3.6/dist-packages/vsw/commands/setup.py seed:251d2c6efccf4b5e9aaf84bf05f52c1c root@bc05ac57d34e:/# root@bc05ac57d34e:/# Public DID: W5rN1RzRH355C7xsWNdN7u Verkey: GrPgtsTyWNZkFFN6FygdGyrv334JLisVaAHUdFq7Jh81

root@bc05ac57d34e:/# root@bc05ac57d34e:/# root@bc05ac57d34e:/# root@bc05ac57d34e:/# root@bc05ac57d34e:/# root@bc05ac57d34e:/# root@bc05ac57d34e:/# vsw list -c 2021-05-21 06:31:11 vsw.commands.list ERROR /usr/local/lib/python3.6/dist-packages/vsw/commands/list.py Failed to execute list: HTTPConnectionPool(host='127.0.0.1', port=8021): Max retries exceeded with url: /connections (Caused by NewConnectionError('<urllib3.connection.HTTPConnection object at 0x7fade9100f98>: Failed to establish a new connection: [Errno 111] Connection refused',)) root@bc05ac57d34e:/# root@bc05ac57d34e:/# :::::::::::::::::::::::::::::::::::::::::::::: :: vsw-agent :: :: :: :: :: :: Inbound Transports: :: :: :: :: - http://127.0.0.1:8020 :: :: :: :: Outbound Transports: :: :: :: :: - http :: :: - https :: :: :: :: Public DID Information: :: :: :: :: - DID: W5rN1RzRH355C7xsWNdN7u :: :: :: :: Administration API: :: :: :: :: - http://127.0.0.1:8021 :: :: :: :: ver: 0.0.2 :: ::::::::::::::::::::::::::::::::::::::::::::::

Listening...

root@bc05ac57d34e:/# root@bc05ac57d34e:/# root@bc05ac57d34e:/# root@bc05ac57d34e:/# vsw list -c {'results': []} root@bc05ac57d34e:/#

wenjing commented 3 years ago

Verified fix in 0.0.16