-
Notifications
You must be signed in to change notification settings - Fork 214
Print error message when passing a non-existant socket path in the PAB #323
Conversation
let priorContract :: (SomeBuiltinState a, Wallet.ContractInstanceId, ContractActivationArgs a) | ||
priorContract = (s, cid, args) | ||
pure priorContract | ||
runConfigCommand |
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.
Changes in this function are only formatting
f705402
to
b1acd56
Compare
@bwbush This works for you as well? Since we print the information on the tip of the cardano using the socket, it will depend wheter the socket file doesn't exist. |
b1acd56
to
e72e60a
Compare
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 changes are okay, but they don't fix the problem.
When I run plutus-pab-executables
with a valid socket, I get
[nix-shell:plutus-apps.PR323/plutus-pab-executables]$ git log -n 1 --oneline
e72e60adf (HEAD -> kll-pab-invalid-socket-path, origin/kll-pab-invalid-socket-path) Print error message when passing a non-existant socket path in the PAB
[nix-shell:plutus-apps.PR323/plutus-pab-executables]$ cabal run exe:plutus-pab-examples -- webserver --config marlowe-pab.yaml
Up to date
[pab:Info:19] [2022-02-23 18:01:41.21 UTC] Restoring PAB state ...
[pab:Info:19] [2022-02-23 18:01:41.21 UTC] No contract instance were restored in the PAB state.
[pab:Info:19] [2022-02-23 18:01:41.21 UTC] Starting PAB backend server on port 9080
Current block: 95. Current slot: 127678
Current block: 97. Current slot: 161191
Current block: 252. Current slot: 363718
^C
but when I remove the socket file, I get continuing silence and no error message:
[nix-shell:plutus-apps.PR323/plutus-pab-executables]$ rm node.socket
[nix-shell:plutus-apps.PR323/plutus-pab-executables]$ cabal run exe:plutus-pab-examples -- webserver --config marlowe-pab.yaml
Up to date
[pab:Info:19] [2022-02-23 18:01:51.92 UTC] Restoring PAB state ...
[pab:Info:19] [2022-02-23 18:01:51.92 UTC] No contract instance were restored in the PAB state.
[pab:Info:19] [2022-02-23 18:01:51.92 UTC] Starting PAB backend server on port 9080
^C
This needs to pass several test cases:
- Success: the socket file is connected to a running node.
- Failure: the socket file exists but is not connected to a running node.
- Failure: the socket file does not exist.
e72e60a
to
917fde8
Compare
@bwbush Oops, I put the code in the wrong place. Should be fixed now. |
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.
Works perfectly now!
[nix-shell:plutus-apps.PR323/plutus-pab-executables]$ ln -s ../../networks/private/node.socket
[nix-shell:plutus-apps.PR323/plutus-pab-executables]$ cabal run exe:plutus-pab-examples -- webserver --config ../../networks/private/marlowe-pab.yaml
[pab:Info:19] [2022-02-24 16:26:20.73 UTC] Connecting to Alonzo node with config:
Socket: node.socket
Network Id: Testnet (NetworkMagic {unNetworkMagic = 1564})
Port: 80
Security Param: 2160
The tip of the local node: SlotNo 790305
[pab:Info:19] [2022-02-24 16:26:20.81 UTC] Restoring PAB state ...
[pab:Info:19] [2022-02-24 16:26:20.81 UTC] No contract instance were restored in the PAB state.
[pab:Info:19] [2022-02-24 16:26:20.81 UTC] Starting PAB backend server on port 9080
Current block: 72. Current slot: 105761
^C
[nix-shell:plutus-apps.PR323/plutus-pab-executables]$ rm node.socket
[nix-shell:plutus-apps.PR323/plutus-pab-executables]$ cabal run exe:plutus-pab-examples -- webserver --config ../../networks/private/marlowe-pab.yaml
plutus-pab-examples: Network.Socket.connect: <socket: 74>: does not exist (No such file or directory)
[nix-shell:plutus-apps.PR323/plutus-pab-executables]$ rm node.socket
[nix-shell:plutus-apps.PR323/plutus-pab-executables]$ mkfifo node.socket
[nix-shell:plutus-apps.PR323/plutus-pab-executables]$ cabal run exe:plutus-pab-examples -- webserver --config ../../networks/private/marlowe-pab.yaml
plutus-pab-examples: Network.Socket.connect: <socket: 74>: does not exist (Connection refused)
Fixes #287
Pre-submit checklist: