File tree Expand file tree Collapse file tree 3 files changed +12
-2
lines changed
packages/eth-rpc-adapter/src Expand file tree Collapse file tree 3 files changed +12
-2
lines changed Original file line number Diff line number Diff line change @@ -55,7 +55,8 @@ export async function start(): Promise<void> {
5555 version : ${ version }
5656 endpoint url : ${ opts . endpoint }
5757 subquery url : ${ opts . subqlUrl }
58- listening to : ${ opts . port }
58+ server host : ${ opts . host }
59+ server port : ${ opts . port }
5960 max blockCache : ${ opts . maxBlockCacheSize }
6061 max batchSize : ${ opts . maxBatchSize }
6162 max storageSize : ${ opts . storageCacheSize }
Original file line number Diff line number Diff line change @@ -10,6 +10,7 @@ import { errorHandler } from './middlewares';
1010import { logger } from './utils/logger' ;
1111
1212export interface EthRpcServerOptions extends ServerOptions {
13+ host ?: string ;
1314 port : number ;
1415 batchSize : number ;
1516 middleware ?: HandleFunction [ ] ;
@@ -101,7 +102,7 @@ export default class EthRpcServer {
101102 }
102103
103104 start ( ) : void {
104- this . server . listen ( this . options . port ) ;
105+ this . server . listen ( this . options . port , this . options . host ) ;
105106 }
106107
107108 stop ( ) : void {
Original file line number Diff line number Diff line change @@ -6,6 +6,7 @@ export const sleep = async (time = 1000): Promise<void> => new Promise(resolve =
66const {
77 ENDPOINT_URL ,
88 SUBQL_URL ,
9+ HOST ,
910 PORT ,
1011 MAX_CACHE_SIZE ,
1112 MAX_BATCH_SIZE ,
@@ -43,6 +44,13 @@ export const yargsOptions = yargs(hideBin(process.argv))
4344 'Subquery url: *optional* if testing contracts locally that doesn\'t query logs or historical Tx, otherwise *required*' ,
4445 type : 'string' ,
4546 } ,
47+ host : {
48+ alias : 'h' ,
49+ demandOption : false ,
50+ default : HOST ?? 'localhost' ,
51+ describe : 'host to listen for http and ws requests' ,
52+ type : 'string' ,
53+ } ,
4654 port : {
4755 alias : 'p' ,
4856 demandOption : false ,
You can’t perform that action at this time.
0 commit comments