sunshine-protocol / sunshine-keybase-ui-old

Flutter ui for sunshine-keybase
Apache License 2.0
2 stars 0 forks source link

Sunshine Identity Demo #7

Open 4meta5 opened 4 years ago

4meta5 commented 4 years ago

Running the APP

These are the directions for running the Sunshine Identity app in iOS emulator on MacOS. To run it on Android, use the directions on the README.

Once substrate releases rc5 (and we update our code to use rc5), the directions on the README will work for iOS as well, but, for now, the following directions are the only way to get it working.

  1. Make a new directory called sunshine-identity-demo and enter it

    $ mkdir sunshine-identity-demo && cd sunshine-identity-demo
  2. Clone the master branch of this repository

    $ git clone https://github.com/sunshine-protocol/sunshine-identity-ui.git
  3. Clone sysinfo locally

    $ git clone https://github.com/GuillaumeGomez/sysinfo.git
  4. Edit sysinfo version (downgrade) in sysinfo/Cargo.toml

    [package]
    name = "sysinfo"
    -version = "0.14.14"
    +version = "0.13.14"
  5. Patch sunshine-identity-ui/Cargo.toml

Place this below the existing workspace metadata in sunshine-identity-ui/Cargo.toml:

[patch.crates-io]
netstat2 = { git = "https://github.com/shekohex/netstat2-rs/", branch = "ios-support" }
sysinfo = { path = "../sysinfo" } # local sysinfo for testing
  1. Enter sunshine-identity-ui and run cargo update

    $ cd sunshine-identity-ui
    $ cargo update
  2. Build the project using cargo make

# in /sunshine-identity-ui
$ cargo make ios-release --profile release

this will take a while, get a cup of coffee or watch a Netflix Movie ;)

Next, run

# in /sunshine-identity-ui
$ cargo make post-ios --profile release
  1. Open the ios simulator from the command line

    $ open -a simulator

    You may also find Simulator and navigate File -> Open Device -> iOS 13.5 -> Iphone SE (this is the device I last tested it on)

  2. Run the flutter app

# in /sunshine-identity-ui
$ flutter run

This should open the Flutter App in your emulator automatically.

Demo Instructions

When the app opens, it will take the client some time to sync. This is because substrate creates empty blocks even when there are no transactions. The app's client is syncing with a live testnet.

Once it is done syncing, click Generate An Account and follow the directions. Behind the scenes, this is generating a unique ID, associating it with your device (device key), and storing your password hash in the local keystore (on the hardware).

Once the account is generated, click on the icon in the top right corner to access your account details.

Upon creating a new account, funds are already minted. This allows you to pay fees to link your github account or perform other demo actions.

To link your github account with your identity, click on the Identities header in the Account Settings. Click on Github and click Create Proof. Follow the directions in the UI and post the provided markdown text in a gist titled sunshine-identity-proof.md publicly from your github account (create gist page).

After posting the gist, tell the UI to look for the proof. Behind the scenes, it is looking for the gist and parsing it to prove signed authorization to link with the github account.