diff --git a/README.md b/README.md index e4fa904..ce5619d 100644 --- a/README.md +++ b/README.md @@ -38,6 +38,12 @@ Traditional Blockchains process blocks as single unit of computation(if a double | Linux ARM 64 | https://github.com/deroproject/derosuite/releases | | More Builds | https://github.com/deroproject/derosuite/releases | + +### Build from sources: +In go workspace: **go get -u github.com/deroproject/derosuite/...** + +Check bin folder for derod, explorer and wallet binaries. Use golang-1.10.3 version minimum. + ### DERO Quickstart 1. Choose your Operating System and [download Dero software](https://github.com/deroproject/derosuite/releases) 2. Extract the file and change to extracted folder in cmd prompt. @@ -86,11 +92,6 @@ Secure and fast crypto is the basic necessity of this project and adequate amoun There are other optimizations such as base-scalar multiplication could be done in less than a microsecond. Some of these optimizations are not yet deployed and may be deployed at a later stage. -## Build: -In go workspace: **go get -u github.com/deroproject/derosuite/...** - -Check bin folder for derod, explorer and wallet binaries. Use golang-1.10.3 version minimum. - For technical issues and discussion, please visit https://forum.dero.io diff --git a/alt_chain_data/038e2b878d3c204b8726a4159d8e2c113900a7180015ea30a48eda138ed043c7_17004.txt b/alt_chain_data/038e2b878d3c204b8726a4159d8e2c113900a7180015ea30a48eda138ed043c7_17004.txt deleted file mode 100644 index de2179b..0000000 --- a/alt_chain_data/038e2b878d3c204b8726a4159d8e2c113900a7180015ea30a48eda138ed043c7_17004.txt +++ /dev/null @@ -1,24 +0,0 @@ -{ - "id": "0", - "jsonrpc": "2.0", - "result": { - "blob": "0606a8dfd3d2058e7a86de29068834e3dd3a498c4717159cceec7b6f0753b65cbf889d564a69823c7c008a02a8850101ffec84010197c39fb0ecf3060235527c1f4ad20b7003a4a714801d5e0fc5c44538256b2c80e4c98a75be7424ed2b01296ce3ef0900a4d99c574f918e11b1e72e536b8f3a69702bf307800b8852037a02080000000002f64c030000", - "block_header": { - "block_size": 95, - "depth": 862, - "difficulty": 92945024, - "hash": "038e2b878d3c204b8726a4159d8e2c113900a7180015ea30a48eda138ed043c7", - "height": 17004, - "major_version": 6, - "minor_version": 6, - "nonce": 2315287612, - "num_txes": 0, - "orphan_status": true, - "prev_hash": "8e7a86de29068834e3dd3a498c4717159cceec7b6f0753b65cbf889d564a6982", - "reward": 30368741187991, - "timestamp": 1515515816 - }, - "json": "{\n \"major_version\": 6, \n \"minor_version\": 6, \n \"timestamp\": 1515515816, \n \"prev_id\": \"8e7a86de29068834e3dd3a498c4717159cceec7b6f0753b65cbf889d564a6982\", \n \"nonce\": 2315287612, \n \"miner_tx\": {\n \"version\": 2, \n \"unlock_time\": 17064, \n \"vin\": [ {\n \"gen\": {\n \"height\": 17004\n }\n }\n ], \n \"vout\": [ {\n \"amount\": 30368741187991, \n \"target\": {\n \"key\": \"35527c1f4ad20b7003a4a714801d5e0fc5c44538256b2c80e4c98a75be7424ed\"\n }\n }\n ], \n \"extra\": [ 1, 41, 108, 227, 239, 9, 0, 164, 217, 156, 87, 79, 145, 142, 17, 177, 231, 46, 83, 107, 143, 58, 105, 112, 43, 243, 7, 128, 11, 136, 82, 3, 122, 2, 8, 0, 0, 0, 0, 2, 246, 76, 3\n ], \n \"rct_signatures\": {\n \"type\": 0\n }\n }, \n \"tx_hashes\": [ ]\n}", - "status": "OK" - } -} \ No newline at end of file diff --git a/alt_chain_data/03ca43b2dbfefe2b1854c516a4d30a7feeb5386dfe1169c3caf33ec3ff898582_16998.txt b/alt_chain_data/03ca43b2dbfefe2b1854c516a4d30a7feeb5386dfe1169c3caf33ec3ff898582_16998.txt deleted file mode 100644 index 7b9e8e0..0000000 --- a/alt_chain_data/03ca43b2dbfefe2b1854c516a4d30a7feeb5386dfe1169c3caf33ec3ff898582_16998.txt +++ /dev/null @@ -1,25 +0,0 @@ -{ - "id": "0", - "jsonrpc": "2.0", - "result": { - "blob": "0606c8b2d3d20578581a7ea3a71082ead85cfde06ebb2a4d7bbfcfef9a0fe69e373e78b807fa7f9662013d02a2850101ffe6840101def3eaad9ba00702bb5bb6f749afdd7d64d8b3b4fa2b8a44c77bf637d0c13d3a994b1d269d8780f82b013eeb27eeff0bd10d40f5892504ec95d81399d150cefa504a0fbacfe6fdc8a563020800000000a0472ac70017abda0ac60520cf99e8b28612349ae639fcbdcc4b1ee256bd064660e96029ba63b0450e0e92ee7af62ca755e2f0522e68a4c11497c1179e09dad0a807729455abc27d43eefa50e1714eb0714e45742c7c6c4dd718b494d3290177dd18172a5acc03d87bf62b5c7d6980a78a238061894f2baf3e3929dc006abcd3622f80adc7dcd900d779234f61b29f6f98ba0956a08082607d6c95ead01c252a5086b413a9fd3a0dd65e7e2005395c69a0a676af4048a69e4191b5948d1cae9cb548ef8bc79dd8e247ed59b2b67e7ff1d7129de06038c388bc55581585b178c440eb9d8e60ab843859096066f80ca797d71db0b481d27f64791dc4cfc621ab462d455c94f7424ab37e5a8ca54eca36d5c0dc096cf85b3022f5c5461f704eea1b48b625189e13575dc5528ba9321dea609fa0574b36a4225c7c850f6b78ce68b2a6d6f001bf9874400f342178ef174768af48d2f3bab1cf647684315321fa09ee984b18667712a37f8767923e0f43524a27b4744a2a189ab42b0eee3505aad99afa25952a9debf3fb8f643488edc07d19bd4ce931e82405a22f3f65aa2500146eeafe7aa2785e9e25f5dc5283b684e29582242db611927cdb6a33636b916a6923f56afe2233bc6cd9e3fb4c999eda97345ce93f6af87d917a110c24b885e40b1bab0213a3dc13ea61c256f8cae39eda04a7d4f234a4b8a664834135bd01169b5ae91683a0b11e245b7e3ac9088f863f260c9697b420a80b9e1ec0713b230a2ae4b2edb9f8fad5616c670ff266a41b2006fdfbe835682a6f97486c2df19c3a1052202b74e0d65a59c2fada5e48344a33d0b1d97d1b7fd261a3f8226644c8ca8127fd3a4347ae5bd5b09a9bbbfcb1026da1a2ef4521247d53c0d71abcec48f9d6112f6dd43627aa882a53d4f7e97b27e52c57b66eefa55d2e855459fb46b2f273f564f390fa3f005281716c770f50afbbc1946e1516e6bddd2ce0ea826a4a6f433cadfeb962e4b97964737a3bada86e6ec67b36b94873402dbf72fd53f7f7f5c8804ddb82069f41", - "block_header": { - "block_size": 95, - "depth": 866, - "difficulty": 89115444, - "hash": "03ca43b2dbfefe2b1854c516a4d30a7feeb5386dfe1169c3caf33ec3ff898582", - "height": 16998, - "major_version": 6, - "minor_version": 6, - "nonce": 1023500950, - "num_txes": 23, - "orphan_status": true, - "prev_hash": "78581a7ea3a71082ead85cfde06ebb2a4d7bbfcfef9a0fe69e373e78b807fa7f", - "reward": 31893181086174, - "timestamp": 1515510088 - }, - "json": "{\n \"major_version\": 6, \n \"minor_version\": 6, \n \"timestamp\": 1515510088, \n \"prev_id\": \"78581a7ea3a71082ead85cfde06ebb2a4d7bbfcfef9a0fe69e373e78b807fa7f\", \n \"nonce\": 1023500950, \n \"miner_tx\": {\n \"version\": 2, \n \"unlock_time\": 17058, \n \"vin\": [ {\n \"gen\": {\n \"height\": 16998\n }\n }\n ], \n \"vout\": [ {\n \"amount\": 31893181086174, \n \"target\": {\n \"key\": \"bb5bb6f749afdd7d64d8b3b4fa2b8a44c77bf637d0c13d3a994b1d269d8780f8\"\n }\n }\n ], \n \"extra\": [ 1, 62, 235, 39, 238, 255, 11, 209, 13, 64, 245, 137, 37, 4, 236, 149, 216, 19, 153, 209, 80, 206, 250, 80, 74, 15, 186, 207, 230, 253, 200, 165, 99, 2, 8, 0, 0, 0, 0, 160, 71, 42, 199\n ], \n \"rct_signatures\": {\n \"type\": 0\n }\n }, \n \"tx_hashes\": [ \"abda0ac60520cf99e8b28612349ae639fcbdcc4b1ee256bd064660e96029ba63\", \"b0450e0e92ee7af62ca755e2f0522e68a4c11497c1179e09dad0a807729455ab\", \"c27d43eefa50e1714eb0714e45742c7c6c4dd718b494d3290177dd18172a5acc\", \"03d87bf62b5c7d6980a78a238061894f2baf3e3929dc006abcd3622f80adc7dc\", \"d900d779234f61b29f6f98ba0956a08082607d6c95ead01c252a5086b413a9fd\", \"3a0dd65e7e2005395c69a0a676af4048a69e4191b5948d1cae9cb548ef8bc79d\", \"d8e247ed59b2b67e7ff1d7129de06038c388bc55581585b178c440eb9d8e60ab\", \"843859096066f80ca797d71db0b481d27f64791dc4cfc621ab462d455c94f742\", \"4ab37e5a8ca54eca36d5c0dc096cf85b3022f5c5461f704eea1b48b625189e13\", \"575dc5528ba9321dea609fa0574b36a4225c7c850f6b78ce68b2a6d6f001bf98\", \"74400f342178ef174768af48d2f3bab1cf647684315321fa09ee984b18667712\", \"a37f8767923e0f43524a27b4744a2a189ab42b0eee3505aad99afa25952a9deb\", \"f3fb8f643488edc07d19bd4ce931e82405a22f3f65aa2500146eeafe7aa2785e\", \"9e25f5dc5283b684e29582242db611927cdb6a33636b916a6923f56afe2233bc\", \"6cd9e3fb4c999eda97345ce93f6af87d917a110c24b885e40b1bab0213a3dc13\", \"ea61c256f8cae39eda04a7d4f234a4b8a664834135bd01169b5ae91683a0b11e\", \"245b7e3ac9088f863f260c9697b420a80b9e1ec0713b230a2ae4b2edb9f8fad5\", \"616c670ff266a41b2006fdfbe835682a6f97486c2df19c3a1052202b74e0d65a\", \"59c2fada5e48344a33d0b1d97d1b7fd261a3f8226644c8ca8127fd3a4347ae5b\", \"d5b09a9bbbfcb1026da1a2ef4521247d53c0d71abcec48f9d6112f6dd43627aa\", \"882a53d4f7e97b27e52c57b66eefa55d2e855459fb46b2f273f564f390fa3f00\", \"5281716c770f50afbbc1946e1516e6bddd2ce0ea826a4a6f433cadfeb962e4b9\", \"7964737a3bada86e6ec67b36b94873402dbf72fd53f7f7f5c8804ddb82069f41\"\n ]\n}", - "status": "OK", - "tx_hashes": ["abda0ac60520cf99e8b28612349ae639fcbdcc4b1ee256bd064660e96029ba63","b0450e0e92ee7af62ca755e2f0522e68a4c11497c1179e09dad0a807729455ab","c27d43eefa50e1714eb0714e45742c7c6c4dd718b494d3290177dd18172a5acc","03d87bf62b5c7d6980a78a238061894f2baf3e3929dc006abcd3622f80adc7dc","d900d779234f61b29f6f98ba0956a08082607d6c95ead01c252a5086b413a9fd","3a0dd65e7e2005395c69a0a676af4048a69e4191b5948d1cae9cb548ef8bc79d","d8e247ed59b2b67e7ff1d7129de06038c388bc55581585b178c440eb9d8e60ab","843859096066f80ca797d71db0b481d27f64791dc4cfc621ab462d455c94f742","4ab37e5a8ca54eca36d5c0dc096cf85b3022f5c5461f704eea1b48b625189e13","575dc5528ba9321dea609fa0574b36a4225c7c850f6b78ce68b2a6d6f001bf98","74400f342178ef174768af48d2f3bab1cf647684315321fa09ee984b18667712","a37f8767923e0f43524a27b4744a2a189ab42b0eee3505aad99afa25952a9deb","f3fb8f643488edc07d19bd4ce931e82405a22f3f65aa2500146eeafe7aa2785e","9e25f5dc5283b684e29582242db611927cdb6a33636b916a6923f56afe2233bc","6cd9e3fb4c999eda97345ce93f6af87d917a110c24b885e40b1bab0213a3dc13","ea61c256f8cae39eda04a7d4f234a4b8a664834135bd01169b5ae91683a0b11e","245b7e3ac9088f863f260c9697b420a80b9e1ec0713b230a2ae4b2edb9f8fad5","616c670ff266a41b2006fdfbe835682a6f97486c2df19c3a1052202b74e0d65a","59c2fada5e48344a33d0b1d97d1b7fd261a3f8226644c8ca8127fd3a4347ae5b","d5b09a9bbbfcb1026da1a2ef4521247d53c0d71abcec48f9d6112f6dd43627aa","882a53d4f7e97b27e52c57b66eefa55d2e855459fb46b2f273f564f390fa3f00","5281716c770f50afbbc1946e1516e6bddd2ce0ea826a4a6f433cadfeb962e4b9","7964737a3bada86e6ec67b36b94873402dbf72fd53f7f7f5c8804ddb82069f41"] - } -} \ No newline at end of file diff --git a/alt_chain_data/0eb61f1b78d810d314769e5e6157bc22894127b5d8e5bc417e99091005a7b858_16999.txt b/alt_chain_data/0eb61f1b78d810d314769e5e6157bc22894127b5d8e5bc417e99091005a7b858_16999.txt deleted file mode 100644 index 5a6b3c0..0000000 --- a/alt_chain_data/0eb61f1b78d810d314769e5e6157bc22894127b5d8e5bc417e99091005a7b858_16999.txt +++ /dev/null @@ -1,25 +0,0 @@ -{ - "id": "0", - "jsonrpc": "2.0", - "result": { - "blob": "0606d0c9d3d20503ca43b2dbfefe2b1854c516a4d30a7feeb5386dfe1169c3caf33ec3ff898582ed0300d702a3850101ffe78401019fd4ef8592a007025a5d066ac8f5772be60aad59ac33813937efb7edd090006d83f7b625d56deeb72b012c28df62dfe6eda5c5d3113f8d1f3de463f99937e57369ce44b26580444dbf1b0208000000000cf68274001774149ceb2f51f2b8a71536e1e1ddd57a141cdb19d9dea33bf10b09fd336617b0b0f82f931a8147cdc44dbaa9d95425c9980dcd5ab9065892fbeed204902e339f31ca3214fdecac929eb7a4d09fcd799bbe12c5adda9740fa20e4a58178bf32fa014252ccdfb7f5e97838ec2e142eb7ba77115ad0ce34f875e8d0e7d15a2aaa4ddd07a95dd7b66f7b3354c455b712014acf488051700d91869abd0c386ebb40c8c958b296459577ac81d472c1b7c026cfbf355bf86c603fc98615b8f3ae17d17cb4f8edbbdf0bdaf1f269651ef74c1e653d84ff5c597031a008e58f68a04db944da76a0ee549dbadbf47bffa9d729a7747226496b7e213f0729639eebeb6f48108a82a1ca79591e9efd8c6c020be08b02e76d2ebf61aa3f21b84f90bf2a618b477bb01c4b62bd317b4cf92b846d81f8eee205689e4f084e189f3124e697877f67d857f478803f81c1f8b7b893f3f8af830833600d75c43e61733c648cc4a524b50e32232cf5e0e6d9b5c4e539e3d33578aa9c82b54e549e92b1e04d16f3f9dbd156163b6fca1ce4c1572482f2d7dc16634043a7b828488f0b8e5178ddedab49bba1b6646110f2437e83782f50dcffedc67ea4f59971681a3e0f552de091bebbd2c0be66fd022b64d3c61e450513bb4edd1123ef43b1da771bcd94141b29ca933db89499001acb38098e666a8c8d426692ab16547009db6f55a1badc84ea714fbe9c6d63cbfdba522c4d9bac212fdabce699691c646e50fe77e6b6110174d4ff592de728b309cd842af835b80b5966df29fa10d5341c7c3637922b7dfa7ec00937b17522a0136067fe7823bd1808ff8850556584f39b61cc774871a4ff3adedab05cad0e401308b0e9ecd231a4d50f85bc50babfd3701256c7dfaa5b86f37cbe7dc71ce59eb3fbfc0afc6a80b2a4450673f9a44772eee79df273d1bdd43faf13f813dc222c7c88d371504d721be75332b20e3278afefcdb1b4c5a36aee6ae4a5fd7aec7e4f79daab35affd5f8fa2edbd40b83e761b8d59a74cf87e77944244539b", - "block_header": { - "block_size": 95, - "depth": 866, - "difficulty": 92722474, - "hash": "0eb61f1b78d810d314769e5e6157bc22894127b5d8e5bc417e99091005a7b858", - "height": 16999, - "major_version": 6, - "minor_version": 6, - "nonce": 3607102445, - "num_txes": 23, - "orphan_status": true, - "prev_hash": "03ca43b2dbfefe2b1854c516a4d30a7feeb5386dfe1169c3caf33ec3ff898582", - "reward": 31890681358879, - "timestamp": 1515513040 - }, - "json": "{\n \"major_version\": 6, \n \"minor_version\": 6, \n \"timestamp\": 1515513040, \n \"prev_id\": \"03ca43b2dbfefe2b1854c516a4d30a7feeb5386dfe1169c3caf33ec3ff898582\", \n \"nonce\": 3607102445, \n \"miner_tx\": {\n \"version\": 2, \n \"unlock_time\": 17059, \n \"vin\": [ {\n \"gen\": {\n \"height\": 16999\n }\n }\n ], \n \"vout\": [ {\n \"amount\": 31890681358879, \n \"target\": {\n \"key\": \"5a5d066ac8f5772be60aad59ac33813937efb7edd090006d83f7b625d56deeb7\"\n }\n }\n ], \n \"extra\": [ 1, 44, 40, 223, 98, 223, 230, 237, 165, 197, 211, 17, 63, 141, 31, 61, 228, 99, 249, 153, 55, 229, 115, 105, 206, 68, 178, 101, 128, 68, 77, 191, 27, 2, 8, 0, 0, 0, 0, 12, 246, 130, 116\n ], \n \"rct_signatures\": {\n \"type\": 0\n }\n }, \n \"tx_hashes\": [ \"74149ceb2f51f2b8a71536e1e1ddd57a141cdb19d9dea33bf10b09fd336617b0\", \"b0f82f931a8147cdc44dbaa9d95425c9980dcd5ab9065892fbeed204902e339f\", \"31ca3214fdecac929eb7a4d09fcd799bbe12c5adda9740fa20e4a58178bf32fa\", \"014252ccdfb7f5e97838ec2e142eb7ba77115ad0ce34f875e8d0e7d15a2aaa4d\", \"dd07a95dd7b66f7b3354c455b712014acf488051700d91869abd0c386ebb40c8\", \"c958b296459577ac81d472c1b7c026cfbf355bf86c603fc98615b8f3ae17d17c\", \"b4f8edbbdf0bdaf1f269651ef74c1e653d84ff5c597031a008e58f68a04db944\", \"da76a0ee549dbadbf47bffa9d729a7747226496b7e213f0729639eebeb6f4810\", \"8a82a1ca79591e9efd8c6c020be08b02e76d2ebf61aa3f21b84f90bf2a618b47\", \"7bb01c4b62bd317b4cf92b846d81f8eee205689e4f084e189f3124e697877f67\", \"d857f478803f81c1f8b7b893f3f8af830833600d75c43e61733c648cc4a524b5\", \"0e32232cf5e0e6d9b5c4e539e3d33578aa9c82b54e549e92b1e04d16f3f9dbd1\", \"56163b6fca1ce4c1572482f2d7dc16634043a7b828488f0b8e5178ddedab49bb\", \"a1b6646110f2437e83782f50dcffedc67ea4f59971681a3e0f552de091bebbd2\", \"c0be66fd022b64d3c61e450513bb4edd1123ef43b1da771bcd94141b29ca933d\", \"b89499001acb38098e666a8c8d426692ab16547009db6f55a1badc84ea714fbe\", \"9c6d63cbfdba522c4d9bac212fdabce699691c646e50fe77e6b6110174d4ff59\", \"2de728b309cd842af835b80b5966df29fa10d5341c7c3637922b7dfa7ec00937\", \"b17522a0136067fe7823bd1808ff8850556584f39b61cc774871a4ff3adedab0\", \"5cad0e401308b0e9ecd231a4d50f85bc50babfd3701256c7dfaa5b86f37cbe7d\", \"c71ce59eb3fbfc0afc6a80b2a4450673f9a44772eee79df273d1bdd43faf13f8\", \"13dc222c7c88d371504d721be75332b20e3278afefcdb1b4c5a36aee6ae4a5fd\", \"7aec7e4f79daab35affd5f8fa2edbd40b83e761b8d59a74cf87e77944244539b\"\n ]\n}", - "status": "OK", - "tx_hashes": ["74149ceb2f51f2b8a71536e1e1ddd57a141cdb19d9dea33bf10b09fd336617b0","b0f82f931a8147cdc44dbaa9d95425c9980dcd5ab9065892fbeed204902e339f","31ca3214fdecac929eb7a4d09fcd799bbe12c5adda9740fa20e4a58178bf32fa","014252ccdfb7f5e97838ec2e142eb7ba77115ad0ce34f875e8d0e7d15a2aaa4d","dd07a95dd7b66f7b3354c455b712014acf488051700d91869abd0c386ebb40c8","c958b296459577ac81d472c1b7c026cfbf355bf86c603fc98615b8f3ae17d17c","b4f8edbbdf0bdaf1f269651ef74c1e653d84ff5c597031a008e58f68a04db944","da76a0ee549dbadbf47bffa9d729a7747226496b7e213f0729639eebeb6f4810","8a82a1ca79591e9efd8c6c020be08b02e76d2ebf61aa3f21b84f90bf2a618b47","7bb01c4b62bd317b4cf92b846d81f8eee205689e4f084e189f3124e697877f67","d857f478803f81c1f8b7b893f3f8af830833600d75c43e61733c648cc4a524b5","0e32232cf5e0e6d9b5c4e539e3d33578aa9c82b54e549e92b1e04d16f3f9dbd1","56163b6fca1ce4c1572482f2d7dc16634043a7b828488f0b8e5178ddedab49bb","a1b6646110f2437e83782f50dcffedc67ea4f59971681a3e0f552de091bebbd2","c0be66fd022b64d3c61e450513bb4edd1123ef43b1da771bcd94141b29ca933d","b89499001acb38098e666a8c8d426692ab16547009db6f55a1badc84ea714fbe","9c6d63cbfdba522c4d9bac212fdabce699691c646e50fe77e6b6110174d4ff59","2de728b309cd842af835b80b5966df29fa10d5341c7c3637922b7dfa7ec00937","b17522a0136067fe7823bd1808ff8850556584f39b61cc774871a4ff3adedab0","5cad0e401308b0e9ecd231a4d50f85bc50babfd3701256c7dfaa5b86f37cbe7d","c71ce59eb3fbfc0afc6a80b2a4450673f9a44772eee79df273d1bdd43faf13f8","13dc222c7c88d371504d721be75332b20e3278afefcdb1b4c5a36aee6ae4a5fd","7aec7e4f79daab35affd5f8fa2edbd40b83e761b8d59a74cf87e77944244539b"] - } -} \ No newline at end of file diff --git a/alt_chain_data/1ae49ffd0caa6ffb6dc5617a06ae75e7d140303d69e06f4b6b0dcc4bc98383bc_16996.txt b/alt_chain_data/1ae49ffd0caa6ffb6dc5617a06ae75e7d140303d69e06f4b6b0dcc4bc98383bc_16996.txt deleted file mode 100644 index b915ac5..0000000 --- a/alt_chain_data/1ae49ffd0caa6ffb6dc5617a06ae75e7d140303d69e06f4b6b0dcc4bc98383bc_16996.txt +++ /dev/null @@ -1,24 +0,0 @@ -{ - "id": "0", - "jsonrpc": "2.0", - "result": { - "blob": "06069dacd3d20516417000452bb3c27c028024a1a21b2d8264a13967cc2b070563b7cb2ecc8236240215db02a0850101ffe484010192ca908deef30602b7840aca58a897165d0c4c90a6e1519d635808f5f32d0dfd8cec545751f9719a2b0185ab9544cf529130c7557fa1a7d3ebc0a25f832ca909bca1e67ca1fb38b472fe02080000000007472ac70000", - "block_header": { - "block_size": 95, - "depth": 868, - "difficulty": 84590039, - "hash": "1ae49ffd0caa6ffb6dc5617a06ae75e7d140303d69e06f4b6b0dcc4bc98383bc", - "height": 16996, - "major_version": 6, - "minor_version": 6, - "nonce": 3675587108, - "num_txes": 0, - "orphan_status": true, - "prev_hash": "16417000452bb3c27c028024a1a21b2d8264a13967cc2b070563b7cb2ecc8236", - "reward": 30369204413714, - "timestamp": 1515509277 - }, - "json": "{\n \"major_version\": 6, \n \"minor_version\": 6, \n \"timestamp\": 1515509277, \n \"prev_id\": \"16417000452bb3c27c028024a1a21b2d8264a13967cc2b070563b7cb2ecc8236\", \n \"nonce\": 3675587108, \n \"miner_tx\": {\n \"version\": 2, \n \"unlock_time\": 17056, \n \"vin\": [ {\n \"gen\": {\n \"height\": 16996\n }\n }\n ], \n \"vout\": [ {\n \"amount\": 30369204413714, \n \"target\": {\n \"key\": \"b7840aca58a897165d0c4c90a6e1519d635808f5f32d0dfd8cec545751f9719a\"\n }\n }\n ], \n \"extra\": [ 1, 133, 171, 149, 68, 207, 82, 145, 48, 199, 85, 127, 161, 167, 211, 235, 192, 162, 95, 131, 44, 169, 9, 188, 161, 230, 124, 161, 251, 56, 180, 114, 254, 2, 8, 0, 0, 0, 0, 7, 71, 42, 199\n ], \n \"rct_signatures\": {\n \"type\": 0\n }\n }, \n \"tx_hashes\": [ ]\n}", - "status": "OK" - } -} \ No newline at end of file diff --git a/alt_chain_data/1d9687780f854ea310bf5d7ea5e756be167fa043d81a58c3a3e602e08e7ad920_17006.txt b/alt_chain_data/1d9687780f854ea310bf5d7ea5e756be167fa043d81a58c3a3e602e08e7ad920_17006.txt deleted file mode 100644 index ebe6051..0000000 --- a/alt_chain_data/1d9687780f854ea310bf5d7ea5e756be167fa043d81a58c3a3e602e08e7ad920_17006.txt +++ /dev/null @@ -1,24 +0,0 @@ -{ - "id": "0", - "jsonrpc": "2.0", - "result": { - "blob": "0606d9e7d3d2059249ac65bef9acb1b4375a50d9857627ef9f78961fe8fdd6068621572a174bd61c1e006802aa850101ffee84010183e180f9ebf30602edc679784518be061a918062d7b11544948d091e5f06d389d849156100d47b5e2b01a9128d72db29bc746278350850ba4d12a904dc565a03265c599c30b5b34e921a02080000000004472ac70000", - "block_header": { - "block_size": 95, - "depth": 860, - "difficulty": 106837230, - "hash": "1d9687780f854ea310bf5d7ea5e756be167fa043d81a58c3a3e602e08e7ad920", - "height": 17006, - "major_version": 6, - "minor_version": 6, - "nonce": 1744838172, - "num_txes": 0, - "orphan_status": true, - "prev_hash": "9249ac65bef9acb1b4375a50d9857627ef9f78961fe8fdd6068621572a174bd6", - "reward": 30368625340547, - "timestamp": 1515516889 - }, - "json": "{\n \"major_version\": 6, \n \"minor_version\": 6, \n \"timestamp\": 1515516889, \n \"prev_id\": \"9249ac65bef9acb1b4375a50d9857627ef9f78961fe8fdd6068621572a174bd6\", \n \"nonce\": 1744838172, \n \"miner_tx\": {\n \"version\": 2, \n \"unlock_time\": 17066, \n \"vin\": [ {\n \"gen\": {\n \"height\": 17006\n }\n }\n ], \n \"vout\": [ {\n \"amount\": 30368625340547, \n \"target\": {\n \"key\": \"edc679784518be061a918062d7b11544948d091e5f06d389d849156100d47b5e\"\n }\n }\n ], \n \"extra\": [ 1, 169, 18, 141, 114, 219, 41, 188, 116, 98, 120, 53, 8, 80, 186, 77, 18, 169, 4, 220, 86, 90, 3, 38, 92, 89, 156, 48, 181, 179, 78, 146, 26, 2, 8, 0, 0, 0, 0, 4, 71, 42, 199\n ], \n \"rct_signatures\": {\n \"type\": 0\n }\n }, \n \"tx_hashes\": [ ]\n}", - "status": "OK" - } -} \ No newline at end of file diff --git a/alt_chain_data/6360ac8eba51cf1215461f304635e01935345f7fb7fa0c1ce3263ac131b5cb35_17007.txt b/alt_chain_data/6360ac8eba51cf1215461f304635e01935345f7fb7fa0c1ce3263ac131b5cb35_17007.txt deleted file mode 100644 index 3193ef6..0000000 --- a/alt_chain_data/6360ac8eba51cf1215461f304635e01935345f7fb7fa0c1ce3263ac131b5cb35_17007.txt +++ /dev/null @@ -1,24 +0,0 @@ -{ - "id": "0", - "jsonrpc": "2.0", - "result": { - "blob": "0606a9e9d3d2051d9687780f854ea310bf5d7ea5e756be167fa043d81a58c3a3e602e08e7ad9209929090602ab850101ffef8401019fb1b1ddebf30602c7b8a1da31ed781b3153245337e5c34aab53055ebc64a0de8a7c336af1a233ce2b016cbf39ec1ad5079ec981f8ce5b0e59b2e014199c0476496cf404a1323adb6d4d02080000000001bcd9f60000", - "block_header": { - "block_size": 95, - "depth": 859, - "difficulty": 87833212, - "hash": "6360ac8eba51cf1215461f304635e01935345f7fb7fa0c1ce3263ac131b5cb35", - "height": 17007, - "major_version": 6, - "minor_version": 6, - "nonce": 101263769, - "num_txes": 0, - "orphan_status": true, - "prev_hash": "1d9687780f854ea310bf5d7ea5e756be167fa043d81a58c3a3e602e08e7ad920", - "reward": 30368567416991, - "timestamp": 1515517097 - }, - "json": "{\n \"major_version\": 6, \n \"minor_version\": 6, \n \"timestamp\": 1515517097, \n \"prev_id\": \"1d9687780f854ea310bf5d7ea5e756be167fa043d81a58c3a3e602e08e7ad920\", \n \"nonce\": 101263769, \n \"miner_tx\": {\n \"version\": 2, \n \"unlock_time\": 17067, \n \"vin\": [ {\n \"gen\": {\n \"height\": 17007\n }\n }\n ], \n \"vout\": [ {\n \"amount\": 30368567416991, \n \"target\": {\n \"key\": \"c7b8a1da31ed781b3153245337e5c34aab53055ebc64a0de8a7c336af1a233ce\"\n }\n }\n ], \n \"extra\": [ 1, 108, 191, 57, 236, 26, 213, 7, 158, 201, 129, 248, 206, 91, 14, 89, 178, 224, 20, 25, 156, 4, 118, 73, 108, 244, 4, 161, 50, 58, 219, 109, 77, 2, 8, 0, 0, 0, 0, 1, 188, 217, 246\n ], \n \"rct_signatures\": {\n \"type\": 0\n }\n }, \n \"tx_hashes\": [ ]\n}", - "status": "OK" - } -} \ No newline at end of file diff --git a/alt_chain_data/77d6b92961146232ba36ced359f6dbbf3170299b530d2c7d0da5c398f7713d23_17008.txt b/alt_chain_data/77d6b92961146232ba36ced359f6dbbf3170299b530d2c7d0da5c398f7713d23_17008.txt deleted file mode 100644 index f46fce8..0000000 --- a/alt_chain_data/77d6b92961146232ba36ced359f6dbbf3170299b530d2c7d0da5c398f7713d23_17008.txt +++ /dev/null @@ -1,25 +0,0 @@ -{ - "id": "0", - "jsonrpc": "2.0", - "result": { - "blob": "0606f3efd3d2056360ac8eba51cf1215461f304635e01935345f7fb7fa0c1ce3263ac131b5cb35ff94049c02ac850101fff0840101aa9fddd9e3f90602a96b487a44e654d507ce0874bf5464b6bc7e6ca41af6616b2e3382a95c6ca0c82b01ba0c32ea6c5ca20178026281d05527d6bb0c55b744df551a7dca1bb836f69cb802080000000012f64c030003c58f0769da85da444823d8d6839b16253df8f09ffdddc13dfdb9a2b6fbc8628e83cbaf489cf66fb1c6b0c1b8999fba800cf9fce5750dbc167e359c9b0dee3fdc1492c83a04df176ebc184492194ebe64191d471f377132dcafb09724b8176b4a", - "block_header": { - "block_size": 95, - "depth": 858, - "difficulty": 85023515, - "hash": "77d6b92961146232ba36ced359f6dbbf3170299b530d2c7d0da5c398f7713d23", - "height": 17008, - "major_version": 6, - "minor_version": 6, - "nonce": 2617545983, - "num_txes": 3, - "orphan_status": true, - "prev_hash": "6360ac8eba51cf1215461f304635e01935345f7fb7fa0c1ce3263ac131b5cb35", - "reward": 30572570693546, - "timestamp": 1515517939 - }, - "json": "{\n \"major_version\": 6, \n \"minor_version\": 6, \n \"timestamp\": 1515517939, \n \"prev_id\": \"6360ac8eba51cf1215461f304635e01935345f7fb7fa0c1ce3263ac131b5cb35\", \n \"nonce\": 2617545983, \n \"miner_tx\": {\n \"version\": 2, \n \"unlock_time\": 17068, \n \"vin\": [ {\n \"gen\": {\n \"height\": 17008\n }\n }\n ], \n \"vout\": [ {\n \"amount\": 30572570693546, \n \"target\": {\n \"key\": \"a96b487a44e654d507ce0874bf5464b6bc7e6ca41af6616b2e3382a95c6ca0c8\"\n }\n }\n ], \n \"extra\": [ 1, 186, 12, 50, 234, 108, 92, 162, 1, 120, 2, 98, 129, 208, 85, 39, 214, 187, 12, 85, 183, 68, 223, 85, 26, 125, 202, 27, 184, 54, 246, 156, 184, 2, 8, 0, 0, 0, 0, 18, 246, 76, 3\n ], \n \"rct_signatures\": {\n \"type\": 0\n }\n }, \n \"tx_hashes\": [ \"c58f0769da85da444823d8d6839b16253df8f09ffdddc13dfdb9a2b6fbc8628e\", \"83cbaf489cf66fb1c6b0c1b8999fba800cf9fce5750dbc167e359c9b0dee3fdc\", \"1492c83a04df176ebc184492194ebe64191d471f377132dcafb09724b8176b4a\"\n ]\n}", - "status": "OK", - "tx_hashes": ["c58f0769da85da444823d8d6839b16253df8f09ffdddc13dfdb9a2b6fbc8628e","83cbaf489cf66fb1c6b0c1b8999fba800cf9fce5750dbc167e359c9b0dee3fdc","1492c83a04df176ebc184492194ebe64191d471f377132dcafb09724b8176b4a"] - } -} \ No newline at end of file diff --git a/alt_chain_data/78581a7ea3a71082ead85cfde06ebb2a4d7bbfcfef9a0fe69e373e78b807fa7f_16997.txt b/alt_chain_data/78581a7ea3a71082ead85cfde06ebb2a4d7bbfcfef9a0fe69e373e78b807fa7f_16997.txt deleted file mode 100644 index 67c202c..0000000 --- a/alt_chain_data/78581a7ea3a71082ead85cfde06ebb2a4d7bbfcfef9a0fe69e373e78b807fa7f_16997.txt +++ /dev/null @@ -1,24 +0,0 @@ -{ - "id": "0", - "jsonrpc": "2.0", - "result": { - "blob": "0606e1acd3d2051ae49ffd0caa6ffb6dc5617a06ae75e7d140303d69e06f4b6b0dcc4bc98383bc0fb1aa6002a1850101ffe5840101dd91c1f1edf30602ec337478b685134eff525f3cfbf18dd46de2824fa71a2b822d855376ec04b7f82b01f6f9bcac1f8bc3358c0279588a46433e1fe6a11e97eaaebfaee98dff85a621a102080000000001f682740000", - "block_header": { - "block_size": 95, - "depth": 867, - "difficulty": 85817995, - "hash": "78581a7ea3a71082ead85cfde06ebb2a4d7bbfcfef9a0fe69e373e78b807fa7f", - "height": 16997, - "major_version": 6, - "minor_version": 6, - "nonce": 1621799183, - "num_txes": 0, - "orphan_status": true, - "prev_hash": "1ae49ffd0caa6ffb6dc5617a06ae75e7d140303d69e06f4b6b0dcc4bc98383bc", - "reward": 30369146489053, - "timestamp": 1515509345 - }, - "json": "{\n \"major_version\": 6, \n \"minor_version\": 6, \n \"timestamp\": 1515509345, \n \"prev_id\": \"1ae49ffd0caa6ffb6dc5617a06ae75e7d140303d69e06f4b6b0dcc4bc98383bc\", \n \"nonce\": 1621799183, \n \"miner_tx\": {\n \"version\": 2, \n \"unlock_time\": 17057, \n \"vin\": [ {\n \"gen\": {\n \"height\": 16997\n }\n }\n ], \n \"vout\": [ {\n \"amount\": 30369146489053, \n \"target\": {\n \"key\": \"ec337478b685134eff525f3cfbf18dd46de2824fa71a2b822d855376ec04b7f8\"\n }\n }\n ], \n \"extra\": [ 1, 246, 249, 188, 172, 31, 139, 195, 53, 140, 2, 121, 88, 138, 70, 67, 62, 31, 230, 161, 30, 151, 234, 174, 191, 174, 233, 141, 255, 133, 166, 33, 161, 2, 8, 0, 0, 0, 0, 1, 246, 130, 116\n ], \n \"rct_signatures\": {\n \"type\": 0\n }\n }, \n \"tx_hashes\": [ ]\n}", - "status": "OK" - } -} \ No newline at end of file diff --git a/alt_chain_data/8e7a86de29068834e3dd3a498c4717159cceec7b6f0753b65cbf889d564a6982_17003.txt b/alt_chain_data/8e7a86de29068834e3dd3a498c4717159cceec7b6f0753b65cbf889d564a6982_17003.txt deleted file mode 100644 index 2272697..0000000 --- a/alt_chain_data/8e7a86de29068834e3dd3a498c4717159cceec7b6f0753b65cbf889d564a6982_17003.txt +++ /dev/null @@ -1,25 +0,0 @@ -{ - "id": "0", - "jsonrpc": "2.0", - "result": { - "blob": "0606a0ddd3d205f87dd7136998a2e56a963ca1387a9738a98c7aa72a6f8a570f9c71397af383ed76080a1502a7850101ffeb840101c6c7edffe9f506021c41a23fd5a320a69fa4cb7d2ed436ccbab272e00a87a8e5e62773d2ba068af02b01f760a7b6c9ab5c7a93980930048314a0d030453bff3f17d480e2a47db4423d6202080000000002f682740001a3da5b87603312186d940ef790c3cd3d46ae5533a4118b40949d902d3a190583", - "block_header": { - "block_size": 95, - "depth": 863, - "difficulty": 89795673, - "hash": "8e7a86de29068834e3dd3a498c4717159cceec7b6f0753b65cbf889d564a6982", - "height": 17003, - "major_version": 6, - "minor_version": 6, - "nonce": 352979062, - "num_txes": 1, - "orphan_status": true, - "prev_hash": "f87dd7136998a2e56a963ca1387a9738a98c7aa72a6f8a570f9c71397af383ed", - "reward": 30436822311878, - "timestamp": 1515515552 - }, - "json": "{\n \"major_version\": 6, \n \"minor_version\": 6, \n \"timestamp\": 1515515552, \n \"prev_id\": \"f87dd7136998a2e56a963ca1387a9738a98c7aa72a6f8a570f9c71397af383ed\", \n \"nonce\": 352979062, \n \"miner_tx\": {\n \"version\": 2, \n \"unlock_time\": 17063, \n \"vin\": [ {\n \"gen\": {\n \"height\": 17003\n }\n }\n ], \n \"vout\": [ {\n \"amount\": 30436822311878, \n \"target\": {\n \"key\": \"1c41a23fd5a320a69fa4cb7d2ed436ccbab272e00a87a8e5e62773d2ba068af0\"\n }\n }\n ], \n \"extra\": [ 1, 247, 96, 167, 182, 201, 171, 92, 122, 147, 152, 9, 48, 4, 131, 20, 160, 208, 48, 69, 59, 255, 63, 23, 212, 128, 226, 164, 125, 180, 66, 61, 98, 2, 8, 0, 0, 0, 0, 2, 246, 130, 116\n ], \n \"rct_signatures\": {\n \"type\": 0\n }\n }, \n \"tx_hashes\": [ \"a3da5b87603312186d940ef790c3cd3d46ae5533a4118b40949d902d3a190583\"\n ]\n}", - "status": "OK", - "tx_hashes": ["a3da5b87603312186d940ef790c3cd3d46ae5533a4118b40949d902d3a190583"] - } -} \ No newline at end of file diff --git a/alt_chain_data/9249ac65bef9acb1b4375a50d9857627ef9f78961fe8fdd6068621572a174bd6_17005.txt b/alt_chain_data/9249ac65bef9acb1b4375a50d9857627ef9f78961fe8fdd6068621572a174bd6_17005.txt deleted file mode 100644 index f18a3a2..0000000 --- a/alt_chain_data/9249ac65bef9acb1b4375a50d9857627ef9f78961fe8fdd6068621572a174bd6_17005.txt +++ /dev/null @@ -1,24 +0,0 @@ -{ - "id": "0", - "jsonrpc": "2.0", - "result": { - "blob": "0606c5e1d3d205038e2b878d3c204b8726a4159d8e2c113900a7180015ea30a48eda138ed043c7714e05ec02a9850101ffed840101d691d094ecf306020b9449d7678bc9eeaee5d73f2d56b87e07c7d44172c8b994e009bf2a4c4af6752b01fb004518d60291251a1a576677f9e2bcf5233079c7a0b2b42190b7cb8fb6ff0502080000000002472ac70000", - "block_header": { - "block_size": 95, - "depth": 861, - "difficulty": 99356865, - "hash": "9249ac65bef9acb1b4375a50d9857627ef9f78961fe8fdd6068621572a174bd6", - "height": 17005, - "major_version": 6, - "minor_version": 6, - "nonce": 3959770737, - "num_txes": 0, - "orphan_status": true, - "prev_hash": "038e2b878d3c204b8726a4159d8e2c113900a7180015ea30a48eda138ed043c7", - "reward": 30368683264214, - "timestamp": 1515516101 - }, - "json": "{\n \"major_version\": 6, \n \"minor_version\": 6, \n \"timestamp\": 1515516101, \n \"prev_id\": \"038e2b878d3c204b8726a4159d8e2c113900a7180015ea30a48eda138ed043c7\", \n \"nonce\": 3959770737, \n \"miner_tx\": {\n \"version\": 2, \n \"unlock_time\": 17065, \n \"vin\": [ {\n \"gen\": {\n \"height\": 17005\n }\n }\n ], \n \"vout\": [ {\n \"amount\": 30368683264214, \n \"target\": {\n \"key\": \"0b9449d7678bc9eeaee5d73f2d56b87e07c7d44172c8b994e009bf2a4c4af675\"\n }\n }\n ], \n \"extra\": [ 1, 251, 0, 69, 24, 214, 2, 145, 37, 26, 26, 87, 102, 119, 249, 226, 188, 245, 35, 48, 121, 199, 160, 178, 180, 33, 144, 183, 203, 143, 182, 255, 5, 2, 8, 0, 0, 0, 0, 2, 71, 42, 199\n ], \n \"rct_signatures\": {\n \"type\": 0\n }\n }, \n \"tx_hashes\": [ ]\n}", - "status": "OK" - } -} \ No newline at end of file diff --git a/alt_chain_data/a39b5f88e39231ddebf80f8023724f9b7ee77dbb81e91f19b96933a8cf118313_17000.txt b/alt_chain_data/a39b5f88e39231ddebf80f8023724f9b7ee77dbb81e91f19b96933a8cf118313_17000.txt deleted file mode 100644 index a438f46..0000000 --- a/alt_chain_data/a39b5f88e39231ddebf80f8023724f9b7ee77dbb81e91f19b96933a8cf118313_17000.txt +++ /dev/null @@ -1,25 +0,0 @@ -{ - "id": "0", - "jsonrpc": "2.0", - "result": { - "blob": "0606a1cfd3d2050eb61f1b78d810d314769e5e6157bc22894127b5d8e5bc417e99091005a7b8588f81029602a4850101ffe8840101ebccbfbbe5f906023c944822f98c9f59fdef57a196bf1987d6f04f8e0721034f974ceb3e4d88bb2d2b019c25765d6603202013f4a89d8ab60e3149ef064aee4a8feab0f936115a716a5502080000000004f64c0300036c69e35c2acfc877af5d1eaa74c70606dbc0b61d84f7e9d497fffaa1af1b6d169027c337be0ddbe65cbe3e21586915d4f39627a96397a40e445be458ba739200ef54f28c61a031912cd49d1a8c8ef1ccba64e23854dbb3328a2551de2290cfc8", - "block_header": { - "block_size": 95, - "depth": 865, - "difficulty": 88182342, - "hash": "a39b5f88e39231ddebf80f8023724f9b7ee77dbb81e91f19b96933a8cf118313", - "height": 17000, - "major_version": 6, - "minor_version": 6, - "nonce": 2516746639, - "num_txes": 3, - "orphan_status": true, - "prev_hash": "0eb61f1b78d810d314769e5e6157bc22894127b5d8e5bc417e99091005a7b858", - "reward": 30573044164203, - "timestamp": 1515513761 - }, - "json": "{\n \"major_version\": 6, \n \"minor_version\": 6, \n \"timestamp\": 1515513761, \n \"prev_id\": \"0eb61f1b78d810d314769e5e6157bc22894127b5d8e5bc417e99091005a7b858\", \n \"nonce\": 2516746639, \n \"miner_tx\": {\n \"version\": 2, \n \"unlock_time\": 17060, \n \"vin\": [ {\n \"gen\": {\n \"height\": 17000\n }\n }\n ], \n \"vout\": [ {\n \"amount\": 30573044164203, \n \"target\": {\n \"key\": \"3c944822f98c9f59fdef57a196bf1987d6f04f8e0721034f974ceb3e4d88bb2d\"\n }\n }\n ], \n \"extra\": [ 1, 156, 37, 118, 93, 102, 3, 32, 32, 19, 244, 168, 157, 138, 182, 14, 49, 73, 239, 6, 74, 238, 74, 143, 234, 176, 249, 54, 17, 90, 113, 106, 85, 2, 8, 0, 0, 0, 0, 4, 246, 76, 3\n ], \n \"rct_signatures\": {\n \"type\": 0\n }\n }, \n \"tx_hashes\": [ \"6c69e35c2acfc877af5d1eaa74c70606dbc0b61d84f7e9d497fffaa1af1b6d16\", \"9027c337be0ddbe65cbe3e21586915d4f39627a96397a40e445be458ba739200\", \"ef54f28c61a031912cd49d1a8c8ef1ccba64e23854dbb3328a2551de2290cfc8\"\n ]\n}", - "status": "OK", - "tx_hashes": ["6c69e35c2acfc877af5d1eaa74c70606dbc0b61d84f7e9d497fffaa1af1b6d16","9027c337be0ddbe65cbe3e21586915d4f39627a96397a40e445be458ba739200","ef54f28c61a031912cd49d1a8c8ef1ccba64e23854dbb3328a2551de2290cfc8"] - } -} \ No newline at end of file diff --git a/alt_chain_data/f63b50e5962bb7fec38a224f09935177a103c20bcd272a0df24c36559bdc2106_17001.txt b/alt_chain_data/f63b50e5962bb7fec38a224f09935177a103c20bcd272a0df24c36559bdc2106_17001.txt deleted file mode 100644 index d20da6b..0000000 --- a/alt_chain_data/f63b50e5962bb7fec38a224f09935177a103c20bcd272a0df24c36559bdc2106_17001.txt +++ /dev/null @@ -1,24 +0,0 @@ -{ - "id": "0", - "jsonrpc": "2.0", - "result": { - "blob": "0606f5d7d3d205a39b5f88e39231ddebf80f8023724f9b7ee77dbb81e91f19b96933a8cf118313ac15007902a5850101ffe9840101f1dc8d83edf30602b41caa95b2a8f18f4a776d13b501d9c75690cc8eb08214a2f56ade005667b1c32b01b8ebd18f15c4d2028b057b25561c5802455cb0e8628036448d87f8aa917a866302080000000003472ac70000", - "block_header": { - "block_size": 311875, - "depth": 865, - "difficulty": 89283276, - "hash": "f63b50e5962bb7fec38a224f09935177a103c20bcd272a0df24c36559bdc2106", - "height": 17001, - "major_version": 6, - "minor_version": 6, - "nonce": 2030048684, - "num_txes": 0, - "orphan_status": true, - "prev_hash": "a39b5f88e39231ddebf80f8023724f9b7ee77dbb81e91f19b96933a8cf118313", - "reward": 30368914959985, - "timestamp": 1515514869 - }, - "json": "{\n \"major_version\": 6, \n \"minor_version\": 6, \n \"timestamp\": 1515514869, \n \"prev_id\": \"a39b5f88e39231ddebf80f8023724f9b7ee77dbb81e91f19b96933a8cf118313\", \n \"nonce\": 2030048684, \n \"miner_tx\": {\n \"version\": 2, \n \"unlock_time\": 17061, \n \"vin\": [ {\n \"gen\": {\n \"height\": 17001\n }\n }\n ], \n \"vout\": [ {\n \"amount\": 30368914959985, \n \"target\": {\n \"key\": \"b41caa95b2a8f18f4a776d13b501d9c75690cc8eb08214a2f56ade005667b1c3\"\n }\n }\n ], \n \"extra\": [ 1, 184, 235, 209, 143, 21, 196, 210, 2, 139, 5, 123, 37, 86, 28, 88, 2, 69, 92, 176, 232, 98, 128, 54, 68, 141, 135, 248, 170, 145, 122, 134, 99, 2, 8, 0, 0, 0, 0, 3, 71, 42, 199\n ], \n \"rct_signatures\": {\n \"type\": 0\n }\n }, \n \"tx_hashes\": [ ]\n}", - "status": "OK" - } -} \ No newline at end of file diff --git a/alt_chain_data/f87dd7136998a2e56a963ca1387a9738a98c7aa72a6f8a570f9c71397af383ed_17002.txt b/alt_chain_data/f87dd7136998a2e56a963ca1387a9738a98c7aa72a6f8a570f9c71397af383ed_17002.txt deleted file mode 100644 index 8e1f6cf..0000000 --- a/alt_chain_data/f87dd7136998a2e56a963ca1387a9738a98c7aa72a6f8a570f9c71397af383ed_17002.txt +++ /dev/null @@ -1,24 +0,0 @@ -{ - "id": "0", - "jsonrpc": "2.0", - "result": { - "blob": "060684dbd3d205f63b50e5962bb7fec38a224f09935177a103c20bcd272a0df24c36559bdc21068e8e029502a6850101ffea840101e4a8bee7ecf30602613f808c5bbb29eb77f807aaf7a4f155a40b60c858a1eac744f110f182ff236c2b0179be02b5802845c93eb47dec53c476b3ab6c9d416a098ce0c94a0a108f87b6c102080000000003f64c030000", - "block_header": { - "block_size": 189336, - "depth": 864, - "difficulty": 86994653, - "hash": "f87dd7136998a2e56a963ca1387a9738a98c7aa72a6f8a570f9c71397af383ed", - "height": 17002, - "major_version": 6, - "minor_version": 6, - "nonce": 2499972750, - "num_txes": 0, - "orphan_status": true, - "prev_hash": "f63b50e5962bb7fec38a224f09935177a103c20bcd272a0df24c36559bdc2106", - "reward": 30368857035876, - "timestamp": 1515515268 - }, - "json": "{\n \"major_version\": 6, \n \"minor_version\": 6, \n \"timestamp\": 1515515268, \n \"prev_id\": \"f63b50e5962bb7fec38a224f09935177a103c20bcd272a0df24c36559bdc2106\", \n \"nonce\": 2499972750, \n \"miner_tx\": {\n \"version\": 2, \n \"unlock_time\": 17062, \n \"vin\": [ {\n \"gen\": {\n \"height\": 17002\n }\n }\n ], \n \"vout\": [ {\n \"amount\": 30368857035876, \n \"target\": {\n \"key\": \"613f808c5bbb29eb77f807aaf7a4f155a40b60c858a1eac744f110f182ff236c\"\n }\n }\n ], \n \"extra\": [ 1, 121, 190, 2, 181, 128, 40, 69, 201, 62, 180, 125, 236, 83, 196, 118, 179, 171, 108, 157, 65, 106, 9, 140, 224, 201, 74, 10, 16, 143, 135, 182, 193, 2, 8, 0, 0, 0, 0, 3, 246, 76, 3\n ], \n \"rct_signatures\": {\n \"type\": 0\n }\n }, \n \"tx_hashes\": [ ]\n}", - "status": "OK" - } -} \ No newline at end of file diff --git a/blockchain/readme.txt b/blockchain/readme.txt deleted file mode 100644 index 3a96823..0000000 --- a/blockchain/readme.txt +++ /dev/null @@ -1,37 +0,0 @@ -The blockchain is stored as follows, assuming genesis block is stored - -each block has a single child to store main chain -each block can have multiple children to store numerous blocks as alternative - - -each block stores the following extra info - 1) height - 2) single parent - 3) cumulative difficulty - 4) size of block ( size of all transactions included within block + size of block ) - 5) timestamp - 6) cumulative coins - 7) block blob itself - 8) child - 9) multiple children ( alternative or orphan blocks ) - -storing block mean storing all attributes except child/children -connecting a block means setting child/children attributes properly - - -imagine the chain as a doubly linked list, with traversal possible using blockids as ptrs - -the psedo code is as follows - -1) verify incoming blockor semantic errors -2) verify block pow -3) verify each and every transaction for correctnes -4) store the transactions -5) store the block, height, cumulative difficulty, coins emission etc -6) check whether block is the new top, -7) if yes,update main chain -8) if not we have to do chain reorganisation at the top -9) choose the block with higher poW as new top -10) push alt chain txs to mem pool after verification -11) if block is being added somewhere in the middle, find the chain with higher Pow as main chain -12) push the orphan block txs to mempool after verification diff --git a/difficulty/LICENSE b/difficulty/LICENSE deleted file mode 100644 index 26fca3f..0000000 --- a/difficulty/LICENSE +++ /dev/null @@ -1,90 +0,0 @@ -RESEARCH LICENSE - - -Version 1.1.2 - -I. DEFINITIONS. - -"Licensee " means You and any other party that has entered into and has in effect a version of this License. - -“Licensor” means DERO PROJECT(GPG: 0F39 E425 8C65 3947 702A 8234 08B2 0360 A03A 9DE8) and its successors and assignees. - -"Modifications" means any (a) change or addition to the Technology or (b) new source or object code implementing any portion of the Technology. - -"Research Use" means research, evaluation, or development for the purpose of advancing knowledge, teaching, learning, or customizing the Technology for personal use. Research Use expressly excludes use or distribution for direct or indirect commercial (including strategic) gain or advantage. - -"Technology" means the source code, object code and specifications of the technology made available by Licensor pursuant to this License. - -"Technology Site" means the website designated by Licensor for accessing the Technology. - -"You" means the individual executing this License or the legal entity or entities represented by the individual executing this License. - -II. PURPOSE. - -Licensor is licensing the Technology under this Research License (the "License") to promote research, education, innovation, and development using the Technology. - -COMMERCIAL USE AND DISTRIBUTION OF TECHNOLOGY AND MODIFICATIONS IS PERMITTED ONLY UNDER AN APPROPRIATE COMMERCIAL USE LICENSE AVAILABLE FROM LICENSOR AT . - -III. RESEARCH USE RIGHTS. - -A. Subject to the conditions contained herein, Licensor grants to You a non-exclusive, non-transferable, worldwide, and royalty-free license to do the following for Your Research Use only: - -1. reproduce, create Modifications of, and use the Technology alone, or with Modifications; -2. share source code of the Technology alone, or with Modifications, with other Licensees; - -3. distribute object code of the Technology, alone, or with Modifications, to any third parties for Research Use only, under a license of Your choice that is consistent with this License; and - -4. publish papers and books discussing the Technology which may include relevant excerpts that do not in the aggregate constitute a significant portion of the Technology. - -B. Residual Rights. You may use any information in intangible form that you remember after accessing the Technology, except when such use violates Licensor's copyrights or patent rights. - -C. No Implied Licenses. Other than the rights granted herein, Licensor retains all rights, title, and interest in Technology , and You retain all rights, title, and interest in Your Modifications and associated specifications, subject to the terms of this License. - -D. Open Source Licenses. Portions of the Technology may be provided with notices and open source licenses from open source communities and third parties that govern the use of those portions, and any licenses granted hereunder do not alter any rights and obligations you may have under such open source licenses, however, the disclaimer of warranty and limitation of liability provisions in this License will apply to all Technology in this distribution. - -IV. INTELLECTUAL PROPERTY REQUIREMENTS - -As a condition to Your License, You agree to comply with the following restrictions and responsibilities: - -A. License and Copyright Notices. You must include a copy of this License in a Readme file for any Technology or Modifications you distribute. You must also include the following statement, "Use and distribution of this technology is subject to the Java Research License included herein", (a) once prominently in the source code tree and/or specifications for Your source code distributions, and (b) once in the same file as Your copyright or proprietary notices for Your binary code distributions. You must cause any files containing Your Modification to carry prominent notice stating that You changed the files. You must not remove or alter any copyright or other proprietary notices in the Technology. - -B. Licensee Exchanges. Any Technology and Modifications You receive from any Licensee are governed by this License. - -V. GENERAL TERMS. - -A. Disclaimer Of Warranties. - -TECHNOLOGY IS PROVIDED "AS IS", WITHOUT WARRANTIES OF ANY KIND, EITHER EXPRESS OR IMPLIED INCLUDING, WITHOUT LIMITATION, WARRANTIES THAT ANY SUCH TECHNOLOGY IS FREE OF DEFECTS, MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING OF THIRD PARTY RIGHTS. YOU AGREE THAT YOU BEAR THE ENTIRE RISK IN CONNECTION WITH YOUR USE AND DISTRIBUTION OF ANY AND ALL TECHNOLOGY UNDER THIS LICENSE. - -B. Infringement; Limitation Of Liability. - -1. If any portion of, or functionality implemented by, the Technology becomes the subject of a claim or threatened claim of infringement ("Affected Materials"), Licensor may, in its unrestricted discretion, suspend Your rights to use and distribute the Affected Materials under this License. Such suspension of rights will be effective immediately upon Licensor's posting of notice of suspension on the Technology Site. - -2. IN NO EVENT WILL LICENSOR BE LIABLE FOR ANY DIRECT, INDIRECT, PUNITIVE, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES IN CONNECTION WITH OR ARISING OUT OF THIS LICENSE (INCLUDING, WITHOUT LIMITATION, LOSS OF PROFITS, USE, DATA, OR ECONOMIC ADVANTAGE OF ANY SORT), HOWEVER IT ARISES AND ON ANY THEORY OF LIABILITY (including negligence), WHETHER OR NOT LICENSOR HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. LIABILITY UNDER THIS SECTION V.B.2 SHALL BE SO LIMITED AND EXCLUDED, NOTWITHSTANDING FAILURE OF THE ESSENTIAL PURPOSE OF ANY REMEDY. - -C. Termination. - -1. You may terminate this License at any time by notifying Licensor in writing. - -2. All Your rights will terminate under this License if You fail to comply with any of its material terms or conditions and do not cure such failure within thirty (30) days after becoming aware of such noncompliance. - -3. Upon termination, You must discontinue all uses and distribution of the Technology , and all provisions of this Section V shall survive termination. - -D. Miscellaneous. - -1. Trademark. You agree to comply with Licensor's Trademark & Logo Usage Requirements, if any and as modified from time to time, available at the Technology Site. Except as expressly provided in this License, You are granted no rights in or to any Licensor's trademarks now or hereafter used or licensed by Licensor. - -2. Integration. This License represents the complete agreement of the parties concerning the subject matter hereof. - -3. Severability. If any provision of this License is held unenforceable, such provision shall be reformed to the extent necessary to make it enforceable unless to do so would defeat the intent of the parties, in which case, this License shall terminate. - -4. Governing Law. This License is governed by the laws of the United States and the State of California, as applied to contracts entered into and performed in California between California residents. In no event shall this License be construed against the drafter. - -5. Export Control. You agree to comply with the U.S. export controlsand trade laws of other countries that apply to Technology and Modifications. - -READ ALL THE TERMS OF THIS LICENSE CAREFULLY BEFORE ACCEPTING. - -BY CLICKING ON THE YES BUTTON BELOW OR USING THE TECHNOLOGY, YOU ARE ACCEPTING AND AGREEING TO ABIDE BY THE TERMS AND CONDITIONS OF THIS LICENSE. YOU MUST BE AT LEAST 18 YEARS OF AGE AND OTHERWISE COMPETENT TO ENTER INTO CONTRACTS. - -IF YOU DO NOT MEET THESE CRITERIA, OR YOU DO NOT AGREE TO ANY OF THE TERMS OF THIS LICENSE, DO NOT USE THIS SOFTWARE IN ANY FORM. - diff --git a/difficulty/difficulty.go b/difficulty/difficulty.go deleted file mode 100644 index 62938f8..0000000 --- a/difficulty/difficulty.go +++ /dev/null @@ -1,140 +0,0 @@ -// Copyright 2017-2018 DERO Project. All rights reserved. -// Use of this source code in any form is governed by RESEARCH license. -// license can be found in the LICENSE file. -// GPG: 0F39 E425 8C65 3947 702A 8234 08B2 0360 A03A 9DE8 -// -// -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY -// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF -// MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL -// THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS -// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, -// STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF -// THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -package difficulty - -import "fmt" -import "math/big" - -import "github.com/deroproject/derosuite/config" -import "github.com/deroproject/derosuite/crypto" - -var ( - // bigZero is 0 represented as a big.Int. It is defined here to avoid - // the overhead of creating it multiple times. - bigZero = big.NewInt(0) - - // bigOne is 1 represented as a big.Int. It is defined here to avoid - // the overhead of creating it multiple times. - bigOne = big.NewInt(1) - - // oneLsh256 is 1 shifted left 256 bits. It is defined here to avoid - // the overhead of creating it multiple times. - oneLsh256 = new(big.Int).Lsh(bigOne, 256) - - // enabling this will simulation mode with hard coded difficulty set to 1 - // the variable is knowingly not exported, so no one can tinker with it - simulation = false // simulation mode is disabled -) - -// HashToBig converts a PoW has into a big.Int that can be used to -// perform math comparisons. -func HashToBig(buf crypto.Hash) *big.Int { - // A Hash is in little-endian, but the big package wants the bytes in - // big-endian, so reverse them. - blen := len(buf) // its hardcoded 32 bytes, so why do len but lets do it - for i := 0; i < blen/2; i++ { - buf[i], buf[blen-1-i] = buf[blen-1-i], buf[i] - } - - return new(big.Int).SetBytes(buf[:]) -} - -// this function calculates the difficulty in big num form -func ConvertDifficultyToBig(difficultyi uint64) *big.Int { - if difficultyi == 0 { - panic("difficulty can never be zero") - } - // (1 << 256) / (difficultyNum ) - difficulty := new(big.Int).SetUint64(difficultyi) - denominator := new(big.Int).Add(difficulty, bigZero) // above 2 lines can be merged - return new(big.Int).Div(oneLsh256, denominator) -} - -// this function check whether the pow hash meets difficulty criteria -func CheckPowHash(pow_hash crypto.Hash, difficulty uint64) bool { - big_difficulty := ConvertDifficultyToBig(difficulty) - big_pow_hash := HashToBig(pow_hash) - - if big_pow_hash.Cmp(big_difficulty) <= 0 { // if work_pow is less than difficulty - return true - } - return false -} - -/* this function calculates difficulty on the basis of previous timestamps and cumulative_difficulty */ -func Next_Difficulty(timestamps []uint64, cumulative_difficulty []uint64, target_seconds uint64) (difficulty uint64) { - - difficulty = 1 // default difficulty is 1 // for genesis block - - if simulation == true { // simulation mode has difficulty set to 1 - return 1 - } - - if len(timestamps) > config.DIFFICULTY_BLOCKS_COUNT_V2 { - panic("More timestamps provided than required") - } - if len(timestamps) != len(cumulative_difficulty) { - panic("Number of timestamps != Number of cumulative_difficulty") - } - - if len(timestamps) <= 1 { - return difficulty // return 1 - } - - length := uint64(len(timestamps)) - - weighted_timespans := uint64(0) - for i := uint64(1); i < length; i++ { - timespan := uint64(0) - if timestamps[i-1] >= timestamps[i] { - timespan = 1 - } else { - timespan = timestamps[i] - timestamps[i-1] - } - if timespan > (10 * target_seconds) { - timespan = 10 * target_seconds - } - weighted_timespans += i * timespan - } - - minimum_timespan := (target_seconds * length) / 2 - if weighted_timespans < minimum_timespan { // fix startup weirdness - weighted_timespans = minimum_timespan - } - - total_work := cumulative_difficulty[length-1] - cumulative_difficulty[0] - - // convert input for 128 bit multiply - var big_total_work, big_target, big_result big.Int - big_total_work.SetUint64(total_work) - - target := (((length + 1) / 2) * target_seconds * 3) / 2 - big_target.SetUint64(target) - - big_result.Mul(&big_total_work, &big_target) - - if big_result.IsUint64() { - if big_result.Uint64() > 0x000fffffffffffff { // this will give us atleast 1 year to fix the difficulty algorithm - fmt.Printf("Total work per target_time will soon cross 2^64, please fix the difficulty algorithm\n") - } - difficulty = big_result.Uint64() / weighted_timespans - } else { - panic("Total work per target_time crossing 2^64 , please fix the above") - } - - return difficulty -} diff --git a/difficulty/difficulty_test.go b/difficulty/difficulty_test.go deleted file mode 100644 index e3d5bde..0000000 --- a/difficulty/difficulty_test.go +++ /dev/null @@ -1,109 +0,0 @@ -// Copyright 2017-2018 DERO Project. All rights reserved. -// Use of this source code in any form is governed by RESEARCH license. -// license can be found in the LICENSE file. -// GPG: 0F39 E425 8C65 3947 702A 8234 08B2 0360 A03A 9DE8 -// -// -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY -// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF -// MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL -// THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS -// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, -// STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF -// THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -package difficulty - -import "testing" - -import "github.com/deroproject/derosuite/crypto" - -func Test_Next_Difficulty(t *testing.T) { - - target_seconds := uint64(120) - - var cumulative_difficulties []uint64 - var timestamps []uint64 - - calculated := Next_Difficulty(timestamps, cumulative_difficulties, target_seconds) - expected := uint64(1) - if calculated != expected { - t.Errorf("Difficulty should be %d found %d\n", expected, calculated) - } - - timestamps = append(timestamps, 1) - cumulative_difficulties = append(cumulative_difficulties, 1) - calculated = Next_Difficulty(timestamps, cumulative_difficulties, target_seconds) - expected = uint64(1) - if calculated != expected { - t.Errorf("Difficulty should be %d found %d\n", expected, calculated) - } - - timestamps = append(timestamps, 1) - cumulative_difficulties = append(cumulative_difficulties, 3) - calculated = Next_Difficulty(timestamps, cumulative_difficulties, target_seconds) - expected = uint64(3) - if calculated != expected { - t.Errorf("Difficulty should be %d found %d\n", expected, calculated) - } - - timestamps = append(timestamps, 1) - cumulative_difficulties = append(cumulative_difficulties, 10) - calculated = Next_Difficulty(timestamps, cumulative_difficulties, target_seconds) - expected = uint64(18) - if calculated != expected { - t.Errorf("Difficulty should be %d found %d\n", expected, calculated) - } - - timestamps = append(timestamps, 1) - cumulative_difficulties = append(cumulative_difficulties, 20) - calculated = Next_Difficulty(timestamps, cumulative_difficulties, target_seconds) - expected = uint64(28) - if calculated != expected { - t.Errorf("Difficulty should be %d found %d\n", expected, calculated) - } - -} - -/* - * raw data from daemon - * - * /* - * 2018-01-07 20:18:21.157 [P2P4] INFO global src/cryptonote_core/blockchain.cpp:1436 ----- BLOCK ADDED AS ALTERNATIVE ON HEIGHT 16163 -id: -PoW: <28b6fdf6655c45631c28be02bc528342b25fe913696911b788a01e0b0a000000> -difficulty: 77897895 -2018-01-07 21:17:40.182 [P2P9] INFO global src/cryptonote_protocol/cryptonote_protocol_handler.inl:1521 SYNCHRONIZED OK -2018-01-07 22:04:14.368 [P2P2] INFO global src/p2p/net_node.inl:258 Host 125.161.128.47 blocked. -status -Height: 16294/16294 (100.0%) on mainnet, not mining, net hash 780.13 kH/s, v6, up to date, 0(out)+15(in) connections, uptime 0d 10h 29m 2s -2018-01-08 03:14:37.490 [P2P1] INFO global src/cryptonote_core/blockchain.cpp:1436 ----- BLOCK ADDED AS ALTERNATIVE ON HEIGHT 13618 -id: -PoW: -difficulty: 90940906 -*/ -func Test_CheckPowHash(t *testing.T) { - - hash := crypto.Hash{0x28, 0xb6, 0xfd, 0xf6, 0x65, 0x5c, 0x45, 0x63, 0x1c, 0x28, 0xbe, - 0x02, 0xbc, 0x52, 0x83, 0x42, 0xb2, 0x5f, 0xe9, 0x13, 0x69, 0x69, - 0x11, 0xb7, 0x88, 0xa0, 0x1e, 0x0b, 0x0a, 0x00, 0x00, 0x00} - - difficulty := uint64(77897895) - - if !CheckPowHash(hash, difficulty) { - t.Errorf("POW check failedm, severe BUG\n") - } - - hash = crypto.Hash{0xb3, 0x4c, 0xaa, 0x51, 0x54, 0x3b, 0x82, 0xef, 0xee, 0x03, 0x36, 0x67, - 0x7d, 0xd8, 0x25, 0xe3, 0x23, 0x62, 0x20, 0xe6, 0x9d, 0x2f, 0x09, - 0x0c, 0x58, 0xdf, 0x0b, 0x3e, 0x05, 0x00, 0x00, 0x00} - - difficulty = uint64(77897895) - - if !CheckPowHash(hash, difficulty) { - t.Errorf("POW check 2 failed, severe BUG\n") - } - -} diff --git a/p2pv2/README.md b/p2pv2/README.md deleted file mode 100644 index 280d843..0000000 --- a/p2pv2/README.md +++ /dev/null @@ -1,9 +0,0 @@ -This is the basic design of the V2 protocol which features quite a lot of flexibility and easy up-gradation - - - -The protocol is planned to be complete SSL/TLS based to avoid mass traffic analysis by any one. - - - -This is work-in-progress \ No newline at end of file diff --git a/p2pv2/command_loop_infinite.go b/p2pv2/command_loop_infinite.go deleted file mode 100644 index 14ad6cc..0000000 --- a/p2pv2/command_loop_infinite.go +++ /dev/null @@ -1,168 +0,0 @@ -// Copyright 2017-2018 DERO Project. All rights reserved. -// Use of this source code in any form is governed by RESEARCH license. -// license can be found in the LICENSE file. -// GPG: 0F39 E425 8C65 3947 702A 8234 08B2 0360 A03A 9DE8 -// -// -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY -// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF -// MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL -// THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS -// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, -// STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF -// THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -package p2pv2 - -import "io" -import "net" - -//import "sync" -import "time" -import "runtime/debug" -import "container/list" -import "encoding/binary" - -import log "github.com/sirupsen/logrus" -import "github.com/romana/rlog" -import "github.com/vmihailenco/msgpack" - -// this function waits for any commands from the connection and suitably responds doing sanity checks -// this is the core of the p2p package -/* this is the entire connection handler, all incoming/outgoing connections end up here */ -func Handle_Connection(conn net.Conn, remote_addr *net.TCPAddr, incoming bool) { - - var connection Connection - connection.Incoming = incoming - connection.Conn = conn - var idle int - - connection.Addr = remote_addr // since we may be connecting via socks, get target IP - connection.Command_queue = list.New() // init command queue - connection.State = HANDSHAKE_PENDING - if incoming { - connection.logger = logger.WithFields(log.Fields{"RIP": remote_addr.String(), "DIR": "INC", "V2": "1"}) - } else { - connection.logger = logger.WithFields(log.Fields{"RIP": remote_addr.String(), "DIR": "OUT", "V2": "1"}) - } - - defer func() { - if r := recover(); r != nil { - connection.logger.Warnf("Recovered while handling connection, Stack trace below", r) - connection.logger.Warnf("Stack trace \n%s", debug.Stack()) - - } - }() - - Connection_Add(&connection) // add connection to pool - if !incoming { // we initiated the connection, we must send the handshake first - connection.Send_Handshake_Command() // send handshake - } - - // goroutine to exit the connection if signalled - go func() { - ticker := time.NewTicker(1 * time.Second) // 1 second ticker - for { - select { - case <-ticker.C: - idle++ - // if idle more than 13 secs, we should send a timed sync - if idle > 13 { - if connection.State != HANDSHAKE_PENDING { - connection.State = IDLE - } - //Send_Timed_Sync(&connection) - //connection.logger.Debugf("We should send a timed sync") - idle = 0 - } - case <-Exit_Event: // p2p is shutting down, close the connection - connection.Exit = true - ticker.Stop() // release resources of timer - Connection_Delete(&connection) - conn.Close() - return // close the connection and close the routine - } - if connection.Exit { // release resources of timer - ticker.Stop() - Connection_Delete(&connection) - conn.Close() - return - } - } - }() - - // the infinite loop handler - for { - length_buf := make([]byte, 4, 4) // prefix length is 4 bytes - if connection.Exit { - break - } - - read_count, err := io.ReadFull(connection.Conn, length_buf) - if err != nil { - rlog.Tracef(2, "Error while reading command prefix length exiting err:%s\n", err) - connection.Exit = true - continue - } - - length := binary.LittleEndian.Uint32(length_buf) // convert little endian bytes 4 bytes to length - - // check safety of length, we should not allocate more than 100 MB as that is the limit of the block - - command_buf := make([]byte, length, length) - //set_timeout(&connection) // we should not hang for hrs waiting for data to come - read_count, err = io.ReadFull(connection.Conn, command_buf) - if err != nil { - rlog.Tracef(2, "Error while reading command data exiting err:%s\n", err) - connection.Exit = true - continue - } - - command_buf = command_buf[:read_count] - var dummy_command Common - err = msgpack.Unmarshal(command_buf, &dummy_command) - if err != nil { - rlog.Tracef(2, "Error while parsing command data exiting err:%s\n", err) - connection.Exit = true - continue - } - - // if handshake not done, donot process any command - - if !connection.HandShakeCompleted && dummy_command.Command != V2_COMMAND_HANDSHAKE { - rlog.Tracef(2, "Peer Sending something but we are waiting for handshake command data exiting err:%s\n", err) - connection.Exit = true - continue - } - - switch dummy_command.Command { - case V2_COMMAND_HANDSHAKE: - var handshake Handshake - err = msgpack.Unmarshal(command_buf, &handshake) - if err != nil { - rlog.Tracef(2, "Error while parsing incoming handshake data exiting err:%s\n", err) - connection.Exit = true - continue - } - - case V2_COMMAND_SYNC: - - case V2_COMMAND_CHAIN_REQUEST: - - case V2_COMMAND_CHAIN_RESPONSE: // this should be verified whether we are waiting for it - - case V2_COMMAND_OBJECTS_REQUEST: - - case V2_COMMAND_OBJECTS_RESPONSE: // this should be verified whether we are waiting for it - - case V2_NOTIFY_NEW_BLOCK: - - case V2_NOTIFY_NEW_TX: - - } - - } - -} diff --git a/p2pv2/connection_pool.go b/p2pv2/connection_pool.go deleted file mode 100644 index 8dcf964..0000000 --- a/p2pv2/connection_pool.go +++ /dev/null @@ -1,156 +0,0 @@ -// Copyright 2017-2018 DERO Project. All rights reserved. -// Use of this source code in any form is governed by RESEARCH license. -// license can be found in the LICENSE file. -// GPG: 0F39 E425 8C65 3947 702A 8234 08B2 0360 A03A 9DE8 -// -// -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY -// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF -// MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL -// THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS -// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, -// STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF -// THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -package p2pv2 - -/* this file implements the connection pool manager, keeping a list of active connections etc - * this will also ensure that a single IP is connected only once - * - */ -import "fmt" -import "net" -import "sync" -import "container/list" - -import log "github.com/sirupsen/logrus" - -import "github.com/deroproject/derosuite/crypto" - -// any connection incoming/outgoing can only be in this state -type Conn_State string - -const ( - HANDSHAKE_PENDING Conn_State = "Pending" - IDLE = "Idle" - ACTIVE = "Active" -) - -// This structure is used to do book keeping for the connection and keeps other DATA related to peer -type Connection struct { - Incoming bool // is connection incoming or outgoing - Addr *net.TCPAddr // endpoint on the other end - Port uint32 // port advertised by other end as its server,if it's 0 server cannot accept connections - - Peer_Info // all peer info parameters are present here - - Peer_ID uint64 // Remote peer id - Last_Height uint64 // last height sent by peer - Top_Version uint64 // current hard fork version supported by peer - Exit bool // Exit marker that connection needs to be killed - State Conn_State // state of the connection - Top_ID crypto.Hash // top block id of the connection - Cumulative_Difficulty uint64 // cumulative difficulty of top block of peer - logger *log.Entry // connection specific logger - Requested_Objects [][32]byte // currently unused as we sync up with a single peer at a time - Conn net.Conn // actual object to talk - Command_queue *list.List // New protocol is partly syncronous/partly asyncronous - sync.Mutex - - HandShakeCompleted bool // whether handshake is completed - - Bytes_Sent uint64 // total bytes sent - Bytes_Received uint64 // total bytes received - - // TODO a bloom filter that an object has been relayed -} - -var connection_map = map[string]*Connection{} -var connection_mutex sync.Mutex - -func Key(ip net.IP) string { - return string(ip.To16()) // Simple []byte => string conversion -} - -// check whether an IP is in the map already -func IsConnected(ip net.IP) bool { - connection_mutex.Lock() - defer connection_mutex.Unlock() - - if _, ok := connection_map[Key(ip)]; ok { - return true - } - return false -} - -// add connection to map -func Connection_Add(c *Connection) { - connection_mutex.Lock() - defer connection_mutex.Unlock() - connection_map[Key(c.Addr.IP)] = c -} - -// add connection to map -func Connection_Delete(c *Connection) { - connection_mutex.Lock() - defer connection_mutex.Unlock() - delete(connection_map, Key(c.Addr.IP)) -} - -// prints all the connection info to screen -func Connection_Print() { - connection_mutex.Lock() - defer connection_mutex.Unlock() - fmt.Printf("Connection info for peers\n") - fmt.Printf("%-20s %-16s %-5s %-7s %9s %3s\n", "Remote Addr", "PEER ID", "PORT", " State", "Height", "DIR") - for _, v := range connection_map { - dir := "OUT" - if v.Incoming { - dir = "INC" - } - fmt.Printf("%-20s %16x %5d %7s %9d %s\n", v.Addr.IP, v.Peer_ID, v.Port, v.State, v.Last_Height, dir) - } - -} - -// for continuos update on command line, get the maximum height of all peers -func Best_Peer_Height() (best_height uint64) { - connection_mutex.Lock() - for _, v := range connection_map { - if v.Last_Height > best_height { - best_height = v.Last_Height - } - } - connection_mutex.Unlock() - return -} - -// this function return peer count which have successful handshake -func Peer_Count() (Count uint64) { - connection_mutex.Lock() - for _, v := range connection_map { - if v.State != HANDSHAKE_PENDING { - Count++ - } - } - connection_mutex.Unlock() - return -} - -// this returns count of peers in both directions -func Peer_Direction_Count() (Incoming uint64, Outgoing uint64) { - connection_mutex.Lock() - for _, v := range connection_map { - if v.State != HANDSHAKE_PENDING { - if v.Incoming { - Incoming++ - } else { - Outgoing++ - } - } - } - connection_mutex.Unlock() - return -} diff --git a/p2pv2/controller.go b/p2pv2/controller.go deleted file mode 100644 index 1c1d01e..0000000 --- a/p2pv2/controller.go +++ /dev/null @@ -1,148 +0,0 @@ -// Copyright 2017-2018 DERO Project. All rights reserved. -// Use of this source code in any form is governed by RESEARCH license. -// license can be found in the LICENSE file. -// GPG: 0F39 E425 8C65 3947 702A 8234 08B2 0360 A03A 9DE8 -// -// -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY -// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF -// MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL -// THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS -// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, -// STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF -// THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -package p2pv2 - -import "net" -import "time" -import "sync/atomic" - -import log "github.com/sirupsen/logrus" - -import "github.com/deroproject/derosuite/globals" -import "github.com/deroproject/derosuite/blockchain" - -var chain *blockchain.Blockchain // external reference to chain - -var Exit_Event = make(chan bool) // causes all threads to exit -var Exit_In_Progress bool // marks we are doing exit -var logger *log.Entry // global logger, every logger in this package is a child of this - -// Initialize P2P subsystem -func P2P_Init(params map[string]interface{}) error { - logger = globals.Logger.WithFields(log.Fields{"com": "P2P"}) // all components must use this logger - chain = params["chain"].(*blockchain.Blockchain) - go P2P_engine() // start outgoing engine - go P2P_Server_v2() // start accepting connections - logger.Infof("P2P started") - atomic.AddUint32(&globals.Subsystem_Active, 1) // increment subsystem - return nil -} - -func P2P_engine() { - - // if user provided ips at command line , use them, currently we use only the first one - - var end_point_list []string - - /* - if _,ok := globals.Arguments["--add-exclusive-node"] ; ok { // check if parameter is supported - if globals.Arguments["--add-exclusive-node"] != nil { - tmp_list := globals.Arguments["--add-exclusive-node"].([]string) - for i := range tmp_list { - end_point_list = append(end_point_list,tmp_list[i]) - } - } - } - */ - // add hard-coded seeds - end_point_list = append(end_point_list, "127.0.0.1:18095") - - for { - if Exit_In_Progress { - return - } - //remote_addr := "localhost:18090" - //remote_addr := "192.168.56.1:18090" - //remote_addr := "76.74.170.128:18090" - //remote_addr := "89.38.97.110:18090" - remote_addr := end_point_list[0] - - remote_ip, err := net.ResolveTCPAddr("tcp", remote_addr) - - if err != nil { - if Exit_In_Progress { - return - } - logger.Debugf("Resolve address failed:", err.Error()) - time.Sleep(2 * time.Second) - continue - } - - // since we may be connecting through socks, grab the remote ip for our purpose rightnow - conn, err := globals.Dialer.Dial("tcp", remote_ip.String()) - if err != nil { - if Exit_In_Progress { - return - } - logger.Debugf("Dial failed err %s", err.Error()) - time.Sleep(2 * time.Second) - continue - } - - logger.Debugf("Connection established to %s", remote_ip) - Handle_Connection(conn, remote_ip, false) // handle connection - time.Sleep(4 * time.Second) - } - -} - -func P2P_Server_v2() { - - // listen to incoming tcp connections - l, err := net.Listen("tcp", "0.0.0.0:18095") - if err != nil { - logger.Fatalf("Could not listen on port 18095, errr %s", err) - } - defer l.Close() - - // p2p is shutting down, close the listening socket - go func() { - <-Exit_Event - l.Close() - }() - - // A common pattern is to start a loop to continously accept connections - for { - conn, err := l.Accept() //accept connections using Listener.Accept() - if err != nil { - if Exit_In_Progress { // break the loop, since we are exiting - break - } - logger.Warnf("Err while accepting incoming connection errr %s", err) - continue - } - raddr := conn.RemoteAddr().(*net.TCPAddr) - go Handle_Connection(conn, raddr, true) // handle connection in a different go routine - } - -} - -// shutdown the p2p component -func P2P_Shutdown() { - Exit_In_Progress = true - close(Exit_Event) // send signal to all connections to exit - // TODO we must wait for connections to kill themselves - time.Sleep(1 * time.Second) - logger.Infof("P2P Shutdown") - atomic.AddUint32(&globals.Subsystem_Active, ^uint32(0)) // this decrement 1 fom subsystem - -} - -func Connection_ShutDown(connection *Connection) { - connection.Conn.Close() - -} diff --git a/p2pv2/dummy_test.go b/p2pv2/dummy_test.go deleted file mode 100644 index 9c5ecbe..0000000 --- a/p2pv2/dummy_test.go +++ /dev/null @@ -1,13 +0,0 @@ -// Copyright 2017-2018 DERO Project. All rights reserved. -// Use of this source code in any form is governed by RESEARCH license -// license can be found in the LICENSE file. -// GPG: 0F39 E425 8C65 3947 702A 8234 08B2 0360 A03A 9DE8 - -package p2pv2 - -import "testing" - -// Needs to expand test to cover failure conditions -func Test_Part1(t *testing.T) { - -} diff --git a/p2pv2/interface.go b/p2pv2/interface.go deleted file mode 100644 index 50b8b18..0000000 --- a/p2pv2/interface.go +++ /dev/null @@ -1,44 +0,0 @@ -// Copyright 2017-2018 DERO Project. All rights reserved. -// Use of this source code in any form is governed by RESEARCH license. -// license can be found in the LICENSE file. -// GPG: 0F39 E425 8C65 3947 702A 8234 08B2 0360 A03A 9DE8 -// -// -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY -// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF -// MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL -// THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS -// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, -// STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF -// THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -package p2pv2 - -// This file defines what all needs to be responded to become a server ( handling incoming requests) - -// entire wire protocol is handled using the following few functions ( 14 ) -type Wire interface { - Send_Handshake_Command() - Handle_Handshake_Command() - - Send_Sync_Command() - Handle_Sync_Command() - - Send_Chain_Request_command() - Handle_Chain_Request_command() - - Send_Chain_Response_command() - Handle_Chain_Response_command() - - Send_Object_Request_Command() - Handle_Object_Response_Command() - - // notifications are here - Send_Notify_New_Block() - Handle_Notify_New_Block() - - Send_Notify_New_Transaction() - Handle_Notify_New_Transaction() -} diff --git a/p2pv2/peer.go b/p2pv2/peer.go deleted file mode 100644 index b2a1472..0000000 --- a/p2pv2/peer.go +++ /dev/null @@ -1,105 +0,0 @@ -// Copyright 2017-2018 DERO Project. All rights reserved. -// Use of this source code in any form is governed by RESEARCH license. -// license can be found in the LICENSE file. -// GPG: 0F39 E425 8C65 3947 702A 8234 08B2 0360 A03A 9DE8 -// -// -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY -// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF -// MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL -// THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS -// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, -// STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF -// THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -package p2pv2 - -//import "net" -//import "sync" -import "time" - -//import "container/list" - -//import log "github.com/sirupsen/logrus" -import "github.com/vmihailenco/msgpack" - -//import "github.com/deroproject/derosuite/crypto" -import "github.com/deroproject/derosuite/globals" - -//import "github.com/deroproject/derosuite/blockchain" - -// This file defines what all needs to be responded to become a server ( handling incoming requests) - -// fill the common part from our chain -func fill_common(common *Common) { - common.Height = chain.Get_Height() - 1 - common.Top_ID, _ = chain.Load_BL_ID_at_Height(common.Height - 1) - - common.Cumulative_Difficulty = chain.Load_Block_Cumulative_Difficulty(common.Top_ID) - common.Top_Version = 6 // this must be taken from the hardfork - -} - -// send the handshake command -// when we initiate a connection, we immediately send a handshake -func (conn *Connection) Send_Handshake_Command() { - var h Handshake - fill_common(&h.Common) // fill common information - - conn.Lock() - defer conn.Unlock() - - // fill other information - - h.Local_Time = time.Now().UTC().Unix() - h.Local_Port = 0 - h.PeerID = 0 - h.Network_ID = globals.Config.Network_ID - //PeerList []Peer_Info `msgpack:"PLIST"` - //Extension_List []string `msgpack:"EXT"` - - //serialize and send - b, err := msgpack.Marshal(h) - if err != nil { - panic(err) - } - - conn.Send_Message(b) // send the message to peer - -} - -// a handshake command has been received, make the most of it -func (conn *Connection) Handle_Handshake_Command(h *Handshake) { - - conn.Lock() - defer conn.Unlock() - - if h.Network_ID != globals.Config.Network_ID { - logger.Debugf("Connection represents different network %x rejecting peer err:%s\n", h.Network_ID) - conn.Exit = true - } - - // TODO check whether the peer represents current hardfork, if not reject - - // TODO check if the peer time is +- 2hrs from the our time , reject him , - - // fill other information - - h.Local_Time = time.Now().UTC().Unix() - h.Local_Port = 0 - h.PeerID = 0 - h.Network_ID = globals.Config.Network_ID - //PeerList []Peer_Info `msgpack:"PLIST"` - //Extension_List []string `msgpack:"EXT"` - - //serialize and send - b, err := msgpack.Marshal(h) - if err != nil { - panic(err) - } - - conn.Send_Message(b) // send the message to peer - -} diff --git a/p2pv2/wire_structs.go b/p2pv2/wire_structs.go deleted file mode 100644 index 708f288..0000000 --- a/p2pv2/wire_structs.go +++ /dev/null @@ -1,118 +0,0 @@ -// Copyright 2017-2018 DERO Project. All rights reserved. -// Use of this source code in any form is governed by RESEARCH license. -// license can be found in the LICENSE file. -// GPG: 0F39 E425 8C65 3947 702A 8234 08B2 0360 A03A 9DE8 -// -// -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY -// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF -// MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL -// THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS -// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, -// STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF -// THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -package p2pv2 - -import "net" -import "encoding/binary" - -// This file defines the structure for the protocol which is a msgp encoded ( which is standard) -// msgp would cause an easy rewrite of p2p layer even in c, ruby or rust etc as future may demand -// the protocol is length prefixed msgp payload -// though we can use http2 stream features, they may become compilcated as the project evolve -// the prefix length is 4 bytes, little endian encoded ( so a frame can be 4GB in size) -// this is Work-In-Progress -// the reason for writing it from scratch is the mess of boost serialisation -// the p2p package is currently the most complex within the entire project - -// the protocol is partly syncronous, partly asyncronous , except for first handshake, so the node remain undetectable to external network scans, the detection cost is to atleast send a handshake packet*/ - -// these are the commands required to make it completely operational -const V2_COMMAND_HANDSHAKE = 1 // commands are syncronous and must be responded within 10 secs -const V2_COMMAND_SYNC = 2 -const V2_COMMAND_CHAIN_REQUEST = 3 -const V2_COMMAND_CHAIN_RESPONSE = 4 -const V2_COMMAND_OBJECTS_REQUEST = 5 -const V2_COMMAND_OBJECTS_RESPONSE = 6 - -const V2_NOTIFY_NEW_BLOCK = 0x80000000 // Notifications are asyncronous all notifications come here, such as new block, new txs -const V2_NOTIFY_NEW_TX = 0x80000001 // notify tx using this - -// used to parse incoming packet for for command , so as a repective command command could be triggered -type Common struct { - Command uint64 `msgpack:"C"` - Height uint64 `msgpack:"H"` - Cumulative_Difficulty uint64 `msgpack:"CD"` - Top_ID [32]byte `msgpack:"TI"` // 32 bytes of Top block - Top_Version uint64 `msgpack:"TV"` // this basically represents the hard fork version -} - -// at start, client sends handshake and server will respond to handshake -type Handshake struct { - Common // add all fields of Common - Local_Time int64 `msgpack:"LT"` - Local_Port uint32 `msgpack:"LP"` - PeerID uint64 `msgpack:"PID"` - Network_ID [16]byte `msgpack:"NID"` // 16 bytes - PeerList []Peer_Info `msgpack:"PLIST"` - Extension_List []string `msgpack:"EXT"` - Request bool `msgpack:"REQUEST"` //whether this is a request -} - -type Peer_Info struct { - IP net.IP `msgpack:"IP"` - Port uint32 `msgpack:"P"` - ID uint64 `msgpack:"I"` - LastSeen uint64 `msgpack:"LS"` -} - -type Sync struct { - Common // add all fields of common -} - -type Chain_Request struct { - Block_list [][32]byte `msgpack:"BLIST"` -} - -type Chain_Response struct { - Start_height uint64 `msgpack:"SH"` - Block_list [][32]byte `msgpack:"BLIST"` -} - -type Object_Request struct { - Block_list [][32]byte `msgpack:"BLIST"` - Tx_list [][32]byte `msgpack:"TXLIST"` -} - -type Complete_Block struct { - Block []byte `msgpack:"BLOCK"` - Txs [][]byte `msgpack:"TXS"` -} - -type Object_Response struct { - Blocks []Complete_Block `msgpack:"CBLOCKS"` - Txs [][]byte `msgpack:"TXS"` -} - -type Notify_New_Objects struct { - Block Complete_Block `msgpack:"CBLOCK"` - Txs [][]byte `msgpack:"TXS"` -} - -// each packet has to be parsed twice once for extracting command and then a full parsing - -// the message is sent as follows -// assumingin peer lock has already been taken -func (conn *Connection) Send_Message(data_bytes []byte) { - - var length_bytes [4]byte - binary.LittleEndian.PutUint32(length_bytes[:], uint32(len(data_bytes))) - - // send the length prefix - conn.Conn.Write(length_bytes[:]) - conn.Conn.Write(data_bytes) // send the message itself - -}