소스 검색

server: configurable js endpoint

Joystream Stats 3 년 전
부모
커밋
8fef2ded34
2개의 변경된 파일3개의 추가작업 그리고 6개의 파일을 삭제
  1. 2 1
      server/config.json
  2. 1 5
      server/joystream/ws.ts

+ 2 - 1
server/config.json

@@ -1,3 +1,4 @@
 {
-    "domain": "https://testnet.joystream.org"
+    "domain": "https://testnet.joystream.org",
+    "wsLocation": "wss://joystreamstats.live:9945"
 }

+ 1 - 5
server/joystream/ws.ts

@@ -1,11 +1,7 @@
-// TODO allow alternative backends
-
+ import {wsLocation} from "../config.json"
 import { ApiPromise, WsProvider } from '@polkadot/api'
 import { types } from '@joystream/types'
 
-const wsLocation =
-    'ws://localhost:9944'
-    // 'wss://rome-rpc-endpoint.joystream.org:9944'
 
 const connectUpstream = async (): Promise<ApiPromise> => {
     try {