Skip to content

Instantly share code, notes, and snippets.

@jeluard
Last active July 25, 2018 07:31
Show Gist options
  • Save jeluard/7611c538887565a9c16429522bdeb8c5 to your computer and use it in GitHub Desktop.
Save jeluard/7611c538887565a9c16429522bdeb8c5 to your computer and use it in GitHub Desktop.

status-cli is a command line whose goal is to simplify developers testing and debugging on status during DApps development.

It offers the following features:

  • listing of running status instances (local emulators or real devices available on same WIFI)
  • deployment of a DApp running on the developer machine
  • update chain used by Status so that local testrpc developer chain is used intead

As much as possible this CLI tool will rely on tools provided by mobile toolchain providers (e.g. adb). Specifically the discovery process should not mandate the inclusion of network stacks in Status itself.

To be discoverable and configurable, a device must have Status running and developer mode enabled.

For security reasons users must confirm command execution on the device itself.

list-devices

Returns a list a devices detected. Can be empty. A configurable timeout ensures this commands does not block too long.

>status-cli list --timeout SECONDS
192.168.0.1
192.168.0.2
...

open-dapp

Opens a DApp from a URL in Status. This DApp can be hosted on dev localhost machine. Necessary port-forwarding is handled automatically.

>status-cli open-dapp URL --ip DEVICE_IP
Proper error code is returned

switch-node

Configure Status to connect to a different node chain. Necessary port-forwarding is handled automatically.

>status-cli switch-node URL --ip DEVICE_IP
Proper error code is returned

ping

Validates all necessary configuration is correct. Also opens a popup on device.

>status-cli ping --ip DEVICE_IP
Proper error code is returned

I am a DApp dev, how does it look like for me ?

  • First install Status on a device (emulator or real). (ONCE ONLY)
  • Recover an account based on testrpc seedphrase, enable developer mode. (ONCE ONLY)
  • Run status-cli list to get its IP
  • Run status-cli switch-node URL --ip IP to connect to local testrpc
  • Run status-cli open-dapp URL --ip IP to open the DApp

Open Questions

Is it required to run on a real device?

Do we want to replicate testrpc accounts in status?

Can we leverage docker to have special Status builds and emulation encapsulated?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment