Nodejs Token Transfer Error: The network is stopped due to unrecognized protocol update

Hi all,

When making a transfer with nodejs, I get this error and the transaction doesn’t get sent.

 // Sign transaction

      const signer = buildAccountSigner(walletExport);
      const signature = await signTransaction(accountTransaction, signer);

//[x] the error starts here
      const transactionHash = await client.sendAccountTransaction(
        accountTransaction,
        signature,
      );

      // #endregion documentation-snippet-sign-transaction
      const status = await client.waitForTransactionFinalization(
        transactionHash,
      );

The network is stopped due to unrecognized protocol update

This error starts at send AccountTransaction. Looking forward to resolving this issue with your help.

Thank you.

for more clarity, this is exaclty the procedure from the example on https://vscode.dev/github/Concordium/concordium-node-sdk-js/blob/main/examples/nodejs/common/simpleTransfer.ts

    try {
      const fileContent = readFileSync(filePath, 'utf8');
      const walletExport = parseWallet(fileContent);
      const sender = AccountAddress.fromBase58(walletExport.value.address);

      const toAddress = AccountAddress.fromBase58(
        '4MYtff8XgjNSBqgjVjX...',
      );

      const nextNonce = await client.getNextAccountNonce(sender);

      const header = {
        expiry: TransactionExpiry.futureMinutes(60),
        nonce: nextNonce.nonce,
        sender,
      };

      const simpleTransfer = {
        amount: CcdAmount.fromMicroCcd(100),
        toAddress,
      };

      // #region documentation-snippet-sign-transaction
      const accountTransaction = {
        header: header,
        payload: simpleTransfer,
        type: AccountTransactionType.Transfer,
      };

      // Sign transaction
      const signer = buildAccountSigner(walletExport);
      const signature = await signTransaction(accountTransaction, signer);

      const transactionHash = await client.sendAccountTransaction(
        accountTransaction,
        signature,
      );

      // #endregion documentation-snippet-sign-transaction
      const status = await client.waitForTransactionFinalization(
        transactionHash,
      );

      console.log(status);
    } catch (error) {
      console.error(`Error reading file: ${error.message}`);
      return res.status(HttpStatusCodes.OK);
    }

What node are you connecting to?

It looks like you have a node version before 6, which is not up to date and so cannot keep up with the network.

You need to update the node is the most likely resolution.

Nonexisting sender account.

@abizjak, I updated the node to version 6.2, and currently, I’m getting a strange error. what could be the possible solution for this?

The sender account is from the exported private key. And I think every account should be valid because it’s gotten direclty from the wallet.

Much appreciated in advance.

Hello @abizjak, I would love to refer to the implementation of a transfer that I shared earlier. From your response, I am to update my node to a new version which I did update to 6.2. I have spent hours trying to debug the reason why an account that comes from a private wallet key seems not to exist on the Concordium blockchain.

This is slowing me down in a lot of areas. A quick response to this is much appreciated.

Nonexisting sender account.

The most likely reason for this is that your node is not caught up.

If you have concordium-client, if you run concordium-client consensus status --grpc-ip IP-OF-YOUR-NODE it should show you whether your node is caught up or not. You can compare the height printed there with the current height, which is around 12222001. See https://ccdscan.io/ for the current values.