Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

networks.js for another cryptocurrency #121

Closed
germanstudent opened this issue Mar 9, 2014 · 5 comments
Closed

networks.js for another cryptocurrency #121

germanstudent opened this issue Mar 9, 2014 · 5 comments

Comments

@germanstudent
Copy link

Hey bitcore team, awesome work you do here! I really love insight and want to fork the project for another cryptocurrency named fuckcoin. (yes, i know ^^)

I find it hard to get the networks.js settings of bitcore right, resulting in

[historic_sync] ERROR: Bad genesis block. Network mismatch between Insight and bitcoind? Insight is configured for:livenet

when starting insight / bitcore.

The hexdump for the fuckcoin genesis block is

00000000  fb c0 b6 db 04 01 00 00  01 00 00 00 00 00 00 00  |................|
00000010  00 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00  |................|
00000020  00 00 00 00 00 00 00 00  00 00 00 00 db 2c ed d9  |.............,..|
00000030  d5 98 36 30 e1 03 ef 34  4b 15 99 9e 4f 4d 55 f9  |..60...4K...OMU.|
00000040  45 d3 0d 68 dd a2 44 fe  10 50 7b 53 9d 81 d8 52  |E..h..D..P{S...R|
00000050  ff ff 0f 1e d4 fb 0c 00  01 01 00 00 00 01 00 00  |................|
00000060  00 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00  |................|
00000070  00 00 00 00 00 00 00 00  00 00 00 00 00 00 ff ff  |................|
00000080  ff ff 34 04 ff ff 00 1d  01 04 2c 48 6f 77 20 53  |..4.......,How S|
00000090  65 78 20 41 66 66 65 63  74 73 20 49 6e 74 65 6c  |ex Affects Intel|
000000a0  6c 69 67 65 6e 63 65 2c  20 61 6e 64 20 56 69 63  |ligence, and Vic|
000000b0  65 20 56 65 72 73 61 ff  ff ff ff 01 00 a5 45 9b  |e Versa.......E.|
000000c0  01 00 00 00 43 41 04 01  84 71 0f a6 89 ad 50 23  |....CA...q....P#|
000000d0  69 0c 80 f3 a4 9c 8f 13  f8 d4 5b 8c 85 7f bc bc  |i.........[.....|
000000e0  8b c4 a8 e4 d3 eb 4b 10  f4 d4 60 4f a0 8d ce 60  |......K...`O...`|
000000f0  1a af 0f 47 02 16 fe 1b  51 85 0b 4a cf 21 b1 79  |...G....Q..J.!.y|
00000100  c4 50 70 ac 7b 03 a9 ac  00 00 00 00 fb c0 b6 db  |.Pp.{...........|
00000110  bb 00 00 00 02 00 00 00  a9 07 e6 72 1d 87 d0 26  |...........r...&|
00000120  5b f2 fe d6 a1 0a 00 0c  fd dc da 10              |[...........|
0000012c

Genesis Block Blockexplorer

Genesis Block main.cpp

base58.h fuckcoin

I set networks.js to

exports.livenet = {
  name: 'livenet',
  addressVersion: 0x23,
  magic: hex('fbc0b6db'),
  genesisBlock: {
    height: 0,
    nonce: 850900,
    version: 1,
    hash: hex('32F3A2C560499F2600108F5B10DADCFD0C000AA1D6FEF25B26D0871D72E607A9'),
    prev_hash: buffertools.fill(new Buffer(32), 0),
    timestamp: 1389920669,
    merkle_root: hex('537B5010FE44A2DD680DD345F9554D4F9E99154B34EF03E1303698D5D9ED2CDB'),
    bits: 486604799
  },
  genesisBlockTx: {
    outs: [{
      v: hex('00A5459B01000000'), // 69 FUCKs
      s: new Put()
        .word8(65) // 65 bytes of data follow
        .put(hex('040184710FA689AD5023690C80F3A49C8F13F8D45B8C857FBCBC8BC4A8E4D3EB4B10F4D4604FA08DCE601AAF0F470216FE1B51850B4ACF21B179C45070AC7B03A9'))
        .word8(0xAC) // OP_CHECKSIG
        .buffer()
    }],
    lock_time: 0,
    version: 1,
    hash: hex('537B5010FE44A2DD680DD345F9554D4F9E99154B34EF03E1303698D5D9ED2CDB'),
    ins: [{
      q: 0xFFFFFFFF,
      o: hex("0000000000000000000000000000000000000000000000000000000000000000FFFFFFFF"),
      s: new Put()
        .put(hex('04FFFF001D01042C'))
        .put(new Buffer('How Sex Affects Intelligence, ' +
                        'and Vice Versa', 'ascii'))
        .buffer()
    }]
  },
  proofOfWorkLimit: hex("00000000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF"),
  checkpoints: [], // need to put checkpoint blocks here
  addressPubkey: 35,
  addressScript: 5,
  keySecret: 128,
};

I don't have a full code overview, yet. Are there other dependencies that could cause the Bad genesis block error? Or can you please check if there is an error in my version of networks.js? Thank you!

@maraoz
Copy link
Contributor

maraoz commented Mar 12, 2014

Can you post the full stack trace of the error? That might help.

@matiu
Copy link
Contributor

matiu commented Mar 15, 2014

Please check insight Readme. You need to set the environment variable: INSIGHT_NETWORK

@acejam
Copy link

acejam commented Jun 4, 2014

Any luck with this?

@matiu
Copy link
Contributor

matiu commented Jun 4, 2014

Take a look of:

bitpay/insight-api#115

On Wed, Jun 4, 2014 at 3:28 PM, acejam notifications@github.com wrote:

Any luck with this?


Reply to this email directly or view it on GitHub
#121 (comment).

Matías Alejo Garcia
Skype/Twitter: @EMATIU
Roads? Where we're going, we don't need roads!

@ryanxcharles
Copy link
Contributor

If this is still an issue please let us know. Otherwise marking as resolved for now.

slowfx pushed a commit to slowfx/bitcore-mona that referenced this issue Jul 14, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants