I'm trying to send a transaction with a memo program inside it. The problem appears on solana cli and web3 too.
This is the command:
solana transfer --from ./.cache/solana.json RECIVER_PUBLIC_KEY 0.00001 --allow-unfunded-recipient --url https://api.testnet.solana.com --fee-payer ./.cache/solana.json --with-memo hello
and this the response:
Error: RPC response error -32005: Node is unhealthy
The same with typescript/js snippet:
async function sendRawTransaction(message:string):Promise<string>{
const connection = await new Connection(CONNECTION_STRING);
let tx = new Transaction().add(
SystemProgram.transfer({
fromPubkey: WALLET.publicKey,
toPubkey: RECIVER_ADDRESS,
lamports: 0,
}),
);
await tx.add(
new TransactionInstruction({
keys: [{ pubkey: WALLET.publicKey, isSigner: true, isWritable: true }],
data: Buffer.from(message, "utf-8"),
programId: MEMO_PROGRAM,
})
);
return new Promise((res, rej)=>{
sendAndConfirmTransaction(connection, tx, [WALLET]).then(s=>{
console.log(s)
res(s)
}).catch(e=>{
console.log(e)
rej(e)
})
})
}
and the response is:
SendTransactionError: failed to send transaction: Node is unhealthy
at Connection.sendEncodedTransaction (/Users/manueltardivo/Sviluppo/Notarify/Refactor/ntf-blackbox/node_modules/@solana/web3.js/lib/index.cjs.js:6812:13)
at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
at async Connection.sendRawTransaction (/Users/manueltardivo/Sviluppo/Notarify/Refactor/ntf-blackbox/node_modules/@solana/web3.js/lib/index.cjs.js:6769:20)
at async Connection.sendTransaction (/Users/manueltardivo/Sviluppo/Notarify/Refactor/ntf-blackbox/node_modules/@solana/web3.js/lib/index.cjs.js:6759:12)
at async sendAndConfirmTransaction (/Users/manueltardivo/Sviluppo/Notarify/Refactor/ntf-blackbox/node_modules/@solana/web3.js/lib/index.cjs.js:2219:21) {
logs: undefined
}
node:internal/process/promises:288
triggerUncaughtException(err, true /* fromPromise */);
^
SendTransactionError: failed to send transaction: Node is unhealthy
at Connection.sendEncodedTransaction (/Users/manueltardivo/Sviluppo/Notarify/Refactor/ntf-blackbox/node_modules/@solana/web3.js/lib/index.cjs.js:6812:13)
at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
at async Connection.sendRawTransaction (/Users/manueltardivo/Sviluppo/Notarify/Refactor/ntf-blackbox/node_modules/@solana/web3.js/lib/index.cjs.js:6769:20)
at async Connection.sendTransaction (/Users/manueltardivo/Sviluppo/Notarify/Refactor/ntf-blackbox/node_modules/@solana/web3.js/lib/index.cjs.js:6759:12)
at async sendAndConfirmTransaction (/Users/manueltardivo/Sviluppo/Notarify/Refactor/ntf-blackbox/node_modules/@solana/web3.js/lib/index.cjs.js:2219:21) {
logs: undefined
}
Node.js v18.4.0
[nodemon] app crashed - waiting for file changes before starting...
I've already tried to delete node_modules and re install them. Could be a problem with the RPC provider?