Skip to content

Commit

Permalink
Merge branch 'main' into sd-stem-upload-row
Browse files Browse the repository at this point in the history
  • Loading branch information
Saliou Diallo committed Jan 23, 2024
2 parents e057073 + e147d2e commit e0d8e31
Show file tree
Hide file tree
Showing 147 changed files with 1,182 additions and 1,197 deletions.
2 changes: 1 addition & 1 deletion .circleci/src/commands/@web-commands.yml
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ web-pr-comment:
web-build:
parameters:
build-type:
default: 'prod-source-maps'
default: 'prod'
type: string
build-directory:
default: 'packages/web/build-production'
Expand Down
2 changes: 0 additions & 2 deletions .circleci/src/jobs/@mobile-jobs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,11 @@ mobile-init:
name: copy staging env
command: |
cd packages/mobile
echo "FCM_SENDER_ID=$FCM_SENDER_ID" >> .env.stage
echo "AMPLITUDE_WRITE_KEY=$AMPLITUDE_WRITE_KEY_STAGE" >> .env.stage
- run:
name: copy production env
command: |
cd packages/mobile
echo "FCM_SENDER_ID=$FCM_SENDER_ID" >> .env.prod
echo "AMPLITUDE_WRITE_KEY=$AMPLITUDE_WRITE_KEY_PROD" >> .env.prod
- create_concatenated_patch_file:
Expand Down
10 changes: 5 additions & 5 deletions .circleci/src/jobs/@web-jobs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -51,15 +51,15 @@ web-build-demo:
- run:
name: build-demo
no_output_timeout: 30m
# Set the branch name as the VITE_PUBLIC_URL so that relative paths work, e.g.
# Set the branch name as the VITE_BASENAME so that relative paths work, e.g.
# demo.audius.co/some-branch/handle/track resolves as /handle/track would at audius.co
command: |
cd packages/web
cp ./.env/.env.stage ./.env/.env.stage.tmp
echo -e "\nVITE_PUBLIC_URL=/${CIRCLE_BRANCH}" >> ./.env/.env.stage
cp ./env/.env.stage ./env/.env.stage.tmp
echo -e "\nVITE_BASENAME=/${CIRCLE_BRANCH}" >> ./env/.env.stage
CI=false npm run build:stage -w audius-client
mv build-staging build-demo
cp ./.env/.env.stage.tmp ./.env/.env.stage
cp ./env/.env.stage.tmp ./env/.env.stage
- persist_to_workspace:
root: ./
paths:
Expand Down Expand Up @@ -104,7 +104,7 @@ web-build-production:
resource_class: xlarge
steps:
- web-build:
build-type: prod-source-maps
build-type: prod
build-directory: packages/web/build-production
build-name: build-production

Expand Down
85 changes: 76 additions & 9 deletions packages/common/src/services/env.ts
Original file line number Diff line number Diff line change
@@ -1,13 +1,80 @@
import { Nullable } from 'utils/typeUtils'

export type Environment = 'development' | 'staging' | 'production'

export type Env = {
AAO_ENDPOINT?: string
EAGER_DISCOVERY_NODES?: string
EXPLORE_CONTENT_URL?: string
ENVIRONMENT?: Environment
ORACLE_ETH_ADDRESSES?: string
SUGGESTED_FOLLOW_HANDLES?: string
GENERAL_ADMISSION?: string
IDENTITY_SERVICE?: string
PUBLIC_HOSTNAME?: string
AAO_ENDPOINT: string
AMPLITUDE_API_KEY: Nullable<string>
AMPLITUDE_PROXY: Nullable<string>
AMPLITUDE_WRITE_KEY: Nullable<string>
AUDIUS_URL: string
BITSKI_CALLBACK_URL: string
BITSKI_CLIENT_ID: string
CACHE_PRUNE_MIN: string
CLAIM_DISTRIBUTION_CONTRACT_ADDRESS: Nullable<string>
CLAIMABLE_TOKEN_PDA: string
CLAIMABLE_TOKEN_PROGRAM_ADDRESS: string
COINFLOW_APP_ID: string
COINFLOW_MERCHANT_ID: string
COINFLOW_PARTNER_ID: string
COGNITO_KEY: Nullable<string>
COGNITO_TEMPLATE_ID: Nullable<string>
EAGER_DISCOVERY_NODES: string
ENTITY_MANAGER_ADDRESS: string
ENVIRONMENT: Environment
ETH_BRIDGE_ADDRESS: Nullable<string>
ETH_NETWORK_ID: string
ETH_OWNER_WALLET: Nullable<string>
ETH_PROVIDER_URL: string
ETH_REGISTRY_ADDRESS: string
ETH_TOKEN_ADDRESS: string
ETH_TOKEN_BRIDGE_ADDRESS: Nullable<string>
EXPLORE_CONTENT_URL: string
FCM_PUSH_PUBLIC_KEY: Nullable<string>
FINGERPRINT_ENDPOINT: Nullable<string>
FINGERPRINT_PUBLIC_API_KEY: Nullable<string>
GA_HOSTNAME: string
GA_MEASUREMENT_ID: string
GENERAL_ADMISSION: string
HCAPTCHA_BASE_URL: string
HCAPTCHA_SITE_KEY: string
IDENTITY_SERVICE: string
INSTAGRAM_APP_ID: string
INSTAGRAM_REDIRECT_URL: string
METADATA_PROGRAM_ID: string
OPENSEA_API_URL: string
OPTIMIZELY_KEY: string
ORACLE_ETH_ADDRESSES: string
PAYMENT_ROUTER_PROGRAM_ID: string
PUBLIC_HOSTNAME: string
PUBLIC_PROTOCOL: string
BASENAME: string
REACHABILITY_URL: string
STRIPE_CLIENT_PUBLISHABLE_KEY: string
RECAPTCHA_SITE_KEY: string
REGISTRY_ADDRESS: string
REWARDS_MANAGER_PROGRAM_ID: string
REWARDS_MANAGER_PROGRAM_PDA: string
REWARDS_MANAGER_TOKEN_PDA: string
SAFARI_WEB_PUSH_ID: string
SCHEME: string
SENTRY_DSN: string
SOL_BRIDGE_ADDRESS: Nullable<string>
SOL_TOKEN_BRIDGE_ADDRESS: Nullable<string>
SOLANA_CLUSTER_ENDPOINT: string
SOLANA_FEE_PAYER_ADDRESS: string
SOLANA_RELAY_ENDPOINT: string
SOLANA_TOKEN_PROGRAM_ADDRESS: string
SOLANA_WEB3_CLUSTER: string
SUGGESTED_FOLLOW_HANDLES: string
TIKTOK_APP_ID: string
TRPC_ENDPOINT: string
USDC_MINT_ADDRESS: string
USER_NODE: string
USE_HASH_ROUTING: boolean
WAUDIO_MINT_ADDRESS: string
WEB3_NETWORK_ID: string
WEB3_PROVIDER_URL: string
WORMHOLE_ADDRESS: Nullable<string>
WORMHOLE_RPC_HOSTS: Nullable<string>
}
2 changes: 1 addition & 1 deletion packages/common/src/store/buy-usdc/sagas.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import { call, put, race, select, take, takeLeading } from 'typed-redux-saga'
import { Name } from 'models/Analytics'
import { ErrorLevel } from 'models/ErrorReporting'
import { PurchaseVendor } from 'models/PurchaseContent'
import { Status } from 'models/Status'
import {
createPaymentRouterRouteTransaction,
createTransferToUserBankTransaction,
Expand Down Expand Up @@ -44,7 +45,6 @@ import {
} from './slice'
import { BuyUSDCError, BuyUSDCErrorCode } from './types'
import { getBuyUSDCRemoteConfig, getUSDCUserBank } from './utils'
import { Status } from 'models/Status'

type PurchaseStepParams = {
desiredAmount: number
Expand Down
2 changes: 1 addition & 1 deletion packages/common/src/store/buy-usdc/slice.ts
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
import { Action, createSlice, PayloadAction } from '@reduxjs/toolkit'

import { PurchaseVendor } from 'models/PurchaseContent'
import { Status } from 'models/Status'
import { StripeSessionCreationError } from 'store/ui/stripe-modal/types'

import { BuyUSDCStage, PurchaseInfo, BuyUSDCError } from './types'
import { Status } from 'models/Status'

type StripeSessionStatus =
| 'initialized'
Expand Down
1 change: 1 addition & 0 deletions packages/common/src/store/ui/mobile-overflow-menu/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ export enum OverflowAction {
ADD_TO_ALBUM = 'ADD_TO_ALBUM',
ADD_TO_PLAYLIST = 'ADD_TO_PLAYLIST',
REMOVE_FROM_PLAYLIST = 'REMOVE_FROM_PLAYLIST',
EDIT_ALBUM = 'EDIT_ALBUM',
EDIT_PLAYLIST = 'EDIT_PLAYLIST',
DELETE_PLAYLIST = 'DELETE_PLAYLIST',
PUBLISH_PLAYLIST = 'PUBLISH_PLAYLIST',
Expand Down
2 changes: 1 addition & 1 deletion packages/ddex/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -55,5 +55,5 @@ WORKDIR /app
COPY --from=app-builder --chown=nodejs:nodejs /app .
WORKDIR /app/packages/ddex/server

EXPOSE 8926
EXPOSE 3000
CMD ["node", "dist/index.js"]
2 changes: 1 addition & 1 deletion packages/ddex/Dockerfile.fast
Original file line number Diff line number Diff line change
Expand Up @@ -51,5 +51,5 @@ COPY packages/ddex/server/dist /app/packages/ddex/server/public

WORKDIR /app/packages/ddex/server

EXPOSE 8926
EXPOSE 3000
CMD [ "node", "dist/index.js" ]
1 change: 0 additions & 1 deletion packages/ddex/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,4 +15,3 @@ If you want to run the frontend locally, you'll need to:

Notes:
* When running on stage or prod, the backend serves the frontend as static assets at the root path
* (for now) When ran on stage or prod, the app will query its local `/d_api/env` endpoint to get environment variables that are set on the node. TODO: The backend can just read these from the environment directly.
31 changes: 0 additions & 31 deletions packages/ddex/client/.env.dev
Original file line number Diff line number Diff line change
@@ -1,35 +1,4 @@
# For testing staging locally (ie, npm run stage)
VITE_ENV_OVERRIDE=sandbox
VITE_NODE_TYPE_OVERRIDE=discovery
VITE_NODE_URL_OVERRIDE=https://localhost:5000
VITE_AUDIUS_URL_OVERRIDE=

VITE_ETH_NETWORK_ID_OVERRIDE=5
VITE_ETH_TOKEN_ADDRESS_OVERRIDE=0x855FA758c77D68a04990E992aA4dcdeF899F654A
VITE_ETH_REGISTRY_ADDRESS_OVERRIDE=0xABbfF712977dB51f9f212B85e8A4904c818C2b63
VITE_ETH_PROVIDER_URL_OVERRIDE=http://localhost:8546
VITE_ETH_OWNER_WALLET_OVERRIDE=0x855FA758c77D68a04990E992aA4dcdeF899F654A # it's blank in other stage configs

VITE_QUERY_PROPOSAL_START_BLOCK_OVERRIDE=1
VITE_GQL_URI_OVERRIDE=
VITE_GQL_BACKUP_URI_OVERRIDE=

VITE_ENTITY_MANAGER_ADDRESS_OVERRIDE=0x254dffcd3277C0b1660F6d42EFbB754edaBAbC2B

VITE_IDENTITY_SERVICE_ENDPOINT_OVERRIDE=localhost:7000

# not found in local
VITE_WORMHOLE_CONTRACT_ADDRESS_OVERRIDE=0xf6f45e4d836da1d4ecd43bb1074620bfb0b7e0d7

VITE_CLAIM_DISTRIBUTION_CONTRACT_ADDRESS_OVERRIDE=0x74b89B916c97d50557E8F944F32662fE52Ce378d
VITE_SOLANA_CLUSTER_ENDPOINT_OVERRIDE=http://localhost:8899
VITE_WAUDIO_MINT_ADDRESS_OVERRIDE=37RCjhgV1qGV2Q54EHFScdxZ22ydRMdKMtVgod47fDP3
VITE_USDC_MINT_ADDRESS_OVERRIDE=26Q7gP8UfkDzi7GMFEQxTJaNJ8D2ybCUjex58M5MLu8y
VITE_SOLANA_TOKEN_PROGRAM_ADDRESS_OVERRIDE=TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA
VITE_CLAIMABLE_TOKEN_PDA_OVERRIDE=testHKV1B56fbvop4w6f2cTGEub9dRQ2Euta5VmqdX9
VITE_SOLANA_FEE_PAYER_ADDRESS_OVERRIDE=HunCgdP91aVeoh8J7cbKTcFRoUwwhHwqYqVVLVkkqQjg
VITE_CLAIMABLE_TOKEN_PROGRAM_ADDRESS_OVERRIDE=testHKV1B56fbvop4w6f2cTGEub9dRQ2Euta5VmqdX9
VITE_REWARDS_MANAGER_PROGRAM_ID_OVERRIDE=testLsJKtyABc9UXJF8JWFKf1YH4LmqCWBC42c6akPb
VITE_REWARDS_MANAGER_PROGRAM_PDA_OVERRIDE=DJPzVothq58SmkpRb1ATn5ddN2Rpv1j2TcGvM3XsHf1c
VITE_REWARDS_MANAGER_TOKEN_PDA_OVERRIDE=FRk4j95RG2kSk3BHXBPVgKszFc2rLQ8K6RS83k3dmzvQ
VITE_OPTIMIZELY_SDK_KEY_OVERRIDE=MX4fYBgANQetvmBXGpuxzF
34 changes: 2 additions & 32 deletions packages/ddex/client/.env.stage.local
Original file line number Diff line number Diff line change
@@ -1,35 +1,5 @@
# For testing staging locally (ie, npm run stage)
VITE_ENV_OVERRIDE=stage
VITE_NODE_TYPE_OVERRIDE=discovery
VITE_NODE_URL_OVERRIDE=https://discoveryprovider2.staging.audius.co
VITE_AUDIUS_URL_OVERRIDE=https://staging.audius.co

VITE_DDEX_KEY_OVERRIDE=388c38db7bae770d5f371f9d02bebcac4da5e1e9

VITE_ETH_NETWORK_ID_OVERRIDE=5
VITE_ETH_TOKEN_ADDRESS_OVERRIDE=0x5375BE4c52fA29b26077B0F15ee5254D779676A6
VITE_ETH_REGISTRY_ADDRESS_OVERRIDE=0xF27A9c44d7d5DDdA29bC1eeaD94718EeAC1775e3
VITE_ETH_PROVIDER_URL_OVERRIDE=https://eth-goerli.g.alchemy.com/v2/OeXKHus0Nn5z_O7VZjzbprNtKjrYCdUX
VITE_ETH_OWNER_WALLET_OVERRIDE= # 0x5375BE4c52fA29b26077B0F15ee5254D779676A6 # it's blank in other stage configs

VITE_QUERY_PROPOSAL_START_BLOCK_OVERRIDE=1
VITE_GQL_URI_OVERRIDE=https://api.thegraph.com/subgraphs/name/audius-infra/audius-network-goerli
VITE_GQL_BACKUP_URI_OVERRIDE= # it's staging so having a backup isn't as important

VITE_ENTITY_MANAGER_ADDRESS_OVERRIDE=0x1Cd8a543596D499B9b6E7a6eC15ECd2B7857Fd64

VITE_IDENTITY_SERVICE_ENDPOINT_OVERRIDE=https://identityservice.staging.audius.co

VITE_WORMHOLE_CONTRACT_ADDRESS_OVERRIDE=0xf6f45e4d836da1d4ecd43bb1074620bfb0b7e0d7
VITE_CLAIM_DISTRIBUTION_CONTRACT_ADDRESS_OVERRIDE=0x74b89B916c97d50557E8F944F32662fE52Ce378d
VITE_SOLANA_CLUSTER_ENDPOINT_OVERRIDE=https://solana-mainnet.g.alchemy.com/v2/N_o4w4Lgk2afO8uho9uuZu0LNi6gldVz
VITE_WAUDIO_MINT_ADDRESS_OVERRIDE=BELGiMZQ34SDE6x2FUaML2UHDAgBLS64xvhXjX5tBBZo
VITE_USDC_MINT_ADDRESS_OVERRIDE=EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v
VITE_SOLANA_TOKEN_PROGRAM_ADDRESS_OVERRIDE=TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA
VITE_CLAIMABLE_TOKEN_PDA_OVERRIDE=Aw5AjygeMf9Nvg61BXvFSAzkqxcLqL8koepb14kvfc3W
VITE_SOLANA_FEE_PAYER_ADDRESS_OVERRIDE=E3CfijtAJwBSHfwFEViAUd3xp7c8TBxwC1eXn1Fgxp8h
VITE_CLAIMABLE_TOKEN_PROGRAM_ADDRESS_OVERRIDE=2sjQNmUfkV6yKKi4dPR8gWRgtyma5aiymE3aXL2RAZww
VITE_REWARDS_MANAGER_PROGRAM_ID_OVERRIDE=CDpzvz7DfgbF95jSSCHLX3ERkugyfgn9Fw8ypNZ1hfXp
VITE_REWARDS_MANAGER_PROGRAM_PDA_OVERRIDE=GaiG9LDYHfZGqeNaoGRzFEnLiwUT7WiC6sA6FDJX9ZPq
VITE_REWARDS_MANAGER_TOKEN_PDA_OVERRIDE=HJQj8P47BdA7ugjQEn45LaESYrxhiZDygmukt8iumFZJ
VITE_NODE_URL_OVERRIDE=https://audius-ddex.staging.audius.co
VITE_DDEX_KEY_OVERRIDE=49d5e13d355709b615b7cce7369174fb240b6b39
VITE_OPTIMIZELY_SDK_KEY_OVERRIDE=MX4fYBgANQetvmBXGpuxzF
2 changes: 1 addition & 1 deletion packages/ddex/client/src/components/App.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import Layout from './Layout'

const App = () => {
return (
<Router basename='/ddex'>
<Router>
<Layout>
<Routes>
<Route path='/' element={<Ddex />} />
Expand Down
13 changes: 5 additions & 8 deletions packages/ddex/client/src/components/AppWithProviders.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ import { QueryClient, QueryClientProvider } from '@tanstack/react-query'
import { httpBatchLink } from '@trpc/client'
import Web3 from 'web3'

import { AudiusLibsProvider } from 'providers/AudiusLibsProvider'
import { AudiusSdkProvider } from 'providers/AudiusSdkProvider'
import { RemoteConfigProvider } from 'providers/RemoteConfigProvider'
import { ThemeProvider } from 'providers/ThemeProvider'
Expand Down Expand Up @@ -38,13 +37,11 @@ const AppWithProviders = () => {
<trpc.Provider client={trpcClient} queryClient={queryClient}>
<QueryClientProvider client={queryClient}>
<RemoteConfigProvider>
<AudiusLibsProvider>
<AudiusSdkProvider>
<ThemeProvider>
<App />
</ThemeProvider>
</AudiusSdkProvider>
</AudiusLibsProvider>
<AudiusSdkProvider>
<ThemeProvider>
<App />
</ThemeProvider>
</AudiusSdkProvider>
</RemoteConfigProvider>
</QueryClientProvider>
</trpc.Provider>
Expand Down
Loading

0 comments on commit e0d8e31

Please sign in to comment.