Skip to content

Commit

Permalink
Merge pull request #296 from EYBlockchain/david/deploy-wallet-testnet
Browse files Browse the repository at this point in the history
David/deploy wallet testnet
  • Loading branch information
Westlad authored Nov 22, 2021
2 parents d969266 + 189a6b9 commit d780068
Show file tree
Hide file tree
Showing 8 changed files with 31 additions and 12 deletions.
11 changes: 10 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -124,13 +124,22 @@ npm run build
./liquidity-provider
```

- Launch wallet.
- Generate wallet
```
cd wallet
npm install
```

- Launch wallet in ganache (localhost)
```
npm start
```

- Launch wallet in localhost connected to testnet deploymen
```
npm run start-ropsten
```

- When the wallet starts, you will have the option to enter your private key on connecting with metamask wallet installed in your browser. If you select the latter, you need to have previously configured your metamask wallet to operate with Nightfall's deployment on localhost

More information can be found [here](https://github.com/EYBlockchain/nightfall_3/wallet/README.md)
Expand Down
4 changes: 3 additions & 1 deletion doc/chain-reorgs.md
Original file line number Diff line number Diff line change
Expand Up @@ -183,4 +183,6 @@ chain 2: propose(H_p), ...propose(H_r), ...propose(H_n), ...propose(H_m)

First of all, removal events will be received. This will remove the respective `proposeBlock` calls (`H'_q...H'_t`) from the L2 database (or,
more accurately it will set their L1 block number to null). Then the new 'chain 2' events will be played. These will be the ones after `propose(H_n)`.
Then, the events that were removed will be re-mined. The re-mined `proposeBlocks` will revert because none of them can be attached after H_m. However, the `challenge(H_q)` will succeed and will force a rollback to H_p. That is correct behaviour because all of the blocks after H_p on chain 2 are in fact invalid (because H_q is invalid).
Then, the events that were removed will be re-mined. The re-mined `proposeBlocks` will revert because none of them can be attached after H_m. However, the `challenge(H_q)` will succeed and will force a rollback to H_p.
That is correct behaviour because all of the blocks after H_p on chain 2 are in fact invalid (because H_q is invalid).

4 changes: 4 additions & 0 deletions nightfall-client/src/app.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,10 @@ import {
} from './routes/index.mjs';

const app = express();
app.use((req, res, next) => {
res.header('Access-Control-Allow-Origin', '*');
next();
});

app.use(cors());
app.use(bodyParser.json({ limit: '2mb' }));
Expand Down
4 changes: 4 additions & 0 deletions nightfall-optimist/src/app.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,10 @@ import fileUpload from 'express-fileupload';
import { proposer, block, challenger, transaction } from './routes/index.mjs';

const app = express();
app.use((req, res, next) => {
res.header('Access-Control-Allow-Origin', '*');
next();
});

app.use(cors());
app.use(bodyParser.json({ limit: '2mb' }));
Expand Down
6 changes: 4 additions & 2 deletions wallet/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,10 @@
"web3": "^1.6.0"
},
"scripts": {
"start": "react-scripts start",
"build": "react-scripts build",
"start": "REACT_APP_ENVIRONMENT=Localhost react-scripts start",
"start-ropsten": "REACT_APP_ENVIRONMENT=Ropsten react-scripts start",
"build": "REACT_APP_ENVIRONMENT=Ropsten react-scripts build",
"deploy": "npm run build && aws s3 sync build/ s3://nightfallv3-wallet --cache-control max-age=172800 --delete && aws configure set preview.cloudfront true && aws cloudfront create-invalidation --distribution-id E9K9C7N0TG7LG --paths \"/*\"",
"test": "react-scripts test --env=jsdom",
"eject": "react-scripts eject"
},
Expand Down
2 changes: 0 additions & 2 deletions wallet/src/constants.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
/* ignore unused exports */
const DEFAULT_NF_ADDRESS_INDEX = 0;
const DEFAULT_ENVIRONMENT = 'Localhost';
const NF3_GITHUB_ISSUES_URL = 'https://github.com/EYBlockchain/nightfall_3/issues';
const DEFAULT_TOKEN_TYPE = 'ERC20';
const TOKEN_TYPE = {
Expand Down Expand Up @@ -47,7 +46,6 @@ const BALANCE_INTERVAL = 30000;

export {
DEFAULT_NF_ADDRESS_INDEX,
DEFAULT_ENVIRONMENT,
NF3_GITHUB_ISSUES_URL,
DEFAULT_TOKEN_TYPE,
DEFAULT_TOKEN_ADDRESS,
Expand Down
8 changes: 4 additions & 4 deletions wallet/src/utils/lib/environment.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,10 @@ const SUPPORTED_ENVIRONMENTS = {
ropsten: {
name: 'Ropsten',
chainId: 3,
clientApiUrl: '',
optimistApiUrl: '',
optimistWsUrl: '',
web3WsUrl: '',
clientApiUrl: 'https://client1.testnet.nightfall3.com',
optimistApiUrl: 'https://optimist1.testnet.nightfall3.com',
optimistWsUrl: 'wss://optimist1-ws.testnet.nightfall3.com',
web3WsUrl: 'wss://ropsten1-ws.testnet.nightfall3.com',
},
rinkeby: {
name: 'Rinkeby',
Expand Down
4 changes: 2 additions & 2 deletions wallet/src/views/app.view.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,11 @@ import PropTypes from 'prop-types';
import Transactions from './transactions/transactions.view.jsx';
import Login from './login/login.view.jsx';
import { setEnvironment } from '../utils/lib/environment';
import { DEFAULT_ENVIRONMENT, NF3_GITHUB_ISSUES_URL } from '../constants';
import { NF3_GITHUB_ISSUES_URL } from '../constants';
import * as loginActions from '../store/login/login.actions';

function App({ onDeleteWallet }) {
setEnvironment(DEFAULT_ENVIRONMENT);
setEnvironment(process.env.REACT_APP_ENVIRONMENT);

// Detect page refresh
React.useEffect(() => {
Expand Down

0 comments on commit d780068

Please sign in to comment.