File tree Expand file tree Collapse file tree 2 files changed +12
-5
lines changed
packages/discovery-provider/plugins/pedalboard/apps/relay/src Expand file tree Collapse file tree 2 files changed +12
-5
lines changed Original file line number Diff line number Diff line change @@ -43,6 +43,12 @@ const defaultCoreEndpoint = (env: string): string => {
4343 return 'http://core:50051'
4444}
4545
46+ export const chainId = ( config : Config ) : string => {
47+ if ( config . environment == "stage" ) return "1056801"
48+ if ( config . environment == "dev" ) return "1337"
49+ return "31524"
50+ }
51+
4652export const readConfig = ( ) : Config => {
4753 if ( config !== null ) {
4854 return config
Original file line number Diff line number Diff line change 1- import { Config , readConfig } from './config/config'
1+ import { chainId , Config , readConfig } from './config/config'
22import { ethers , providers } from 'ethers'
33import { WalletManager } from './walletManager'
44import { logger } from './logger'
@@ -26,16 +26,17 @@ export let web3: providers.JsonRpcProvider
2626export let wallets : WalletManager
2727
2828const main = async ( ) => {
29- if ( config . environment !== "dev" ) {
29+ try {
3030 // async config
3131 const connectedWeb3 = await connectWeb3 ( config )
3232 web3 = connectedWeb3 . web3
3333 config . acdcChainId = connectedWeb3 . chainId . toString ( )
3434 wallets = new WalletManager ( web3 )
35- } else {
36- // needs to stay so decoding can happen correctly
37- config . acdcChainId = "1337"
35+ } catch ( e ) {
36+ logger . warn ( "web3 not configured for relay, acdc not reachable" )
3837 }
38+ // needs to stay so decoding can happen correctly
39+ config . acdcChainId = chainId ( config )
3940
4041 // start webserver after async config
4142 const { serverHost, serverPort } = config
You can’t perform that action at this time.
0 commit comments