Skip to content

Commit

Permalink
chore: switch to new staging (#2433)
Browse files Browse the repository at this point in the history
  • Loading branch information
pwltr authored Jan 14, 2025
1 parent 579fc3d commit ee0c827
Show file tree
Hide file tree
Showing 6 changed files with 22 additions and 38 deletions.
16 changes: 7 additions & 9 deletions .env.development.template
Original file line number Diff line number Diff line change
Expand Up @@ -13,36 +13,34 @@ ENABLE_MIGRATION_DEBUG=false
# react-native-ldk JS logs
ENABLE_LDK_LOGS=true

# Bitkit backend
BACKEND_HOST=https://bitkit.stag0.blocktank.to

# LDK backups
BACKUPS_SERVER_HOST=https://blocktank.synonym.to/staging-backups-ldk
BACKUPS_SERVER_HOST=https://bitkit.stag0.blocktank.to/backups-ldk
BACKUPS_SERVER_PUBKEY=02c03b8b8c1b5500b622646867d99bf91676fac0f38e2182c91a9ff0d053a21d6d

# Slashtags
WEB_RELAY=https://webrelay.slashtags.to

# Blocktank
BLOCKTANK_HOST=https://api1.blocktank.to/api
BLOCKTANK_HOST=https://api.stag0.blocktank.to/blocktank/api/v2

# Network
ELECTRUM_BITCOIN_HOST=35.187.18.233
ELECTRUM_BITCOIN_SSL_PORT=8900
ELECTRUM_BITCOIN_TCP_PORT=8911
ELECTRUM_BITCOIN_PROTO=ssl

ELECTRUM_REGTEST_HOST=35.233.47.252
ELECTRUM_REGTEST_HOST=34.65.86.104
ELECTRUM_REGTEST_SSL_PORT=18484
ELECTRUM_REGTEST_TCP_PORT=18483
ELECTRUM_REGTEST_PROTO=tcp

ELECTRUM_SIGNET_HOST=35.233.47.252
ELECTRUM_SIGNET_SSL_PORT=18484
ELECTRUM_SIGNET_TCP_PORT=18483
ELECTRUM_SIGNET_PROTO=tcp

TREASURE_HUNT_HOST=" "

# format: "<pubkey>, <pubkey>, ..."
TRUSTED_ZERO_CONF_PEERS="0296b2db342fcf87ea94d981757fdf4d3e545bd5cef4919f58b5d38dfdd73bf5c9,03b9a456fb45d5ac98c02040d39aec77fa3eeb41fd22cf40b862b393bcfc43473a,039b8b4dd1d88c2c5db374290cda397a8f5d79f312d6ea5d5bfdfc7c6ff363eae3,03342eac98d8c07ac8a4f303b2ad09a34b3350357730013d534d0537a4d1d8a14d,03816141f1dce7782ec32b66a300783b1d436b19777e7c686ed00115bd4b88ff4b"
TRUSTED_ZERO_CONF_PEERS="028a8910b0048630d4eb17af25668cdd7ea6f2d8ae20956e7a06e2ae46ebcb69fc,0296b2db342fcf87ea94d981757fdf4d3e545bd5cef4919f58b5d38dfdd73bf5c9,03b9a456fb45d5ac98c02040d39aec77fa3eeb41fd22cf40b862b393bcfc43473a,039b8b4dd1d88c2c5db374290cda397a8f5d79f312d6ea5d5bfdfc7c6ff363eae3,03342eac98d8c07ac8a4f303b2ad09a34b3350357730013d534d0537a4d1d8a14d,03816141f1dce7782ec32b66a300783b1d436b19777e7c686ed00115bd4b88ff4b"

WALLET_DEFAULT_SELECTED_NETWORK=bitcoin

Expand Down
8 changes: 3 additions & 5 deletions .env.test.template
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,9 @@ ENABLE_MIGRATION_DEBUG=false
# react-native-ldk JS logs
ENABLE_LDK_LOGS=false

# Bitkit backend
BACKEND_HOST=https://bitkit.stag0.blocktank.to

# LDK backups
BACKUPS_SERVER_HOST=http://127.0.0.1:3003
BACKUPS_SERVER_PUBKEY=0319c4ff23820afec0c79ce3a42031d7fef1dff78b7bdd69b5560684f3e1827675
Expand All @@ -34,11 +37,6 @@ ELECTRUM_REGTEST_SSL_PORT=60001
ELECTRUM_REGTEST_TCP_PORT=60001
ELECTRUM_REGTEST_PROTO=tcp

ELECTRUM_SIGNET_HOST=35.233.47.252
ELECTRUM_SIGNET_SSL_PORT=18484
ELECTRUM_SIGNET_TCP_PORT=18483
ELECTRUM_SIGNET_PROTO=tcp

TREASURE_HUNT_HOST=" "

# format: "<pubkey>, <pubkey>, ..."
Expand Down
6 changes: 1 addition & 5 deletions src/@types/env.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@ declare module '@env' {
export const ENABLE_MIGRATION_DEBUG: string;
export const ENABLE_LDK_LOGS: string;

export const BACKEND_HOST: string;
export const BACKUPS_SERVER_HOST: string;
export const BACKUPS_SERVER_PUBKEY: string;

export const BLOCKTANK_HOST: string;

export const ELECTRUM_BITCOIN_HOST: string;
Expand All @@ -18,10 +18,6 @@ declare module '@env' {
export const ELECTRUM_REGTEST_SSL_PORT: number;
export const ELECTRUM_REGTEST_TCP_PORT: number;
export const ELECTRUM_REGTEST_PROTO: string;
export const ELECTRUM_SIGNET_HOST: string;
export const ELECTRUM_SIGNET_SSL_PORT: number;
export const ELECTRUM_SIGNET_TCP_PORT: number;
export const ELECTRUM_SIGNET_PROTO: string;

export const TREASURE_HUNT_HOST: string;

Expand Down
24 changes: 8 additions & 16 deletions src/constants/env.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import {
BACKEND_HOST,
BACKUPS_SERVER_HOST,
BACKUPS_SERVER_PUBKEY,
BLOCKTANK_HOST,
Expand All @@ -11,10 +12,6 @@ import {
ELECTRUM_REGTEST_PROTO,
ELECTRUM_REGTEST_SSL_PORT,
ELECTRUM_REGTEST_TCP_PORT,
ELECTRUM_SIGNET_HOST,
ELECTRUM_SIGNET_PROTO,
ELECTRUM_SIGNET_SSL_PORT,
ELECTRUM_SIGNET_TCP_PORT,
ENABLE_I18NEXT_DEBUGGER,
ENABLE_LDK_LOGS,
ENABLE_MIGRATION_DEBUG,
Expand Down Expand Up @@ -43,8 +40,8 @@ if (!isProtocol(ELECTRUM_REGTEST_PROTO)) {
throw new Error(`${ELECTRUM_REGTEST_PROTO} is not a valid protocol.`);
}

if (!isProtocol(ELECTRUM_SIGNET_PROTO)) {
throw new Error(`${ELECTRUM_SIGNET_PROTO} is not a valid protocol.`);
if (!BACKEND_HOST) {
throw new Error('BACKEND_HOST is missing.');
}

if (!BACKUPS_SERVER_HOST || !BACKUPS_SERVER_PUBKEY) {
Expand All @@ -53,19 +50,18 @@ if (!BACKUPS_SERVER_HOST || !BACKUPS_SERVER_PUBKEY) {

export const __JEST__ = process.env.JEST_WORKER_ID !== undefined;

export const __ENABLE_REDUX_LOGGER__ = ENABLE_REDUX_LOGGER === 'true' ?? true;
export const __ENABLE_MIGRATION_DEBUG__ =
ENABLE_MIGRATION_DEBUG === 'true' ?? false;
export const __ENABLE_REDUX_LOGGER__ = ENABLE_REDUX_LOGGER === 'true';
export const __ENABLE_MIGRATION_DEBUG__ = ENABLE_MIGRATION_DEBUG === 'true';
export const __ENABLE_REDUX_IMMUTABLE_CHECK__ =
__DEV__ && ENABLE_REDUX_IMMUTABLE_CHECK
? ENABLE_REDUX_IMMUTABLE_CHECK === 'true'
: false;

export const __ENABLE_I18NEXT_DEBUGGER__ =
ENABLE_I18NEXT_DEBUGGER === 'true' ?? __DEV__;
export const __ENABLE_I18NEXT_DEBUGGER__ = ENABLE_I18NEXT_DEBUGGER === 'true';

export const __ENABLE_LDK_LOGS__ = ENABLE_LDK_LOGS === 'true' ?? __DEV__;
export const __ENABLE_LDK_LOGS__ = ENABLE_LDK_LOGS === 'true';

export const __BACKEND_HOST__ = BACKEND_HOST;
export const __BACKUPS_SERVER_HOST__ = BACKUPS_SERVER_HOST;
export const __BACKUPS_SERVER_PUBKEY__ = BACKUPS_SERVER_PUBKEY;

Expand All @@ -79,10 +75,6 @@ export const __ELECTRUM_REGTEST_HOST__ = ELECTRUM_REGTEST_HOST;
export const __ELECTRUM_REGTEST_SSL_PORT__ = ELECTRUM_REGTEST_SSL_PORT;
export const __ELECTRUM_REGTEST_TCP_PORT__ = ELECTRUM_REGTEST_TCP_PORT;
export const __ELECTRUM_REGTEST_PROTO__ = ELECTRUM_REGTEST_PROTO;
export const __ELECTRUM_SIGNET_HOST__ = ELECTRUM_SIGNET_HOST;
export const __ELECTRUM_SIGNET_SSL_PORT__ = ELECTRUM_SIGNET_SSL_PORT;
export const __ELECTRUM_SIGNET_TCP_PORT__ = ELECTRUM_SIGNET_TCP_PORT;
export const __ELECTRUM_SIGNET_PROTO__ = ELECTRUM_SIGNET_PROTO;

export const __TREASURE_HUNT_HOST__ = TREASURE_HUNT_HOST;

Expand Down
2 changes: 1 addition & 1 deletion src/utils/blocktank/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ export const setupBlocktank = async (
break;
case EAvailableNetwork.bitcoinRegtest:
dispatch(updateUser({ isGeoBlocked: false }));
bt.baseUrl = 'https://api.stag.blocktank.to/blocktank/api/v2';
bt.baseUrl = 'https://api.stag0.blocktank.to/blocktank/api/v2';
break;
}
if (isGeoBlocked) {
Expand Down
4 changes: 2 additions & 2 deletions src/utils/exchange-rate/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import { ok, err, Result } from '@synonymdev/result';
import i18n from '../i18n';
import { timeAgo } from '../helpers';
import { getWalletStore } from '../../store/helpers';
import { __BLOCKTANK_HOST__ } from '../../constants/env';
import { __BACKEND_HOST__ } from '../../constants/env';
import { showToast } from '../notifications';

export const mostUsedExchangeTickers = {
Expand Down Expand Up @@ -56,7 +56,7 @@ export const getExchangeRates = async (): Promise<Result<IExchangeRates>> => {
const lastUpdatedAt = getWalletStore().exchangeRates.USD?.lastUpdatedAt;

try {
const response = await fetch(`${__BLOCKTANK_HOST__}/fx/rates/btc`);
const response = await fetch(`${__BACKEND_HOST__}/fx/rates/btc`);
const { tickers } = await response.json();

const rates: IExchangeRates = tickers.reduce(
Expand Down

0 comments on commit ee0c827

Please sign in to comment.