Bitcoin Forum
May 10, 2024, 06:17:58 AM *
News: Latest Bitcoin Core release: 27.0 [Torrent]
 
   Home   Help Search Login Register More  
Pages: [1]
  Print  
Author Topic: Insight Explorer Address has mismatched network type  (Read 39 times)
Rux (OP)
Legendary
*
Offline Offline

Activity: 1291
Merit: 1024


https://crypto.ba


View Profile WWW
December 28, 2020, 07:30:40 PM
 #1

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.cpp

When 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


RXC Crypto.ba Decentralized solutions!
1715321878
Hero Member
*
Offline Offline

Posts: 1715321878

View Profile Personal Message (Offline)

Ignore
1715321878
Reply with quote  #2

1715321878
Report to moderator
1715321878
Hero Member
*
Offline Offline

Posts: 1715321878

View Profile Personal Message (Offline)

Ignore
1715321878
Reply with quote  #2

1715321878
Report to moderator
TalkImg was created especially for hosting images on bitcointalk.org: try it next time you want to post an image
Advertised sites are not endorsed by the Bitcoin Forum. They may be unsafe, untrustworthy, or illegal in your jurisdiction.
Rux (OP)
Legendary
*
Offline Offline

Activity: 1291
Merit: 1024


https://crypto.ba


View Profile WWW
December 28, 2020, 07:43:20 PM
 #2

From here only logical solution is that we didn't modified these three entries

pubkeyhash: 0x4c,
privatekey: 0xcc,
scripthash: 0x10,

But in source code, we cannot find direct link with those three entries, there is similar line but with long string.




 

RXC Crypto.ba Decentralized solutions!
Bitcoin_Arena
Copper Member
Legendary
*
Offline Offline

Activity: 2030
Merit: 1788


฿itcoin for all, All for ฿itcoin.


View Profile
December 28, 2020, 08:32:14 PM
 #3

This kind of problem could easily be identified and solved by people who are more familiar with Dash and insight explorer and not here so I suggest you would try contacting the dash community or Devs.
Have you tried checking out their issues explorer; https://github.com/dashevo/insight-ui/issues


.BEST..CHANGE.███████████████
██
██
██
██
██
██
██
██
██
██
██
██
██
██
██
██
██
██
██
██
██
██
██
██
███████████████
..BUY/ SELL CRYPTO..
Rux (OP)
Legendary
*
Offline Offline

Activity: 1291
Merit: 1024


https://crypto.ba


View Profile WWW
December 28, 2020, 08:52:03 PM
 #4

I'm sorry i posted here, believe me i tried to figure out via Dash community, but nobody answered the question.

I have found something similar but no luck so far, and i have found this lines in codes

if (!bufferVersion.network || (network && network !== bufferVersion.network)) {
    throw new TypeError('Address has mismatched network type.');
  }

https://github.com/dashevo/dashcore-lib/blob/v0.19-dev/lib/address.js#L198

Thanks for the link, will search there.

RXC Crypto.ba Decentralized solutions!
Pages: [1]
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.19 | SMF © 2006-2009, Simple Machines Valid XHTML 1.0! Valid CSS!