Add config for fixie static ip proxy.
This commit is contained in:
parent
d4715695ad
commit
f2d934a4db
|
@ -43,3 +43,6 @@ SENTRY_DSN=""
|
|||
|
||||
# Logging level
|
||||
LOG_LEVEL="debug"
|
||||
|
||||
# Fixie proxy URL for BitGo requests (optional)
|
||||
# FIXIE_URL=""
|
||||
|
|
|
@ -18,12 +18,17 @@ export async function initBitGo() {
|
|||
throw new Error(`BitGo cannot be used on anything but mainnet, connected node is ${network}`);
|
||||
}
|
||||
|
||||
const proxy = env.FIXIE_URL || undefined;
|
||||
const bitgo = new BitGo({
|
||||
env: 'prod', // Non-prod ZEC is not supported
|
||||
accessToken: env.BITGO_ACCESS_TOKEN,
|
||||
proxy,
|
||||
});
|
||||
bitgoWallet = await bitgo.coin('zec').wallets().get({ id: env.BITGO_WALLET_ID });
|
||||
log.info(`Initialized BitGo wallet "${bitgoWallet.label()}"`);
|
||||
if (proxy) {
|
||||
log.info(`Proxying BitGo requests through ${proxy}`);
|
||||
}
|
||||
}
|
||||
|
||||
export async function getContributionAddress(id: number) {
|
||||
|
|
|
@ -30,12 +30,14 @@ const DEFAULTS = {
|
|||
TESTNET_START_BLOCK: "390000",
|
||||
|
||||
SENTRY_DSN: "",
|
||||
FIXIE_URL: "",
|
||||
};
|
||||
|
||||
const OPTIONAL: { [key: string]: undefined | boolean } = {
|
||||
BITGO_WALLET_ID: true,
|
||||
BITGO_ACCESS_TOKEN: true,
|
||||
BIP32_XPUB: true,
|
||||
FIXIE_URL: true,
|
||||
// NOTE: Remove these from optional when sapling is ready
|
||||
SPROUT_ADDRESS: true,
|
||||
SPROUT_VIEWKEY: true,
|
||||
|
|
|
@ -61,6 +61,7 @@ declare module 'bitgo' {
|
|||
interface BitGoOptions {
|
||||
env: 'test' | 'prod';
|
||||
accessToken: string;
|
||||
proxy?: string;
|
||||
}
|
||||
|
||||
export class BitGo {
|
||||
|
|
Loading…
Reference in New Issue