Configured connection to use rpc from env
This commit is contained in:
parent
177495a003
commit
89d6abef36
|
@ -3,6 +3,7 @@ import * as dotenv from 'dotenv';
|
|||
dotenv.config();
|
||||
|
||||
export default {
|
||||
rpcEndpoint: process.env.RPC_ENDPOINT || '',
|
||||
dbConnectionString: (process.env.NODE_ENV == 'production') ?
|
||||
`mongodb://${process.env.DB_USER}:${encodeURIComponent(process.env.DB_PASS || '')}@${process.env.DB_HOSTS}/${process.env.DB}${process.env.DB_OPTIONS}`:
|
||||
'mongodb://localhost:27017/mango_alerts',
|
||||
|
|
|
@ -23,7 +23,7 @@ const router = new Router;
|
|||
const cluster = 'mainnet-beta';
|
||||
const client = new MangoClient();
|
||||
const clusterIds = IDS[cluster];
|
||||
const connection = new Connection(IDS.cluster_urls[cluster], 'singleGossip');
|
||||
const connection = new Connection(config.rpcEndpoint || IDS.cluster_urls[cluster], 'singleGossip');
|
||||
const dexProgramId = new PublicKey(clusterIds.dex_program_id);
|
||||
|
||||
app.use(cors());
|
||||
|
|
Loading…
Reference in New Issue