Ganache : Invalid JSON RPC response: "" Error

I attempting to deploy the GSN contracts; my steps, prior to deploying my contracts as follows:
my truffle-config.js —> network_id: ‘777’
root:# ganache-cli -d -h -p 9545 --chainId 777
Ganache CLI v6.12.2 (ganache-core: 2.13.2)

root:# node_modules/.bin/gsn start
Error: Invalid JSON RPC response: ""
    at Object.InvalidResponse (/home/workspace/Vue-box-gsn/node_modules/@opengsn/gsn/node_modules/web3-core-helpers/src/errors.js:42:16)
    at XMLHttpRequest.request.onreadystatechange (/home/workspace/Vue-box-gsn/node_modules/@opengsn/gsn/node_modules/web3-providers-http/src/index.js:106:32)
    at XMLHttpRequestEventTarget.dispatchEvent (/home/workspace/Vue-box-gsn/node_modules/xhr2-cookies/xml-http-request-event-target.ts:44:13)
    at XMLHttpRequest._setReadyState (/home/workspace/Vue-box-gsn/node_modules/xhr2-cookies/xml-http-request.ts:219:8)
    at XMLHttpRequest._onHttpRequestError (/home/workspace/Vue-box-gsn/node_modules/xhr2-cookies/xml-http-request.ts:379:8)
    at ClientRequest.<anonymous> (/home/workspace/Vue-box-gsn/node_modules/xhr2-cookies/xml-http-request.ts:266:37)
    at ClientRequest.emit (events.js:198:13)
    at Socket.socketErrorListener (_http_client.js:392:9)
    at Socket.emit (events.js:198:13)
    at emitErrorNT (internal/streams/destroy.js:91:8)
    at emitErrorAndCloseNT (internal/streams/destroy.js:59:3)
    at process._tickCallback (internal/process/next_tick.js:63:19)

Any help is appreciated

My suspicion is that you didn’t provide a networkId. Make sure it has the same value as the chainId.

ganache-cli --networkId 777 --chainId 777 --port 9545


ganache-cli -i 777 -p 9545 --chainId 777

1 Like

GSN start works with ganache on port 8545.

1 Like

Ok i tried with simply using
# ganache-cli -i 777 -d --chainId 777

And that works deploying the GSN contracts on
local host 127.0.01:8544

Where can I change the default host in GSN ?


ok so to solve my problem I deployed the GSN contracts to a specific host address by passing my custom URL in the command line

node_modules/.bin/gsn start -n

1 Like

glad you solve it. we’ll update the docs