Skip to content
This repository has been archived by the owner on Mar 12, 2020. It is now read-only.

Latest commit

 

History

History
76 lines (54 loc) · 2.62 KB

DEVELOPMENT.md

File metadata and controls

76 lines (54 loc) · 2.62 KB

Insteall Textile Mobile

To run Textile Mobile in development mode you'll need,

  1. The latest code from this repo + dependencies
  2. The textile-go framework to run a cafe node

Latest Textile Mobile

git clone [email protected]:textileio/textile-mobile.git

Textile Cafe

You can identify the correct cafe version you'll need by inspecting the /package.json file to see the @textile/go-mobile version number.

You can either clone/checkout the appropriate commit associated with that release or download the release built for your hardware. You can find the release here, textile-go releases

Start your daemon

If you are running the Textile command line for the first time, use this Quick Start guide.

Run a Cafe

Now that you've started your daemon, modify it to run in Cafe mode and restart it. See here for instructions

At the same time, you can capture your API and Cafe addresses from the textile config file. They should look like,

    "Addresses": {
        "API": "127.0.0.1:40600",
        "CafeAPI": "127.0.0.1:40601",
        "Gateway": "127.0.0.1:5050"
    },

You'll need these to modify your .env to run the mobile app in development mode.

Run app in development mode

  1. Install all dependancies with yarn
  2. Launch your Textile cafe (see above)
  3. Modify your .env file to match your cafe details (see below)
  4. Finally, run react-native start and launch the app in the simulator of your choice. You can launch the app using one of hte IDEs or directly using react-native run-ios or react-native run-android

Creating your .env file

You should store a file called, .env in the root of your Textile Mobile folder. It should look like,

RN_TEXTILE_CAFES_JSON="base64 encoded Cafe[] JSON"
RN_TEXTILE_GATEWAY_URL="http://{gateway-address}"
RN_TEXTILE_CAMERA_ROLL_THREAD_KEY="photos-camera_roll"
RN_TEMPORARY_REFERRAL="SOMETHING"
RN_URL_SCHEME="textile-dev"
RN_IOS_STORE_LINK="https://<ios store link>"
RN_ANDROID_STORE_LINK="https://<android store link>"

RN_TEXTILE_CAFES_JSON should be the base64 encoded contents of a json file similar to:

[
  {
    "name": "A display name",
    "peerId": "a-peer-id",
    "token": "a-cafe-token"
  },
  {
    "name": "Another display name",
    "peerId": "another-peer-id",
    "token": "another-cafe-token"
  }
]

The gateway-address (including port) and information to fill out the above json object should be found in the Cafe setup step above.