Testnets
Etherspot supports EVM Testnets.
Etherspot supports many testnets as a means for developers to test their applications before they move to mainnet. Currently, we support:
    Etherspot (our own POA network with a built-in Faucet)
    Ropsten
    Kovan
    Rinkeby
    Görli
    Sokol (xDai Testnet)
    Binance (Binance Testnet)
    Fantom (Fantom Testnet)
    Mumbai (Polygon, formerly known as Matic, Testnet)

Instantiating on all available test chains

Use the same private key or authentication method when instantiating an instance of the Etherspot SDK to generate the same Ethereum address across all chains
💪
Here we show you a basic example of how you could go about instantiating all the test networks we support and make them available via a class. Feel free to copy and paste this code, and modify it how you wish.
1
import {
2
Sdk as EtherspotSdk,
3
NetworkNames,
4
EnvNames,
5
} from 'etherspot';
6
7
class EtherspotService {
8
instances: { [network: string]: EtherspotSdk } = {};
9
10
init(privateKey: string): void {
11
/**
12
* You can use this space to do anything else
13
* you're application may require to run.
14
*/
15
16
// Etherspot POA Network with built-in Faucet
17
// https://try.etherspot.dev/#TopUpAccount
18
this.instances[NetworkNames.Etherspot] =
19
new EtherspotSdk(privateKey, {
20
env: EnvNames.TestNets,
21
networkName: NetworkNames.Etherspot
22
});
23
24
// Ropsten
25
this.instances[NetworkNames.Ropsten] =
26
new EtherspotSdk(privateKey, {
27
env: EnvNames.TestNets,
28
networkName: NetworkNames.Ropsten
29
});
30
31
// Kovan
32
this.instances[NetworkNames.Kovan] =
33
new EtherspotSdk(privateKey, {
34
env: EnvNames.TestNets,
35
networkName: NetworkNames.Kovan
36
});
37
38
// Görli
39
this.instances[NetworkNames.Goerli] =
40
new EtherspotSdk(privateKey, {
41
env: EnvNames.TestNets,
42
networkName: NetworkNames.Goerli
43
});
44
45
// Sokol (xDai Testnet)
46
this.instances[NetworkNames.Sokol] =
47
new EtherspotSdk(privateKey, {
48
env: EnvNames.TestNets,
49
networkName: NetworkNames.Sokol
50
});
51
52
// Binance (Binance Testnet)
53
this.instances[NetworkNames.BscTest] =
54
new EtherspotSdk(privateKey, {
55
env: EnvNames.TestNets,
56
networkName: NetworkNames.bscTest
57
});
58
59
// Fantom (Fantom Testnet)
60
this.instances[NetworkNames.FantomTest] =
61
new EtherspotSdk(privateKey, {
62
env: EnvNames.TestNets,
63
networkName: NetworkNames.fantomTest
64
});
65
66
// Mumbai (Polygon, formerly known as Matic, Testnet)
67
this.instances[NetworkNames.Mumbai] =
68
new EtherspotSdk(privateKey, {
69
env: EnvNames.TestNets,
70
networkName: NetworkNames.Mumbai
71
});
72
}
73
}
Copied!

Instantiating on a single chain

Below is a basic example of how you would instantiate an instance on the Etherspot SDK on a single test chain.
Kovan
1
import { Sdk, NetworkNames, randomPrivateKey, EnvNames } from 'etherspot';
2
3
const privateKey = randomPrivateKey();
4
let sdk: Sdk
5
6
/**
7
* Replace `privateKey` with your own private key
8
* or Etherspot Authentication method.
9
*/
10
sdk = new Sdk({
11
privateKey,
12
}, {
13
env: EnvNames.TestNets,
14
networkName: 'kovan' as NetworkNames, //
15
});
16
17
console.info('SDK created on Kovan testnet.');
Copied!
Last modified 2mo ago