1

I have a .appx installation of Ganache for Windows. I've made a blockchain on it & deployed a smart contract. Now I want to test it on Android Metamask. But Ganache address is only listening to my PC & it's not usable across all devices connected to same network.

How is it possible to make it open to lan & also connect it to Android Metamask?

Thank you

1 Answer 1

2

You can change the --server command line argument on ganache:

Server:
      --server.ws                        Enable a websocket server.                            [boolean] [default: true]
      --server.wsBinary                  Whether or not websockets should response with binary data (ArrayBuffers) or
                                         strings.                     [choices: "true", "false", "auto"] [default: auto]
      --server.rpcEndpoint               Defines the endpoint route the HTTP and WebSocket servers will listen on.
                                                                         [default: "/" (Ethereum), "/rpc/v0" (Filecoin)]
      --server.chunkSize                 For memory and performance reasons ganache may respond with chunked
                                         transfer-encoding over HTTP and fragmented send over WebSockets. This option
                                         allows you to control the approximate size of each chunk.
                                                                                             [number] [default: 1048576]
  -h, --server.host, --host, --hostname  Hostname to listen on.
                                         deprecated aliases: --host, --hostname
                                                                                         [string] [default: "127.0.0.1"]
  -p, --server.port, --port              Port to listen on.
                                         deprecated aliases: --port
                                                                                                [number] [default: 8545]

Options:
  -?, --help     Show help                                                                                     [boolean]
      --version  Show version number                                                                           [boolean]

In TCP/IP when you set --server 0.0.0.0 it will listen to all IP addresses, not just localhost. This includes any public IP addresses your computer has.

This is not limited to ganache, but is how TCP/IP protocol and applications work.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.