on 92feccf help sign in
bridge/README.md
142 lines 5.0 kB history raw
1# Bridge
3An application for interacting with Azimuth.
5## Usage
7### Requirements
9Python 3.7.2
11### Instructions
131. To use Bridge, [download a release](https://github.com/urbit/bridge/releases) and unzip it (`bridge-$version.zip`).
142. Open up your command line interface (Terminal on MacOS, Command Prompt on Windows).
153. `cd` into the `bridge-$version` directory.
164. Run this command: `python3 -m http.server 5000 --bind 127.0.0.1`
175. You can then use Bridge by navigating to http://localhost:5000 using a web browser.
19### Verify checksums
21To validate your downloaded file's integrity, compare the lines in checksum.txt to SHA-256 hashes of the `bridge-$version` directory's contents.
23- On MacOS: `shasum -a 256 -c checksums.txt .`
24- On Linux: `sha256sum -c checksums.txt .`
25- On Windows: Go into the `build` directory and verify files individually with `CertUtil -hashFile [file_name] SHA256`
27## Development Notes
29### Install / Build
31Clone the repo, and use a simple `npm install`. You can then use a `npm run
32build` to create an optimised static build (serve it with e.g. [serve][serv]).
34### General notes
36For development, use `npm run pilot` to get going after a `npm install`. This
37will boot up a Ganache node in the background, deploy the Azimuth contracts to
38it, and fire up a local webserver. Bridge will be served on `localhost:3000`.
40Note that one of our dependencies itself depends on a library called
41`handle-thing` which breaks under the Ledger support requirements (see below)
42on node 11.1.0, so make sure you're using some other node version.
44You can use [nvm](https://github.com/creationix/nvm), for example, and do:
46```
47$ nvm install 11.0.0
48$ nvm use v11.0.0
49```
51before running `npm run pilot`.
53### Ledger support
55To authenticate and sign transactions with a Ledger, Bridge must be serving
56over HTTPS on localhost. This requires self-signed certificates. You can do
57this via the following:
59* Install [mkcert](https://github.com/FiloSottile/mkcert)
60* Install a local certificate authority via `mkcert -install`
61* In your `bridge` directory, generate a certificate valid for localhost via
62 `mkcert localhost`. This will produce two files: `localhost.pem`, the local
63 certificate, and `localhost-key.pem`, its corresponding private key.
64* Run `python bridge-https.py`
66Bridge will serve to localhost over HTTPS on port 4443
68### Useful Accounts
70The ecliptic owner is the only account that's able to create galaxies, so
71it's a good place to get started. On the testnet, it's the address:
73```
740x6DEfFb0caFDB11D175F123F6891AA64F01c24F7d
75```
77You can authenticate as it using the following mnemonic:
79```
80benefit crew supreme gesture quantum web media hazard theory mercy wing kitten
81```
83Under that mnemonic, Ganache will also auto-populate the following accounts
84with 100 ETH:
86```
870x6deffb0cafdb11d175f123f6891aa64f01c24f7d
880xd53208cf45fc9bd7938b200bff8814a26146688f
890x7b2a2d51e4d8fac602e20a5f6907ff9fbd88e1fd
900xf48062ae8bafd6ef19cd6cb89db93a0d0ca6ce26
910xf84a77aeb351c49dfa87e805a659d2daddff7606
920x167e357cf8b845370d0d408f9b389b66185b7b5b
930xcbecf3abc9878f07afc851aead2d8f1c436cc71d
940x0afc0c3f4eeea500871f464ca71eef5e54a9af36
950x6d654ef2489674d21aed428e8a4ad8ca4820f125
960x218f6f87683db546ad47a5dc8b480e5a9b694866
97```
99To play around with any of these, authenticate using the same mnemonic, but
100use a custom HD path of `m/44'/60'/0'/0/1`, `m/44'/60'/0'/0/2`, and so on.
102### Initial Development State
104You can also tweak a couple of things to change your development state
105somewhat (say, for example, you want to start on the points list screen, instead
106of having to re-authenticate whenever you make a change or refresh the page):
108* The `.env.development` file contains environment variables that you can
109 provide to the application when it's running in development. You can access
110 them via `process.env.REACT_APP_<whatever>`.
112* The `componentDidMount` method of the Bridge component in `src/Bridge.js`
113 can be tweaked for setting your initial state. You can provide a specific
114 wallet, network type, and so on.
116### HTTPS
118For development, you can enable HTTPS on localhost without a certificate for
119Chrome by pasting the following into the URL bar:
121```
122chrome://flags/#allow-insecure-localhost
123```
125In Firefox, you may need to allow connecting to the unsecured local node
126websocket. Do this by going to `about:config` and setting the
127`network.websocket.allowInsecureFromHTTPS` flag to `true`.
129Additionally you need to run with the `HTTPS` environment variable set to
130`true`. Note that `npm run pilot` will handle this automatically.
132### Releases
134To generate a release `bridge-$VERSION.zip` file, use a simple `npm run
135release`.
137This will pack the build directory together with the README, `bridge-https.py`
138script, and also generate a set of checksums for the build directory. You can
139verify the checksums on e.g. OS X via `shasum -c checksums.txt`.
141[rele]: https://github.com/urbit/bridge/releases/latest
142[serv]: http://npmjs.com/package/serve