diff --git a/.gitignore b/.gitignore index a44f0d37..cc239fac 100644 --- a/.gitignore +++ b/.gitignore @@ -1,8 +1,12 @@ release xcode debug +build *.DS_Store -Notebooks/blocksci/pybind11 +Notebooks/blocksci *.so +*.dylib *.pyc -src/blocksci/include/blocksci/external +include/blocksci/external +python/blocksci/pybind11 +*.egg-info diff --git a/.gitmodules b/.gitmodules index c9fd9d6a..127194c8 100644 --- a/.gitmodules +++ b/.gitmodules @@ -1,5 +1,5 @@ [submodule "libs/pybind11"] - path = external/pybind11 + path = python/blocksci/pybind11 url = https://github.com/pybind/pybind11/ [submodule "libs/bitcoin-api-cpp"] path = external/bitcoin-api-cpp @@ -14,7 +14,7 @@ path = external/range-v3 url = https://github.com/ericniebler/range-v3.git [submodule "Notebooks/blocksci/Blockchain-Known-Pools"] - path = Notebooks/blocksci/Blockchain-Known-Pools + path = python/blocksci/Blockchain-Known-Pools url = https://github.com/blockchain/Blockchain-Known-Pools [submodule "libs/clipp"] path = external/clipp diff --git a/CMakeLists.txt b/CMakeLists.txt index db5f4d6c..29ac0c83 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -5,15 +5,11 @@ set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${CMAKE_CURRENT_SOURCE_DIR}/cmake/") set(BlockSci_VERSION 0.5.0) -add_subdirectory(external) +option(BLOCKSCI_PYTHON_BUILD "Install pybind11 header files?" OFF) -add_subdirectory(src/blocksci) -add_subdirectory(src/parser) -add_subdirectory(src/mempool_recorder) -add_subdirectory(src/python-interface) -add_subdirectory(src/clusterer) -add_subdirectory(src/benchmark) -add_subdirectory(src/example) +add_subdirectory(external) -include( CMakePackageConfigHelpers ) -set(CONFIG_PACKAGE_INSTALL_DIR lib/cmake/blocksci) +add_subdirectory(src) +add_subdirectory(tools) +add_subdirectory(benchmark) +add_subdirectory(example) \ No newline at end of file diff --git a/src/benchmark/CMakeLists.txt b/benchmark/CMakeLists.txt similarity index 78% rename from src/benchmark/CMakeLists.txt rename to benchmark/CMakeLists.txt index b9395d75..eb7f6b55 100644 --- a/src/benchmark/CMakeLists.txt +++ b/benchmark/CMakeLists.txt @@ -1,4 +1,9 @@ -add_executable(blocksci_benchmark main.cpp) +cmake_minimum_required(VERSION 3.5) +project(blocksci_benchmark) + +find_package(blocksci REQUIRED) + +add_executable(blocksci_benchmark EXCLUDE_FROM_ALL main.cpp) target_compile_options(blocksci_benchmark PRIVATE -Wall -Wextra -Wpedantic) diff --git a/src/benchmark/main.cpp b/benchmark/main.cpp similarity index 100% rename from src/benchmark/main.cpp rename to benchmark/main.cpp diff --git a/blocksci/Blockchain-Known-Pools/README.md b/blocksci/Blockchain-Known-Pools/README.md deleted file mode 100644 index 43716648..00000000 --- a/blocksci/Blockchain-Known-Pools/README.md +++ /dev/null @@ -1,6 +0,0 @@ -Blockchain Pools -====================== - -Bitcoin Mining Known Pools Tracking Tags for https://blockchain.info/pools - -Contributions welcome. diff --git a/blocksci/Blockchain-Known-Pools/pools.json b/blocksci/Blockchain-Known-Pools/pools.json deleted file mode 100644 index 5033d251..00000000 --- a/blocksci/Blockchain-Known-Pools/pools.json +++ /dev/null @@ -1,670 +0,0 @@ -{ - "coinbase_tags" : { - "pool.bitcoin.com" : { - "name" : "Bitcoin.com", - "link" : "https://www.bitcoin.com" - }, - "Mined By 175btc.com" : { - "name" : "175btc", - "link" : "https://www.175btc.com" - }, - "/mined by gbminers/" : { - "name" : "GBMiners", - "link" : "https://gbminers.com" - }, - "/A-XBT/" : { - "name" : "A-XBT", - "link" : "http://www.a-xbt.com" - }, - "ASICMiner" : { - "name" : "ASICMiner", - "link" : "http://www.asicminer.co" - }, - "/BATPOOL/" : { - "name" : "BATPOOL", - "link" : "https://www.batpool.com" - }, - "BitMinter" : { - "name" : "BitMinter", - "link" : "https://bitminter.com" - }, - "/Bitcoin-Russia.ru/" : { - "name" : "BitcoinRussia", - "link" : "https://bitcoin-russia.ru" - }, - "btcserv" : { - "name" : "BTCServ", - "link" : "http://btcserv.net" - }, - "simplecoin" : { - "name" : "simplecoin.us", - "link" : "http://simplecoin.us" - }, - "BTC Guild" : { - "name" : "BTC Guild", - "link" : "http://www.btcguild.com" - }, - "Eligius" : { - "name" : "Eligius", - "link" : "http://eligius.st" - }, - "ozco.in" : { - "name" : "OzCoin", - "link" : "http://ozcoin.net" - }, - "ozcoin" : { - "name" : "OzCoin", - "link" : "http://ozcoin.net" - }, - "EMC" : { - "name" : "EclipseMC", - "link" : "https://eclipsemc.com" - }, - "MaxBTC" : { - "name" : "MaxBTC", - "link" : "http://maxbtc.com" - }, - "triplemining" : { - "name" : "TripleMining", - "link" : "https://www.triplemining.com" - }, - "Triplemining.com" : { - "name" : "TripleMining", - "link" : "https://www.triplemining.com" - }, - "CoinLab" : { - "name" : "CoinLab", - "link" : "https://coinlab.com" - }, - "50BTC" : { - "name" : "50BTC", - "link" : "https://www.50btc.com" - }, - "ghash.io" : { - "name" : "GHash.IO", - "link" : "https://ghash.io" - }, - "st mining corp" : { - "name" : "ST Mining Corp", - "link" : "https://bitcointalk.org/index.php?topic=77000.msg3207708#msg3207708" - }, - "bitparking" : { - "name" : "Bitparking", - "link" : "http://mmpool.bitparking.com" - }, - "mmpool" : { - "name" : "mmpool", - "link" : "http://mmpool.org/pool" - }, - "by polmine.pl" : { - "name" : "Polmine", - "link" : "https://polmine.pl" - }, - "bypmneU" : { - "name" : "Polmine", - "link" : "https://polmine.pl" - }, - "KnCMiner" : { - "name" : "KnCMiner", - "link" : "https://portal.kncminer.com/pool" - }, - "Bitalo" : { - "name" : "Bitalo", - "link" : "https://bitalo.com/mining" - }, - "七彩神仙鱼" : { - "name" : "F2Pool", - "link" : "https://www.f2pool.com" - }, - "HHTT" : { - "name" : "HHTT", - "link" : "http://hhtt.1209k.com" - }, - "megabigpower.com" : { - "name" : "MegaBigPower", - "link" : "http://megabigpower.com" - }, - "/mtred/" : { - "name" : "Mt Red", - "link" : "https://mtred.com" - }, - "nmcbit.com" : { - "name" : "NMCbit", - "link" : "http://nmcbit.com" - }, - "yourbtc.net" : { - "name" : "Yourbtc.net", - "link" : "http://yourbtc.net" - }, - "Give-Me-Coins" : { - "name" : "Give Me Coins", - "link" : "http://give-me-coins.com" - }, - "/slush/" : { - "name" : "SlushPool", - "link" : "https://slushpool.com" - }, - "Mined by AntPool" : { - "name" : "AntPool", - "link" : "https://www.antpool.com" - }, - "/AntPool/" : { - "name" : "AntPool", - "link" : "https://www.antpool.com" - }, - "Mined by MultiCoin.co" : { - "name" : "MultiCoin.co", - "link" : "http://multicoin.co" - }, - "bcpool.io" : { - "name" : "bcpool.io", - "link" : "https://bcpool.io" - }, - "cointerra" : { - "name" : "Cointerra", - "link" : "http://cointerra.com" - }, - "Kano" : { - "name" : "KanoPool", - "link" : "https://kano.is" - }, - "/solo.ckpool.org/" : { - "name" : "Solo CKPool", - "link" : "http://solo.ckpool.org" - }, - "/ckpool.org/" : { - "name" : "CKPool", - "link" : "http://ckpool.org" - }, - "/NiceHashSolo" : { - "name" : "NiceHash Solo", - "link" : "https://solo.nicehash.com" - }, - "/BitClub Network/" : { - "name" : "BitClub Network", - "link" : "https://bitclubpool.com" - }, - "bitcoinaffiliatenetwork.com" : { - "name" : "Bitcoin Affiliate Network", - "link" : "https://mining.bitcoinaffiliatenetwork.com" - }, - "BTCChina Pool" : { - "name" : "BTCC Pool", - "link" : "https://pool.btcc.com" - }, - "btcchina.com" : { - "name" : "BTCC Pool", - "link" : "https://pool.btcc.com" - }, - "BTCChina.com" : { - "name" : "BTCC Pool", - "link" : "https://pool.btcc.com" - }, - "/BTCC/" : { - "name" : "BTCC Pool", - "link" : "https://pool.btcc.com" - }, - "BW Pool" : { - "name" : "BW.COM", - "link" : "https://bw.com" - }, - "xbtc.exx.com&bw.com" : { - "name" : "xbtc.exx.com&bw.com", - "link" : "https://xbtc.exx.com" - }, - "Bitsolo Pool" : { - "name" : "Bitsolo", - "link" : "http://bitsolo.net" - }, - "/BitFury/" : { - "name" : "BitFury", - "link" : "http://bitfury.com" - }, - "/Bitfury/" : { - "name" : "BitFury", - "link" : "http://bitfury.com" - }, - "/pool34/" : { - "name" : "21 Inc.", - "link" : "https://21.co" - }, - "/agentD/" : { - "name" : "digitalBTC", - "link" : "http://digitalbtc.com" - }, - "/八宝池 8baochi.com/" : { - "name" : "8baochi", - "link" : "http://8baochi.com" - }, - "myBTCcoin Pool" : { - "name" : "myBTCcoin Pool", - "link" : "http://mybtccoin.com" - }, - "TBDice" : { - "name" : "TBDice", - "link" : "http://tbdice.org" - }, - "HASHPOOL" : { - "name" : "HASHPOOL", - "link" : "http://hashpool.com" - }, - "/Nexious/" : { - "name" : "Nexious", - "link" : "https://nexious.com" - }, - "/bravo-mining/" : { - "name" : "Bravo Mining", - "link" : "http://www.bravo-mining.com" - }, - "/HotPool/" : { - "name": "HotPool", - "link": "https://hotpool.co" - }, - "/BCMonster/" : { - "name": "BCMonster", - "link": "http://www.bcmonster.com" - }, - "Mined by 1hash.com" : { - "name": "1Hash", - "link": "http://www.1hash.com" - }, - "/HaoBTC/" : { - "name": "Bixin", - "link": "https://bixin.com/common/pool_landing" - }, - "viabtc.com deploy" : { - "name": "ViaBTC", - "link": "https://viabtc.com" - }, - "/ViaBTC/" : { - "name": "ViaBTC", - "link": "https://viabtc.com" - }, - "/Bitcoin-India/" : { - "name": "Bitcoin India", - "link": "https://bitcoin-india.org" - }, - "--Nug--" : { - "name": "shawnp0wers", - "link": "https://www.brainofshawn.com" - }, - "/phash.io/" : { - "name": "PHash.IO", - "link": "http://phash.io" - }, - "/phash.cn/" : { - "name": "PHash.IO", - "link": "http://phash.io" - }, - "/BTC.TOP/" : { - "name": "BTC.TOP", - "link": "http://btc.top" - }, - "/ConnectBTC - Home for Miners/" : { - "name": "ConnectBTC", - "link": "https://www.connectbtc.com" - }, - "/BTC.COM/" : { - "name": "BTC.com", - "link": "https://pool.btc.com" - }, - "/CANOE/" : { - "name": "CANOE", - "link": "https://www.canoepool.com" - }, - "/RigPool.com/" : { - "name": "RigPool", - "link": "https://www.rigpool.com" - }, - "/haozhuzhu/" : { - "name": "HAOZHUZHU", - "link": "http://haozhuzhu.com/" - }, - "/WATERHOLE.IO/" : { - "name": "Waterhole", - "link": "https://btc.waterhole.io/" - }, - "/$Mined by 7pool.com/" : { - "name": "7pool", - "link": "https://7pool.com/" - }, - "/mined by poopbut/" : { - "name": "MiningKings", - "link": "https://miningkings.com/" - }, - "/DCEX/" : { - "name" : "DCEX", - "link" : "http://dcexploration.cn" - }, - "/58coin.com/" : { - "name" : "58COIN", - "link" : "https://www.58coin.com" - } - }, - "payout_addresses" : { - "1CjPR7Z5ZSyWk6WtXvSFgkptmpoi4UM9BC" : { - "name" : "GHash.IO", - "link" : "https://ghash.io" - }, - "17kkmDx8eSwj2JTTULb3HkJhCmexfysExz" : { - "name" : "Polmine", - "link" : "https://polmine.pl" - }, - "1AajKXkaq2DsnDmP8ZPTrE5gH1HFo1x3AU" : { - "name" : "Polmine", - "link" : "https://polmine.pl" - }, - "16cv7wyeG6RRqhvJpY21CnsjxuKj2gAoK2" : { - "name" : "Polmine", - "link" : "https://polmine.pl" - }, - "13vWXwzNF5Ef9SUXNTdr7de7MqiV4G1gnL" : { - "name" : "Polmine", - "link" : "https://polmine.pl" - }, - "1Nsvmnv8VcTMD643xMYAo35Aco3XA5YPpe" : { - "name" : "Polmine", - "link" : "https://polmine.pl" - }, - "1JrYhdhP2jCY6JwuVzdk9jUwc4pctcSes7" : { - "name" : "Polmine", - "link" : "https://polmine.pl" - }, - "1CK6KHY6MHgYvmRQ4PAafKYDrg1ejbH1cE" : { - "name" : "SlushPool", - "link" : "https://slushpool.com" - }, - "1AqTMY7kmHZxBuLUR5wJjPFUvqGs23sesr" : { - "name" : "SlushPool", - "link" : "https://slushpool.com" - }, - "1AcAj9p6zJn4xLXdvmdiuPCtY7YkBPTAJo" : { - "name" : "BitFury", - "link" : "http://bitfury.com" - }, - "14R2r9FkyDmyxGB9xUVwVLdgsX9YfdVamk" : { - "name" : "BitcoinRussia", - "link" : "https://bitcoin-russia.ru/" - }, - "1BX5YoLwvqzvVwSrdD4dC32vbouHQn2tuF" : { - "name" : "Cointerra", - "link" : "http://cointerra.com" - }, - "19PkHafEN18mquJ9ChwZt5YEFoCdPP5vYB" : { - "name" : "BitMinter", - "link" : "http://bitminter.com" - }, - "15xiShqUqerfjFdyfgBH1K7Gwp6cbYmsTW " : { - "name" : "EclipseMC", - "link" : "https://eclipsemc.com" - }, - "1BwZeHJo7b7M2op7VDfYnsmcpXsUYEcVHm" : { - "name" : "BTC Nuggets", - "link" : "http://104.197.8.250" - }, - "1Cs5RT9SRk1hxsdzivAfkjesNmVVJqfqkw" : { - "name" : "EkanemBTC", - "link" : "https://ekanembtc.com/" - }, - "1KFHE7w8BhaENAswwryaoccDb6qcT6DbYY" : { - "name" : "F2Pool", - "link" : "https://www.f2pool.com" - }, - "3HuobiNg2wHjdPU2mQczL9on8WF7hZmaGd" : { - "name" : "Huobi", - "link" : "http://www.huobi.com" - }, - "1ALA5v7h49QT7WYLcRsxcXqXUqEqaWmkvw" : { - "name" : "CloudHashing", - "link" : "https://cloudhashing.com" - }, - "1K7znxRfkS8R1hcmyMvHDum1hAQreS4VQ4" : { - "name" : "MegaBigPower", - "link" : "https://megabigpower.com" - }, - "1HTejfsPZQGi3afCMEZTn2xdmoNzp13n3F" : { - "name" : "Bitalo", - "link" : "https://bitalo.com/mining" - }, - "1JLRXD8rjRgQtTS9MvfQALfHgGWau9L9ky" : { - "name" : "BW.COM", - "link" : "https://www.bw.com" - }, - "18zRehBcA2YkYvsC7dfQiFJNyjmWvXsvon" : { - "name" : "Bitsolo", - "link" : "http://bitsolo.net" - }, - "155fzsEBHy9Ri2bMQ8uuuR3tv1YzcDywd4" : { - "name" : "BitClub Network", - "link" : "https://bitclubpool.com" - }, - "14yfxkcpHnju97pecpM7fjuTkVdtbkcfE6" : { - "name" : "BitFury", - "link" : "http://bitfury.com" - }, - "15rQXUSBQRubShPpiJfDLxmwS8ze2RUm4z" : { - "name" : "21 Inc.", - "link" : "https://21.co" - }, - "1CdJi2xRTXJF6CEJqNHYyQDNEcM3X7fUhD" : { - "name" : "21 Inc.", - "link" : "https://21.co" - }, - "1GC6HxDvnchDdb5cGkFXsJMZBFRsKAXfwi" : { - "name" : "21 Inc.", - "link" : "https://21.co" - }, - "1MimPd6LrPKGftPRHWdfk8S3KYBfN4ELnD" : { - "name" : "digitalBTC", - "link" : "http://digitalbtc.com" - }, - "1NY15MK947MLzmPUa2gL7UgyR8prLh2xfu" : { - "name" : "digitalX Mintsy", - "link" : "https://www.mintsy.co" - }, - "1P4B6rx1js8TaEDXvZvtrkiEb9XrJgMQ19" : { - "name" : "Telco 214", - "link" : "http://www.telco214.com" - }, - "1MoYfV4U61wqTPTHCyedzFmvf2o3uys2Ua" : { - "name" : "Telco 214", - "link" : "http://www.telco214.com" - }, - "1GaKSh2t396nfSg5Ku2J3Yn1vfVsXrGuH5" : { - "name" : "Telco 214", - "link" : "http://www.telco214.com" - }, - "1AsEJU4ht5wR7BzV6xsNQpwi5qRx4qH1ac" : { - "name" : "Telco 214", - "link" : "http://www.telco214.com" - }, - "18ikmzPqk721ZNvWhDos1UL4H29w352Kj5" : { - "name" : "Telco 214", - "link" : "http://www.telco214.com" - }, - "1DXRoTT67mCbhdHHL1it4J1xsSZHHnFxYR" : { - "name" : "Telco 214", - "link" : "http://www.telco214.com" - }, - "13Sd8Y7nUao3z4bJFkZvCRXpFqHvLy49YY" : { - "name" : "Telco 214", - "link" : "http://www.telco214.com" - }, - "18hvMLisvfc58PvA5rHH7NsLN9CV5ddB2x" : { - "name" : "Telco 214", - "link" : "http://www.telco214.com" - }, - "1BUhwvF9oo3qkaSjjPpWrUzQxXNjkHdMZF" : { - "name" : "Telco 214", - "link" : "http://www.telco214.com" - }, - "1CNq2FAw6S5JfBiDkjkYJUVNQwjoeY4Zfi" : { - "name" : "Telco 214", - "link" : "http://www.telco214.com" - }, - "1LXWA3EEEwPixQcyFWXKX2hWHpkDoLknZW" : { - "name" : "Telco 214", - "link" : "http://www.telco214.com" - }, - "14M1pQ5KKeqmDrmqKyZEnaxAGJfBPrfWvQ" : { - "name" : "Telco 214", - "link" : "http://www.telco214.com" - }, - "152f1muMCNa7goXYhYAQC61hxEgGacmncB" : { - "name" : "BTCC Pool", - "link" : "https://pool.btcc.com" - }, - "1PmRrdp1YSkp1LxPyCfcmBHDEipG5X4eJB" : { - "name" : "BTC Pool Party", - "link" : "https://btcpoolparty.com" - }, - "1Hk9gD8xMo2XBUhE73y5zXEM8xqgffTB5f" : { - "name" : "8baochi", - "link" : "http://8baochi.com" - }, - "151T7r1MhizzJV6dskzzUkUdr7V8JxV2Dx" : { - "name" : "myBTCcoin Pool", - "link" : "http://www.mybtccoin.com" - }, - "1MFsp2txCPwMMBJjNNeKaduGGs8Wi1Ce7X" : { - "name" : "A-XBT", - "link" : "http://www.a-xbt.com" - }, - "1BUiW44WuJ2jiJgXiyxJVFMN8bc1GLdXRk" : { - "name" : "TBDice", - "link" : "http://tbdice.org" - }, - "1MeffGLauEj2CZ18hRQqUauTXb9JAuLbGw" : { - "name" : "Multipool", - "link" : "https://www.multipool.us" - }, - "1qtKetXKgqa7j1KrB19HbvfRiNUncmakk" : { - "name" : "transactioncoinmining", - "link" : "http://sha256.transactioncoinmining.com" - }, - "15MxzsutVroEE9XiDckLxUHTCDAEZgPZJi" : { - "name" : "BTCDig", - "link" : "https://btcdig.com" - }, - "1GBo1f2tzVx5jScV9kJXPUP9RjvYXuNzV7" : { - "name" : "Nexious", - "link" : "https://nexious.com" - }, - "1AePMyovoijxvHuKhTqWvpaAkRCF4QswC6" : { - "name" : "Tricky's BTC Pool", - "link" : "http://pool.wemine.uk" - }, - "17judvK4AC2M6KhaBbAEGw8CTKc9Pg8wup" : { - "name" : "HotPool", - "link" : "https://hotpool.co" - }, - "1jKSjMLnDNup6NPgCjveeP9tUn4YpT94Y" : { - "name" : "BTCMP", - "link" : "https://www.btcmp.com" - }, - "1MPxhNkSzeTNTHSZAibMaS8HS1esmUL1ne" : { - "name" : "Eobot", - "link" : "https://eobot.com" - }, - "16GsNC3q6KgVXkUX7j7aPxSUdHrt1sN2yN" : { - "name" : "Eobot", - "link" : "https://eobot.com" - }, - "1F1xcRt8H8Wa623KqmkEontwAAVqDSAWCV" : { - "name" : "1Hash", - "link" : "http://www.1hash.com" - }, - "1BRY8AD7vSNUEE75NjzfgiG18mWjGQSRuJ" : { - "name" : "UNOMP", - "link" : "http://199.115.116.7:8925" - }, - "19RE4mz2UbDxDVougc6GGdoT4x5yXxwFq2" : { - "name" : "Patel's Mining pool", - "link" : "http://patelsminingpool.com" - }, - "197miJmttpCt2ubVs6DDtGBYFDroxHmvVB" : { - "name" : "Patel's Mining pool", - "link" : "http://patelsminingpool.com" - }, - "18cBEMRxXHqzWWCxZNtU91F5sbUNKhL5PX" : { - "name" : "ViaBTC", - "link" : "http://viabtc.com" - }, - "3NA8hsjfdgVkmmVS9moHmkZsVCoLxUkvvv" : { - "name" : "BTC.com", - "link" : "https://pool.btc.com" - }, - "18EPLvrs2UE11kWBB3ABS7Crwj5tTBYPoa" : { - "name" : "GoGreenLight", - "link" : "http://www.gogreenlight.se" - }, - "12znnESiJ3bgCLftwwrg9wzQKN8fJtoBDa" : { - "name" : "shawnp0wers", - "link" : "https://www.brainofshawn.com" - }, - "18HEMWFXM9UGPVZHUMdBPD3CMFWYn2NPRX" : { - "name" : "shawnp0wers", - "link" : "https://www.brainofshawn.com" - }, - "1AZ6BkCo4zgTuuLpRStJH8iNsehXTMp456" : { - "name" : "Bitcoin India", - "link" : "https://bitcoin-india.org" - }, - "1Hz96kJKF2HLPGY15JWLB5m9qGNxvt8tHJ" : { - "name" : "BTC.TOP", - "link" : "http://btc.top" - }, - "1KPQkehgYAqwiC6UCcbojM3mbGjURrQJF2" : { - "name" : "ConnectBTC", - "link" : "https://www.connectbtc.com" - }, - "167ApWWxUSFQmz2jdz9xop3oAKdLejvMML" : { - "name" : "BATPOOL", - "link" : "https://www.batpool.com" - }, - "1Afcpc2FpPnREU6i52K3cicmHdvYRAH9Wo" : { - "name" : "CANOE", - "link" : "https://www.canoepool.com" - }, - "1JpKmtspBJQVXK67DJP64eBJcAPhDvJ9Er" : { - "name" : "RigPool", - "link" : "https://www.rigpool.com" - }, - "1KsFhYKLs8qb1GHqrPxHoywNQpet2CtP9t" : { - "name" : "Bixin", - "link" : "https://bixin.com/common/pool_landing" - }, - "1E18BNyobcoiejcDYAz5SjbrzifNDEpM88" : { - "name" : "BCMonster", - "link" : "http://www.bcmonster.com" - }, - "19qa95rTbDziNCS9EexUbh2hVY4viUU9tt" : { - "name" : "HAOZHUZHU", - "link" : "http://haozhuzhu.com/" - }, - "1FLH1SoLv4U68yUERhDiWzrJn5TggMqkaZ" : { - "name" : "Waterhole", - "link" : "https://btc.waterhole.io/" - }, - "1JLc3JxvpdL1g5zoX8sKLP4BkJQiwnJftU" : { - "name" : "7pool", - "link" : "https://7pool.com/" - }, - "1EowSPumj9D9AMTpE64Jr7vT3PJDNopVcz" : { - "name" : "MiningKings", - "link" : "https://miningkings.com/" - }, - "1ApE99VM5RJzMRRtwd2JMgmkGabtJqoMEz" : { - "name" : "MiningKings", - "link" : "https://miningkings.com/" - }, - "1KGbsDDAgJN2HDNBjmMHp9828qATo5B9c9" : { - "name" : "MiningKings", - "link" : "https://miningkings.com/" - }, - "199EDJoCpqV672qESEkfFgEqNT1iR2gj3t" : { - "name" : "58COIN", - "link" : "https://www.58coin.com/" - } - } -} diff --git a/blocksci/__init__.py b/blocksci/__init__.py deleted file mode 100644 index 8215c7ee..00000000 --- a/blocksci/__init__.py +++ /dev/null @@ -1,245 +0,0 @@ -from blocksci.blocksci_interface import * -from blocksci.currency import * -from blocksci.blockchain_info import * -from blocksci.blocktrail import * -from blocksci.opreturn import * - -from multiprocess import Pool -from functools import reduce -import operator -import datetime -import dateparser -from dateutil.relativedelta import relativedelta -import pandas as pd -import psutil -import tempfile -import importlib -import subprocess -import sys -import os -import inspect - -version = "0.3" - -def mapreduce_block_ranges(chain, mapFunc, reduceFunc, init, start=None, end=None, cpu_count=psutil.cpu_count()): - """Initialized multithreaded map reduce function over a stream of block ranges - """ - if start is None: - start = 0 - if end is None: - end = len(chain) - elif isinstance(start, str): - blocks = chain.range(start, end) - start = blocks[0].height - end = blocks[-1].height - - if cpu_count == 1: - return mapFunc(chain[start:end]) - - segments = chain.segment(start, end, cpu_count) - with Pool(cpu_count - 1) as p: - results_future = p.map_async(mapFunc, segments[1:]) - last = mapFunc(segments[0]) - results = results_future.get() - results.insert(0, last) - return reduce(reduceFunc, results, init) - - -def mapreduce_blocks(chain, mapFunc, reduceFunc, init, start=None, end=None, cpu_count=psutil.cpu_count()): - """Initialized multithreaded map reduce function over a stream of blocks - """ - def mapRangeFunc(blocks): - return reduce(reduceFunc, (mapFunc(block) for block in blocks), init) - return mapreduce_block_ranges(chain, mapRangeFunc, reduceFunc, init, start, end, cpu_count) - -def mapreduce_txes(chain, mapFunc, reduceFunc, init, start=None, end=None, cpu_count=psutil.cpu_count()): - """Initialized multithreaded map reduce function over a stream of transactions - """ - def mapRangeFunc(blocks): - return reduce(reduceFunc, (mapFunc(tx) for block in blocks for tx in block)) - return mapreduce_block_ranges(chain, mapRangeFunc, reduceFunc, init, start, end, cpu_count) - - -def map_blocks(self, blockFunc, start = None, end = None, cpu_count=psutil.cpu_count()): - """Runs the given function over each block in range and returns a list of the results - """ - def mapFunc(blocks): - return [blockFunc(block) for block in blocks] - - return mapreduce_block_ranges(self, mapFunc, operator.concat, list(), start, end, cpu_count) - -def filter_blocks(self, filterFunc, start = None, end = None, cpu_count=psutil.cpu_count()): - """Return all blocks in range which match the given criteria - """ - def mapFunc(blocks): - return [block for block in blocks if filterFunc(block)] - return mapreduce_block_ranges(self, mapFunc, operator.concat, list(), start, end, cpu_count=cpu_count) - -def filter_txes(self, filterFunc, start = None, end = None, cpu_count=psutil.cpu_count()): - """Return all transactions in range which match the given criteria - """ - def mapFunc(blocks): - return [tx.index for block in blocks for tx in block if filterFunc(tx)] - def reduceFunc(cur, el): - return cur + [el] - init = list() - tx_ids = mapreduce_block_ranges(self, mapFunc, reduceFunc, init, start, end, cpu_count) - return [Tx.tx_with_index(x) for x in tx_ids] - -Blockchain.map_blocks = map_blocks -Blockchain.filter_blocks = filter_blocks -Blockchain.filter_txes = filter_txes -Blockchain.mapreduce_block_ranges = mapreduce_block_ranges -Blockchain.mapreduce_blocks = mapreduce_blocks -Blockchain.mapreduce_txes = mapreduce_txes - -def heights_to_dates(self, df): - return df.set_index(df.index.to_series().apply(lambda x: self[x].time)) - -def block_range(self, start, end=None): - if self.block_times is None: - self.block_times = pd.DataFrame([block.time for block in self], columns=["date"]) - self.block_times["height"] = self.block_times.index - self.block_times.index = self.block_times["date"] - del self.block_times["date"] - - start_date = pd.to_datetime(start) - if end is None: - res = dateparser.DateDataParser().get_date_data(start) - if res['period'] == 'month': - end = start_date + relativedelta(months=1) - elif res['period'] == 'day': - end = start_date + relativedelta(days=1) - elif res['period'] == 'year': - end = start_date + relativedelta(years=1) - else: - end = pd.to_datetime(end) - - return [self[height] for height in self.block_times[(self.block_times.index >= start_date) & (self.block_times.index < end)].height.tolist()] - -old_init = Blockchain.__init__ -def new_init(self, loc): - old_init(self, loc) - self.block_times = None - self.cpp = CPP(self) - ec2_instance_path = "/home/ubuntu/BlockSci/IS_EC2" - tx_heated_path = "/home/ubuntu/BlockSci/TX_DATA_HEATED" - scripts_heated_path = "/home/ubuntu/BlockSci/SCRIPT_DATA_HEATED" - index_heated_path = "/home/ubuntu/BlockSci/INDEX_DATA_HEATED" - - if os.path.exists(ec2_instance_path): - if not os.path.exists(tx_heated_path): - print("Note: this appears to be a fresh instance. Transaction data has not yet been cached locally. Most queries might be slow. Caching is currently ongoing in the background, and usually takes 20 minutes.") - elif not os.path.exists(scripts_heated_path): - print("Note: this appears to be a fresh instance. Script data has not yet been cached locally. Some queries might be slow. Caching is currently ongoing in the background, and usually takes 1.5 hours.") - elif not os.path.exists(index_heated_path): - print("Note: this appears to be a fresh instance. Index data has not yet been cached locally. A few queries might be slow. Caching is currently ongoing in the background, and usually takes 3.5 hours.") -Blockchain.__init__ = new_init -Blockchain.range = block_range -Blockchain.heights_to_dates = heights_to_dates - -first_miner_run = True - -class DummyClass: - pass - -loaderDirectory = os.path.dirname(os.path.abspath(inspect.getsourcefile(DummyClass))) - -def get_miner(block): - global first_miner_run - global tagged_addresses - global pool_data - global coinbase_tag_re - if first_miner_run: - import json - with open(loaderDirectory + "/Blockchain-Known-Pools/pools.json") as f: - pool_data = json.load(f) - addresses = [Address.from_string(addr_string) for addr_string in pool_data["payout_addresses"]] - tagged_addresses = {pointer: pool_data["payout_addresses"][address] for address in addresses if address in pool_data["payout_addresses"]} - coinbase_tag_re = re.compile('|'.join(map(re.escape, pool_data["coinbase_tags"]))) - first_miner_run = False - coinbase = block.coinbase_param.decode("utf_8", "replace") - tag_matches = re.findall(coinbase_tag_re, coinbase) - if len(tag_matches) > 0: - return pool_data["coinbase_tags"][tag_matches[0]]["name"] - for txout in block.coinbase_tx.outs: - if txout.address in tagged_addresses: - return tagged_addresses[txout.address]["name"] - - additional_miners = { - "EclipseMC" : "EclipseMC", - "poolserverj" : "poolserverj", - "/stratumPool/" : "stratumPool", - "/stratum/" : "stratum", - "/nodeStratum/" : "nodeStratum", - "BitLC" : "BitLC", - "/TangPool/" : "TangPool", - "/Tangpool/" : "TangPool", - "pool.mkalinin.ru" : "pool.mkalinin.ru", - "For Pierce and Paul" : "Pierce and Paul", - "50btc.com" : "50btc.com", - "七彩神仙鱼" : "F2Pool" - } - - for miner in additional_miners: - if miner in coinbase: - return additional_miners[miner] - - return "Unknown" - -Block.miner = get_miner - -class CPP(object): - def __init__(self, chain): - self.dynamicFunctionCounter = 0 - self.module_directory = tempfile.TemporaryDirectory() - sys.path.append(self.module_directory.name) - self.saved_tx_filters = {} - self.chain = chain - - def generate_module_name(self): - module_name = "dynamicCode" + str(self.dynamicFunctionCounter) - self.dynamicFunctionCounter += 1 - return module_name - - def filter_tx(self, code, start=None, end=None): - if start is None: - start = 0 - if end is None: - end = len(self.chain) - if code not in self.saved_tx_filters: - from string import Template - filein = open(loaderDirectory + '/filterTxesExtension.cpp') - template = Template(filein.read()) - module_name = self.generate_module_name() - filled_template = template.safe_substitute({"module_name":module_name, "func_def" : code}) - makefile = self.create_makefile(module_name) - func = self.build_function(filled_template, makefile, module_name) - self.saved_tx_filters[code] = func - return self.saved_tx_filters[code](self.chain, start, end) - - def create_makefile(self, module_name): - from string import Template - import os - filein = open(loaderDirectory + '/templateMakefile') - template = Template(filein.read()) - subs = {"module_name" : module_name, "install_location" : self.module_directory.name, "srcname" : module_name + ".cpp", "loaderDirectory":loaderDirectory} - return template.safe_substitute(subs) - - def build_function(self, full_code, makefile, module_name): - builddir = tempfile.TemporaryDirectory() - with open(builddir.name + '/' + module_name + ".cpp", 'w') as f: - f.write(full_code) - with open(builddir.name + '/CMakeLists.txt', 'w') as f: - f.write(makefile) - process = subprocess.Popen(["cmake", "."], cwd=builddir.name, stdout=subprocess.PIPE, stderr=subprocess.PIPE) - out, err = process.communicate() - print(err.decode('utf8')) - process = subprocess.Popen(["make"], cwd=builddir.name, stdout=subprocess.PIPE, stderr=subprocess.PIPE) - out, err = process.communicate() - print(err.decode('utf8')) - process = subprocess.Popen(["make", "install"], cwd=builddir.name, stdout=subprocess.PIPE, stderr=subprocess.PIPE) - out, err = process.communicate() - print(err.decode('utf8')) - mod = importlib.import_module(module_name) - return getattr(mod, "func") \ No newline at end of file diff --git a/blocksci/blockchain_info.py b/blocksci/blockchain_info.py deleted file mode 100644 index 28bcd7be..00000000 --- a/blocksci/blockchain_info.py +++ /dev/null @@ -1,66 +0,0 @@ -import requests -import pandas as pd - -class BlockchainInfoData(object): - def __init__(self, api_key, cache_blocks=False, cache_txs=False): - self.base_url = 'https://blockchain.info/' - self.api_key = api_key - self.cache_blocks = cache_blocks - self.cache_txs = cache_txs - self.block_cache = {} - self.tx_cache = {} - - def block_data(self, block_hash): - if block_hash in self.block_cache: - return self.block_cache[block_hash] - - url = self.base_url + 'rawblock/' + block_hash + "?api_code=" + self.api_key - r = requests.get(url) - r.raise_for_status() - - data = r.json() - if self.cache_blocks: - self.block_cache[block_hash] = data - return data - - def tx_data(self, tx_hash): - if tx_hash in self.tx_cache: - return self.tx_cache[tx_hash] - - url = self.base_url + 'rawtx/' + tx_hash + "?api_code=" + self.api_key - r = requests.get(url) - r.raise_for_status() - - data = r.json() - if self.cache_txs: - self.tx_cache[tx_hash] = data - return data - - def block_arrival_time(self, block_hash): - data = self.block_data(block_hash) - - if "received_time" in data: - return pd.to_datetime(data["received_time"], unit='s') - else: - return None - - def tx_arrival_times(self, block_hash): - data = self.block_data(block_hash) - arrival_times = {} - for tx in data["tx"]: - arrival_times[tx["hash"]] = pd.to_datetime(tx["time"], unit='s') - return arrival_times - - def tx_arrival_time(self, tx_hash): - data = self.tx_data(tx_hash) - if "time" in data: - return pd.to_datetime(data["time"], unit="s") - else: - return None - - def block_relayed_by(self, block_hash): - data = self.block_data(block_hash) - if "relayed_by" in data: - return data["relayed_by"] - else: - return None \ No newline at end of file diff --git a/blocksci/blocktrail.py b/blocksci/blocktrail.py deleted file mode 100644 index 55e2e1b3..00000000 --- a/blocksci/blocktrail.py +++ /dev/null @@ -1,23 +0,0 @@ -import requests -import pandas as pd - -class BlocktrailData(object): - - def __init__(self, api_key): - self.api_key = api_key - self.base_url = "https://api.blocktrail.com/v1/btc/" - self.arrival_times = {} - - def block_header_data(self, height): - url = self.base_url + 'block/{}?api_key={}'.format(height, self.api_key) - r = requests.get(url) - r.raise_for_status() - return r.json() - - def block_arrival_time(self, height): - if height in self.arrival_times: - return self.arrival_times[height] - ts = pd.to_datetime(self.block_header_data(height)['arrival_time']) - self.arrival_times[height] = ts - return ts - \ No newline at end of file diff --git a/blocksci/currency.py b/blocksci/currency.py deleted file mode 100644 index e391aeea..00000000 --- a/blocksci/currency.py +++ /dev/null @@ -1,102 +0,0 @@ -import datetime -import requests -import pandas as pd - -class CurrencyConverter(object): - """ - Imports Bitcoin exchange rates in a variety of currencies using the Coindesk API available at https://www.coindesk.com/price/. - """ - - min_start = pd.to_datetime('2009-01-03').date() - max_end = datetime.date.today() - # the API has data starting at 2010-07-19 - COINDESK_START = pd.to_datetime('2010-07-19').date() - - def __init__(self, currency='USD', start=min_start, end=max_end): - self.currency = currency - - self.start = self.validate_date(start) - self.end = self.validate_date(end) - - if self.start > self.end: - raise ValueError("End date cannot be ahead of start date.") - - self.supported_currencies = self._get_supported_currencies() - if currency not in self.supported_currencies: - raise ValueError("Currency {} is not supported. Please use one of the following options: {}.".format(currency, self.supported_currencies)) - - self.data = self._get_data() - - def _get_supported_currencies(self): - r = requests.get('https://api.coindesk.com/v1/bpi/supported-currencies.json') - r.raise_for_status() - return [x['currency'] for x in r.json()] - - def _get_data(self): - base_url = 'https://api.coindesk.com/v1/bpi/historical/close.json' - r = requests.get('{}?index=USD¤cy={}&start={}&end={}'.format(base_url, self.currency, max(self.COINDESK_START, self.start), max(self.COINDESK_START, self.end))) - r.raise_for_status() - return r.json()['bpi'] - - def to_date(self, s): - return - - def validate_date(self, date): - newdate = pd.to_datetime(date).date() - if newdate < self.min_start or newdate > self.max_end: - raise ValueError("Date must be between {} and {}.".format(self.min_start, self.max_end)) - return newdate - - def exchangerate(self, date): - if date < self.COINDESK_START: - return 0 - return self.data[str(date)] - - def btc_to_currency(self, value, date): - date = self.validate_date(date) - return value * self.exchangerate(date) - - def _btc_to_currency(self, value, date): - return value * self.exchangerate(date) - - def bitcoin_to_currency(self, value, date): - return self.btc_to_currency(value, date) - - def _satoshi_to_currency(self, value, date): - return self._btc_to_currency(value / 1e8, date) - - def satoshi_to_currency(self, value, date): - return self.btc_to_currency(value / 1e8, date) - - def satoshi_to_currency_df(self, df, chain, columns=None): - if columns is None: - columns = df.columns - def convert_row(row): - date = row["index"] - if hasattr(date, 'date'): - date = date.date() - rate = self.exchangerate(date) / 1e8 - for column in columns: - if column in row: - row[column] = rate * row[column] - return row - df["index"] = df.index - index_type = str(df["index"].dtype) - if index_type == "int64": - df["index"] = pd.Series(df["index"]).apply(lambda x: chain[x].time.date()) - df = df.apply(convert_row, axis=1) - del df["index"] - return df - - - def currency_to_btc(self, value, date): - date = self.validate_date(date) - if date < self.COINDESK_START: - return None - return value / self.exchangerate(date) - - def currency_to_bitcoin(self, value, date): - return self.currency_to_btc(value, date) - - def currency_to_satoshi(self, value, date): - return self.currency_to_btc(value, date) * 1e8 \ No newline at end of file diff --git a/blocksci/filterTxesExtension.cpp b/blocksci/filterTxesExtension.cpp deleted file mode 100644 index 6be4bef3..00000000 --- a/blocksci/filterTxesExtension.cpp +++ /dev/null @@ -1,17 +0,0 @@ -#include -#include -#include - -using namespace blocksci; -namespace py = pybind11; - -bool testFunc(const Transaction &tx) { - return ${func_def}; -} - - -PYBIND11_MODULE(${module_name}, m) { - m.def("func", [](const Blockchain &chain, uint32_t start, uint32_t stop) { - return filter(chain, start, stop, testFunc); - }); -} \ No newline at end of file diff --git a/blocksci/mapBlocksExtension.cpp b/blocksci/mapBlocksExtension.cpp deleted file mode 100644 index adb2d5d3..00000000 --- a/blocksci/mapBlocksExtension.cpp +++ /dev/null @@ -1,17 +0,0 @@ -#include -#include -#include - -using namespace blocksci; -namespace py = pybind11; - -auto mapFunc(const Block &block) { - return ${func_def}; -} - - -PYBIND11_MODULE(${module_name}, m) { - m.def("func", [](const Blockchain &chain, uint32_t start, uint32_t stop) { - return chain.map()))>(start, stop, mapFunc); - }); -} \ No newline at end of file diff --git a/blocksci/opreturn.py b/blocksci/opreturn.py deleted file mode 100644 index f264db28..00000000 --- a/blocksci/opreturn.py +++ /dev/null @@ -1,88 +0,0 @@ -import binascii -import re -import Crypto.Cipher.ARC4 -from blocksci import * - -op_return_services = {"OA":"Open Assets", "id":"Blockstack", - "S1":"Stampery","S2":"Stampery","S3":"Stampery","S4":"Stampery","S5":"Stampery", - "Factom!!":"Factom", "FACTOM00":"Factom", "Fa":"Factom", "FA":"Factom", - "ORIGMY":"OriginalMy", - "ProveBit":"ProveBit", - "UNicDC":"University of Nicosia", - "CryptoTests-":"CryptoCopyright", "CryptoProof-":"CryptoCopyright", - "DOCPROOF":"Proof of Existence", - "omni":"Omni Layer", "ASCRIBESPOOL":"Ascribe", - "CC":"Colu", "MG":"Monegraph", - "SB.D":"SB.D", "BITPROOF":"Bitproof", "KC":"KC", "BS":"BlockSign", "OC":"UnknownOC", - "CryptoTests-":"Crypto Copyright", "CryptoProof-":"Crypto Copyright", - "LaPreuve":"LaPreuve", - "RMBd":"Remembr", "RMBe":"Remembr", - "Mined by 1hash.com":"1hash", - "FluxST":"FluxST", "CP110400":"CP1", "KMD":"Komodo", "OKT":"OKT"} -byte_prefixes = {b'g\x01\xdd6\x15&]+':"UnknownBytePrefix", \ - binascii.unhexlify(b'5888'):"Blockstack", binascii.unhexlify(b'5808'):"Blockstack", - binascii.unhexlify(b'455720'):"Eternity Wall", - binascii.unhexlify(b'53504b'):"Coinspark", - binascii.unhexlify(b'4f43'):"Openchain", - b'STAMPD##':"stampd", - b'CNTRPRTY':"Counterparty" - } -exact_string_matches = ["http://www.blockcypher.com/", "http://www.blockcypher.com", "DS", \ - "503: Bitcoin over capacity!", "XX", "XY", "XW", "SS"] -exact_byte_matches = [ - b'\xb3\x87\xfc~\xf6K3\xcf\x01\x82\xec\xf8\xea\xb2\x065\x8cz\xc7\xb5\xa9\xd1$\x1a\x11\xd4Sb\xda\x9af\xa2\xb9l\xb6\xb6\x9b\xd7\xa6a', - b"\xe3\xb0\xc4B\x98\xfc\x1c\x14\x9a\xfb\xf4\xc8\x99o\xb9$'\xaeA\xe4d\x9b\x93L\xa4\x95\x99\x1bxR\xb8U", - b'\xfc\xf4=\xa2D\x99GZ\x96\x00#1\xb8\x97\xc8\xf3#+(\xe5z\xfd\xcb?}y\x91\xbfv\xc8\xf0\xb6\x05\x81\xa2\x89\x9d\x80\x9f\xa9', - b'*K\x94V\x827C\xfe\xc9\xc0\x7fv:\x9f\x0c\xa3@~\xba\xb2\xfa\xca\xe4\x0e\xbbm\x83\xc8\xf5k\x0b\xbf\x94\xcbn\xe7\xb0\x9a$\r' -] - -address_matches = { - Address(155316552, address_type.pubkeyhash):"Chainpoint", - Address(89427334, address_type.pubkeyhash):"Base64DataAddress1", - Address(156665979, address_type.pubkeyhash):"Base64DataAddress2", - Address(182075165, address_type.pubkeyhash):"Base64DataAddress3", - Address(156599323, address_type.pubkeyhash):"Base64DataAddress4", - Address(203933727, address_type.pubkeyhash):"Komodo", - Address(203831434, address_type.pubkey):"Komodo", - Address(127559021, address_type.pubkeyhash): "UnknownAddress1", - Address(16179390, address_type.scripthash):"SpamAddress1", - Address(16163151, address_type.scripthash):"SpamAddress2", - Address(89403362, address_type.pubkeyhash):"SpamAddress3", - Address(155249896, address_type.pubkeyhash):"SpamAddress4", - Address(77604537, address_type.pubkeyhash):"SpamAddress5", - Address(127504441, address_type.pubkeyhash):"SpamAddress5" -} - -def label_application(tx): - if tx.op_return is None: - return None - data = tx.op_return.address.script.data - - if len(data) == 0: - return "Empty" - - decoded = data.decode("ascii", "replace") - strings = re.findall("[a-zA-Z0-9.://! ]+", decoded) - - if decoded in exact_string_matches: - return decoded - elif data in exact_byte_matches: - return data - elif len(strings) > 0 and strings[0].startswith(tuple(op_return_services.keys())): - for prefix in op_return_services: - if strings[0].startswith(prefix): - return op_return_services[prefix] - elif data.startswith(tuple(byte_prefixes.keys())): - for prefix in byte_prefixes: - if data.startswith(prefix): - return byte_prefixes[prefix] - elif len(set(txout.address for txout in tx.outs).intersection(set(address_matches.keys()))) > 0: - for txout in tx.outs: - if txout.address in address_matches: - return address_matches[txout.address] - elif len(tx.ins) > 0: - first_vin_txid = binascii.unhexlify(str(tx.ins[0].spent_tx.hash)) - decoded = Crypto.Cipher.ARC4.new(first_vin_txid).decrypt(data) - if decoded.startswith(b'CNTRPRTY'): - return "Counterparty" - return "Unknown" diff --git a/blocksci/templateMakefile b/blocksci/templateMakefile deleted file mode 100644 index 32df2099..00000000 --- a/blocksci/templateMakefile +++ /dev/null @@ -1,47 +0,0 @@ -cmake_minimum_required(VERSION 3.5) -project(${module_name}) - -set(CMAKE_CXX_STANDARD 14) -set(CMAKE_MACOSX_RPATH 1) -set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall -Wextra -pedantic") -#set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} -D_GLIBCXX_DEBUG") - -# use, i.e. don't skip the full RPATH for the build tree -SET(CMAKE_SKIP_BUILD_RPATH FALSE) - -# when building, don't use the install RPATH already -# (but later on when installing) -SET(CMAKE_BUILD_WITH_INSTALL_RPATH FALSE) - -SET(CMAKE_INSTALL_RPATH "${CMAKE_INSTALL_PREFIX}/lib") - -# add the automatically determined parts of the RPATH -# which point to directories outside the build tree to the install RPATH -SET(CMAKE_INSTALL_RPATH_USE_LINK_PATH TRUE) - -# the RPATH to be used when installing, but only if it's not a system directory -LIST(FIND CMAKE_PLATFORM_IMPLICIT_LINK_DIRECTORIES "${CMAKE_INSTALL_PREFIX}/lib" isSystemDir) -IF("${isSystemDir}" STREQUAL "-1") - SET(CMAKE_INSTALL_RPATH "${CMAKE_INSTALL_PREFIX}/lib") -ENDIF("${isSystemDir}" STREQUAL "-1") - -set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin) - -find_package( Boost COMPONENTS program_options system filesystem thread iostreams REQUIRED ) - -include_directories( ${Boost_INCLUDE_DIR} ) - -link_directories(${Boost_LIBRARY_DIR}) -link_directories(/usr/local/lib) - -add_subdirectory(/home/ubuntu/BlockSci/libs/pybind11 ${CMAKE_CURRENT_BINARY_DIR}/pybind11) - -file(GLOB PYTHON_CLUSTER_SOURCES "*.cpp") - -pybind11_add_module(${module_name} ${PYTHON_CLUSTER_SOURCES}) - -target_compile_options(${module_name} PRIVATE -Wall -Wextra -Wpedantic) - -target_link_libraries( ${module_name} PUBLIC blocksci) - -install(TARGETS ${module_name} DESTINATION ${install_location}) diff --git a/example/CMakeLists.txt b/example/CMakeLists.txt new file mode 100644 index 00000000..12758023 --- /dev/null +++ b/example/CMakeLists.txt @@ -0,0 +1,11 @@ +cmake_minimum_required(VERSION 3.5) +project(blocksci_example) + +find_package(blocksci REQUIRED) + +file(GLOB EXAMPLE_HEADERS "*.hpp") +file(GLOB EXAMPLE_SOURCES "*.cpp") + +add_executable(blocksci_example EXCLUDE_FROM_ALL ${EXAMPLE_SOURCES} ${EXAMPLE_HEADERS}) + +target_link_libraries( blocksci_example blocksci) diff --git a/src/example/example.cpp b/example/example.cpp similarity index 100% rename from src/example/example.cpp rename to example/example.cpp diff --git a/src/example/performance.cpp b/example/performance.cpp similarity index 100% rename from src/example/performance.cpp rename to example/performance.cpp diff --git a/src/example/performance.hpp b/example/performance.hpp similarity index 100% rename from src/example/performance.hpp rename to example/performance.hpp diff --git a/external/CMakeLists.txt b/external/CMakeLists.txt index 83e2b539..3a818c55 100644 --- a/external/CMakeLists.txt +++ b/external/CMakeLists.txt @@ -52,8 +52,4 @@ target_include_directories(rocksdb_headers SYSTEM INTERFACE ${CMAKE_CURRENT_SOUR set(CMAKE_CXX_FLAGS "${saved_flags}") -add_subdirectory(pybind11) - -set_property(GLOBAL PROPERTY pybind11_package_location "${CMAKE_CURRENT_SOURCE_DIR}/pybind11") - add_subdirectory(bitcoin-api-cpp EXCLUDE_FROM_ALL) diff --git a/src/blocksci/include/blocksci/address.hpp b/include/blocksci/address.hpp similarity index 100% rename from src/blocksci/include/blocksci/address.hpp rename to include/blocksci/address.hpp diff --git a/src/blocksci/include/blocksci/address/address.hpp b/include/blocksci/address/address.hpp similarity index 100% rename from src/blocksci/include/blocksci/address/address.hpp rename to include/blocksci/address/address.hpp diff --git a/src/blocksci/include/blocksci/address/address_fwd.hpp b/include/blocksci/address/address_fwd.hpp similarity index 100% rename from src/blocksci/include/blocksci/address/address_fwd.hpp rename to include/blocksci/address/address_fwd.hpp diff --git a/src/blocksci/include/blocksci/address/dedup_address.hpp b/include/blocksci/address/dedup_address.hpp similarity index 100% rename from src/blocksci/include/blocksci/address/dedup_address.hpp rename to include/blocksci/address/dedup_address.hpp diff --git a/src/blocksci/include/blocksci/address/equiv_address.hpp b/include/blocksci/address/equiv_address.hpp similarity index 97% rename from src/blocksci/include/blocksci/address/equiv_address.hpp rename to include/blocksci/address/equiv_address.hpp index 2abc80b3..a97f37a0 100644 --- a/src/blocksci/include/blocksci/address/equiv_address.hpp +++ b/include/blocksci/address/equiv_address.hpp @@ -72,7 +72,7 @@ namespace blocksci { namespace std { template <> - struct hash { + struct BLOCKSCI_EXPORT hash { typedef blocksci::EquivAddress argument_type; typedef size_t result_type; result_type operator()(const argument_type &equiv) const; diff --git a/src/blocksci/include/blocksci/blocksci.hpp b/include/blocksci/blocksci.hpp similarity index 100% rename from src/blocksci/include/blocksci/blocksci.hpp rename to include/blocksci/blocksci.hpp diff --git a/src/blocksci/include/blocksci/blocksci_fwd.hpp b/include/blocksci/blocksci_fwd.hpp similarity index 100% rename from src/blocksci/include/blocksci/blocksci_fwd.hpp rename to include/blocksci/blocksci_fwd.hpp diff --git a/src/blocksci/include/blocksci/chain.hpp b/include/blocksci/chain.hpp similarity index 100% rename from src/blocksci/include/blocksci/chain.hpp rename to include/blocksci/chain.hpp diff --git a/src/blocksci/include/blocksci/chain/algorithms.hpp b/include/blocksci/chain/algorithms.hpp similarity index 100% rename from src/blocksci/include/blocksci/chain/algorithms.hpp rename to include/blocksci/chain/algorithms.hpp diff --git a/src/blocksci/include/blocksci/chain/block.hpp b/include/blocksci/chain/block.hpp similarity index 100% rename from src/blocksci/include/blocksci/chain/block.hpp rename to include/blocksci/chain/block.hpp diff --git a/src/blocksci/include/blocksci/chain/blockchain.hpp b/include/blocksci/chain/blockchain.hpp similarity index 100% rename from src/blocksci/include/blocksci/chain/blockchain.hpp rename to include/blocksci/chain/blockchain.hpp diff --git a/src/blocksci/include/blocksci/chain/chain_fwd.hpp b/include/blocksci/chain/chain_fwd.hpp similarity index 100% rename from src/blocksci/include/blocksci/chain/chain_fwd.hpp rename to include/blocksci/chain/chain_fwd.hpp diff --git a/src/blocksci/include/blocksci/chain/inout_pointer.hpp b/include/blocksci/chain/inout_pointer.hpp similarity index 100% rename from src/blocksci/include/blocksci/chain/inout_pointer.hpp rename to include/blocksci/chain/inout_pointer.hpp diff --git a/src/blocksci/include/blocksci/chain/input.hpp b/include/blocksci/chain/input.hpp similarity index 100% rename from src/blocksci/include/blocksci/chain/input.hpp rename to include/blocksci/chain/input.hpp diff --git a/src/blocksci/include/blocksci/chain/output.hpp b/include/blocksci/chain/output.hpp similarity index 100% rename from src/blocksci/include/blocksci/chain/output.hpp rename to include/blocksci/chain/output.hpp diff --git a/src/blocksci/include/blocksci/chain/range_util.hpp b/include/blocksci/chain/range_util.hpp similarity index 100% rename from src/blocksci/include/blocksci/chain/range_util.hpp rename to include/blocksci/chain/range_util.hpp diff --git a/src/blocksci/include/blocksci/chain/transaction.hpp b/include/blocksci/chain/transaction.hpp similarity index 100% rename from src/blocksci/include/blocksci/chain/transaction.hpp rename to include/blocksci/chain/transaction.hpp diff --git a/src/blocksci/include/blocksci/chain/transaction_range.hpp b/include/blocksci/chain/transaction_range.hpp similarity index 100% rename from src/blocksci/include/blocksci/chain/transaction_range.hpp rename to include/blocksci/chain/transaction_range.hpp diff --git a/src/blocksci/include/blocksci/chain/transaction_summary.hpp b/include/blocksci/chain/transaction_summary.hpp similarity index 100% rename from src/blocksci/include/blocksci/chain/transaction_summary.hpp rename to include/blocksci/chain/transaction_summary.hpp diff --git a/src/blocksci/include/blocksci/cluster.hpp b/include/blocksci/cluster.hpp similarity index 100% rename from src/blocksci/include/blocksci/cluster.hpp rename to include/blocksci/cluster.hpp diff --git a/src/blocksci/include/blocksci/cluster/cluster.hpp b/include/blocksci/cluster/cluster.hpp similarity index 100% rename from src/blocksci/include/blocksci/cluster/cluster.hpp rename to include/blocksci/cluster/cluster.hpp diff --git a/src/blocksci/include/blocksci/cluster/cluster_access.hpp b/include/blocksci/cluster/cluster_access.hpp similarity index 100% rename from src/blocksci/include/blocksci/cluster/cluster_access.hpp rename to include/blocksci/cluster/cluster_access.hpp diff --git a/src/blocksci/include/blocksci/cluster/cluster_fwd.hpp b/include/blocksci/cluster/cluster_fwd.hpp similarity index 100% rename from src/blocksci/include/blocksci/cluster/cluster_fwd.hpp rename to include/blocksci/cluster/cluster_fwd.hpp diff --git a/src/blocksci/include/blocksci/cluster/cluster_manager.hpp b/include/blocksci/cluster/cluster_manager.hpp similarity index 100% rename from src/blocksci/include/blocksci/cluster/cluster_manager.hpp rename to include/blocksci/cluster/cluster_manager.hpp diff --git a/src/blocksci/include/blocksci/core.hpp b/include/blocksci/core.hpp similarity index 100% rename from src/blocksci/include/blocksci/core.hpp rename to include/blocksci/core.hpp diff --git a/src/blocksci/include/blocksci/core/address_info.hpp b/include/blocksci/core/address_info.hpp similarity index 100% rename from src/blocksci/include/blocksci/core/address_info.hpp rename to include/blocksci/core/address_info.hpp diff --git a/src/blocksci/include/blocksci/core/address_types.hpp b/include/blocksci/core/address_types.hpp similarity index 100% rename from src/blocksci/include/blocksci/core/address_types.hpp rename to include/blocksci/core/address_types.hpp diff --git a/src/blocksci/include/blocksci/core/bitcoin_uint256.hpp b/include/blocksci/core/bitcoin_uint256.hpp similarity index 100% rename from src/blocksci/include/blocksci/core/bitcoin_uint256.hpp rename to include/blocksci/core/bitcoin_uint256.hpp diff --git a/src/blocksci/include/blocksci/core/chain_access.hpp b/include/blocksci/core/chain_access.hpp similarity index 100% rename from src/blocksci/include/blocksci/core/chain_access.hpp rename to include/blocksci/core/chain_access.hpp diff --git a/src/blocksci/include/blocksci/core/core_fwd.hpp b/include/blocksci/core/core_fwd.hpp similarity index 100% rename from src/blocksci/include/blocksci/core/core_fwd.hpp rename to include/blocksci/core/core_fwd.hpp diff --git a/src/blocksci/include/blocksci/core/dedup_address_info.hpp b/include/blocksci/core/dedup_address_info.hpp similarity index 100% rename from src/blocksci/include/blocksci/core/dedup_address_info.hpp rename to include/blocksci/core/dedup_address_info.hpp diff --git a/src/blocksci/include/blocksci/core/dedup_address_type.hpp b/include/blocksci/core/dedup_address_type.hpp similarity index 100% rename from src/blocksci/include/blocksci/core/dedup_address_type.hpp rename to include/blocksci/core/dedup_address_type.hpp diff --git a/src/blocksci/include/blocksci/core/equiv_address_type.hpp b/include/blocksci/core/equiv_address_type.hpp similarity index 100% rename from src/blocksci/include/blocksci/core/equiv_address_type.hpp rename to include/blocksci/core/equiv_address_type.hpp diff --git a/src/blocksci/include/blocksci/core/file_mapper.hpp b/include/blocksci/core/file_mapper.hpp similarity index 100% rename from src/blocksci/include/blocksci/core/file_mapper.hpp rename to include/blocksci/core/file_mapper.hpp diff --git a/src/blocksci/include/blocksci/core/hash_combine.hpp b/include/blocksci/core/hash_combine.hpp similarity index 100% rename from src/blocksci/include/blocksci/core/hash_combine.hpp rename to include/blocksci/core/hash_combine.hpp diff --git a/src/blocksci/include/blocksci/core/in_place_array.hpp b/include/blocksci/core/in_place_array.hpp similarity index 100% rename from src/blocksci/include/blocksci/core/in_place_array.hpp rename to include/blocksci/core/in_place_array.hpp diff --git a/src/blocksci/include/blocksci/core/inout.hpp b/include/blocksci/core/inout.hpp similarity index 100% rename from src/blocksci/include/blocksci/core/inout.hpp rename to include/blocksci/core/inout.hpp diff --git a/src/blocksci/include/blocksci/core/raw_address.hpp b/include/blocksci/core/raw_address.hpp similarity index 100% rename from src/blocksci/include/blocksci/core/raw_address.hpp rename to include/blocksci/core/raw_address.hpp diff --git a/src/blocksci/include/blocksci/core/raw_block.hpp b/include/blocksci/core/raw_block.hpp similarity index 100% rename from src/blocksci/include/blocksci/core/raw_block.hpp rename to include/blocksci/core/raw_block.hpp diff --git a/src/blocksci/include/blocksci/core/raw_transaction.hpp b/include/blocksci/core/raw_transaction.hpp similarity index 100% rename from src/blocksci/include/blocksci/core/raw_transaction.hpp rename to include/blocksci/core/raw_transaction.hpp diff --git a/src/blocksci/include/blocksci/core/script_access.hpp b/include/blocksci/core/script_access.hpp similarity index 100% rename from src/blocksci/include/blocksci/core/script_access.hpp rename to include/blocksci/core/script_access.hpp diff --git a/src/blocksci/include/blocksci/core/script_data.hpp b/include/blocksci/core/script_data.hpp similarity index 100% rename from src/blocksci/include/blocksci/core/script_data.hpp rename to include/blocksci/core/script_data.hpp diff --git a/src/blocksci/include/blocksci/core/script_info.hpp b/include/blocksci/core/script_info.hpp similarity index 100% rename from src/blocksci/include/blocksci/core/script_info.hpp rename to include/blocksci/core/script_info.hpp diff --git a/src/blocksci/include/blocksci/exception.hpp b/include/blocksci/exception.hpp similarity index 100% rename from src/blocksci/include/blocksci/exception.hpp rename to include/blocksci/exception.hpp diff --git a/src/blocksci/include/blocksci/heuristics.hpp b/include/blocksci/heuristics.hpp similarity index 100% rename from src/blocksci/include/blocksci/heuristics.hpp rename to include/blocksci/heuristics.hpp diff --git a/src/blocksci/include/blocksci/heuristics/blockchain_heuristics.hpp b/include/blocksci/heuristics/blockchain_heuristics.hpp similarity index 100% rename from src/blocksci/include/blocksci/heuristics/blockchain_heuristics.hpp rename to include/blocksci/heuristics/blockchain_heuristics.hpp diff --git a/src/blocksci/include/blocksci/heuristics/change_address.hpp b/include/blocksci/heuristics/change_address.hpp similarity index 100% rename from src/blocksci/include/blocksci/heuristics/change_address.hpp rename to include/blocksci/heuristics/change_address.hpp diff --git a/src/blocksci/include/blocksci/heuristics/taint.hpp b/include/blocksci/heuristics/taint.hpp similarity index 100% rename from src/blocksci/include/blocksci/heuristics/taint.hpp rename to include/blocksci/heuristics/taint.hpp diff --git a/src/blocksci/include/blocksci/heuristics/tx_identification.hpp b/include/blocksci/heuristics/tx_identification.hpp similarity index 100% rename from src/blocksci/include/blocksci/heuristics/tx_identification.hpp rename to include/blocksci/heuristics/tx_identification.hpp diff --git a/src/blocksci/include/blocksci/index.hpp b/include/blocksci/index.hpp similarity index 100% rename from src/blocksci/include/blocksci/index.hpp rename to include/blocksci/index.hpp diff --git a/src/blocksci/include/blocksci/index/address_index.hpp b/include/blocksci/index/address_index.hpp similarity index 100% rename from src/blocksci/include/blocksci/index/address_index.hpp rename to include/blocksci/index/address_index.hpp diff --git a/src/blocksci/include/blocksci/index/address_output_range.hpp b/include/blocksci/index/address_output_range.hpp similarity index 100% rename from src/blocksci/include/blocksci/index/address_output_range.hpp rename to include/blocksci/index/address_output_range.hpp diff --git a/src/blocksci/include/blocksci/index/column_iterator.hpp b/include/blocksci/index/column_iterator.hpp similarity index 100% rename from src/blocksci/include/blocksci/index/column_iterator.hpp rename to include/blocksci/index/column_iterator.hpp diff --git a/src/blocksci/include/blocksci/index/hash_index.hpp b/include/blocksci/index/hash_index.hpp similarity index 100% rename from src/blocksci/include/blocksci/index/hash_index.hpp rename to include/blocksci/index/hash_index.hpp diff --git a/src/blocksci/include/blocksci/index/mempool_index.hpp b/include/blocksci/index/mempool_index.hpp similarity index 100% rename from src/blocksci/include/blocksci/index/mempool_index.hpp rename to include/blocksci/index/mempool_index.hpp diff --git a/src/blocksci/include/blocksci/meta.hpp b/include/blocksci/meta.hpp similarity index 100% rename from src/blocksci/include/blocksci/meta.hpp rename to include/blocksci/meta.hpp diff --git a/src/blocksci/include/blocksci/script.hpp b/include/blocksci/script.hpp similarity index 100% rename from src/blocksci/include/blocksci/script.hpp rename to include/blocksci/script.hpp diff --git a/src/blocksci/include/blocksci/scripts/bitcoin_pubkey.hpp b/include/blocksci/scripts/bitcoin_pubkey.hpp similarity index 100% rename from src/blocksci/include/blocksci/scripts/bitcoin_pubkey.hpp rename to include/blocksci/scripts/bitcoin_pubkey.hpp diff --git a/src/blocksci/include/blocksci/scripts/bitcoin_script.hpp b/include/blocksci/scripts/bitcoin_script.hpp similarity index 100% rename from src/blocksci/include/blocksci/scripts/bitcoin_script.hpp rename to include/blocksci/scripts/bitcoin_script.hpp diff --git a/src/blocksci/include/blocksci/scripts/multisig_pubkey_script.hpp b/include/blocksci/scripts/multisig_pubkey_script.hpp similarity index 100% rename from src/blocksci/include/blocksci/scripts/multisig_pubkey_script.hpp rename to include/blocksci/scripts/multisig_pubkey_script.hpp diff --git a/src/blocksci/include/blocksci/scripts/multisig_script.hpp b/include/blocksci/scripts/multisig_script.hpp similarity index 100% rename from src/blocksci/include/blocksci/scripts/multisig_script.hpp rename to include/blocksci/scripts/multisig_script.hpp diff --git a/src/blocksci/include/blocksci/scripts/nonstandard_script.hpp b/include/blocksci/scripts/nonstandard_script.hpp similarity index 100% rename from src/blocksci/include/blocksci/scripts/nonstandard_script.hpp rename to include/blocksci/scripts/nonstandard_script.hpp diff --git a/src/blocksci/include/blocksci/scripts/nulldata_script.hpp b/include/blocksci/scripts/nulldata_script.hpp similarity index 100% rename from src/blocksci/include/blocksci/scripts/nulldata_script.hpp rename to include/blocksci/scripts/nulldata_script.hpp diff --git a/src/blocksci/include/blocksci/scripts/pubkey_base_script.hpp b/include/blocksci/scripts/pubkey_base_script.hpp similarity index 100% rename from src/blocksci/include/blocksci/scripts/pubkey_base_script.hpp rename to include/blocksci/scripts/pubkey_base_script.hpp diff --git a/src/blocksci/include/blocksci/scripts/pubkey_script.hpp b/include/blocksci/scripts/pubkey_script.hpp similarity index 100% rename from src/blocksci/include/blocksci/scripts/pubkey_script.hpp rename to include/blocksci/scripts/pubkey_script.hpp diff --git a/src/blocksci/include/blocksci/scripts/script.hpp b/include/blocksci/scripts/script.hpp similarity index 100% rename from src/blocksci/include/blocksci/scripts/script.hpp rename to include/blocksci/scripts/script.hpp diff --git a/src/blocksci/include/blocksci/scripts/script_variant.hpp b/include/blocksci/scripts/script_variant.hpp similarity index 100% rename from src/blocksci/include/blocksci/scripts/script_variant.hpp rename to include/blocksci/scripts/script_variant.hpp diff --git a/src/blocksci/include/blocksci/scripts/script_view.hpp b/include/blocksci/scripts/script_view.hpp similarity index 100% rename from src/blocksci/include/blocksci/scripts/script_view.hpp rename to include/blocksci/scripts/script_view.hpp diff --git a/src/blocksci/include/blocksci/scripts/scripthash_script.hpp b/include/blocksci/scripts/scripthash_script.hpp similarity index 100% rename from src/blocksci/include/blocksci/scripts/scripthash_script.hpp rename to include/blocksci/scripts/scripthash_script.hpp diff --git a/src/blocksci/include/blocksci/scripts/scripts_fwd.hpp b/include/blocksci/scripts/scripts_fwd.hpp similarity index 100% rename from src/blocksci/include/blocksci/scripts/scripts_fwd.hpp rename to include/blocksci/scripts/scripts_fwd.hpp diff --git a/src/blocksci/include/blocksci/typedefs.hpp b/include/blocksci/typedefs.hpp similarity index 100% rename from src/blocksci/include/blocksci/typedefs.hpp rename to include/blocksci/typedefs.hpp diff --git a/src/blocksci/include/blocksci/util/data_access.hpp b/include/blocksci/util/data_access.hpp similarity index 100% rename from src/blocksci/include/blocksci/util/data_access.hpp rename to include/blocksci/util/data_access.hpp diff --git a/src/blocksci/include/blocksci/util/data_configuration.hpp b/include/blocksci/util/data_configuration.hpp similarity index 100% rename from src/blocksci/include/blocksci/util/data_configuration.hpp rename to include/blocksci/util/data_configuration.hpp diff --git a/src/blocksci/include/blocksci/util/hash.hpp b/include/blocksci/util/hash.hpp similarity index 100% rename from src/blocksci/include/blocksci/util/hash.hpp rename to include/blocksci/util/hash.hpp diff --git a/src/blocksci/include/blocksci/util/memory_view.hpp b/include/blocksci/util/memory_view.hpp similarity index 100% rename from src/blocksci/include/blocksci/util/memory_view.hpp rename to include/blocksci/util/memory_view.hpp diff --git a/src/blocksci/include/blocksci/util/parallel.hpp b/include/blocksci/util/parallel.hpp similarity index 100% rename from src/blocksci/include/blocksci/util/parallel.hpp rename to include/blocksci/util/parallel.hpp diff --git a/src/blocksci/include/blocksci/util/progress_bar.hpp b/include/blocksci/util/progress_bar.hpp similarity index 100% rename from src/blocksci/include/blocksci/util/progress_bar.hpp rename to include/blocksci/util/progress_bar.hpp diff --git a/src/blocksci/include/blocksci/util/state.hpp b/include/blocksci/util/state.hpp similarity index 100% rename from src/blocksci/include/blocksci/util/state.hpp rename to include/blocksci/util/state.hpp diff --git a/src/python-interface/CMakeLists.txt b/python/CMakeLists.txt similarity index 58% rename from src/python-interface/CMakeLists.txt rename to python/CMakeLists.txt index e0f5cb52..1c90bfa4 100644 --- a/src/python-interface/CMakeLists.txt +++ b/python/CMakeLists.txt @@ -1,15 +1,19 @@ -file(GLOB PYTHON_INTERFACE_HEADERS "*.hpp") -file(GLOB PYTHON_INTERFACE_SOURCES "*.cpp") +cmake_minimum_required(VERSION 3.5) +project(blockscipy) + +find_package(blocksci REQUIRED) + +add_subdirectory(blocksci/pybind11) + +file(GLOB PYTHON_INTERFACE_HEADERS "src/*.hpp") +file(GLOB PYTHON_INTERFACE_SOURCES "src/*.cpp") pybind11_add_module(blocksci_interface ${PYTHON_INTERFACE_SOURCES} ${PYTHON_INTERFACE_HEADERS}) -target_compile_options(blocksci_interface PRIVATE -Wall -Wextra -Wpedantic) +target_compile_options(blocksci_interface PRIVATE -Wall -Wextra -Wpedantic -Winstantiation-after-specialization) target_link_libraries( blocksci_interface PUBLIC blocksci) get_property(PYBIND11_PACKAGE_LOCATION GLOBAL PROPERTY pybind11_package_location) -install(TARGETS blocksci_interface DESTINATION ${CMAKE_SOURCE_DIR}/Notebooks/blocksci) -install(DIRECTORY ${PYBIND11_PACKAGE_LOCATION} DESTINATION ${CMAKE_SOURCE_DIR}/Notebooks/blocksci) - source_group(blocksci_interface FILES ${PYTHON_INTERFACE_HEADERS} ${PYTHON_INTERFACE_SOURCES}) diff --git a/python/MANIFEST.in b/python/MANIFEST.in new file mode 100644 index 00000000..aaa0b869 --- /dev/null +++ b/python/MANIFEST.in @@ -0,0 +1,5 @@ +include README.md LICENSE +include blocksci/templateMakefile +include blocksci/filterTxesExtension.cpp +recursive-include blocksci/Blockchain-Known-Pools +recursive-include blocksci/pybind11/include \ No newline at end of file diff --git a/Notebooks/blocksci/Blockchain-Known-Pools b/python/blocksci/Blockchain-Known-Pools similarity index 100% rename from Notebooks/blocksci/Blockchain-Known-Pools rename to python/blocksci/Blockchain-Known-Pools diff --git a/Notebooks/blocksci/__init__.py b/python/blocksci/__init__.py similarity index 100% rename from Notebooks/blocksci/__init__.py rename to python/blocksci/__init__.py diff --git a/Notebooks/blocksci/blockchain_info.py b/python/blocksci/blockchain_info.py similarity index 100% rename from Notebooks/blocksci/blockchain_info.py rename to python/blocksci/blockchain_info.py diff --git a/Notebooks/blocksci/blocktrail.py b/python/blocksci/blocktrail.py similarity index 100% rename from Notebooks/blocksci/blocktrail.py rename to python/blocksci/blocktrail.py diff --git a/Notebooks/blocksci/currency.py b/python/blocksci/currency.py similarity index 100% rename from Notebooks/blocksci/currency.py rename to python/blocksci/currency.py diff --git a/Notebooks/blocksci/filterTxesExtension.cpp b/python/blocksci/filterTxesExtension.cpp similarity index 100% rename from Notebooks/blocksci/filterTxesExtension.cpp rename to python/blocksci/filterTxesExtension.cpp diff --git a/Notebooks/blocksci/opreturn.py b/python/blocksci/opreturn.py similarity index 100% rename from Notebooks/blocksci/opreturn.py rename to python/blocksci/opreturn.py diff --git a/Notebooks/blocksci/pickler.py b/python/blocksci/pickler.py similarity index 100% rename from Notebooks/blocksci/pickler.py rename to python/blocksci/pickler.py diff --git a/external/pybind11 b/python/blocksci/pybind11 similarity index 100% rename from external/pybind11 rename to python/blocksci/pybind11 diff --git a/Notebooks/blocksci/templateMakefile b/python/blocksci/templateMakefile similarity index 100% rename from Notebooks/blocksci/templateMakefile rename to python/blocksci/templateMakefile diff --git a/requirements.txt b/python/requirements.txt similarity index 100% rename from requirements.txt rename to python/requirements.txt diff --git a/setup.py b/python/setup.py similarity index 91% rename from setup.py rename to python/setup.py index feb2ca1b..57547231 100644 --- a/setup.py +++ b/python/setup.py @@ -48,6 +48,9 @@ def build_extension(self, ext): cmake_args += ['-DCMAKE_BUILD_TYPE=' + cfg] build_args += ['--', '-j2'] + if platform.system() == "Darwin": + cmake_args += ['-DOPENSSL_ROOT_DIR=/usr/local/opt/openssl'] + env = os.environ.copy() env['CXXFLAGS'] = '{} -DVERSION_INFO=\\"{}\\"'.format(env.get('CXXFLAGS', ''), self.distribution.get_version()) @@ -63,9 +66,9 @@ def build_extension(self, ext): author_email='blocksci@cs.princeton.edu', description='BlockSci: A high-performance tool for blockchain science and exploration', long_description='', - ext_modules=[CMakeExtension('blocksci_interface')], - ext_package="blocksci", - packages=['blocksci'], + ext_modules=[CMakeExtension('blocksci')], + packages = find_packages(), + include_package_data = True, cmdclass=dict(build_ext=CMakeBuild), zip_safe=False, ) \ No newline at end of file diff --git a/src/python-interface/address_py.cpp b/python/src/address_py.cpp similarity index 100% rename from src/python-interface/address_py.cpp rename to python/src/address_py.cpp diff --git a/src/python-interface/address_py.hpp b/python/src/address_py.hpp similarity index 100% rename from src/python-interface/address_py.hpp rename to python/src/address_py.hpp diff --git a/src/python-interface/address_range_py.cpp b/python/src/address_range_py.cpp similarity index 100% rename from src/python-interface/address_range_py.cpp rename to python/src/address_range_py.cpp diff --git a/src/python-interface/address_range_py.hpp b/python/src/address_range_py.hpp similarity index 100% rename from src/python-interface/address_range_py.hpp rename to python/src/address_range_py.hpp diff --git a/src/python-interface/block_py.cpp b/python/src/block_py.cpp similarity index 100% rename from src/python-interface/block_py.cpp rename to python/src/block_py.cpp diff --git a/src/python-interface/block_py.hpp b/python/src/block_py.hpp similarity index 99% rename from src/python-interface/block_py.hpp rename to python/src/block_py.hpp index 9bb47ee9..9cc8310c 100644 --- a/src/python-interface/block_py.hpp +++ b/python/src/block_py.hpp @@ -12,6 +12,7 @@ #include #include +#include #include diff --git a/src/python-interface/blockchain_py.cpp b/python/src/blockchain_py.cpp similarity index 100% rename from src/python-interface/blockchain_py.cpp rename to python/src/blockchain_py.cpp diff --git a/src/python-interface/caster_py.hpp b/python/src/caster_py.hpp similarity index 99% rename from src/python-interface/caster_py.hpp rename to python/src/caster_py.hpp index 3acd6e8c..a6eb996e 100644 --- a/src/python-interface/caster_py.hpp +++ b/python/src/caster_py.hpp @@ -26,6 +26,9 @@ namespace pybind11 { namespace detail { } }; + template + struct type_caster> : variant_caster> {}; + template <> struct type_caster { private: using value_conv = make_caster; @@ -49,9 +52,6 @@ namespace pybind11 { namespace detail { template struct type_caster> : optional_caster> {}; - - template - struct type_caster> : variant_caster> {}; }} #endif /* caster_py_hpp */ diff --git a/src/python-interface/cluster_py.cpp b/python/src/cluster_py.cpp similarity index 98% rename from src/python-interface/cluster_py.cpp rename to python/src/cluster_py.cpp index b035b73c..9c0ad976 100644 --- a/src/python-interface/cluster_py.cpp +++ b/python/src/cluster_py.cpp @@ -103,7 +103,7 @@ void init_cluster(pybind11::module &m) { py::module::import("sys").attr("stdout") ); return ClusterManager::createClustering(chain, heuristic, location, shouldOverwrite); - }, py::arg("location"), py::arg("chain"), py::arg("heuristic") = heuristics::LegacyChange{}, py::arg("should_overwrite") = false) + }, py::arg("location"), py::arg("chain"), py::arg("heuristic") = heuristics::ChangeHeuristic{heuristics::LegacyChange{}}, py::arg("should_overwrite") = false) .def("cluster_with_address", [](const ClusterManager &cm, const Address &address) -> Cluster { return cm.getCluster(address); }, "Return the cluster containing the given address") diff --git a/src/python-interface/cluster_py.hpp b/python/src/cluster_py.hpp similarity index 100% rename from src/python-interface/cluster_py.hpp rename to python/src/cluster_py.hpp diff --git a/src/python-interface/function_traits.hpp b/python/src/function_traits.hpp similarity index 100% rename from src/python-interface/function_traits.hpp rename to python/src/function_traits.hpp diff --git a/src/python-interface/heuristics_py.cpp b/python/src/heuristics_py.cpp similarity index 100% rename from src/python-interface/heuristics_py.cpp rename to python/src/heuristics_py.cpp diff --git a/src/python-interface/input_py.cpp b/python/src/input_py.cpp similarity index 100% rename from src/python-interface/input_py.cpp rename to python/src/input_py.cpp diff --git a/src/python-interface/input_py.hpp b/python/src/input_py.hpp similarity index 100% rename from src/python-interface/input_py.hpp rename to python/src/input_py.hpp diff --git a/src/python-interface/input_range_py.cpp b/python/src/input_range_py.cpp similarity index 100% rename from src/python-interface/input_range_py.cpp rename to python/src/input_range_py.cpp diff --git a/src/python-interface/input_range_py.hpp b/python/src/input_range_py.hpp similarity index 100% rename from src/python-interface/input_range_py.hpp rename to python/src/input_range_py.hpp diff --git a/src/python-interface/multisig_pubkey_range_py.cpp b/python/src/multisig_pubkey_range_py.cpp similarity index 100% rename from src/python-interface/multisig_pubkey_range_py.cpp rename to python/src/multisig_pubkey_range_py.cpp diff --git a/src/python-interface/multisig_py.cpp b/python/src/multisig_py.cpp similarity index 100% rename from src/python-interface/multisig_py.cpp rename to python/src/multisig_py.cpp diff --git a/src/python-interface/multisig_py.hpp b/python/src/multisig_py.hpp similarity index 100% rename from src/python-interface/multisig_py.hpp rename to python/src/multisig_py.hpp diff --git a/src/python-interface/nonstandard_py.cpp b/python/src/nonstandard_py.cpp similarity index 100% rename from src/python-interface/nonstandard_py.cpp rename to python/src/nonstandard_py.cpp diff --git a/src/python-interface/nonstandard_py.hpp b/python/src/nonstandard_py.hpp similarity index 100% rename from src/python-interface/nonstandard_py.hpp rename to python/src/nonstandard_py.hpp diff --git a/src/python-interface/nulldata_py.cpp b/python/src/nulldata_py.cpp similarity index 100% rename from src/python-interface/nulldata_py.cpp rename to python/src/nulldata_py.cpp diff --git a/src/python-interface/nulldata_py.hpp b/python/src/nulldata_py.hpp similarity index 100% rename from src/python-interface/nulldata_py.hpp rename to python/src/nulldata_py.hpp diff --git a/src/python-interface/output_py.cpp b/python/src/output_py.cpp similarity index 100% rename from src/python-interface/output_py.cpp rename to python/src/output_py.cpp diff --git a/src/python-interface/output_py.hpp b/python/src/output_py.hpp similarity index 100% rename from src/python-interface/output_py.hpp rename to python/src/output_py.hpp diff --git a/src/python-interface/output_range_py.cpp b/python/src/output_range_py.cpp similarity index 100% rename from src/python-interface/output_range_py.cpp rename to python/src/output_range_py.cpp diff --git a/src/python-interface/output_range_py.hpp b/python/src/output_range_py.hpp similarity index 100% rename from src/python-interface/output_range_py.hpp rename to python/src/output_range_py.hpp diff --git a/src/python-interface/pubkey_py.cpp b/python/src/pubkey_py.cpp similarity index 100% rename from src/python-interface/pubkey_py.cpp rename to python/src/pubkey_py.cpp diff --git a/src/python-interface/pubkey_py.hpp b/python/src/pubkey_py.hpp similarity index 100% rename from src/python-interface/pubkey_py.hpp rename to python/src/pubkey_py.hpp diff --git a/src/python-interface/pubkey_range_py.cpp b/python/src/pubkey_range_py.cpp similarity index 100% rename from src/python-interface/pubkey_range_py.cpp rename to python/src/pubkey_range_py.cpp diff --git a/src/python-interface/pubkey_range_py.hpp b/python/src/pubkey_range_py.hpp similarity index 100% rename from src/python-interface/pubkey_range_py.hpp rename to python/src/pubkey_range_py.hpp diff --git a/src/python-interface/pubkeyhash_range_py.cpp b/python/src/pubkeyhash_range_py.cpp similarity index 100% rename from src/python-interface/pubkeyhash_range_py.cpp rename to python/src/pubkeyhash_range_py.cpp diff --git a/src/python-interface/python_interface.cpp b/python/src/python_interface.cpp similarity index 100% rename from src/python-interface/python_interface.cpp rename to python/src/python_interface.cpp diff --git a/src/python-interface/range_apply_py.hpp b/python/src/range_apply_py.hpp similarity index 100% rename from src/python-interface/range_apply_py.hpp rename to python/src/range_apply_py.hpp diff --git a/src/python-interface/range_conversion.cpp b/python/src/range_conversion.cpp similarity index 100% rename from src/python-interface/range_conversion.cpp rename to python/src/range_conversion.cpp diff --git a/src/python-interface/range_conversion.hpp b/python/src/range_conversion.hpp similarity index 99% rename from src/python-interface/range_conversion.hpp rename to python/src/range_conversion.hpp index 0dc1df58..6e58d7ed 100644 --- a/src/python-interface/range_conversion.hpp +++ b/python/src/range_conversion.hpp @@ -17,6 +17,8 @@ #include #include +#include + struct blocksci_tag {}; struct py_tag {}; struct numpy_tag {}; diff --git a/src/python-interface/ranges_py.cpp b/python/src/ranges_py.cpp similarity index 98% rename from src/python-interface/ranges_py.cpp rename to python/src/ranges_py.cpp index 1f1388fb..30f16444 100644 --- a/src/python-interface/ranges_py.cpp +++ b/python/src/ranges_py.cpp @@ -8,6 +8,8 @@ #include "ranges_py.hpp" #include "caster_py.hpp" +#include + namespace py = pybind11; using namespace blocksci; diff --git a/src/python-interface/ranges_py.hpp b/python/src/ranges_py.hpp similarity index 100% rename from src/python-interface/ranges_py.hpp rename to python/src/ranges_py.hpp diff --git a/src/python-interface/scripthash_py.cpp b/python/src/scripthash_py.cpp similarity index 100% rename from src/python-interface/scripthash_py.cpp rename to python/src/scripthash_py.cpp diff --git a/src/python-interface/scripthash_py.hpp b/python/src/scripthash_py.hpp similarity index 100% rename from src/python-interface/scripthash_py.hpp rename to python/src/scripthash_py.hpp diff --git a/src/python-interface/self_apply_py.hpp b/python/src/self_apply_py.hpp similarity index 100% rename from src/python-interface/self_apply_py.hpp rename to python/src/self_apply_py.hpp diff --git a/src/python-interface/tx_py.cpp b/python/src/tx_py.cpp similarity index 100% rename from src/python-interface/tx_py.cpp rename to python/src/tx_py.cpp diff --git a/src/python-interface/tx_py.hpp b/python/src/tx_py.hpp similarity index 100% rename from src/python-interface/tx_py.hpp rename to python/src/tx_py.hpp diff --git a/src/python-interface/tx_summary_py.cpp b/python/src/tx_summary_py.cpp similarity index 100% rename from src/python-interface/tx_summary_py.cpp rename to python/src/tx_summary_py.cpp diff --git a/src/python-interface/witness_pubkeyhash_range_py.cpp b/python/src/witness_pubkeyhash_range_py.cpp similarity index 100% rename from src/python-interface/witness_pubkeyhash_range_py.cpp rename to python/src/witness_pubkeyhash_range_py.cpp diff --git a/src/blocksci/CMakeLists.txt b/src/CMakeLists.txt similarity index 97% rename from src/blocksci/CMakeLists.txt rename to src/CMakeLists.txt index f89bb7f7..e01b2271 100644 --- a/src/blocksci/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -10,8 +10,8 @@ set(INCLUDE_INSTALL_DIR include/blocksci ) set(LIB_INSTALL_DIR lib/ ) set(SYSCONFIG_INSTALL_DIR etc/blocksci/ . ) -set(BLOCKSCI_HEADER_PREFIX ${CMAKE_CURRENT_SOURCE_DIR}/include/blocksci) -set(BLOCKSCI_SOURCE_PREFIX ${CMAKE_CURRENT_SOURCE_DIR}/src) +set(BLOCKSCI_HEADER_PREFIX ${CMAKE_CURRENT_SOURCE_DIR}/../include/blocksci) +set(BLOCKSCI_SOURCE_PREFIX ${CMAKE_CURRENT_SOURCE_DIR}) add_library(blocksci SHARED "") @@ -113,11 +113,12 @@ target_link_libraries( blocksci ) target_include_directories(blocksci PUBLIC - $ - $ + $ + $ + $ $ $ - $ + $ ) target_include_directories(blocksci PRIVATE diff --git a/src/blocksci/src/address/address.cpp b/src/address/address.cpp similarity index 100% rename from src/blocksci/src/address/address.cpp rename to src/address/address.cpp diff --git a/src/blocksci/src/address/address_unity.cpp b/src/address/address_unity.cpp similarity index 100% rename from src/blocksci/src/address/address_unity.cpp rename to src/address/address_unity.cpp diff --git a/src/blocksci/src/address/equiv_address.cpp b/src/address/equiv_address.cpp similarity index 100% rename from src/blocksci/src/address/equiv_address.cpp rename to src/address/equiv_address.cpp diff --git a/src/blocksci/blocksci-config.cmake b/src/blocksci-config.cmake similarity index 100% rename from src/blocksci/blocksci-config.cmake rename to src/blocksci-config.cmake diff --git a/src/blocksci/src/blocksci_unity.cpp b/src/blocksci_unity.cpp similarity index 100% rename from src/blocksci/src/blocksci_unity.cpp rename to src/blocksci_unity.cpp diff --git a/src/blocksci/src/chain/block.cpp b/src/chain/block.cpp similarity index 100% rename from src/blocksci/src/chain/block.cpp rename to src/chain/block.cpp diff --git a/src/blocksci/src/chain/blockchain.cpp b/src/chain/blockchain.cpp similarity index 100% rename from src/blocksci/src/chain/blockchain.cpp rename to src/chain/blockchain.cpp diff --git a/src/blocksci/src/chain/chain_unity.cpp b/src/chain/chain_unity.cpp similarity index 100% rename from src/blocksci/src/chain/chain_unity.cpp rename to src/chain/chain_unity.cpp diff --git a/src/blocksci/src/chain/inout_pointer.cpp b/src/chain/inout_pointer.cpp similarity index 100% rename from src/blocksci/src/chain/inout_pointer.cpp rename to src/chain/inout_pointer.cpp diff --git a/src/blocksci/src/chain/input.cpp b/src/chain/input.cpp similarity index 100% rename from src/blocksci/src/chain/input.cpp rename to src/chain/input.cpp diff --git a/src/blocksci/src/chain/output.cpp b/src/chain/output.cpp similarity index 100% rename from src/blocksci/src/chain/output.cpp rename to src/chain/output.cpp diff --git a/src/blocksci/src/chain/transaction.cpp b/src/chain/transaction.cpp similarity index 100% rename from src/blocksci/src/chain/transaction.cpp rename to src/chain/transaction.cpp diff --git a/src/blocksci/src/cluster/cluster.cpp b/src/cluster/cluster.cpp similarity index 100% rename from src/blocksci/src/cluster/cluster.cpp rename to src/cluster/cluster.cpp diff --git a/src/blocksci/src/cluster/cluster_access.cpp b/src/cluster/cluster_access.cpp similarity index 100% rename from src/blocksci/src/cluster/cluster_access.cpp rename to src/cluster/cluster_access.cpp diff --git a/src/blocksci/src/cluster/cluster_manager.cpp b/src/cluster/cluster_manager.cpp similarity index 100% rename from src/blocksci/src/cluster/cluster_manager.cpp rename to src/cluster/cluster_manager.cpp diff --git a/src/blocksci/src/cluster/cluster_unity.cpp b/src/cluster/cluster_unity.cpp similarity index 100% rename from src/blocksci/src/cluster/cluster_unity.cpp rename to src/cluster/cluster_unity.cpp diff --git a/src/blocksci/src/core/address_info.cpp b/src/core/address_info.cpp similarity index 100% rename from src/blocksci/src/core/address_info.cpp rename to src/core/address_info.cpp diff --git a/src/blocksci/src/core/bitcoin_uint256.cpp b/src/core/bitcoin_uint256.cpp similarity index 100% rename from src/blocksci/src/core/bitcoin_uint256.cpp rename to src/core/bitcoin_uint256.cpp diff --git a/src/blocksci/src/core/chain_access.cpp b/src/core/chain_access.cpp similarity index 100% rename from src/blocksci/src/core/chain_access.cpp rename to src/core/chain_access.cpp diff --git a/src/blocksci/src/core/dedup_address_info.cpp b/src/core/dedup_address_info.cpp similarity index 100% rename from src/blocksci/src/core/dedup_address_info.cpp rename to src/core/dedup_address_info.cpp diff --git a/src/blocksci/src/core/file_mapper.cpp b/src/core/file_mapper.cpp similarity index 100% rename from src/blocksci/src/core/file_mapper.cpp rename to src/core/file_mapper.cpp diff --git a/src/blocksci/src/core/raw_address.cpp b/src/core/raw_address.cpp similarity index 100% rename from src/blocksci/src/core/raw_address.cpp rename to src/core/raw_address.cpp diff --git a/src/blocksci/src/core/script_access.cpp b/src/core/script_access.cpp similarity index 100% rename from src/blocksci/src/core/script_access.cpp rename to src/core/script_access.cpp diff --git a/src/blocksci/src/core/script_data.cpp b/src/core/script_data.cpp similarity index 100% rename from src/blocksci/src/core/script_data.cpp rename to src/core/script_data.cpp diff --git a/src/example/CMakeLists.txt b/src/example/CMakeLists.txt deleted file mode 100644 index fe781e0a..00000000 --- a/src/example/CMakeLists.txt +++ /dev/null @@ -1,6 +0,0 @@ -file(GLOB EXAMPLE_HEADERS "*.hpp") -file(GLOB EXAMPLE_SOURCES "*.cpp") - -add_executable(example EXCLUDE_FROM_ALL ${EXAMPLE_SOURCES} ${EXAMPLE_HEADERS}) - -target_link_libraries( example blocksci) diff --git a/src/blocksci/src/exception.cpp b/src/exception.cpp similarity index 100% rename from src/blocksci/src/exception.cpp rename to src/exception.cpp diff --git a/src/blocksci/src/heuristics/blockchain_heuristics.cpp b/src/heuristics/blockchain_heuristics.cpp similarity index 100% rename from src/blocksci/src/heuristics/blockchain_heuristics.cpp rename to src/heuristics/blockchain_heuristics.cpp diff --git a/src/blocksci/src/heuristics/change_address.cpp b/src/heuristics/change_address.cpp similarity index 100% rename from src/blocksci/src/heuristics/change_address.cpp rename to src/heuristics/change_address.cpp diff --git a/src/blocksci/src/heuristics/heuristics_unity.cpp b/src/heuristics/heuristics_unity.cpp similarity index 100% rename from src/blocksci/src/heuristics/heuristics_unity.cpp rename to src/heuristics/heuristics_unity.cpp diff --git a/src/blocksci/src/heuristics/taint.cpp b/src/heuristics/taint.cpp similarity index 100% rename from src/blocksci/src/heuristics/taint.cpp rename to src/heuristics/taint.cpp diff --git a/src/blocksci/src/heuristics/tx_identification.cpp b/src/heuristics/tx_identification.cpp similarity index 100% rename from src/blocksci/src/heuristics/tx_identification.cpp rename to src/heuristics/tx_identification.cpp diff --git a/src/blocksci/src/index/address_index.cpp b/src/index/address_index.cpp similarity index 100% rename from src/blocksci/src/index/address_index.cpp rename to src/index/address_index.cpp diff --git a/src/blocksci/src/index/address_index_priv.cpp b/src/index/address_index_priv.cpp similarity index 100% rename from src/blocksci/src/index/address_index_priv.cpp rename to src/index/address_index_priv.cpp diff --git a/src/blocksci/src/index/address_index_priv.hpp b/src/index/address_index_priv.hpp similarity index 100% rename from src/blocksci/src/index/address_index_priv.hpp rename to src/index/address_index_priv.hpp diff --git a/src/blocksci/src/index/address_output_range.cpp b/src/index/address_output_range.cpp similarity index 100% rename from src/blocksci/src/index/address_output_range.cpp rename to src/index/address_output_range.cpp diff --git a/src/blocksci/src/index/column_iterator.cpp b/src/index/column_iterator.cpp similarity index 100% rename from src/blocksci/src/index/column_iterator.cpp rename to src/index/column_iterator.cpp diff --git a/src/blocksci/src/index/hash_index.cpp b/src/index/hash_index.cpp similarity index 100% rename from src/blocksci/src/index/hash_index.cpp rename to src/index/hash_index.cpp diff --git a/src/blocksci/src/index/hash_index_priv.cpp b/src/index/hash_index_priv.cpp similarity index 100% rename from src/blocksci/src/index/hash_index_priv.cpp rename to src/index/hash_index_priv.cpp diff --git a/src/blocksci/src/index/hash_index_priv.hpp b/src/index/hash_index_priv.hpp similarity index 100% rename from src/blocksci/src/index/hash_index_priv.hpp rename to src/index/hash_index_priv.hpp diff --git a/src/blocksci/src/index/index_unity.cpp b/src/index/index_unity.cpp similarity index 100% rename from src/blocksci/src/index/index_unity.cpp rename to src/index/index_unity.cpp diff --git a/src/blocksci/src/index/mempool_index.cpp b/src/index/mempool_index.cpp similarity index 100% rename from src/blocksci/src/index/mempool_index.cpp rename to src/index/mempool_index.cpp diff --git a/src/blocksci/src/scripts/bitcoin_base58.cpp b/src/scripts/bitcoin_base58.cpp similarity index 100% rename from src/blocksci/src/scripts/bitcoin_base58.cpp rename to src/scripts/bitcoin_base58.cpp diff --git a/src/blocksci/src/scripts/bitcoin_base58.hpp b/src/scripts/bitcoin_base58.hpp similarity index 100% rename from src/blocksci/src/scripts/bitcoin_base58.hpp rename to src/scripts/bitcoin_base58.hpp diff --git a/src/blocksci/src/scripts/bitcoin_bech32.cpp b/src/scripts/bitcoin_bech32.cpp similarity index 100% rename from src/blocksci/src/scripts/bitcoin_bech32.cpp rename to src/scripts/bitcoin_bech32.cpp diff --git a/src/blocksci/src/scripts/bitcoin_bech32.hpp b/src/scripts/bitcoin_bech32.hpp similarity index 100% rename from src/blocksci/src/scripts/bitcoin_bech32.hpp rename to src/scripts/bitcoin_bech32.hpp diff --git a/src/blocksci/src/scripts/bitcoin_pubkey.cpp b/src/scripts/bitcoin_pubkey.cpp similarity index 100% rename from src/blocksci/src/scripts/bitcoin_pubkey.cpp rename to src/scripts/bitcoin_pubkey.cpp diff --git a/src/blocksci/src/scripts/bitcoin_script.cpp b/src/scripts/bitcoin_script.cpp similarity index 100% rename from src/blocksci/src/scripts/bitcoin_script.cpp rename to src/scripts/bitcoin_script.cpp diff --git a/src/blocksci/src/scripts/bitcoin_segwit_addr.cpp b/src/scripts/bitcoin_segwit_addr.cpp similarity index 100% rename from src/blocksci/src/scripts/bitcoin_segwit_addr.cpp rename to src/scripts/bitcoin_segwit_addr.cpp diff --git a/src/blocksci/src/scripts/bitcoin_segwit_addr.hpp b/src/scripts/bitcoin_segwit_addr.hpp similarity index 100% rename from src/blocksci/src/scripts/bitcoin_segwit_addr.hpp rename to src/scripts/bitcoin_segwit_addr.hpp diff --git a/src/blocksci/src/scripts/multisig_pubkey_script.cpp b/src/scripts/multisig_pubkey_script.cpp similarity index 100% rename from src/blocksci/src/scripts/multisig_pubkey_script.cpp rename to src/scripts/multisig_pubkey_script.cpp diff --git a/src/blocksci/src/scripts/multisig_script.cpp b/src/scripts/multisig_script.cpp similarity index 100% rename from src/blocksci/src/scripts/multisig_script.cpp rename to src/scripts/multisig_script.cpp diff --git a/src/blocksci/src/scripts/pubkey_base_script.cpp b/src/scripts/pubkey_base_script.cpp similarity index 100% rename from src/blocksci/src/scripts/pubkey_base_script.cpp rename to src/scripts/pubkey_base_script.cpp diff --git a/src/blocksci/src/scripts/pubkey_script.cpp b/src/scripts/pubkey_script.cpp similarity index 100% rename from src/blocksci/src/scripts/pubkey_script.cpp rename to src/scripts/pubkey_script.cpp diff --git a/src/blocksci/src/scripts/script.cpp b/src/scripts/script.cpp similarity index 100% rename from src/blocksci/src/scripts/script.cpp rename to src/scripts/script.cpp diff --git a/src/blocksci/src/scripts/script_unity.cpp b/src/scripts/script_unity.cpp similarity index 100% rename from src/blocksci/src/scripts/script_unity.cpp rename to src/scripts/script_unity.cpp diff --git a/src/blocksci/src/scripts/script_variant.cpp b/src/scripts/script_variant.cpp similarity index 100% rename from src/blocksci/src/scripts/script_variant.cpp rename to src/scripts/script_variant.cpp diff --git a/src/blocksci/src/scripts/script_view.cpp b/src/scripts/script_view.cpp similarity index 100% rename from src/blocksci/src/scripts/script_view.cpp rename to src/scripts/script_view.cpp diff --git a/src/blocksci/src/scripts/scripthash_script.cpp b/src/scripts/scripthash_script.cpp similarity index 100% rename from src/blocksci/src/scripts/scripthash_script.cpp rename to src/scripts/scripthash_script.cpp diff --git a/src/blocksci/src/util/data_configuration.cpp b/src/util/data_configuration.cpp similarity index 100% rename from src/blocksci/src/util/data_configuration.cpp rename to src/util/data_configuration.cpp diff --git a/src/blocksci/src/util/hash.cpp b/src/util/hash.cpp similarity index 100% rename from src/blocksci/src/util/hash.cpp rename to src/util/hash.cpp diff --git a/src/blocksci/src/util/util_unity.cpp b/src/util/util_unity.cpp similarity index 100% rename from src/blocksci/src/util/util_unity.cpp rename to src/util/util_unity.cpp diff --git a/tools/CMakeLists.txt b/tools/CMakeLists.txt new file mode 100644 index 00000000..b63e84b6 --- /dev/null +++ b/tools/CMakeLists.txt @@ -0,0 +1,6 @@ +cmake_minimum_required(VERSION 3.5) +project(blocksci_tools) + +add_subdirectory(parser) +add_subdirectory(mempool_recorder) +add_subdirectory(clusterer) \ No newline at end of file diff --git a/src/clusterer/CMakeLists.txt b/tools/clusterer/CMakeLists.txt similarity index 88% rename from src/clusterer/CMakeLists.txt rename to tools/clusterer/CMakeLists.txt index 2f7fbaf9..65df76e4 100644 --- a/src/clusterer/CMakeLists.txt +++ b/tools/clusterer/CMakeLists.txt @@ -1,4 +1,7 @@ +cmake_minimum_required(VERSION 3.5) +project(blocksci_clusterer) +find_package(blocksci REQUIRED) add_executable(blocksci_clusterer main.cpp) target_compile_options(blocksci_clusterer PRIVATE -Wall -Wextra -Wpedantic) diff --git a/src/clusterer/main.cpp b/tools/clusterer/main.cpp similarity index 100% rename from src/clusterer/main.cpp rename to tools/clusterer/main.cpp diff --git a/src/mempool_recorder/CMakeLists.txt b/tools/mempool_recorder/CMakeLists.txt similarity index 89% rename from src/mempool_recorder/CMakeLists.txt rename to tools/mempool_recorder/CMakeLists.txt index fc31f0b9..28b7cb26 100644 --- a/src/mempool_recorder/CMakeLists.txt +++ b/tools/mempool_recorder/CMakeLists.txt @@ -1,3 +1,7 @@ +cmake_minimum_required(VERSION 3.5) +project(mempool_recorder) + +find_package(blocksci REQUIRED) find_package( Boost 1.58 COMPONENTS filesystem REQUIRED ) add_executable(mempool_recorder main.cpp) diff --git a/src/mempool_recorder/file_writer.hpp b/tools/mempool_recorder/file_writer.hpp similarity index 100% rename from src/mempool_recorder/file_writer.hpp rename to tools/mempool_recorder/file_writer.hpp diff --git a/src/mempool_recorder/main.cpp b/tools/mempool_recorder/main.cpp similarity index 100% rename from src/mempool_recorder/main.cpp rename to tools/mempool_recorder/main.cpp diff --git a/src/parser/CMakeLists.txt b/tools/parser/CMakeLists.txt similarity index 93% rename from src/parser/CMakeLists.txt rename to tools/parser/CMakeLists.txt index d7a3b1e2..a0f26263 100644 --- a/src/parser/CMakeLists.txt +++ b/tools/parser/CMakeLists.txt @@ -1,3 +1,7 @@ +cmake_minimum_required(VERSION 3.5) +project(blocksci_parser) + +find_package(blocksci REQUIRED) find_package(OpenSSL REQUIRED) find_package(Sparsehash REQUIRED) diff --git a/src/parser/address_db.cpp b/tools/parser/address_db.cpp similarity index 100% rename from src/parser/address_db.cpp rename to tools/parser/address_db.cpp diff --git a/src/parser/address_db.hpp b/tools/parser/address_db.hpp similarity index 100% rename from src/parser/address_db.hpp rename to tools/parser/address_db.hpp diff --git a/src/parser/address_state.cpp b/tools/parser/address_state.cpp similarity index 100% rename from src/parser/address_state.cpp rename to tools/parser/address_state.cpp diff --git a/src/parser/address_state.hpp b/tools/parser/address_state.hpp similarity index 100% rename from src/parser/address_state.hpp rename to tools/parser/address_state.hpp diff --git a/src/parser/address_writer.cpp b/tools/parser/address_writer.cpp similarity index 100% rename from src/parser/address_writer.cpp rename to tools/parser/address_writer.cpp diff --git a/src/parser/address_writer.hpp b/tools/parser/address_writer.hpp similarity index 100% rename from src/parser/address_writer.hpp rename to tools/parser/address_writer.hpp diff --git a/src/parser/basic_types.cpp b/tools/parser/basic_types.cpp similarity index 100% rename from src/parser/basic_types.cpp rename to tools/parser/basic_types.cpp diff --git a/src/parser/basic_types.hpp b/tools/parser/basic_types.hpp similarity index 100% rename from src/parser/basic_types.hpp rename to tools/parser/basic_types.hpp diff --git a/src/parser/block_processor.cpp b/tools/parser/block_processor.cpp similarity index 100% rename from src/parser/block_processor.cpp rename to tools/parser/block_processor.cpp diff --git a/src/parser/block_processor.hpp b/tools/parser/block_processor.hpp similarity index 100% rename from src/parser/block_processor.hpp rename to tools/parser/block_processor.hpp diff --git a/src/parser/block_replayer.cpp b/tools/parser/block_replayer.cpp similarity index 100% rename from src/parser/block_replayer.cpp rename to tools/parser/block_replayer.cpp diff --git a/src/parser/block_replayer.hpp b/tools/parser/block_replayer.hpp similarity index 100% rename from src/parser/block_replayer.hpp rename to tools/parser/block_replayer.hpp diff --git a/src/parser/bloom_filter.cpp b/tools/parser/bloom_filter.cpp similarity index 100% rename from src/parser/bloom_filter.cpp rename to tools/parser/bloom_filter.cpp diff --git a/src/parser/bloom_filter.hpp b/tools/parser/bloom_filter.hpp similarity index 100% rename from src/parser/bloom_filter.hpp rename to tools/parser/bloom_filter.hpp diff --git a/src/parser/chain_index.cpp b/tools/parser/chain_index.cpp similarity index 100% rename from src/parser/chain_index.cpp rename to tools/parser/chain_index.cpp diff --git a/src/parser/chain_index.hpp b/tools/parser/chain_index.hpp similarity index 100% rename from src/parser/chain_index.hpp rename to tools/parser/chain_index.hpp diff --git a/src/parser/config.hpp b/tools/parser/config.hpp similarity index 100% rename from src/parser/config.hpp rename to tools/parser/config.hpp diff --git a/src/parser/file_writer.hpp b/tools/parser/file_writer.hpp similarity index 100% rename from src/parser/file_writer.hpp rename to tools/parser/file_writer.hpp diff --git a/src/parser/hash_index_creator.cpp b/tools/parser/hash_index_creator.cpp similarity index 100% rename from src/parser/hash_index_creator.cpp rename to tools/parser/hash_index_creator.cpp diff --git a/src/parser/hash_index_creator.hpp b/tools/parser/hash_index_creator.hpp similarity index 100% rename from src/parser/hash_index_creator.hpp rename to tools/parser/hash_index_creator.hpp diff --git a/src/parser/main.cpp b/tools/parser/main.cpp similarity index 100% rename from src/parser/main.cpp rename to tools/parser/main.cpp diff --git a/src/parser/output_spend_data.cpp b/tools/parser/output_spend_data.cpp similarity index 100% rename from src/parser/output_spend_data.cpp rename to tools/parser/output_spend_data.cpp diff --git a/src/parser/output_spend_data.hpp b/tools/parser/output_spend_data.hpp similarity index 100% rename from src/parser/output_spend_data.hpp rename to tools/parser/output_spend_data.hpp diff --git a/src/parser/parser_configuration.cpp b/tools/parser/parser_configuration.cpp similarity index 100% rename from src/parser/parser_configuration.cpp rename to tools/parser/parser_configuration.cpp diff --git a/src/parser/parser_configuration.hpp b/tools/parser/parser_configuration.hpp similarity index 100% rename from src/parser/parser_configuration.hpp rename to tools/parser/parser_configuration.hpp diff --git a/src/parser/parser_fwd.hpp b/tools/parser/parser_fwd.hpp similarity index 100% rename from src/parser/parser_fwd.hpp rename to tools/parser/parser_fwd.hpp diff --git a/src/parser/parser_index.hpp b/tools/parser/parser_index.hpp similarity index 100% rename from src/parser/parser_index.hpp rename to tools/parser/parser_index.hpp diff --git a/src/parser/parser_index_creator.hpp b/tools/parser/parser_index_creator.hpp similarity index 100% rename from src/parser/parser_index_creator.hpp rename to tools/parser/parser_index_creator.hpp diff --git a/src/parser/preproccessed_block.cpp b/tools/parser/preproccessed_block.cpp similarity index 100% rename from src/parser/preproccessed_block.cpp rename to tools/parser/preproccessed_block.cpp diff --git a/src/parser/preproccessed_block.hpp b/tools/parser/preproccessed_block.hpp similarity index 100% rename from src/parser/preproccessed_block.hpp rename to tools/parser/preproccessed_block.hpp diff --git a/src/parser/safe_mem_reader.hpp b/tools/parser/safe_mem_reader.hpp similarity index 100% rename from src/parser/safe_mem_reader.hpp rename to tools/parser/safe_mem_reader.hpp diff --git a/src/parser/script_input.cpp b/tools/parser/script_input.cpp similarity index 100% rename from src/parser/script_input.cpp rename to tools/parser/script_input.cpp diff --git a/src/parser/script_input.hpp b/tools/parser/script_input.hpp similarity index 100% rename from src/parser/script_input.hpp rename to tools/parser/script_input.hpp diff --git a/src/parser/script_output.cpp b/tools/parser/script_output.cpp similarity index 100% rename from src/parser/script_output.cpp rename to tools/parser/script_output.cpp diff --git a/src/parser/script_output.hpp b/tools/parser/script_output.hpp similarity index 100% rename from src/parser/script_output.hpp rename to tools/parser/script_output.hpp diff --git a/src/parser/serializable_map.hpp b/tools/parser/serializable_map.hpp similarity index 100% rename from src/parser/serializable_map.hpp rename to tools/parser/serializable_map.hpp diff --git a/src/parser/utxo.hpp b/tools/parser/utxo.hpp similarity index 100% rename from src/parser/utxo.hpp rename to tools/parser/utxo.hpp diff --git a/src/parser/utxo_address_state.cpp b/tools/parser/utxo_address_state.cpp similarity index 100% rename from src/parser/utxo_address_state.cpp rename to tools/parser/utxo_address_state.cpp diff --git a/src/parser/utxo_address_state.hpp b/tools/parser/utxo_address_state.hpp similarity index 100% rename from src/parser/utxo_address_state.hpp rename to tools/parser/utxo_address_state.hpp diff --git a/src/parser/utxo_state.hpp b/tools/parser/utxo_state.hpp similarity index 100% rename from src/parser/utxo_state.hpp rename to tools/parser/utxo_state.hpp