blockchainmultiversx

Should I use the MultiversX devnet instead of the testnet for development?


I've been using the testnet lately and I encounter issues: they reset it very often and the service is down for multiple hours and sometimes have bugs.

Should I use the devnet? From what I've understood it's more stable and they reset it less often?

I have a backend in js that uses the elrond-sdk-erdjs and I'm confused because there is no function that initializes the https://devnet-gateway.multiversx.com only the testnet. Is there a reason?

utils.ts

// TODO: Adjust with respect to current terminology (localnet instead of devnet).
function getDevnetProvider() {
    return new proxyProvider_1.ProxyProvider("http://localhost:7950", { timeout: 5000 });
}
exports.getDevnetProvider = getDevnetProvider;
function getTestnetProvider() {
    return new proxyProvider_1.ProxyProvider("https://testnet-gateway.elrond.com", { timeout: 5000 });
}
exports.getTestnetProvider = getTestnetProvider;
function getMainnetProvider() {
    return new proxyProvider_1.ProxyProvider("https://gateway.elrond.com", { timeout: 20000 });
}

Solution

  • The testnet is pretty volatile and it is reset very often (maybe weekly), without any warnings. Elrond recommends developers to use the devnet, it is reset maybe once every 3-4 months, so it's more stable.

    You can get the provider like this:

    function getDevnetProvider() {
        return new proxyProvider_1.ProxyProvider("https://devnet-gateway.elrond.com", { timeout: 5000 });
    }
    

    And the devnet explorer is here: https://devnet-explorer.elrond.com/