getLatestBlockInfo timeout when accessing test node

Hello,

I am trying to use Casper JS SDK with Chrome Casper Signer plugin to access a test node from my web server. I have nodejs set up and running and connecting nicely with the Casper Signer Chrome plugin (I had to request to be added to the plugin whitelist). When I try to retrieve the latest block info, using the Casper JS SDK, I get a timeout. I am trying to follow the instructions outlined here:

https://github.com/casper-network/docs-archive/blob/master/dapp-dev-guide/tutorials/casper-signer.rst

My code looks like this. I have put a comment above the line that is causing the timeout:

import * as casper from "https://cdn.jsdelivr.net/npm/casper-js-sdk@2.10.0";

//Create Casper client and service to interact with Casper node.
const apiUrl = 'http://178.170.62.143:7777/rpc';
const casperService = new CasperServiceByJsonRPC(apiUrl);
const casperClient = new CasperClient(apiUrl);

const btnConnect = document.getElementById("btnConnect");
btnConnect.addEventListener("click", async () => {
    window.casperlabsHelper.requestConnection();
    await AccountInformation();
})

const btnDisconnect = document.getElementById("btnDisconnect");
btnDisconnect.addEventListener("click", () => {
        window.casperlabsHelper.disconnectFromSite();
})

async function AccountInformation(){
        const isConnected = await window.casperlabsHelper.isConnected()
        if(isConnected){
                const publicKey = await window.casperlabsHelper.getActivePublicKey();
                textAddress.textContent += publicKey;

// ****** THIS CALL FAILS WITH A TIMEOUT *****************
                const latestBlock = await casperService.getLatestBlockInfo();

                const root = await casperService.getStateRootHash(latestBlock.block.hash);


                const balanceUref = await casperService.getAccountBalanceUrefByPublicKey(
                        root,
                        CLPublicKey.fromHex(publicKey)
                        )

                //account balance from the last block
                const balance = await casperService.getAccountBalance(
                        latestBlock.block.header.state_root_hash,
                        balanceUref
                );
                textBalance.textContent = `PublicKeyHex ${balance.toString()}`;
        }
}

Many thanks for your help!

Adrian

My Git repository can be found here: GitHub - adrianj74/nodejs_signer

I have fixed this issue. The first problem was that I was using a test node that was incorrect!! I used a valid on and the timeout went away. Then I got a CORS error. This was fixed using a proxy server to handle a javascript request to get the balance, which then called the casper sdk.