on 616e621 help sign in
bridge/README.md
122 lines 3.9 kB history raw
1# bridge
3An application for interacting with Azimuth.
5## Install
7Clone the repo, and use a simple `npm install`.
9## Build
11You can use a `npm run build` to create an optimised static build.
13## Usage
15The build directory needs to be served with a static server; you can use the
16`bridge` script to start serving the site at localhost:5000.
18### Ledger support
20To authenticate and sign transactions with a Ledger, Bridge must be serving
21over HTTPS on localhost. This requires self-signed certificates. You can do
22this via the following:
24* Install [mkcert](https://github.com/FiloSottile/mkcert)
25* Install a local certificate authority via `mkcert -install`
26* In your `bridge` directory, generate a certificate valid for localhost via
27 `mkcert localhost`. This will produce two files: `localhost.pem`, the local
28 certificate, and `localhost-key.pem`, its corresponding private key.
29* Run `python bridge-https.py`
31Bridge will serve to localhost over HTTPS on port 4443
33## Development
35### General notes
37Use `npm run pilot` to get going. This will boot up a Ganache node in
38the background, deploy the Azimuth contracts to it, and fire up a local
39webserver. Bridge will be served on `localhost:3000`.
41Note that one of our dependencies itself depends on a library called
42`handle-thing` which breaks under the Ledger support requirements (see below)
43on node 11.1.0, so make sure you're using some other node version.
45You can use [nvm](https://github.com/creationix/nvm), for example, and do:
47```
48$ nvm install 11.0.0
49$ nvm use v11.0.0
50```
52before running `npm run pilot`.
54### Useful Accounts
56The ecliptic owner is the only account that's able to create galaxies, so
57it's a good place to get started. On the testnet, it's the address:
59```
600x6DEfFb0caFDB11D175F123F6891AA64F01c24F7d
61```
63You can authenticate as it using the following mnemonic:
65```
66benefit crew supreme gesture quantum web media hazard theory mercy wing kitten
67```
69Under that mnemonic, Ganache will also auto-populate the following accounts
70with 100 ETH:
72```
730x6deffb0cafdb11d175f123f6891aa64f01c24f7d
740xd53208cf45fc9bd7938b200bff8814a26146688f
750x7b2a2d51e4d8fac602e20a5f6907ff9fbd88e1fd
760xf48062ae8bafd6ef19cd6cb89db93a0d0ca6ce26
770xf84a77aeb351c49dfa87e805a659d2daddff7606
780x167e357cf8b845370d0d408f9b389b66185b7b5b
790xcbecf3abc9878f07afc851aead2d8f1c436cc71d
800x0afc0c3f4eeea500871f464ca71eef5e54a9af36
810x6d654ef2489674d21aed428e8a4ad8ca4820f125
820x218f6f87683db546ad47a5dc8b480e5a9b694866
83```
85To play around with any of these, authenticate using the same mnemonic, but
86use a custom HD path of `m/44'/60'/0'/0/1`, `m/44'/60'/0'/0/2`, and so on.
88### Initial Development State
90You can also tweak a couple of things to change your development state
91somewhat (say, for example, you want to start on the points list screen, instead
92of having to re-authenticate whenever you make a change or refresh the page):
94* The `.env.development` file contains environment variables that you can
95 provide to the application when it's running in development. You can access
96 them via `process.env.REACT_APP_<whatever>`.
98* The `componentDidMount` method of the Bridge component in `src/Bridge.js`
99 can be tweaked for setting your initial state. You can provide a specific
100 wallet, network type, and so on.
102### HTTPS
104For development, you can enable HTTPS on localhost without a certificate for
105Chrome by pasting the following into the URL bar:
107```
108chrome://flags/#allow-insecure-localhost
109```
111Additionally you need to run with the `HTTPS` environment variable set to
112`true`. Note that `npm run pilot` will handle this automatically.
114### Releases
116To generate a release `.tar.gz` file, use a simple `npm run release`.
118This will pack the build directory together with the `bridge` and
119`bridge-https.py` scripts, and also generate a set of checksums for the build
120directory. You can verify the checksums on e.g. OS X via `shasum -c
121checksums.txt`.