Hello Community!
I forked Dash's code to start a Community project, with learning in mind.
We managed to get all figured out, but this Insight explorer is killing us, and we want to learn basics.
When we start Insight node, it starts ok, we can see explorer website and even blocks with connection.
But if we click on any block or anything else, we get error and all node goes down.
Error that we get on console is
"error: uncaught exception: TypeError: Address has mismatched network type."
error: uncaught exception: TypeError: Address has mismatched network type.
at Function.Address._transformBuffer (/home/rxc/dashcore-node/mynode/node_modules/@dashevo/dashcore-lib/lib/address.js:217:11)
at Function.Address._transformString (/home/rxc/dashcore-node/mynode/node_modules/@dashevo/dashcore-lib/lib/address.js:296:22)
at Address._classifyArguments (/home/rxc/dashcore-node/mynode/node_modules/@dashevo/dashcore-lib/lib/address.js:116:20)
at new Address (/home/rxc/dashcore-node/mynode/node_modules/@dashevo/dashcore-lib/lib/address.js:76:19)
at Object.Address (/home/rxc/dashcore-node/mynode/node_modules/@dashevo/dashcore-lib/lib/address.js:54:12)
at TxController.transformOutput (/home/rxc/dashcore-node/mynode/node_modules/@dashevo/insight-api/lib/transactions.js:183:28)
at Array.map (<anonymous>)
at TxController.transformTransaction (/home/rxc/dashcore-node/mynode/node_modules/@dashevo/insight-api/lib/transactions.js:86:42)
at /home/rxc/dashcore-node/mynode/node_modules/@dashevo/insight-api/lib/transactions.js:280:16
at /home/rxc/dashcore-node/node_modules/async/dist/async.js:4617:26
As i understand that has something with networks.js file, where we define networkMagic to match our network.
File is located at /dashcore-node/mynode/node_modules/@dashevo/dashcore-lib/lib/networks.js
From our source code we have this information
pchMessageStart[0] = 0xd6;
pchMessageStart[1] = 0x93;
pchMessageStart[2] = 0xf3;
pchMessageStart[3] = 0x43;
vAlertPubKey = ParseHex("04e807f1caf222eb75de194e8b83c065c89fbce06b60d0968cdc832bd1ce17ef264362b43df7fd9
7cc7a1a38d69d6b7aab3c16cf7a3a9988fa8816c69a6a3016e1");
nDefaultPort = 23506;
nPruneAfterHeight = 100000;
So we changed networkMagic to 0x4693f343, and p2p port 23506
Should we change anything else from here?
addNetwork({
name: 'livenet',
alias: 'mainnet',
pubkeyhash: 0x4c,
privatekey: 0xcc,
scripthash: 0x10,
xpubkey: 0x488b21e, // 'xpub' (Bitcoin Default)
xprivkey: 0x488ade4, // 'xprv' (Bitcoin Default)
networkMagic: 0xd693f343,
port: 23506,
Our source code chainparams.cpp for reference
https://github.com/Ruxiol/ruxcryptoRXC/blob/master/src/chainparams.cppWhen i read error again, it says TypeError: Address has mismatched network type, could that be problem somewhere else, some other file?
If someone could help us understand we would be grateful
Rux, Crypto.ba Community