From 72e91efd6d723ce47f57ae37d73ff683335c2955 Mon Sep 17 00:00:00 2001 From: Bradley Mackey Date: Sat, 13 Nov 2021 13:46:14 +0000 Subject: [PATCH 1/2] Add Garlicoin --- lib/coininfo.js | 1 + lib/coins/grlc.js | 56 +++++++++++++++++++++++++++++++++++++++++++ test/coininfo.test.js | 1 + 3 files changed, 58 insertions(+) create mode 100644 lib/coins/grlc.js diff --git a/lib/coininfo.js b/lib/coininfo.js index 7a769b6..a97cbc7 100644 --- a/lib/coininfo.js +++ b/lib/coininfo.js @@ -13,6 +13,7 @@ var coins = [ require('./coins/dcr'), require('./coins/dgb'), require('./coins/doge'), + require('./coins/grlc'), require('./coins/grs'), require('./coins/ltc'), require('./coins/via'), diff --git a/lib/coins/grlc.js b/lib/coins/grlc.js new file mode 100644 index 0000000..f074f92 --- /dev/null +++ b/lib/coins/grlc.js @@ -0,0 +1,56 @@ +// https://github.com/GarlicoinOrg/Garlicoin/blob/master/src/chainparams.cpp + +var common = { + name: 'Garlicoin', + unit: 'GRLC', +}; + +var main = Object.assign({}, { + hashGenesisBlock: '2ada80bf415a89358d697569c96eb98cdbf4c3b8878ac5722c01284492e27228', + port: 42069, + protocol: { + magic: 0xd2c6b6db + }, + bech32: 'grlc', + seedsDns: [ + 'dnsseed.rshaw.space', + 'dnsseed.garli.co.in' + ], + versions: { + bip32: { + private: 0x0488ade4, + public: 0x0488b21e + }, + bip44: 69420, + private: 0xb0, + public: 0x26, + scripthash: 0x32 + } +}, common); + +var test = Object.assign({}, { + hashGenesisBlock: 'b25004ec2dc27689999f9ee14856ee0464d7f73f3fae3cf43c1d40f89c141aea', + port: 42075, + protocol: { + magic: 0xfdd2c8f2 + }, + bech32: 'tgrlc', + seedsDns: [ + 'dnsseed-testnet.rshaw.space' + ], + versions: { + bip32: { + private: 0x04358394, + public: 0x043587cf + }, + bip44: 1, + private: 0xef, + public: 0x6f, + scripthash: 0x3a + } +}, common); + +module.exports = { + main, + test +}; diff --git a/test/coininfo.test.js b/test/coininfo.test.js index 9a3476c..1103822 100644 --- a/test/coininfo.test.js +++ b/test/coininfo.test.js @@ -11,6 +11,7 @@ test('+ coininfo()', function (t) { 'doge', 'doge-test', 'ltc', 'ltc-test', 'via', 'via-test', + 'grlc', 'grlc-test', 'grs', 'grs-test', 'nbt', 'nmc', From 7737af3c48aea6d521136880cb2546ea8c7b0878 Mon Sep 17 00:00:00 2001 From: Bradley Mackey Date: Fri, 24 Dec 2021 14:38:07 +0000 Subject: [PATCH 2/2] Garlicoin: fix big/little endian mixup in magic --- lib/coins/grlc.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/coins/grlc.js b/lib/coins/grlc.js index f074f92..5ee4057 100644 --- a/lib/coins/grlc.js +++ b/lib/coins/grlc.js @@ -9,7 +9,7 @@ var main = Object.assign({}, { hashGenesisBlock: '2ada80bf415a89358d697569c96eb98cdbf4c3b8878ac5722c01284492e27228', port: 42069, protocol: { - magic: 0xd2c6b6db + magic: 0xdbb6c6d2 }, bech32: 'grlc', seedsDns: [ @@ -32,7 +32,7 @@ var test = Object.assign({}, { hashGenesisBlock: 'b25004ec2dc27689999f9ee14856ee0464d7f73f3fae3cf43c1d40f89c141aea', port: 42075, protocol: { - magic: 0xfdd2c8f2 + magic: 0xf2c8d2fd }, bech32: 'tgrlc', seedsDns: [