Hey @Duka
I’m currently building a Node.js backend to interact with a smart contract using @klever/sdk-node. I’m following your official documentation and explicitly setting the node and API endpoints to Testnet like your code above so:
import { Account, utils, TransactionType } from '@klever/sdk-node';
utils.setProviders({
node: 'https://node.testnet.klever.org',
api: 'https://api.testnet.klever.org',
});
However, when the server runs, I still get the following error:
❌ Error: fetch failed
...
cause: Error: getaddrinfo ENOTFOUND node.mainnet.klever.finance
This indicates that the SDK is still trying to connect to the outdated node.mainnet.klever.finance endpoint… even though I never set this in my code or .env file.
What I’ve already confirmed:
- My
.envvariables point to Testnet (.orgdomain, not.finance). - I’m explicitly calling
utils.setProviders(...)before initializingAccountor making any transaction. - I’m using
@klever/sdk-node@2.4.1(latest).
Is utils.setProviders() currently being ignored or overwritten internally by the SDK?
How can I ensure that the correct endpoints (e.g., https://node.testnet.klever.org) are being used for signing and broadcasting?
Thanks for any insight! ![]()
EDIT:
node_modules/@klever/sdk-node/dist/cjs/index.js
Here is the domain is hardcoded in multiple places.
