on master help sign in
Merge pull request #1113 from dillon/fix/local-deployment

Fix local deployment

commitd49bb352dfd3219f6d7934530c6dc2cb3adc3f55 authordillon <dpett122@gmail.com> dateWed 12 Jul 2023, 22:52 (3 years ago) parent0002780881554f
8 files changed+31−27
DEVELOPMENT.md+2−2 migrations/1_migration.js+2−1 package-lock.json+3−15 src/lib/constants.ts+3−1 src/lib/flags.js+1−1 src/lib/network.js+18−5 src/views/Login/LoginSelector.tsx+1−1 truffle-config.js+1−1
DEVELOPMENT.md+2−2
@@ -165,7 +165,7 @@ npm run pilot-l2
165165Start a local fake ship from the master branch in the [urbit repo](https://github.com/urbit/urbit)
166166
167167```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
169169```
170170
171171```dojo
@@ -179,7 +179,7 @@ Start a local fake ship from the master branch in the [urbit repo](https://githu
179179> :roller|local
180180> :roller|setkey '58d62eb79797502bc0f66cd3e7a49d00287bff53a2734b799ef09cb746340ed0'
181181> :roller|quota 9.999
182−> |cors-approve 'http://localhost:3000'
182+> |cors-approve 'https://127.0.0.1:3000'
183183:: Once L2 txs have been sent via Bridge, this will manually commit and batch them, avoiding waiting for the timer
184184::
185185> :roller|commit
migrations/1_migration.js+2−1
@@ -63,7 +63,8 @@ module.exports = async function(deployer) {
6363 '0x0000000000000000000000000000000000000000',
6464 azimuth.address,
6565 polls.address,
66− claims.address
66+ claims.address,
67+ '0x0000000000000000000000000000000000000000' // treasury
6768 );
6869
6970 // configure contract ownership
package-lock.json+3−15
@@ -5569,8 +5569,8 @@
55695569 }
55705570 },
55715571 "node_modules/azimuth-solidity": {
5572− "version": "1.2.3",
5573− "resolved": "git+ssh://git@github.com/urbit/azimuth.git#c5394f7aabb6e9de49a67ab0cd227ac62303efd5",
5572+ "version": "1.2.4",
5573+ "resolved": "git+ssh://git@github.com/urbit/azimuth.git#bcf1d7bcf64cd73a3688434feb786be39a116819",
55745574 "bundleDependencies": [
55755575 "openzeppelin-solidity"
55765576 ],
@@ -15842,11 +15842,6 @@
1584215842 "xhr-request-promise": "^0.1.2"
1584315843 }
1584415844 },
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− },
1585015845 "node_modules/web3/node_modules/get-stream": {
1585115846 "version": "6.0.1",
1585215847 "resolved": "https://registry.npmjs.org/get-stream/-/get-stream-6.0.1.tgz",
@@ -20207,7 +20202,7 @@
2020720202 }
2020820203 },
2020920204 "azimuth-solidity": {
20210− "version": "git+ssh://git@github.com/urbit/azimuth.git#c5394f7aabb6e9de49a67ab0cd227ac62303efd5",
20205+ "version": "git+ssh://git@github.com/urbit/azimuth.git#bcf1d7bcf64cd73a3688434feb786be39a116819",
2021120206 "from": "azimuth-solidity@github:urbit/azimuth",
2021220207 "requires": {
2021320208 "babel-polyfill": "^6.26.0",
@@ -27158,13 +27153,6 @@
2715827153 "bn.js": "^4.11.6",
2715927154 "elliptic": "^6.4.0",
2716027155 "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− }
2716827156 }
2716927157 },
2717027158 "get-stream": {
src/lib/constants.ts+3−1
@@ -230,6 +230,7 @@ const EIP1559_TRANSACTION_TYPE = 2;
230230// https://chainlist.org/?testnets=true
231231const ETHEREUM_MAINNET_CHAIN_ID = '0x1';
232232const ETHEREUM_GOERLI_CHAIN_ID = '0x5';
233+const ETHEREUM_LOCAL_CHAIN_ID = '0x539';
233234
234235export {
235236 CHECK_BLOCK_EVERY_MS,
@@ -281,5 +282,6 @@ export {
281282 LOCKUP_TOOLTIP,
282283 INITIAL_NETWORK_KEY_REVISION,
283284 ETHEREUM_MAINNET_CHAIN_ID,
284− ETHEREUM_GOERLI_CHAIN_ID
285+ ETHEREUM_GOERLI_CHAIN_ID,
286+ ETHEREUM_LOCAL_CHAIN_ID,
285287};
src/lib/flags.js+1−1
@@ -1,7 +1,7 @@
11import { version } from '../../package.json';
22
33// 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;
55export const isGoerli = import.meta.env.VITE_GOERLI === 'true';
66export const isMainnet = import.meta.env.VITE_MAINNET === 'true';
77export const versionLabel =
src/lib/network.js+18−5
@@ -1,5 +1,9 @@
1−import { isMainnet } from "./flags";
2−import { ETHEREUM_GOERLI_CHAIN_ID, ETHEREUM_MAINNET_CHAIN_ID, } from './constants';
1+import { isDevelopment, isGoerli, isMainnet } from './flags';
2+import {
3+ ETHEREUM_GOERLI_CHAIN_ID,
4+ ETHEREUM_LOCAL_CHAIN_ID,
5+ ETHEREUM_MAINNET_CHAIN_ID,
6+} from './constants';
37
48const NETWORK_TYPES = {
59 OFFLINE: Symbol('OFFLINE'),
@@ -31,7 +35,16 @@ const chainIdToNetworkType = chainId => {
3135};
3236
3337const expectedChainId = () => {
34− return isMainnet ? ETHEREUM_MAINNET_CHAIN_ID : ETHEREUM_GOERLI_CHAIN_ID;
35−}
38+ return isGoerli
39+ ? ETHEREUM_GOERLI_CHAIN_ID
40+ : isDevelopment && !isMainnet
41+ ? ETHEREUM_LOCAL_CHAIN_ID
42+ : ETHEREUM_MAINNET_CHAIN_ID;
43+};
3644
37−export { NETWORK_TYPES, expectedChainId, renderNetworkType, chainIdToNetworkType };
45+export {
46+ NETWORK_TYPES,
47+ expectedChainId,
48+ renderNetworkType,
49+ chainIdToNetworkType,
50+};
src/views/Login/LoginSelector.tsx+1−1
@@ -99,7 +99,7 @@ export default function LoginSelector({
9999 /**
100100 * Ensure wallet is connected to expected chain
101101 */
102− if (window.ethereum.chainId !== expectedChainId() ) {
102+ if (window.ethereum.chainId !== expectedChainId()) {
103103 console.log(`unexpected chain: ${window.ethereum.chainId}`);
104104 await window.ethereum.request({
105105 method: 'wallet_switchEthereumChain',
truffle-config.js+1−1
@@ -5,7 +5,7 @@ require('babel-polyfill');
55module.exports = {
66 networks: {
77 development: {
8− host: 'localhost',
8+ host: '0.0.0.0',
99 port: 8545,
1010 network_id: '*', // Match any network id
1111 gas: 6000000,