code: def set_api_rpc(self, rpc: str = None, rpctls: bool = False) -> None:
          
          if rpc == "ganache":
              rpcconfig = ("localhost", 8545, False)
          else:
              m = re.match(r"infura-(.*)", rpc)
              if m and m.group(1) in ["mainnet", "rinkeby", "kovan", "ropsten"]:
                  rpcconfig = (m.group(1) + ".infura.io", 443, True)
              else:
                  try:
                      host, port = rpc.split(":")
                      rpcconfig = (host, int(port), rpctls)
                  except ValueError:
                      raise CriticalError(
                          "Invalid RPC argument, use 'ganache', 'infura-[network]' or 'HOST:PORT'"
                      )
  
          if rpcconfig:
              log.info("Using RPC settings: %s" % str(rpcconfig))
              self.eth = EthJsonRpc(rpcconfig[0], int(rpcconfig[1]), rpcconfig[2])
          else:
              raise CriticalError("Invalid RPC settings, check help for details.")
docs: Sets the RPC mode to either of ganache or infura
          :param rpc: either of the strings - ganache, infura-mainnet, infura-rinkeby, infura-kovan, infura-ropsten