TBD54566975 / web5-wallet

A reference implementation of a web5 wallet in react native
Apache License 2.0
13 stars 8 forks source link
web5

Web5 Wallet

Built with React Native and Expo

Application Setup

Note that most things are not installed using Homewbrew. Homebrew is nice for personal projects but doesn't scale well for teams.

Installation prerequisites:

Installation steps:

  1. Run corepack enable to turn on corepack for this node version if you haven't already turned it on.

  2. Run corepack install to install yarn pkg manager

  3. Run yarn to install node_modules

    Note, if you encounter the following error:

    "Internal Error: Error when performing the request to https://registry.npmjs.org/yarn;

    Check to see if you are running a VPN that blocks this URL, if so, disable the VPN and try again.

  4. From root repo directory, run:

    cd ios then bundle install

  5. From root repo directory, run:

    cd android the bundle install

  6. In the root repo directory run yarn pods to install CocoaPods

    Note: if you encounter the error below:

    [!] CocoaPods could not find compatible versions for pod "hermes-engine"

    You will need to run the following command to update hermes-engine version in Podfile.lock file in the ios directory as suggested in the full error message:

    pod update hermes-engine --no-repo-update

  7. Install XCode with the latest SDK if necessary

  8. Install Android Studio with the latest SDK if necessary

The project should now be ready to run.

First start the Metro Bundler:

yarn start

To Run iOS: Inside the ios folder, open the .xcworkspace and run the build (click the "play" button).

To Run Android: Open the android folder in Android Studio and run the build.

Debugging

The application can be debugged through VSCode

  1. Download the Expo Tools VSCode Extension.
  2. Use the "Run and Debug" menu in VSCode to run the script "Debug Expo App."
  3. Fire up a simulator so that the session attaches to the debugger.
  4. Set your breakpoints as needed.

    Caution: Reused breakpoints don't work. Make sure to clear breakpoints in between sessions.

Alternative Method

If you are having trouble getting the above method to work. Consider the alternative method below.

Start Metro Bundler with:

npx react-native start --experimental-debugger

Then you can launch the debugger by triggering the Dev Menu in the app (e.g. by pressing d in the Metro Bundler terminal) then choosing the "Open Debugger" option, this will launch the debugger in the browser.

Troubleshooting install

Further troubleshooting install