on master help sign in
Merge pull request #169 from urbit/feat/stub-env

stub env with environment variable, update README

commit39cf89d152b489155b5e326659e698208cd4be10 authorMatt Condon <mattgcondon@gmail.com> dateMon 17 Jun 2019, 16:52 (7 years ago) parent5988a8af88853f
3 files changed+17−15
.env.development+1 README.md+15−14 src/bridge/Bridge.js+1−1
.env.development+1
@@ -2,3 +2,4 @@ REACT_APP_DEV_MNEMONIC='benefit crew supreme gesture quantum web media hazard th
22REACT_APP_DEV_GALAXY_TICKET='~wacfus-dabpex-danted-mosfep-pasrud-lavmer-nodtex-taslus-pactyp-milpub-pildeg-fornev-ralmed-dinfeb-fopbyr-sanbet-sovmyl-dozsut-mogsyx-mapwyc-sorrup-ricnec-marnys-lignex'
33REACT_APP_ROPSTEN_KEY='b7d2af9f01534031ba773374f766ef65'
44REACT_APP_HD_PATH="m/44'/60'/0'/0/0"
5+REACT_APP_STUB_LOCAL='false'
README.md+15−14
@@ -52,14 +52,13 @@ To validate your downloaded file's integrity, compare the lines in checksum.txt
5252
5353### Install / Build
5454
55−Clone the repo, and use a simple `npm install`. You can then use a `npm run
56−build` to create an optimised static build (serve it with e.g. [serve][serv]).
55+Clone the repo, and use a simple `npm install`. You can then use a `npm run build` to create an optimised static build (serve it with e.g. [serve][serv]).
5756
5857### General notes
5958
60−For development, use `npm run pilot` to get going after a `npm install`. This
59+For development, use `npm run pilot` to get going after a `npm install`. This
6160will boot up a Ganache node in the background, deploy the Azimuth contracts to
62−it, and fire up a local webserver. Bridge will be served on `localhost:3000`.
61+it, and fire up a local webserver. Bridge will be served on `localhost:3000`.
6362
6463Note that one of our dependencies itself depends on a library called
6564`handle-thing` which breaks under the Ledger support requirements (see below)
@@ -77,7 +76,7 @@ before running `npm run pilot`.
7776### Useful accounts
7877
7978The ecliptic owner is the only account that's able to create galaxies, so
80−it's a good place to get started. On the testnet, it's the address:
79+it's a good place to get started. On the testnet, it's the address:
8180
8281```
83820x6DEfFb0caFDB11D175F123F6891AA64F01c24F7d
@@ -114,13 +113,16 @@ You can also tweak a couple of things to change your development state
114113somewhat (say, for example, you want to start on the points list screen, instead
115114of having to re-authenticate whenever you make a change or refresh the page):
116115
117−* The `.env.development` file contains environment variables that you can
118− provide to the application when it's running in development. You can access
116+- The `.env.development` file contains environment variables that you can
117+ provide to the application when it's running in development. You can access
119118 them via `process.env.REACT_APP_<whatever>`.
120119
121−* The `componentDidMount` method of the Bridge component in `src/Bridge.js`
122− can be tweaked for setting your initial state. You can provide a specific
123− wallet, network type, and so on.
120+- Set `REACT_APP_STUB_LOCAL='true'` in `.env.development` to enabled stubbing of
121+ certain methods throughout the app.
122+
123+- The top of the Bridge component in `src/Bridge.js` can be tweaked for setting
124+ your initial state. You can provide a specific wallet,
125+ network type, and so on.
124126
125127### HTTPS
126128
@@ -136,15 +138,14 @@ websocket. Do this by going to `about:config` and setting the
136138`network.websocket.allowInsecureFromHTTPS` flag to `true`.
137139
138140Additionally you need to run with the `HTTPS` environment variable set to
139−`true`. Note that `npm run pilot` will handle this automatically.
141+`true`. Note that `npm run pilot` will handle this automatically.
140142
141143### Releases
142144
143−To generate a release `bridge-$VERSION.zip` file, use a simple `npm run
144−release`.
145+To generate a release `bridge-$VERSION.zip` file, use a simple `npm run release`.
145146
146147This will pack the build directory together with the README, `bridge-https.py`
147−script, and also generate a set of checksums for the build directory. You can
148+script, and also generate a set of checksums for the build directory. You can
148149verify the checksums on e.g. OS X via `shasum -c checksums.txt`.
149150
150151[rele]: https://github.com/urbit/bridge/releases/latest
src/bridge/Bridge.js+1−1
@@ -26,7 +26,7 @@ const kInitialNetworkType = isDevelopment
2626 : NETWORK_TYPES.MAINNET;
2727
2828// NB(shrugs): modify these variables to change the default local state.
29−const shouldStubLocal = false;
29+const shouldStubLocal = process.env.REACT_APP_STUB_LOCAL;
3030const kIsStubbed = isDevelopment && shouldStubLocal;
3131const kInitialRoutes = kIsStubbed
3232 ? [