on master help sign in
Merge pull request #1113 from dillon/fix/local-deployment
d49bb35dillon
DEVELOPMENT.md+2−2
@@ -165,7 +165,7 @@ npm run pilot-l2
165Start a local fake ship from the master branch in the [urbit repo](https://github.com/urbit/urbit)
165Start a local fake ship from the master branch in the [urbit repo](https://github.com/urbit/urbit)
166
166
167```sh
167```sh
168−/path/to/urbit -F zod -B ./bin/solid.pill -A ./pkg/arvo zod
168+/path/to/urbit -F zod -B ./bin/solid.pill -A ./pkg/arvo -c zod --http-port 8080
169```
169```
170
170
171```dojo
171```dojo
@@ -179,7 +179,7 @@ Start a local fake ship from the master branch in the [urbit repo](https://githu
179> :roller|local
179> :roller|local
180> :roller|setkey '58d62eb79797502bc0f66cd3e7a49d00287bff53a2734b799ef09cb746340ed0'
180> :roller|setkey '58d62eb79797502bc0f66cd3e7a49d00287bff53a2734b799ef09cb746340ed0'
181> :roller|quota 9.999
181> :roller|quota 9.999
182−> |cors-approve 'http://localhost:3000'
182+> |cors-approve 'https://127.0.0.1:3000'
183:: Once L2 txs have been sent via Bridge, this will manually commit and batch them, avoiding waiting for the timer
183:: Once L2 txs have been sent via Bridge, this will manually commit and batch them, avoiding waiting for the timer
184::
184::
185> :roller|commit
185> :roller|commit
migrations/1_migration.js+2−1
@@ -63,7 +63,8 @@ module.exports = async function(deployer) {
63 '0x0000000000000000000000000000000000000000',
63 '0x0000000000000000000000000000000000000000',
64 azimuth.address,
64 azimuth.address,
65 polls.address,
65 polls.address,
66− claims.address
66+ claims.address,
67+ '0x0000000000000000000000000000000000000000' // treasury
67 );
68 );
68
69
69 // configure contract ownership
70 // configure contract ownership
package-lock.json+3−15
@@ -5569,8 +5569,8 @@
5569 }
5569 }
5570 },
5570 },
5571 "node_modules/azimuth-solidity": {
5571 "node_modules/azimuth-solidity": {
5572− "version": "1.2.3",
5572+ "version": "1.2.4",
5573− "resolved": "git+ssh://git@github.com/urbit/azimuth.git#c5394f7aabb6e9de49a67ab0cd227ac62303efd5",
5573+ "resolved": "git+ssh://git@github.com/urbit/azimuth.git#bcf1d7bcf64cd73a3688434feb786be39a116819",
5574 "bundleDependencies": [
5574 "bundleDependencies": [
5575 "openzeppelin-solidity"
5575 "openzeppelin-solidity"
5576 ],
5576 ],
@@ -15842,11 +15842,6 @@
15842 "xhr-request-promise": "^0.1.2"
15842 "xhr-request-promise": "^0.1.2"
15843 }
15843 }
15844 },
15844 },
15845− "node_modules/web3/node_modules/eth-lib/node_modules/bn.js": {
15846− "version": "4.12.0",
15847− "resolved": "https://registry.npmjs.org/bn.js/-/bn.js-4.12.0.tgz",
15848− "integrity": "sha512-c98Bf3tPniI+scsdk237ku1Dc3ujXQTSgyiPUDEOe7tRkhrqridvh8klBv0HCEso1OLOYcHuCv/cS6DNxKH+ZA=="
15849− },
15850 "node_modules/web3/node_modules/get-stream": {
15845 "node_modules/web3/node_modules/get-stream": {
15851 "version": "6.0.1",
15846 "version": "6.0.1",
15852 "resolved": "https://registry.npmjs.org/get-stream/-/get-stream-6.0.1.tgz",
15847 "resolved": "https://registry.npmjs.org/get-stream/-/get-stream-6.0.1.tgz",
@@ -20207,7 +20202,7 @@
20207 }
20202 }
20208 },
20203 },
20209 "azimuth-solidity": {
20204 "azimuth-solidity": {
20210− "version": "git+ssh://git@github.com/urbit/azimuth.git#c5394f7aabb6e9de49a67ab0cd227ac62303efd5",
20205+ "version": "git+ssh://git@github.com/urbit/azimuth.git#bcf1d7bcf64cd73a3688434feb786be39a116819",
20211 "from": "azimuth-solidity@github:urbit/azimuth",
20206 "from": "azimuth-solidity@github:urbit/azimuth",
20212 "requires": {
20207 "requires": {
20213 "babel-polyfill": "^6.26.0",
20208 "babel-polyfill": "^6.26.0",
@@ -27158,13 +27153,6 @@
27158 "bn.js": "^4.11.6",
27153 "bn.js": "^4.11.6",
27159 "elliptic": "^6.4.0",
27154 "elliptic": "^6.4.0",
27160 "xhr-request-promise": "^0.1.2"
27155 "xhr-request-promise": "^0.1.2"
27161− },
27162− "dependencies": {
27163− "bn.js": {
27164− "version": "4.12.0",
27165− "resolved": "https://registry.npmjs.org/bn.js/-/bn.js-4.12.0.tgz",
27166− "integrity": "sha512-c98Bf3tPniI+scsdk237ku1Dc3ujXQTSgyiPUDEOe7tRkhrqridvh8klBv0HCEso1OLOYcHuCv/cS6DNxKH+ZA=="
27167− }
27168 }
27156 }
27169 },
27157 },
27170 "get-stream": {
27158 "get-stream": {
src/lib/constants.ts+3−1
@@ -230,6 +230,7 @@ const EIP1559_TRANSACTION_TYPE = 2;
230// https://chainlist.org/?testnets=true
230// https://chainlist.org/?testnets=true
231const ETHEREUM_MAINNET_CHAIN_ID = '0x1';
231const ETHEREUM_MAINNET_CHAIN_ID = '0x1';
232const ETHEREUM_GOERLI_CHAIN_ID = '0x5';
232const ETHEREUM_GOERLI_CHAIN_ID = '0x5';
233+const ETHEREUM_LOCAL_CHAIN_ID = '0x539';
233
234
234export {
235export {
235 CHECK_BLOCK_EVERY_MS,
236 CHECK_BLOCK_EVERY_MS,
@@ -281,5 +282,6 @@ export {
281 LOCKUP_TOOLTIP,
282 LOCKUP_TOOLTIP,
282 INITIAL_NETWORK_KEY_REVISION,
283 INITIAL_NETWORK_KEY_REVISION,
283 ETHEREUM_MAINNET_CHAIN_ID,
284 ETHEREUM_MAINNET_CHAIN_ID,
284− ETHEREUM_GOERLI_CHAIN_ID
285+ ETHEREUM_GOERLI_CHAIN_ID,
286+ ETHEREUM_LOCAL_CHAIN_ID,
285};
287};
src/lib/flags.js+1−1
@@ -1,7 +1,7 @@
1import { version } from '../../package.json';
1import { version } from '../../package.json';
2
2
3// are we running bridge in a development build
3// are we running bridge in a development build
4−export const isDevelopment = import.meta.env.DEV === 'development';
4+export const isDevelopment = import.meta.env.DEV === true;
5export const isGoerli = import.meta.env.VITE_GOERLI === 'true';
5export const isGoerli = import.meta.env.VITE_GOERLI === 'true';
6export const isMainnet = import.meta.env.VITE_MAINNET === 'true';
6export const isMainnet = import.meta.env.VITE_MAINNET === 'true';
7export const versionLabel =
7export const versionLabel =
src/lib/network.js+18−5
@@ -1,5 +1,9 @@
1−import { isMainnet } from "./flags";
1+import { isDevelopment, isGoerli, isMainnet } from './flags';
2+import {
3+ ETHEREUM_GOERLI_CHAIN_ID,
4+ ETHEREUM_LOCAL_CHAIN_ID,
2−import { ETHEREUM_GOERLI_CHAIN_ID, ETHEREUM_MAINNET_CHAIN_ID, } from './constants';
5+ ETHEREUM_MAINNET_CHAIN_ID,
6+} from './constants';
3
7
4const NETWORK_TYPES = {
8const NETWORK_TYPES = {
5 OFFLINE: Symbol('OFFLINE'),
9 OFFLINE: Symbol('OFFLINE'),
@@ -31,7 +35,16 @@ const chainIdToNetworkType = chainId => {
31};
35};
32
36
33const expectedChainId = () => {
37const expectedChainId = () => {
38+ return isGoerli
39+ ? ETHEREUM_GOERLI_CHAIN_ID
40+ : isDevelopment && !isMainnet
41+ ? ETHEREUM_LOCAL_CHAIN_ID
34− return isMainnet ? ETHEREUM_MAINNET_CHAIN_ID : ETHEREUM_GOERLI_CHAIN_ID;
42+ : ETHEREUM_MAINNET_CHAIN_ID;
35−}
43+};
36
44
45+export {
46+ NETWORK_TYPES,
47+ expectedChainId,
48+ renderNetworkType,
37−export { NETWORK_TYPES, expectedChainId, renderNetworkType, chainIdToNetworkType };
49+ chainIdToNetworkType,
50+};
src/views/Login/LoginSelector.tsx+1−1
@@ -99,7 +99,7 @@ export default function LoginSelector({
99 /**
99 /**
100 * Ensure wallet is connected to expected chain
100 * Ensure wallet is connected to expected chain
101 */
101 */
102− if (window.ethereum.chainId !== expectedChainId() ) {
102+ if (window.ethereum.chainId !== expectedChainId()) {
103 console.log(`unexpected chain: ${window.ethereum.chainId}`);
103 console.log(`unexpected chain: ${window.ethereum.chainId}`);
104 await window.ethereum.request({
104 await window.ethereum.request({
105 method: 'wallet_switchEthereumChain',
105 method: 'wallet_switchEthereumChain',
truffle-config.js+1−1
@@ -5,7 +5,7 @@ require('babel-polyfill');
5module.exports = {
5module.exports = {
6 networks: {
6 networks: {
7 development: {
7 development: {
8− host: 'localhost',
8+ host: '0.0.0.0',
9 port: 8545,
9 port: 8545,
10 network_id: '*', // Match any network id
10 network_id: '*', // Match any network id
11 gas: 6000000,
11 gas: 6000000,