getRpcUrl.js 876 B

12345678910111213141516171819
  1. // if (process.env.NODE_ENV !== 'production' && (!process.env.REACT_APP_NODE_1 || !process.env.REACT_APP_NODE_2 || !process.env.REACT_APP_NODE_3)) {
  2. // throw Error('One base RPC URL is undefined');
  3. // }
  4. // // Array of available nodes to connect to
  5. // export const nodes = [process.env.REACT_APP_NODE_1, process.env.REACT_APP_NODE_2, process.env.REACT_APP_NODE_3];
  6. const getNodeUrl = () => {
  7. // Use custom node if available (both for development and production)
  8. // However on the testnet it wouldn't work, so if on testnet - comment out the REACT_APP_NODE_PRODUCTION from env file
  9. // if (process.env.APP_NODE) {
  10. // return process.env.APP_NODE;
  11. // }
  12. // return sample(nodes);
  13. // https://data-seed-prebsc-1-s1.binance.org:8545
  14. // return 'https://bsc-dataseed4.defibit.io/';
  15. return 'https://bsc-dataseed4.defibit.io/';
  16. };
  17. export default getNodeUrl;