Skip to content

Commit

Permalink
Add CSS and PUG
Browse files Browse the repository at this point in the history
  • Loading branch information
xiaolin1579 committed Aug 13, 2024
1 parent 8519db8 commit 0961daa
Show file tree
Hide file tree
Showing 5 changed files with 73 additions and 1 deletion.
18 changes: 18 additions & 0 deletions src/Miningcore/Blockchain/Kaspa/KaspaConstants.cs
Original file line number Diff line number Diff line change
Expand Up @@ -105,6 +105,24 @@ public static class KarlsencoinConstants
public const long FishHashPlusForkHeightTestnet = 6000000;
}

public static class ConsensusConstants
{
// List of CSS prefixes: https://github.com/consensus-network/consensusd/blob/master/util/address.go
public const string ChainPrefixDevnet = "consensusdev";
public const string ChainPrefixSimnet = "consensussim";
public const string ChainPrefixTestnet = "consensustest";
public const string ChainPrefixMainnet = "consensus";
}

public static class PugdagConstants
{
// List of PUG prefixes: https://github.com/Pugdag/pugdagd/blob/main/util/address.go
public const string ChainPrefixDevnet = "pugdagdev";
public const string ChainPrefixSimnet = "pugdagsim";
public const string ChainPrefixTestnet = "pugdagtest";
public const string ChainPrefixMainnet = "pugdag";
}

public static class NautilusConstants
{
// List of NTL prefixes: https://github.com/Nautilus-Network/nautiliad/blob/master/util/address.go
Expand Down
2 changes: 2 additions & 0 deletions src/Miningcore/Blockchain/Kaspa/KaspaJobManager.cs
Original file line number Diff line number Diff line change
Expand Up @@ -288,6 +288,8 @@ private KaspaJob CreateJob(long blockHeight)
customShareHasher = new CShake256(null, Encoding.UTF8.GetBytes(KaspaConstants.CoinbaseHeavyHash));

return new KarlsencoinJob(customBlockHeaderHasher, customCoinbaseHasher, customShareHasher);
case "CSS":
case "PUG":
case "NTL":
case "NXL":
if(customBlockHeaderHasher is not Blake2b)
Expand Down
22 changes: 21 additions & 1 deletion src/Miningcore/Blockchain/Kaspa/KaspaUtils.cs
Original file line number Diff line number Diff line change
Expand Up @@ -354,7 +354,27 @@ public KaspaAddressUtility(string coinSymbol = "KAS")
// Build address pattern based on network type and coin symbol
switch(this.CoinSymbol)
{
case "BGA":
case "PUG":
this.stringsToBech32Prefixes = new Dictionary<string, KaspaBech32Prefix>
{
{ PugdagConstants.ChainPrefixMainnet, KaspaBech32Prefix.KaspaMain },
{ PugdagConstants.ChainPrefixDevnet, KaspaBech32Prefix.KaspaDev },
{ PugdagConstants.ChainPrefixTestnet, KaspaBech32Prefix.KaspaTest },
{ PugdagConstants.ChainPrefixSimnet, KaspaBech32Prefix.KaspaSim },
};

break;
case "CSS":
this.stringsToBech32Prefixes = new Dictionary<string, KaspaBech32Prefix>
{
{ ConsensusConstants.ChainPrefixMainnet, KaspaBech32Prefix.KaspaMain },
{ ConsensusConstants.ChainPrefixDevnet, KaspaBech32Prefix.KaspaDev },
{ ConsensusConstants.ChainPrefixTestnet, KaspaBech32Prefix.KaspaTest },
{ ConsensusConstants.ChainPrefixSimnet, KaspaBech32Prefix.KaspaSim },
};

break;
case "BGA":
this.stringsToBech32Prefixes = new Dictionary<string, KaspaBech32Prefix>
{
{ BugnaConstants.ChainPrefixMainnet, KaspaBech32Prefix.KaspaMain },
Expand Down
2 changes: 2 additions & 0 deletions src/Miningcore/Configuration/ClusterConfigExtensions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -258,6 +258,8 @@ public override string GetAlgorithmName()
{
switch(Symbol)
{
case "CSS":
case "PUG":
case "KLS":
case "NTL":
case "NXL":
Expand Down
30 changes: 30 additions & 0 deletions src/Miningcore/coins.json
Original file line number Diff line number Diff line change
Expand Up @@ -5549,6 +5549,36 @@
"explorerTxLink": "https://explorer.kobradag.online/txs/{0}",
"explorerAccountLink": "https://explorer.kobradag.online/addresses/{0}"
},
"consensus": {
"name": "Consensus",
"canonicalName": "Consensus",
"symbol": "CSS",
"family": "kaspa",
"website": "https://consensus-network.com/",
"github": "https://github.com/consensus-network/consensusd",
"market": "",
"twitter": "https://twitter.com/Consensus_CSS",
"telegram": "https://t.me/consensus_network",
"discord": "",
"explorerBlockLink": "https://explorer.consensus-network.com/blocks/$hash$",
"explorerTxLink": "https://explorer.consensus-network.com/txs/{0}",
"explorerAccountLink": "https://explorer.consensus-network.com/addresses/{0}"
},
"pugdag": {
"name": "Pugdag",
"canonicalName": "Pugdag",
"symbol": "PUG",
"family": "kaspa",
"website": "https://pugdag.com/",
"github": "https://github.com/Pugdag/pugdagd",
"market": "https://xeggex.com/market/PUG_USDT?ref=660c7f77a13a5706f612bbc8",
"twitter": "https://twitter.com/pug_dag",
"telegram": "https://t.me/pug_dag",
"discord": "https://discord.com/invite/pugdag",
"explorerBlockLink": "https://explorer.pugdag.com/blocks/$hash$",
"explorerTxLink": "https://explorer.pugdag.com/txs/{0}",
"explorerAccountLink": "https://explorer.pugdag.com/addresses/{0}"
},
"nvolve": {
"name": "Nvolve",
"symbol": "NVOL",
Expand Down

0 comments on commit 0961daa

Please sign in to comment.