forked from spesmilo/electrumx
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add Xaya as new coin with basic chain handling (#889)
* Split out deserialisation of CAuxPow. The current DeserializerAuxPow has code for reading a block header including (potentially) an auxpow. In this change, we split out the logic for reading the actual CAuxPow instance to its own function. This makes the code easier to read, as the different steps are more clearly separated. It will also be useful for working with CAuxPow instances that are part of a different serialisation format (e.g. for the Xaya blockchain). * Add Xaya coin with deserialiser. This defines a new coin for Xaya (https://github.com/xaya/xaya), with the appropriate deserialiser methods. Xaya is based on Namecoin, but uses its own special twist on auxpow for the PoW, so we need to handle that properly in block-header deserialisation. Xaya also has names like Namecoin (but with slightly changed semantics), but handling for them (i.e. building a name index in addition to the address index) will be added later on. * Keep more data in truncated Xaya headers. When Xaya headers are truncated (because they are checkpointed), we still need to send the algorithm and bits with them. That is needed for the difficulty retargeting of Xaya to work correctly. * Define peers for Xaya. We will run ElectrumX instances on the seeder VPSes. Set those in PEERS for mainnet (there are no peers for testnet).
- Loading branch information
Showing
8 changed files
with
324 additions
and
15 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
{ | ||
"hash": "c53c371f253426f9e582e3de9d9f1f03e5e40e771aa96953c502ebe2222bb013", | ||
"confirmations": 630231, | ||
"strippedsize": 582, | ||
"size": 618, | ||
"weight": 2364, | ||
"height": 400021, | ||
"version": 536870912, | ||
"versionHex": "20000000", | ||
"merkleroot": "28e89aa0dbc0f1cacccb3ab402d7891abf636165b2cfd1b018e3b675468d8855", | ||
"tx": [ | ||
"43b8bea316ac7df3eeadd3b941808b100d66d424464af2dfb211773cd8dc0752", | ||
"4d581281a17e679df9f109e0b0e7c59efacfe50860a733d1f06a23fa08540b6d" | ||
], | ||
"time": 1544070336, | ||
"mediantime": 1544070221, | ||
"nonce": 0, | ||
"chainwork": "00000000000000000000000000000000000000000011cc010c812da27182ad31", | ||
"nTx": 2, | ||
"powdata": { | ||
"algo": "neoscrypt", | ||
"mergemined": false, | ||
"bits": "1d016293", | ||
"difficulty": 0.7219816901873947, | ||
"fakeheader": "00000000000000000000000000000000000000000000000000000000000000000000000013b02b22e2eb02c55369a91a770ee4e5031f9f9ddee382e5f92634251f373cc50000000000000000cd8740e3" | ||
}, | ||
"rngseed": "ae81fb25abb6328512e52af04b7e36e03ed545061ad000e6b07ed86e08551cb1", | ||
"previousblockhash": "ab66782b9aa7edd86912bde739b7954517ef82907e7df2b910c6720b69c197fb", | ||
"nextblockhash": "adfaac85095ab7f6c565a4c7af76229abcfd07fb0a0199383c3d65b5294f471a", | ||
"block": "00000020fb97c1690b72c610b9f27d7e9082ef174595b739e7bd1269d8eda79a2b7866ab55888d4675b6e318b0d1cfb2656163bf1a89d702b43acbcccaf1c0dba09ae828c0a4085c0000000000000000029362011d00000000000000000000000000000000000000000000000000000000000000000000000013b02b22e2eb02c55369a91a770ee4e5031f9f9ddee382e5f92634251f373cc50000000000000000cd8740e302020000000001010000000000000000000000000000000000000000000000000000000000000000ffffffff0603951a060101ffffffff02404af6050000000023210259b332f71852584ffcbb7701e76721adf988ba12cdbe1091b7cfd7b36ec93869ac0000000000000000266a24aa21a9edb0c34f0b713a6807ef08628f5db0c5c0037c39b2f6d208b5e08da25b13cfb2e501200000000000000000000000000000000000000000000000000000000000000000000000000200000001ebd8995be8b4ebc8ce2f082bf577818a5abf667afd09f5dcafd1c8790a63b391010000006a4730440220442743b7fc92e9904d3910cc61f5077a787b78f763b9efbe56c9306cbb6e2a77022004fae47d54cb45728894c511611cb66513cf01a04471a4b53821ba4cf386f19901210319f13957ea073a98708f09531a10d0f4e4f42a82102c4fead7c69ba4b4974e6bfeffffff0240420f0000000000445108702f444f474341541e7b2267223a7b2274667472223a5b7b226f223a332c226d223a317d5d7d7d6d7576a91452df4afbfbc31db12150f6e2038fa43c55aeafe988ac04f7fc03000000001976a914711acc7fc374161611ac25fa4f3d264940bcbdd288ac931a0600" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,103 @@ | ||
{ | ||
"hash": "948183fa76c2a4466bb32a06cc4f4f0afe3894d524dd07a963b3836c092f3acd", | ||
"confirmations": 930248, | ||
"strippedsize": 1567, | ||
"size": 1603, | ||
"weight": 6304, | ||
"height": 100000, | ||
"version": 536870912, | ||
"versionHex": "20000000", | ||
"merkleroot": "bd2b4a5a8f1f8085bab936f2f20f82e5928a0bbd573be780fec14d8b4fc4e922", | ||
"tx": [ | ||
"e16a22c4dfd99c639b60914ce75e3a7847fed7c1f3f5f2dd565ff48d6395a116", | ||
"9854b65e59dca27649a3268d0feee2d55036e26cc49038f67aae000dd0126b48" | ||
], | ||
"time": 1534624527, | ||
"mediantime": 1534624309, | ||
"nonce": 0, | ||
"chainwork": "00000000000000000000000000000000000000000003fbc9da84e345e04f5136", | ||
"nTx": 2, | ||
"powdata": { | ||
"algo": "sha256d", | ||
"mergemined": true, | ||
"bits": "18347258", | ||
"difficulty": 20964060431.07306, | ||
"auxpow": { | ||
"tx": { | ||
"hex": "01000000010000000000000000000000000000000000000000000000000000000000000000ffffffff64033c33082cfabe6d6dfe0718afd8c0651b58f14378a128efde085d91bcfa2790de57ec862ad420d90708000000f09f909f000f4d696e6564206279207374636f646500000000000000000000000000000000000000000000000000000000000000000000ff3b9a010320983b4b000000001976a914c825a1ecf2a6830c4401620c3a16f1995057c2ab88ac00000000000000002f6a24aa21a9ed98a08f4c63b7cad2f139005520cf5998e1fa2ad8d53bbad87e0868d8c509149308000000000000000000000000000000002c6a4c2952534b424c4f434b3a88b841b4ba9c30eff483b55f8a520403afac9e2050a769129a76620c51e633615b9cd447", | ||
"txid": "54bfbec36774378ce65ab829b00d45bb4d734a9220932f5514d8b4e1992e8dfc", | ||
"hash": "54bfbec36774378ce65ab829b00d45bb4d734a9220932f5514d8b4e1992e8dfc", | ||
"version": 1, | ||
"size": 294, | ||
"vsize": 294, | ||
"weight": 1176, | ||
"locktime": 1205115995, | ||
"vin": [ | ||
{ | ||
"coinbase": "033c33082cfabe6d6dfe0718afd8c0651b58f14378a128efde085d91bcfa2790de57ec862ad420d90708000000f09f909f000f4d696e6564206279207374636f646500000000000000000000000000000000000000000000000000000000000000000000", | ||
"sequence": 26885119 | ||
} | ||
], | ||
"vout": [ | ||
{ | ||
"value": 12.62196768, | ||
"n": 0, | ||
"scriptPubKey": { | ||
"asm": "OP_DUP OP_HASH160 c825a1ecf2a6830c4401620c3a16f1995057c2ab OP_EQUALVERIFY OP_CHECKSIG", | ||
"hex": "76a914c825a1ecf2a6830c4401620c3a16f1995057c2ab88ac", | ||
"reqSigs": 1, | ||
"type": "pubkeyhash", | ||
"addresses": [ | ||
"CaiAoAHC4kYmGJnNdcJWP8EFDE42Ji7XiS" | ||
] | ||
} | ||
}, | ||
{ | ||
"value": 0.00000000, | ||
"n": 1, | ||
"scriptPubKey": { | ||
"asm": "OP_RETURN aa21a9ed98a08f4c63b7cad2f139005520cf5998e1fa2ad8d53bbad87e0868d8c5091493 0000000000000000", | ||
"hex": "6a24aa21a9ed98a08f4c63b7cad2f139005520cf5998e1fa2ad8d53bbad87e0868d8c5091493080000000000000000", | ||
"type": "nulldata" | ||
} | ||
}, | ||
{ | ||
"value": 0.00000000, | ||
"n": 2, | ||
"scriptPubKey": { | ||
"asm": "OP_RETURN 52534b424c4f434b3a88b841b4ba9c30eff483b55f8a520403afac9e2050a769129a76620c51e63361", | ||
"hex": "6a4c2952534b424c4f434b3a88b841b4ba9c30eff483b55f8a520403afac9e2050a769129a76620c51e63361", | ||
"type": "nulldata" | ||
} | ||
} | ||
], | ||
"blockhash": "00000000000000001903108b258887d0258a3e8caf776983069f94b9f47049f6" | ||
}, | ||
"chainindex": 7, | ||
"merklebranch": [ | ||
"5c3158d4f108917fba77f9695650608477456b8f6f06238b1613311aafa74b09", | ||
"eebaf1b6b9ab455497e6dd571140f0a3647ce36e1ab3e34a177dacc474a755d9", | ||
"69191fcf85cf624ec99de2d341475478d5b4dc6ba47fc615aaefb05af2ca27a8", | ||
"4930ddee5d4553184fc83c98e86f3fb317e6811c00840789dc67fea8be9a182f", | ||
"32648a287897e297e999fff9426c2b90b79bf7d1b086a227a19b13a7ec2b41a2", | ||
"fffd55d7bbea5f951ae2f3a8f540a9a0a71949d9578d9d44d20f86e090a2f810", | ||
"74ddee1ce47dcb62229411fe9ae3a208f488ed18aef409fb5704fb55844ce2e0", | ||
"a3b018da9723bdef26aaf35c69c24ef03c028ef0080cb78f524de8a3f1ae4ef4", | ||
"b2b0fee71fab43ae9c6eb27aaff5f4a1806a3568a0fd7cdae67c95b7f5684ce2", | ||
"ca7503900f2b8aeec18402721788f9ea340ab4216ffd095cba066b3af306cbdb", | ||
"0aba5a93156602ce5202293e3c83c4e1f3c754ff9338770d18bceda4fcfbd686", | ||
"084cf897b58d851626d0ba32d4c717584b018881ab022e8fba1c9d8ed6aaae0e" | ||
], | ||
"chainmerklebranch": [ | ||
"2cadbb3ce34769fc6f95572012c22605f8c3a69982a9a6854523f6548007d30b", | ||
"e5c2407ba454ffeb28cf0c50c5c293a84c9a75788f8a8f35ccb974e606280377", | ||
"a5cd51355bea0fd77416d06bf3647e16b4663d2f87e6a3ccb23e713cb8b4de1c" | ||
], | ||
"parentblock": "00000020913d01444f14db2c6ab43ffd0f36af5613423815543c22000000000000000000a2edf8bab99ac19e7f7adaf23bc43570d543054aed83e77694f26d33ec9db2a51e83785ba70d2c17865f3a57" | ||
} | ||
}, | ||
"rngseed": "1cc1ed830b99a352c02a10fca08284d005c1cfb01e5ffd10b85bcda3e2164636", | ||
"previousblockhash": "8acbc6b31dabb5b3a224d9e4e55e2bd766882f07b2c592e1a101ab7a6e59cd6b", | ||
"nextblockhash": "427b1860366cfc584170f73b0518a71adb9787841c960ad3a857e27b6b773385", | ||
"block": "000000206bcd596e7aab01a1e192c5b2072f8866d72b5ee5e4d924a2b3b5ab1db3c6cb8a22e9c44f8b4dc1fe80e73b57bd0b8a92e5820ff2f236b9ba85801f8f5a4a2bbd0f83785b0000000000000000815872341801000000010000000000000000000000000000000000000000000000000000000000000000ffffffff64033c33082cfabe6d6dfe0718afd8c0651b58f14378a128efde085d91bcfa2790de57ec862ad420d90708000000f09f909f000f4d696e6564206279207374636f646500000000000000000000000000000000000000000000000000000000000000000000ff3b9a010320983b4b000000001976a914c825a1ecf2a6830c4401620c3a16f1995057c2ab88ac00000000000000002f6a24aa21a9ed98a08f4c63b7cad2f139005520cf5998e1fa2ad8d53bbad87e0868d8c509149308000000000000000000000000000000002c6a4c2952534b424c4f434b3a88b841b4ba9c30eff483b55f8a520403afac9e2050a769129a76620c51e633615b9cd44700000000000000000000000000000000000000000000000000000000000000000c094ba7af1a3113168b23066f8f6b45778460505669f977ba7f9108f1d458315cd955a774c4ac7d174ae3b31a6ee37c64a3f0401157dde6975445abb9b6f1baeea827caf25ab0efaa15c67fa46bdcb4d578544741d3e29dc94e62cf85cf1f19692f189abea8fe67dc890784001c81e617b33f6fe8983cc84f1853455deedd3049a2412beca7139ba127a286b0d1f79bb7902b6c42f9ff99e997e29778288a643210f8a290e0860fd2449d8d57d94919a7a0a940f5a8f3e21a955feabbd755fdffe0e24c8455fb0457fb09f4ae18ed88f408a2e39afe11942262cb7de41ceedd74f44eaef1a3e84d528fb70c08f08e023cf04ec2695cf3aa26efbd2397da18b0a3e24c68f5b7957ce6da7cfda068356a80a1f4f5af7ab26e9cae43ab1fe7feb0b2dbcb06f33a6b06ba5c09fd6f21b40a34eaf98817720284c1ee8a2b0f900375ca86d6fbfca4edbc180d773893ff54c7f3e1c4833c3e290252ce026615935aba0a0eaeaad68e9d1cba8f2e02ab8188014b5817c7d432bad02616858db597f84c0800000000030bd3078054f6234585a6a98299a6c3f80526c2122057956ffc6947e33cbbad2c77032806e674b9cc358f8a8f78759a4ca893c2c5500ccf28ebff54a47b40c2e51cdeb4b83c713eb2cca3e6872f3d66b4167e64f36bd01674d70fea5b3551cda50700000000000020913d01444f14db2c6ab43ffd0f36af5613423815543c22000000000000000000a2edf8bab99ac19e7f7adaf23bc43570d543054aed83e77694f26d33ec9db2a51e83785ba70d2c17865f3a5702020000000001010000000000000000000000000000000000000000000000000000000000000000ffffffff0603a086010101ffffffff02ae8ef60500000000232103ac17736c4dfa051108f5a9f6c602bdac64ff6f4aab4dd36b7fb47ed5df8df68bac0000000000000000266a24aa21a9ed2c2eedd160077355e9d578fc8deebe7008bb20ecb418ccb750aa8367a385ad9401200000000000000000000000000000000000000000000000000000000000000000000000000200000002963d484c856e84ee811aaec4e4f1819d01b8444a82cd967b35dda08edec7f772010000006a4730440220528529296ef5d2a3341bf7438f7fc6a8baf3d77cc0f58718b3cb03503dfb64a502203ceff4277e2a7f4acc3b9dea2c8df64b1a794e6dda790de986033dcafb2df3660121039f8c7dfcbe7745bc72d5e1fb3e77a7dac3a20220102e7a1bb4ff96e7f8b8c0cbfeffffff963d484c856e84ee811aaec4e4f1819d01b8444a82cd967b35dda08edec7f772000000006b483045022100998ad854b30a4049e6eda69dd6248976bfa8eaf73244e909f01bd3ced9e1a9fb02203229b294e83931ad4ea8ff823895cd0d579c590337e72a40b1f254d33d65df460121021f787facf0e78ba561a2094803d32d4cba38ec861c60b1732e2615963e6c82a1feffffff02f947fa02000000001976a914463f344026a1829a0dec9da38efe408f786be9e988ac40420f000000000059520b702f46756e436f6f6b6965307b2267223a7b2274667472223a5b7b226f223a31322c226d223a35337d2c7b226f223a31322c226d223a32347d5d7d7d6d7576a914ef56cda5eeea29b552dc6c2526b6a1a16715483188ac9e860100" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.