Network Configuration

Switch Network on Testnet

On Testnet, you can switch between Rinkeby, Ropsten, and Kovan. Default is Rinkeby.
1
import Fortmatic from 'fortmatic';
2
import Web3 from 'web3';
3
​
4
// Default is Rinkeby
5
const fm = new Fortmatic('YOUR_TEST_API_KEY');
6
window.web3 = new Web3(fm.getProvider());
7
​
8
// Setting testnet network to Ropsten
9
const fm = new Fortmatic('YOUR_TEST_API_KEY', 'ropsten');
10
window.web3 = new Web3(fm.getProvider());
11
​
12
// Setting testnet network to Kovan
13
const fm = new Fortmatic('YOUR_TEST_API_KEY', 'kovan');
14
window.web3 = new Web3(fm.getProvider());
Copied!

Switch Network to Custom Node

You can choose to use your own node, like a development test node or a sidechain. We currently support:
Please contact us at our support channel if you want to use other nodes.
1
import Fortmatic from 'fortmatic';
2
import Web3 from 'web3';
3
​
4
const customNodeOptions = {
5
rpcUrl: 'http://127.0.0.1:7545', // your own node url
6
chainId: 1011 // chainId of your own node
7
}
8
​
9
// Setting network to localhost blockchain
10
const fm = new Fortmatic('YOUR_TEST_API_KEY', customNodeOptions);
11
window.web3 = new Web3(fm.getProvider());
Copied!

​

Last modified 8mo ago