forked from jackkleeman/stellar-stripe-anchor
-
Notifications
You must be signed in to change notification settings - Fork 0
/
bridge.cfg.ts
32 lines (28 loc) · 820 Bytes
/
bridge.cfg.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
const fs = require('fs');
import { Config } from './src/config';
const lines = [
`port = ${Config.BRIDGE_PORT}`,
`horizon = "${Config.HORIZON_URL}"`,
`network_passphrase = "${Config.NETWORK_PASSPHRASE}"`,
'[[assets]]',
'code = "USD"',
`issuer = "${Config.ISSUER_ID}"`,
'[database]',
`type = "${Config.DATABASE_TYPE}"`,
`url = "${Config.DATABASE_URL}"`,
'[accounts]',
`receiving_account_id = "${Config.ISSUER_ID}"`,
'[callbacks]',
`receive = "${Config.WITHDRAW_ENDPOINT}"`
];
const lineBreak = '\n';
const bridgeCfgContent = lines.join(lineBreak);
const bridgeCfgPath = 'bridge.cfg';
fs.writeFile(bridgeCfgPath, bridgeCfgContent, (err: any) => {
if (err) {
throw err;
}
console.log(
'The bridge config file was succesfully generated from your environment variables!'
);
});