From c66149339b00a7e6a7e8ef8547d1f9edbdd0242a Mon Sep 17 00:00:00 2001 From: Franck Date: Fri, 29 May 2020 10:30:28 -0700 Subject: [PATCH] [mobile] Replace hardcoded provider url with env var (#4476) * Replace hardcoded provider url with env var * Update doc --- mobile/README.md | 3 +++ mobile/src/constants.js | 6 ++---- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/mobile/README.md b/mobile/README.md index 46d0b6be472d..b8ec213f23ae 100644 --- a/mobile/README.md +++ b/mobile/README.md @@ -62,6 +62,9 @@ To run the mobile app on your phone, you need to both start the Metro builder se If you want to use a physical device in combination with the marketplace DApp running on your local machine (i.e. `Localhost` setting in network selection) make sure you set the `HOST` environment variable to your internal network IP address (e.g. 10.10.10.1). +### Build +Make sure to set the env var MAINNET_PROVIDER_URL and RINKEBY_PROVIDER_URL. They are used [here](./src/constant.js) + ### Tips > Is there a way to remotely debug the app? diff --git a/mobile/src/constants.js b/mobile/src/constants.js index 21916a56c14f..9683afb89425 100644 --- a/mobile/src/constants.js +++ b/mobile/src/constants.js @@ -37,15 +37,13 @@ export const NETWORKS = [ id: 1, name: 'Mainnet', dappUrl: 'https://shoporigin.com/#/', - provider: - 'https://eth-mainnet.alchemyapi.io/v2/snPxmbyVLjq1Sq32Z4pAal7FXwe941uf' + provider: process.env.MAINNET_PROVIDER_URL }, { id: 4, name: 'Rinkeby', dappUrl: 'https://dapp.staging.originprotocol.com/#/', - provider: - 'https://eth-rinkeby.alchemyapi.io/v2/D0SsolVDcXCw6K6j2LWqcpW49QIukUkI' + provider: process.env.RINKEBY_PROVIDER_URL }, { id: 2222,