Compare commits
1214 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 458c7a3389 | |||
| 82f3982175 | |||
| 0184a3139c | |||
| 26357f44ec | |||
| 85931f564a | |||
| 1e8e6c1010 | |||
| f6a1612ff1 | |||
| 1eb22109b5 | |||
| c0b99ac6fd | |||
| cff1210761 | |||
| bae7c65126 | |||
| 04d195d5cd | |||
| a4e1f00993 | |||
| 0d101f0ae6 | |||
| 2ae77e5b71 | |||
| 2e32d14d5f | |||
| 415ad70e2f | |||
| 6380e204dd | |||
| 12993dfe19 | |||
| a64753ecd0 | |||
| e9c7367b92 | |||
| 9f7dc5b768 | |||
| f141bef4b5 | |||
| 32e940577e | |||
| 012d148080 | |||
| d64b4ea2dc | |||
| a9e0b834d9 | |||
| 3a8ec27d93 | |||
| b69de65e78 | |||
| 44f8d941a7 | |||
| 8c1c5fd8e1 | |||
| bbfdeeaff5 | |||
| f12e43bb79 | |||
| a1544022cf | |||
| e2008578da | |||
| 9b5a43580e | |||
| 20c3973504 | |||
| 16b74edc51 | |||
| d611056b1c | |||
| ecc33cfebb | |||
| 0ae2af0bb8 | |||
| bdd34c5f56 | |||
| bbee372a01 | |||
| 5c907d39aa | |||
| 6d3fbc5467 | |||
| 068b286a88 | |||
| b7c4613d40 | |||
| 971f804a6e | |||
| 830c78a032 | |||
| 50634e5e79 | |||
| c5fba9992e | |||
| 29df28d3c8 | |||
| 4a2b75c7fb | |||
| 2a9cf67c3a | |||
| 3bcde151ee | |||
| b22088f330 | |||
| bfb0b5383a | |||
| 560f62a427 | |||
| 271a30998f | |||
| 3c4eeb49fd | |||
| 257781f2e2 | |||
| fb85deabbe | |||
| 6bc30dc6e1 | |||
| 93395771d3 | |||
| d6c249ca17 | |||
| 07259e029a | |||
| b1348b6c80 | |||
| a977f988d5 | |||
| 847ffe3959 | |||
| ed2e0f1a1b | |||
| 240cbd100e | |||
| f7c1baa453 | |||
| 644084a32f | |||
| baab8d3788 | |||
| ce1ef36613 | |||
| 3d08803709 | |||
| a4a0c03517 | |||
| fb21c917ac | |||
| 0d9670ee29 | |||
| ca47bed7b9 | |||
| f3d7d6bfe8 | |||
| d3798a1da7 | |||
| 3bbc0753c6 | |||
| bba9f780bc | |||
| 82cab98f2b | |||
| 9c2bd8292b | |||
| fc1436e86c | |||
| c682ad3111 | |||
| beeba04890 | |||
| 92291c1175 | |||
| 56a1a801bf | |||
| 503fb34c69 | |||
| 43ab92472e | |||
| 0755a9dcf1 | |||
| e62f653b9d | |||
| 752d6a9d05 | |||
| e5d582b6c1 | |||
| 964f4c8065 | |||
| a8a6b7fd02 | |||
| a37362570d | |||
| 01ae862507 | |||
| 81431b12fb | |||
| 2b46cb937a | |||
| 27a0cc9bb1 | |||
| 33b8a500fe | |||
| 28511c7e5a | |||
| 71d07eff63 | |||
| 81533df789 | |||
| 3c28ae9564 | |||
| 24ac83e88b | |||
| c5b4e84652 | |||
| e179208053 | |||
| 2f51c38549 | |||
| 5d14b27616 | |||
| 2822c6abb5 | |||
| 758b55f354 | |||
| a01545e42c | |||
| 3461872435 | |||
| 1957ba519e | |||
| 83f8b70c9b | |||
| 325aca29ce | |||
| 32235b8225 | |||
| e4402845e1 | |||
| 8c56e5f079 | |||
| ee0537c0f5 | |||
| e2ff0ce0da | |||
| 66dc583130 | |||
| 4978cdc9d1 | |||
| 353f22d079 | |||
| fbee340afa | |||
| ed4d0892d7 | |||
| db572ce9d8 | |||
| 436b39c6b1 | |||
| 34820e617f | |||
| 484d34040e | |||
| 06463e3e68 | |||
| 52d3454b0f | |||
| 927258396e | |||
| b9face492d | |||
| d289526f45 | |||
| 1b05f1e750 | |||
| 10d583adb6 | |||
| 1b863109f9 | |||
| e5d487aa50 | |||
| e69f5722df | |||
| b3678bfbe9 | |||
| 7a82b0fe43 | |||
| 5aea5768a7 | |||
| 3f54025384 | |||
| c421324b73 | |||
| 0535ca2892 | |||
| e68a31f72a | |||
| 02533848d2 | |||
| 6cd79b3a48 | |||
| 3d1ef0d049 | |||
| 547b3430c2 | |||
| 88df27a359 | |||
| 7eaef5faca | |||
| 9cb9545ce6 | |||
| 60285a21dd | |||
| 8f716bd1f1 | |||
| 009fa0f474 | |||
| cea19f1c0d | |||
| 0d0bf9cdee | |||
| c353daeb85 | |||
| 865bce5774 | |||
| 853b942af7 | |||
| a9d9e1b48a | |||
| 2f06a8b9b8 | |||
| 197b260d88 | |||
| 26bf2f07a0 | |||
| 09532c901a | |||
| ab89a3c792 | |||
| 2fe5dd8a36 | |||
| 17279708e5 | |||
| e577b298b6 | |||
| d66a2603e3 | |||
| 8bb317c4b7 | |||
| 9ce118ed82 | |||
| aa303a96d1 | |||
| 6c4520481b | |||
| 62707656eb | |||
| 20caceee5d | |||
| 3ac7c0c243 | |||
| ae6a08ee25 | |||
| afa82f4b48 | |||
| e7f87085fb | |||
| 3147a2e968 | |||
| 435e6c7599 | |||
| ce840733f1 | |||
| 54d278643d | |||
| 8d639bfcf2 | |||
| d3026a97b7 | |||
| 77c28df3f0 | |||
| b06fcc7516 | |||
| a01ea2d9d8 | |||
| 0d7b110f15 | |||
| 7cd21f5d0e | |||
| 886da5a73e | |||
| bfa30254df | |||
| b589d373ea | |||
| 8333f7800f | |||
| 91fb15e967 | |||
| e0c1d9377c | |||
| 3f80244d84 | |||
| 433a1991bc | |||
| 915be9e39f | |||
| b9e415c659 | |||
| 1e2e5b85aa | |||
| 40999f0056 | |||
| cf51fe5273 | |||
| 3154b61fc6 | |||
| f9831500e4 | |||
| e9d49b2a1d | |||
| 5eabfb0a1a | |||
| 3fc68e680a | |||
| 1bd9ff1379 | |||
| 9a0a96f990 | |||
| 604ef13aa6 | |||
| 293c6f3930 | |||
| 1f3872254d | |||
| 27a2461d1d | |||
| 70298cd065 | |||
| f655fd1e30 | |||
| 9abe993bb0 | |||
| 2a30901ba5 | |||
| 2c29092b7a | |||
| 7d610f61d5 | |||
| 7d632fdc85 | |||
| 2416a80642 | |||
| 779f72a71e | |||
| 6483c32c8d | |||
| 3f9c622b88 | |||
| 68cbf91fc7 | |||
| df21dd48af | |||
| 9462f2a85b | |||
| 9e37216be2 | |||
| 901b6cb828 | |||
| 2396725eb8 | |||
| 11236f7dc8 | |||
| 8b4b06f1be | |||
| 55e12a3715 | |||
| a66716c0b1 | |||
| abde2ef1ce | |||
| f94d411f3c | |||
| 6178277745 | |||
| a55858b44f | |||
| 2449366d87 | |||
| d1dd95d9c9 | |||
| 37e8cc01cf | |||
| e182c4c992 | |||
| 71b6b8fdef | |||
| 860bb7b067 | |||
| 7361ddf24d | |||
| 1a3ce762b3 | |||
| d006ac2c6e | |||
| 13bd678c03 | |||
| 4aef6cf8bb | |||
| f1c9a1f505 | |||
| 6fe6925f23 | |||
| 2e14be3534 | |||
| f24273378d | |||
| 5a94840442 | |||
| 0936d6e4f0 | |||
| a80d5eb540 | |||
| 6492c6008e | |||
| 9af5dd43ad | |||
| 3558181a7b | |||
| 37e9c3b8a4 | |||
| 3c5c938d40 | |||
| 02a9ce4ee5 | |||
| 9baec059ee | |||
| e9ab515594 | |||
| 07be6a3a81 | |||
| 06aa632e6f | |||
| 9ce9516c99 | |||
| 16053d45d7 | |||
| b39a9bd3ca | |||
| a60584e9ec | |||
| 00b6dabc78 | |||
| 0d33214557 | |||
| d68afc1868 | |||
| e95cc65c43 | |||
| 8cc49350f8 | |||
| 5bd55a5ec6 | |||
| dd2812f1e5 | |||
| 92dfde8a3e | |||
| 6dcdbe0f15 | |||
| dd7e2a477f | |||
| a4459d6207 | |||
| 2581b4c2da | |||
| 28ee73b9e4 | |||
| 4b18bb6ea4 | |||
| 921611ff4d | |||
| fb8e2a71e0 | |||
| ecdaa83669 | |||
| cf325e0e76 | |||
| 94da2e8dff | |||
| 8071ff985f | |||
| a365cfca31 | |||
| d7cd9d24fc | |||
| 7b1b526988 | |||
| 86962eb7aa | |||
| 1029faa02f | |||
| 4a9ccaa62d | |||
| fd0a7ea0c7 | |||
| c0d1070395 | |||
| 180b7edd77 | |||
| 09f5a89a12 | |||
| b1d59a6def | |||
| 3be1d87462 | |||
| 8fa00efa7b | |||
| 18b280ed1d | |||
| 996bb1baba | |||
| a3006cb51a | |||
| 031a1c2eea | |||
| 3c4cf098a9 | |||
| c9193c53d9 | |||
| 831edc465a | |||
| eb8ac56cf6 | |||
| 8daa05bab2 | |||
| 02006e1b50 | |||
| fb78eb615b | |||
| 2b453dd0cb | |||
| 510a271434 | |||
| 1053e22a52 | |||
| c88f126cb1 | |||
| 61bb862cdb | |||
| 2586290a1d | |||
| d6c9c931fd | |||
| 210ae3f9df | |||
| 4dfdaf5447 | |||
| a1f1719f3b | |||
| d17608e631 | |||
| 38211932dc | |||
| bc2b3fa3ac | |||
| 56f42e0018 | |||
| 25452898d9 | |||
| ad08f8b117 | |||
| 93062e4341 | |||
| 314d306145 | |||
| a003486b4a | |||
| ab6b08404a | |||
| 1a75b201fd | |||
| bbc36c3869 | |||
| bf1a09097f | |||
| f3e96d7138 | |||
| 2b47218406 | |||
| c49f12b41d | |||
| 2eea660184 | |||
| 4b1c077b4a | |||
| de25ef0162 | |||
| ad49afb34b | |||
| 8aad4a16b3 | |||
| 8960365f82 | |||
| c967c84e0e | |||
| 61cc29a260 | |||
| cb3b4de1a5 | |||
| 127dcc04bf | |||
| cb8ea37dab | |||
| ebb6fe6942 | |||
| eb490d89c2 | |||
| 64a199be6d | |||
| b01ba2e116 | |||
| 0bada79b6b | |||
| 8894da4f93 | |||
| 37bf8554fc | |||
| ce6553863a | |||
| b16cf00dae | |||
| 17de2ff4bc | |||
| 0b079228d9 | |||
| 82edb263f8 | |||
| 477ab117fc | |||
| b5558baa4c | |||
| 75a894bbd1 | |||
| 24f2ed2f81 | |||
| a75cf652de | |||
| 12deaff85f | |||
| caed7f9493 | |||
| 2cbb648a7f | |||
| 245e6fd9e8 | |||
| 3ce57ec254 | |||
| 5b3c1d749c | |||
| 180766f9aa | |||
| 955a471747 | |||
| ff7d92c731 | |||
| 5e8da4e672 | |||
| 8fc5e5013c | |||
| b92eedeed7 | |||
| a188ca7fad | |||
| 9cd9055913 | |||
| 4bc0b559cb | |||
| 9a9f6379cd | |||
| 7293e37165 | |||
| 403a39d32f | |||
| fb87e01986 | |||
| bd6f68790e | |||
| 33e1ebd3fe | |||
| 9a2cab4b5e | |||
| 70e889ebdb | |||
| 59b693d2f3 | |||
| c96e7323cc | |||
| 4acc9d09b8 | |||
| d0107ed148 | |||
| 3d85ee847c | |||
| 10c2d334f8 | |||
| 82d9d75a78 | |||
| 23ba77ee4d | |||
| 460b09e70b | |||
| b07e8813c6 | |||
| 406aa72112 | |||
| 9fd85942e0 | |||
| 5e7d48e70c | |||
| fb9ade7e9f | |||
| 2b7febf5d0 | |||
| 710f6c2eb7 | |||
| b0a63e2d34 | |||
| 84b656ebbd | |||
| 7bd824bae3 | |||
| e7ce5d044d | |||
| 1c2939e8b2 | |||
| 9c3b8ef3a7 | |||
| 08384156e4 | |||
| d219b78d4c | |||
| d40b3ddfab | |||
| 2c549f61a4 | |||
| 899a908409 | |||
| 21326c5103 | |||
| ae1907816e | |||
| 5063ace6bf | |||
| e05ece5ad7 | |||
| a25b5c9713 | |||
| c09da948fe | |||
| 0fe44256b9 | |||
| fe19402218 | |||
| be1445d7b5 | |||
| 27f644fc1c | |||
| f67009f133 | |||
| e986e5dc2e | |||
| d6364709ca | |||
| e07d37ede8 | |||
| f270b979c8 | |||
| fd953a0b26 | |||
| 258c93e661 | |||
| e3ce482ede | |||
| e8d800b433 | |||
| a5f3e1e2ee | |||
| 5f62069590 | |||
| 4d04e9e2bd | |||
| bbddf40590 | |||
| f4ed9e9840 | |||
| 2085bb454b | |||
| 313a099a4b | |||
| c3add767be | |||
| 6dd72dfcd5 | |||
| b3f562caab | |||
| a847baf331 | |||
| 929e1ca01c | |||
| 1b0103c119 | |||
| d6d9b5bc22 | |||
| ad04fd13ae | |||
| adf3f5df19 | |||
| 6ecdf1af57 | |||
| dd17372ec0 | |||
| 38d900ba83 | |||
| b786271ce7 | |||
| 64dc1c7ea7 | |||
| 43e814ce9a | |||
| 5f6a655ff9 | |||
| e4cfcc1dd9 | |||
| 8bb3e54689 | |||
| 52b7c4fb25 | |||
| 29d84e3bcf | |||
| d4a3bc0e20 | |||
| 45dabd8ddb | |||
| e82fe8cdc1 | |||
| 58dc32dd97 | |||
| 6f22dfca11 | |||
| 785aaec4c3 | |||
| bbfe3d84b7 | |||
| dbb21151b0 | |||
| cf165af025 | |||
| b99b1689b7 | |||
| 3d9a81108d | |||
| 75140a0ec6 | |||
| f370c93e1f | |||
| a5f8d4198b | |||
| 9289a8c40c | |||
| ec15b3b673 | |||
| 8eb5f86e9a | |||
| d28090f292 | |||
| 30df7419b7 | |||
| cfc3ba4b51 | |||
| 3327e7f54a | |||
| 6263c0bbda | |||
| 0801d607a1 | |||
| 2ff6fb7b65 | |||
| fdb2ab19ab | |||
| 9b15e8179f | |||
| 2660d9dd0f | |||
| a92ca028b1 | |||
| 159b54e943 | |||
| 2df53839d9 | |||
| 94496c3dde | |||
| 8a2a9a99a9 | |||
| 6d39ea4696 | |||
| 373182024a | |||
| 0d8610815a | |||
| 7255578936 | |||
| 39e411c2e1 | |||
| 8628dc9141 | |||
| a60fba8c18 | |||
| ab747d66ac | |||
| 7a0a8b94fe | |||
| aacee86563 | |||
| 08fb0ecb53 | |||
| e1f847bc20 | |||
| ec15417fd2 | |||
| 010bdda236 | |||
| 3797f017e9 | |||
| 8c74532f27 | |||
| 891f7f0a0e | |||
| f95d366881 | |||
| 1e1c3ad6e9 | |||
| 71da808969 | |||
| 0db8dc2433 | |||
| 94c8ac09bc | |||
| 36a6e8dcbe | |||
| 1729b51868 | |||
| 896eac6d8c | |||
| 6eb83dc891 | |||
| 15f4761108 | |||
| f98d2e652a | |||
| c28021b5a4 | |||
| bc36be1e58 | |||
| f7a2a6fe07 | |||
| df2a81d76d | |||
| 1d4aa3478d | |||
| 3c510598fa | |||
| c4153a9a2a | |||
| ae233bbf0b | |||
| e44df03d82 | |||
| 18e5e6ab0f | |||
| c61ca959b2 | |||
| 9015106ca2 | |||
| 658d756120 | |||
| 38417b0fd5 | |||
| 4362ee490c | |||
| 9ad9821e2a | |||
| 32b502a1e3 | |||
| 1f57e4f701 | |||
| 746cf3dd42 | |||
| 85d2c71047 | |||
| e20c73fa27 | |||
| 2e3d042d60 | |||
| eb1fd155a3 | |||
| a8582b2a0f | |||
| 6a7bbfabcd | |||
| 8493dbc47b | |||
| 1bf594d9e2 | |||
| 65d83aa09c | |||
| aebd9c28f5 | |||
| 602b9e2ae9 | |||
| 103a2cbd4f | |||
| 13087dd45e | |||
| d697d0017e | |||
| 7e0b958207 | |||
| 394b4f310e | |||
| 5aff5f5796 | |||
| d1fee33482 | |||
| e6b8292d5b | |||
| abd9c80e4d | |||
| e4b11ecab4 | |||
| 781606bec5 | |||
| f4d709c0dd | |||
| 8699e1887c | |||
| bf39319cbb | |||
| 9eab833f66 | |||
| 40b2c2a858 | |||
| e92ce0a5f3 | |||
| f7b90b3808 | |||
| 75bb046f22 | |||
| fd20313d65 | |||
| 837a33480e | |||
| 7b02c3d24a | |||
| c59845e746 | |||
| c75981d201 | |||
| eef41696e8 | |||
| fc31ac6cd0 | |||
| a852b4e3ad | |||
| 0b711cbe65 | |||
| 2d1158af64 | |||
| 963514667d | |||
| ec35c74e5f | |||
| 417c89e96f | |||
| da45871f0b | |||
| d5a9fb8d0e | |||
| b8c68dc2e4 | |||
| 12a3eb862e | |||
| e51af9e6e8 | |||
| b46da74c2c | |||
| 119782920a | |||
| 30ba38c2b3 | |||
| 87547576de | |||
| 5febb8c4e2 | |||
| ddc6986401 | |||
| c0cabc9739 | |||
| 9a1da5b7c2 | |||
| 5daa2b9dff | |||
| 5988acb12b | |||
| 011d05f7b6 | |||
| 294d1a525e | |||
| e5770a5343 | |||
| 7a65e1feb5 | |||
| 4e55f53fb4 | |||
| 4d944d3dc3 | |||
| 3d3b4837ff | |||
| 8270e0898b | |||
| 2ed63ab3ac | |||
| d99a48d87d | |||
| 27375e7382 | |||
| a81d3c4989 | |||
| b922440fc7 | |||
| 6ca6f2ed3d | |||
| 954b9252c1 | |||
| e355f45544 | |||
| ed32664b9e | |||
| 8619057224 | |||
| 10978c59e4 | |||
| ed56206c30 | |||
| 513c2dfc3b | |||
| 0b544bf55a | |||
| a9d39f0803 | |||
| 2248739dd5 | |||
| b83b691714 | |||
| 887611c9d8 | |||
| 390cf0257e | |||
| 2503dca0e3 | |||
| 8fd45cc977 | |||
| 8d9b9e505e | |||
| 2453c08194 | |||
| f149613d54 | |||
| 2c5cfb6442 | |||
| cfddaf1508 | |||
| 6eff190f87 | |||
| e40c5190b1 | |||
| 2584799415 | |||
| 0463901db7 | |||
| c2704af523 | |||
| 328e9cade9 | |||
| 2b61fff449 | |||
| d8bbe2110e | |||
| 1ef88622d6 | |||
| b1d3fb63f3 | |||
| f44ffd1959 | |||
| e7545db663 | |||
| fcf9d2ad15 | |||
| 7986321a52 | |||
| 8e0f28ee30 | |||
| fecfa18999 | |||
| d8b23cd13c | |||
| 0e0101f507 | |||
| 17a17850ea | |||
| 71d4a6dab0 | |||
| 936d3b5280 | |||
| fac9c23103 | |||
| 3674401923 | |||
| 66d6d0dc33 | |||
| 31ce134413 | |||
| b8e6aae289 | |||
| 8f620712ef | |||
| 1069d1c066 | |||
| bc0634a541 | |||
| 8d65a99fe4 | |||
| 6e68714c26 | |||
| 06ff7b661a | |||
| 70a6442b46 | |||
| 9e7d394ae7 | |||
| 326b2d7a04 | |||
| f3045a5e80 | |||
| b3d72cbfcb | |||
| 76c4573c39 | |||
| 741bec9874 | |||
| 46aed06523 | |||
| 7630c1a883 | |||
| 2877e5dfc1 | |||
| 05b88a48a3 | |||
| c74b567fe4 | |||
| a6b6cb0f09 | |||
| 86e9af6fd7 | |||
| 8776f7dfbb | |||
| 929f908a86 | |||
| 229d7b052a | |||
| a5896f7ae8 | |||
| 114c2cee93 | |||
| 7f413ec994 | |||
| bd30a68e7d | |||
| f4a18726b5 | |||
| 50e284357c | |||
| 2ddb03e2be | |||
| ebae616138 | |||
| 0f88640575 | |||
| 75cc82ae0c | |||
| 32dc235aa5 | |||
| 6ffe1d81c2 | |||
| 5b245e64d3 | |||
| a067361d74 | |||
| a7f66c8883 | |||
| e03e7d831e | |||
| 1219ed0dd6 | |||
| fe2ff95f19 | |||
| d72f0ce40c | |||
| df43e2c126 | |||
| d8ecc1174d | |||
| 3e269b49d4 | |||
| 72c9f3b0db | |||
| 2f5b0db786 | |||
| 8d9f16c387 | |||
| d6cb0ee8a0 | |||
| 5444701c38 | |||
| 396479c2bf | |||
| d78885dcd4 | |||
| ede72ff1d8 | |||
| e5bf27030d | |||
| 375bf56e2e | |||
| f79be1b343 | |||
| 3554adf0c1 | |||
| a32cc9f0f5 | |||
| 3759fd4ac4 | |||
| ac58e8be2e | |||
| 1c7646f98f | |||
| 1b9d14e89d | |||
| 3c41388eb7 | |||
| a9a2113ea4 | |||
| b5fa34e1a1 | |||
| 192f1d722d | |||
| b857664d27 | |||
| 19491f0994 | |||
| 6738b57ba2 | |||
| 30560e6cf8 | |||
| e1de021fba | |||
| 8b4f05dc78 | |||
| 950330b5f7 | |||
| 9927718e25 | |||
| b7ff4f2c2c | |||
| 47c79459a6 | |||
| 143960937e | |||
| ee16ce10c1 | |||
| 3988a69946 | |||
| 738b2e416e | |||
| b96dfa602b | |||
| 9d6f232dd1 | |||
| d808ba6cbf | |||
| 818fab8909 | |||
| 1ffaf3a292 | |||
| 8e11c3dffd | |||
| a7496dbc02 | |||
| 9e439044de | |||
| 536552b9db | |||
| 183bab110e | |||
| beea3e2184 | |||
| e0a3add5f2 | |||
| fd8e5e4eed | |||
| 6f7139fe28 | |||
| 57d996491e | |||
| ba8e0578ed | |||
| 65b267c497 | |||
| 512064de61 | |||
| 2cdb8b5323 | |||
| d08ac60fd9 | |||
| fbc0159453 | |||
| 3d526cebbc | |||
| 2d10a6a270 | |||
| 5f7ce28682 | |||
| 9d0f835186 | |||
| 3fdadf3eb5 | |||
| cd57ab6ad9 | |||
| eab8a51bb7 | |||
| dbb4efb98a | |||
| a83d6deec1 | |||
| f212de64f5 | |||
| 6a4583f758 | |||
| 325f2dc22f | |||
| 7134187dc9 | |||
| b20db0a117 | |||
| 3c7fcf65a9 | |||
| 4fa344a0f7 | |||
| 9aa748e628 | |||
| bba4f8d0c5 | |||
| be8b38e5cf | |||
| db9e5ba332 | |||
| 689fa14cfd | |||
| fa924171c7 | |||
| 8a222d5e75 | |||
| fcb62894a5 | |||
| c94b627808 | |||
| 754eb78a05 | |||
| 045929ca7c | |||
| 98b2d2057c | |||
| 98a9eb4f18 | |||
| 58d32ffd1f | |||
| 76c3e89faf | |||
| abf48fde02 | |||
| c31d5b7d3c | |||
| f455ce398c | |||
| b498084388 | |||
| 75c156578c | |||
| fd67ec1f86 | |||
| b1041ea8a8 | |||
| 51a075c0df | |||
| 8bf045974f | |||
| 44d2005ab1 | |||
| 21f827112d | |||
| 5f18eed14d | |||
| 7a83fd2f30 | |||
| 6e258bb210 | |||
| 72adfd3126 | |||
| 196b27f3b2 | |||
| ce192670a3 | |||
| 14ab9f462a | |||
| 93365973a7 | |||
| 950ecd6bbc | |||
| 8420f5f1b1 | |||
| 80352f6b30 | |||
| 6ef166ba33 | |||
| 9368b96129 | |||
| 025f0bdd0b | |||
| 2d76846d3c | |||
| f6cc7abac9 | |||
| 572d2251d7 | |||
| 7dd9fb9b47 | |||
| 92827035e0 | |||
| 5f7b8c3371 | |||
| 03eddddc0e | |||
| 080fbaa26c | |||
| f6a285de87 | |||
| 55e4ea0277 | |||
| bb80fe12a0 | |||
| 5c67f0df20 | |||
| 3697c079fa | |||
| 2e6041dcf5 | |||
| 645de31fe3 | |||
| eef90da7ae | |||
| c0586a5089 | |||
| b30018bb38 | |||
| 6c45573976 | |||
| b6c1b1a6d7 | |||
| d41a441e98 | |||
| 86b6cf2d65 | |||
| cf11993cb1 | |||
| fe7ef30650 | |||
| bb4c7f0298 | |||
| a7db46d69b | |||
| ce81c2769c | |||
| d4a57370ef | |||
| 634039e551 | |||
| a83edceae3 | |||
| 19cc044cab | |||
| 79ad29e99a | |||
| f96e291681 | |||
| 6685a22118 | |||
| a84a0bd8dc | |||
| c2d8c806d2 | |||
| 387860aa4a | |||
| de7bdba95f | |||
| 6baf5247cb | |||
| 146d29b627 | |||
| c1a1249be1 | |||
| 8e7a797586 | |||
| 14a1918fda | |||
| 54e755efdd | |||
| 3df7430663 | |||
| c71d89c95a | |||
| 1b5860eec8 | |||
| 4741880044 | |||
| 02a0cb174a | |||
| e53fd7a062 | |||
| a76d8049c0 | |||
| 0ce1558f54 | |||
| 2807f9a51c | |||
| 03a3423da0 | |||
| 12a011a9ff | |||
| 7a1afc7a95 | |||
| 262b4f2a2e | |||
| fadc5055b2 | |||
| 1c908c261d | |||
| 39216df8eb | |||
| ed59579a9d | |||
| 2aa7389c3f | |||
| 02970e2f8f | |||
| 2e00ac402a | |||
| c94dd46294 | |||
| df802c3b26 | |||
| 8430a506cc | |||
| 46a6196c92 | |||
| e64a0acfb3 | |||
| 14f7a1cb61 | |||
| 1cfacf4118 | |||
| 975679ef87 | |||
| dfa27016fd | |||
| 25d083ef25 | |||
| c989bdb0ea | |||
| cb9e98dc88 | |||
| c7ba11c607 | |||
| 8876af53d8 | |||
| 70f78ebfd1 | |||
| be434329d1 | |||
| 67f091b843 | |||
| 33a592ee52 | |||
| a574e68bb7 | |||
| 001c9e937d | |||
| f01bd88edd | |||
| 8700edb330 | |||
| 9b686673ae | |||
| c841a2d2a9 | |||
| c8248b2d33 | |||
| 5e373b5304 | |||
| d73b506d09 | |||
| d332f6cf23 | |||
| 1c4806e0d7 | |||
| f5ac485ac8 | |||
| 595196b5ec | |||
| 85d177d394 | |||
| 4ee8890166 | |||
| 5e8858c40e | |||
| 420cb71990 | |||
| 451778d704 | |||
| c855bb769a | |||
| f95d56d1eb | |||
| fe5e209eb1 | |||
| f206e4b334 | |||
| 5bd518da4b | |||
| ec8e40907d | |||
| e828709090 | |||
| d4329ae594 | |||
| 2c4c2b8469 | |||
| 14f667de74 | |||
| 578baeae96 | |||
| 1ad3fdfd46 | |||
| 5eaf5d1f51 | |||
| 8e7df958b8 | |||
| 4f2ad9a93c | |||
| 850eb8e6e0 | |||
| 47f551c046 | |||
| ae6747c82d | |||
| 1bd04c2840 | |||
| 11e4c459c9 | |||
| 647319b731 | |||
| e0913f9068 | |||
| af0fa872ae | |||
| 1ce8f28105 | |||
| a525f34fec | |||
| 632f3faac5 | |||
| 4f34c4466a | |||
| ccc5117172 | |||
| b346b93285 | |||
| 2b61c1d90f | |||
| baf5a64c51 | |||
| 260564cff1 | |||
| 248f74d948 | |||
| 724a9e49df | |||
| 726224b253 | |||
| 421e087d81 | |||
| a1ec97a221 | |||
| d151ed9354 | |||
| 7502481f26 | |||
| 76e7e4956d | |||
| 15d25bca27 | |||
| dffc8bcea0 | |||
| a61966ed61 | |||
| e6d77a40e2 | |||
| edcb933874 | |||
| be18ad4177 | |||
| 07a5b191bb | |||
| da12b329be | |||
| 3902612c4b | |||
| 9bce415523 | |||
| 3e4f877ec0 | |||
| 1b601343ff | |||
| 77ee46e153 | |||
| 357c1a20df | |||
| 67bbfea87d | |||
| 220c6939b1 | |||
| fd27ea0e8f | |||
| 4bb1982806 | |||
| 9283677a2b | |||
| d4180a5084 | |||
| 2721b16c46 | |||
| f1ff6a21ee | |||
| 530079b8a5 | |||
| 2ca428bbbb | |||
| 8a27a8cce4 | |||
| 7eec4d742c | |||
| 3f66975e1b | |||
| b7f8c973f4 | |||
| 98e51feb46 | |||
| 68fccd2edb | |||
| 72e414b2b7 | |||
| 79a31ce57c | |||
| 488ed8e562 | |||
| b3bce1651b | |||
| e9a2e4b076 | |||
| cc2f031a32 | |||
| d0eea1bf91 | |||
| 53ba29b288 | |||
| c5f3a03d1e | |||
| da9cdf7df3 | |||
| 8a7f1b1b3a | |||
| aa14620a50 | |||
| 1fa6a7c11a | |||
| 25806b67a2 | |||
| 47ff7e228e | |||
| c135787620 | |||
| bbc3d44526 | |||
| 2e747beda6 | |||
| b9a9be2795 | |||
| 19414b061b | |||
| 74b5ab1798 | |||
| 83cda110aa | |||
| 6f87546492 | |||
| 1f7c89a95c | |||
| 0df11d24f5 | |||
| a6c27a1e3f | |||
| 0a5fa12ce5 | |||
| c090b0cf62 | |||
| 45660e3d96 | |||
| 732190bb11 | |||
| b667f88d0e | |||
| 255d312ae0 | |||
| cc92ae7998 | |||
| ae9905e4c7 | |||
| 38469c26ff | |||
| 07b460147e | |||
| 6cf1b13500 | |||
| 4a8d4ab8d9 | |||
| 65a9574e52 | |||
| 6eacb677a4 | |||
| d081c8ea74 | |||
| 0342e7ffb5 | |||
| c029e5c39d | |||
| a917a9493c | |||
| 02405bb8ff | |||
| d8bb85a1d8 | |||
| fd6b2360aa | |||
| 3e655961e9 | |||
| 077837054b | |||
| 45674ef554 | |||
| eabf856dbd | |||
| 32ea0f2cf6 | |||
| 47f40c0be3 | |||
| 6a66615f37 | |||
| 314a1ba39b | |||
| 2daa7f9fea | |||
| f0d576e1b0 | |||
| be76c58264 | |||
| 8245f232d4 | |||
| 7468af0779 | |||
| 38a6d3e549 | |||
| 3022588e35 | |||
| b81f1c4975 | |||
| ed78e9df6e | |||
| f044149004 | |||
| f126eb7611 | |||
| afa9cf371e | |||
| f813cf6d36 | |||
| 3dcd3dbb7f | |||
| d80a06bc8e | |||
| 947178f10a | |||
| e92cc7d50c | |||
| 989a28a8ca | |||
| e4dd46b498 | |||
| c49e8d4770 | |||
| 86156f3fec | |||
| fec826b10e | |||
| 229b07391b | |||
| e157477b6d | |||
| d40bb61da8 | |||
| 4733d42932 | |||
| e6030dcc3f | |||
| 6615fa67f5 | |||
| dc4b88d08e | |||
| cc2abe3c30 | |||
| 70640b65ea | |||
| 4599d81a59 | |||
| 3ea5b575b7 | |||
| b9eb66e2b3 | |||
| bde5b19c77 | |||
| cc60ab3d63 | |||
| 42f7e6f486 | |||
| 5f68b5923d | |||
| 85abbdd699 | |||
| 3802886722 | |||
| d4e27a27cb | |||
| e882b91b06 | |||
| 4c8dbee79d | |||
| 1438175477 | |||
| 30861bbf91 | |||
| ea6a19a260 | |||
| fc81fa8745 | |||
| 948436e57e | |||
| 3dde71f1ff | |||
| be0e220fe4 | |||
| 2e9a209a78 | |||
| 3ce4f06b6c | |||
| 555414cd51 | |||
| c33033b2f4 | |||
| 3c697c2d7e | |||
| 0e7c1aa481 | |||
| 7d5ff13f75 | |||
| 02a8a512dc | |||
| 4733f46a28 | |||
| 945de348f3 | |||
| 20dd9d7adc | |||
| c5bd184bbc | |||
| ae161fac49 | |||
| 8eb780a8b5 | |||
| 1c33cc9f3d | |||
| 9d692d5194 | |||
| a7da7f932c | |||
| 2e4f7adee4 | |||
| dcb822f812 | |||
| 5da286fed4 | |||
| 4ec0fe8d96 | |||
| 340a3e85c8 | |||
| 64baf660bb | |||
| 4f24f18b27 | |||
| c5ea4dca67 | |||
| deaf47155f | |||
| a1d1420ec3 | |||
| a133a25cc3 | |||
| 65e15b5205 | |||
| ac123939e5 | |||
| 2cafc570a8 | |||
| 9e5d5cecd4 | |||
| deb8d59130 | |||
| 14bbf96feb | |||
| ee1c5a0a56 | |||
| a281db1cbb | |||
| b25e5449c8 | |||
| b267c19a45 | |||
| 0bda37057a | |||
| 2aa8d2bdcc | |||
| eebcbb5cc2 | |||
| acf37ff10f | |||
| 56c239a368 | |||
| ae7386e7be | |||
| 9ddf510716 | |||
| d79fefe546 | |||
| 921cbb0b69 | |||
| 7f1b849394 | |||
| 9f4388843a | |||
| 37fba30c79 | |||
| 8f1fd55e2f | |||
| 8af9e9b27d | |||
| 8b681d6efb | |||
| 75b9a0228b | |||
| cbc00e6416 | |||
| a0778c8d7b | |||
| 0c4dc82c65 | |||
| a35d4b2701 | |||
| 05b0973a23 | |||
| 09f46beeb4 | |||
| b4c7eea4d9 | |||
| 8159ecfce4 | |||
| 662e2b5ba0 | |||
| 5ca9f968aa | |||
| 6ef34bb3f5 | |||
| 9a5be0a321 | |||
| c203f6eb0a | |||
| b713f4e702 | |||
| 111087d96a | |||
| 9e7666d12f | |||
| cb147773b5 | |||
| d84bef8f14 | |||
| 32bb318af4 | |||
| 055b5e2256 | |||
| c1754d122f | |||
| 6d121122f8 | |||
| bfa8334aeb | |||
| 0e222afd6a | |||
| b191962d32 | |||
| 1cf13e142a | |||
| 8f1f81749d | |||
| 72d70eba16 | |||
| ae3612f595 | |||
| 37b6457054 | |||
| 9579be5c7d | |||
| d05d47fa75 | |||
| bd88c04e9e | |||
| eb3a3872eb | |||
| 5cea7be405 | |||
| 516c382fe4 | |||
| 710e55422a | |||
| 3406cf78b4 | |||
| 8fa354796c | |||
| 6c6ef1c1b8 | |||
| c3c326c680 | |||
| 92e20485b2 | |||
| edd782ac23 | |||
| a4d84e318d | |||
| 08ee599f79 | |||
| 134f2d68a3 | |||
| d23c46ff84 | |||
| 820c5db5e8 | |||
| 990916ab62 | |||
| d4e362cd76 | |||
| 1dd06cc509 | |||
| 2e2bd1d137 | |||
| 0818d91f4f | |||
| 6e1f34b168 | |||
| 1a35177633 | |||
| c45689b02b | |||
| 8f27d940e3 | |||
| 6b4640c413 |
@@ -0,0 +1,2 @@
|
||||
**/build
|
||||
**/docker-compose
|
||||
+740
-109
@@ -2,68 +2,443 @@ name: C/C++ CI
|
||||
|
||||
on:
|
||||
push:
|
||||
branches: [ master ]
|
||||
branches: ["master"]
|
||||
paths-ignore:
|
||||
- 'docker-compose/**'
|
||||
- 'docs/**'
|
||||
- 'README.md'
|
||||
|
||||
pull_request:
|
||||
branches: [ master ]
|
||||
|
||||
jobs:
|
||||
build-alpine-static:
|
||||
|
||||
timeout-minutes: 90
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
strategy:
|
||||
matrix:
|
||||
config:
|
||||
- {arch: x86_64, branch: latest-stable, flags: "-ffunction-sections"}
|
||||
- {arch: aarch64, branch: latest-stable, flags: "-ffunction-sections -mfix-cortex-a53-835769 -mfix-cortex-a53-843419"}
|
||||
- {arch: riscv64, branch: latest-stable, flags: "-ffunction-sections"}
|
||||
|
||||
steps:
|
||||
- name: Setup Alpine Linux
|
||||
uses: jirutka/setup-alpine@v1
|
||||
with:
|
||||
arch: ${{ matrix.config.arch }}
|
||||
branch: ${{ matrix.config.branch }}
|
||||
|
||||
- name: Install dependencies
|
||||
shell: alpine.sh --root {0}
|
||||
run: |
|
||||
apk add git cmake gcc g++ make linux-headers xz
|
||||
|
||||
- name: Checkout repository
|
||||
uses: actions/checkout@v4
|
||||
with:
|
||||
submodules: recursive
|
||||
|
||||
- name: Build libcurl
|
||||
shell: alpine.sh {0}
|
||||
run: |
|
||||
cd external/src/curl
|
||||
cmake . -DCMAKE_BUILD_TYPE=Release -DCMAKE_C_FLAGS="-Os -flto=auto ${{ matrix.config.flags }}" -DBUILD_CURL_EXE=OFF -DBUILD_SHARED_LIBS=OFF -DCURL_DISABLE_INSTALL=ON -DCURL_ENABLE_EXPORT_TARGET=OFF -DCURL_DISABLE_HEADERS_API=ON -DCURL_DISABLE_BINDLOCAL=ON -DBUILD_LIBCURL_DOCS=OFF -DBUILD_MISC_DOCS=OFF -DENABLE_CURL_MANUAL=OFF -DCURL_ZLIB=OFF -DCURL_BROTLI=OFF -DCURL_ZSTD=OFF -DCURL_DISABLE_ALTSVC=ON -DCURL_DISABLE_COOKIES=ON -DCURL_DISABLE_DOH=ON -DCURL_DISABLE_GETOPTIONS=ON -DCURL_DISABLE_HSTS=ON -DCURL_DISABLE_LIBCURL_OPTION=ON -DCURL_DISABLE_MIME=ON -DCURL_DISABLE_NETRC=ON -DCURL_DISABLE_NTLM=ON -DCURL_DISABLE_PARSEDATE=ON -DCURL_DISABLE_PROGRESS_METER=ON -DCURL_DISABLE_SHUFFLE_DNS=ON -DCURL_DISABLE_SOCKETPAIR=ON -DCURL_DISABLE_VERBOSE_STRINGS=ON -DCURL_DISABLE_WEBSOCKETS=ON -DHTTP_ONLY=ON -DCURL_ENABLE_SSL=OFF -DUSE_LIBIDN2=OFF -DCURL_USE_LIBPSL=OFF -DCURL_USE_LIBSSH2=OFF -DENABLE_UNIX_SOCKETS=OFF -DCURL_DISABLE_TESTS=ON -DUSE_NGHTTP2=OFF -DBUILD_EXAMPLES=OFF -DP2POOL_BORINGSSL=ON -DCURL_DISABLE_SRP=ON -DCURL_DISABLE_AWS=ON -DCURL_DISABLE_BASIC_AUTH=ON -DCURL_DISABLE_BEARER_AUTH=ON -DCURL_DISABLE_KERBEROS_AUTH=ON -DCURL_DISABLE_NEGOTIATE_AUTH=ON -DOPENSSL_INCLUDE_DIR=../grpc/third_party/boringssl-with-bazel/src/include
|
||||
make -j$(nproc)
|
||||
|
||||
- name: Build libuv
|
||||
shell: alpine.sh {0}
|
||||
run: |
|
||||
cd external/src/libuv
|
||||
mkdir build
|
||||
cd build
|
||||
cmake .. -DCMAKE_BUILD_TYPE=Release -DCMAKE_C_FLAGS='-Os -flto=auto ${{ matrix.config.flags }}' -DBUILD_TESTING=OFF -DLIBUV_BUILD_SHARED=OFF
|
||||
make -j$(nproc)
|
||||
|
||||
- name: Build libzmq
|
||||
shell: alpine.sh {0}
|
||||
run: |
|
||||
cd external/src/libzmq
|
||||
mkdir build
|
||||
cd build
|
||||
cmake .. -DCMAKE_BUILD_TYPE=Release -DCMAKE_POLICY_VERSION_MINIMUM="3.5" -DCMAKE_C_FLAGS='-Os -flto=auto ${{ matrix.config.flags }}' -DCMAKE_CXX_FLAGS='-Os -flto=auto ${{ matrix.config.flags }}' -DWITH_LIBSODIUM=OFF -DWITH_LIBBSD=OFF -DBUILD_TESTS=OFF -DWITH_DOCS=OFF -DENABLE_DRAFTS=OFF -DBUILD_SHARED=OFF
|
||||
make -j$(nproc)
|
||||
|
||||
- name: Build p2pool
|
||||
shell: alpine.sh {0}
|
||||
run: |
|
||||
mkdir build
|
||||
cd build
|
||||
cmake .. -DCMAKE_BUILD_TYPE=Release -DCMAKE_POLICY_VERSION_MINIMUM="3.5" -DCMAKE_C_FLAGS='${{ matrix.config.flags }} -Wl,-s -Wl,--gc-sections' -DCMAKE_CXX_FLAGS='${{ matrix.config.flags }} -Wl,-s -Wl,--gc-sections' -DWITH_GRPC=OFF -DSTATIC_BINARY=ON -DARCH_ID=${{ matrix.config.arch }}
|
||||
make -j$(nproc) p2pool
|
||||
|
||||
- name: Run RandomX tests
|
||||
shell: alpine.sh {0}
|
||||
run: |
|
||||
cd build
|
||||
./p2pool --test
|
||||
make -j$(nproc) randomx-tests
|
||||
external/src/RandomX/randomx-tests
|
||||
|
||||
- name: Build tests
|
||||
shell: alpine.sh {0}
|
||||
run: |
|
||||
cd tests
|
||||
mkdir build
|
||||
cd build
|
||||
cmake .. -DCMAKE_BUILD_TYPE=Release -DCMAKE_POLICY_VERSION_MINIMUM="3.5" -DCMAKE_C_FLAGS='${{ matrix.config.flags }} -Wl,-s -Wl,--gc-sections' -DCMAKE_CXX_FLAGS='${{ matrix.config.flags }} -Wl,-s -Wl,--gc-sections' -DSTATIC_LIBS=ON -DARCH_ID=${{ matrix.config.arch }}
|
||||
make -j$(nproc) p2pool_tests
|
||||
|
||||
- name: Run tests
|
||||
shell: alpine.sh {0}
|
||||
run: |
|
||||
cd tests/build
|
||||
unxz *.xz
|
||||
./p2pool_tests
|
||||
|
||||
- name: List directory
|
||||
run: |
|
||||
cd build
|
||||
ls -la
|
||||
file p2pool
|
||||
|
||||
- name: Archive binary
|
||||
uses: actions/upload-artifact@v4
|
||||
with:
|
||||
name: p2pool-alpine-static-${{ matrix.config.arch }}
|
||||
path: build/p2pool
|
||||
|
||||
build-ubuntu:
|
||||
|
||||
timeout-minutes: 60
|
||||
runs-on: ${{ matrix.config.os }}
|
||||
|
||||
strategy:
|
||||
matrix:
|
||||
config:
|
||||
- {os: ubuntu-latest, c: gcc-11, cpp: g++-11}
|
||||
- {os: ubuntu-18.04, c: gcc, cpp: g++}
|
||||
- {os: ubuntu-22.04, c: gcc-9, cpp: g++-9, flags: ""}
|
||||
- {os: ubuntu-22.04, c: gcc-10, cpp: g++-10, flags: ""}
|
||||
- {os: ubuntu-22.04, c: gcc-11, cpp: g++-11, flags: ""}
|
||||
- {os: ubuntu-22.04, c: gcc-12, cpp: g++-12, flags: ""}
|
||||
- {os: ubuntu-24.04, c: gcc-13, cpp: g++-13, flags: ""}
|
||||
- {os: ubuntu-24.04, c: gcc-14, cpp: g++-14, flags: ""}
|
||||
|
||||
steps:
|
||||
- name: Install dependencies
|
||||
run: |
|
||||
sudo add-apt-repository -y ppa:ubuntu-toolchain-r/test
|
||||
sudo apt update
|
||||
sudo apt install -y git build-essential cmake libuv1-dev libzmq3-dev libsodium-dev libpgm-dev libnorm-dev libgss-dev ${{ matrix.config.c }} ${{ matrix.config.cpp }}
|
||||
sudo apt install -y git build-essential cmake libuv1-dev libzmq3-dev libgss-dev libcurl4-openssl-dev libidn2-0-dev xz-utils ${{ matrix.config.c }} ${{ matrix.config.cpp }}
|
||||
|
||||
- name: Checkout repository
|
||||
uses: actions/checkout@v2
|
||||
uses: actions/checkout@v4
|
||||
with:
|
||||
submodules: true
|
||||
submodules: recursive
|
||||
|
||||
- name: Build p2pool
|
||||
run: |
|
||||
mkdir build
|
||||
cd build
|
||||
cmake .. -DCMAKE_C_COMPILER=${{ matrix.config.c }} -DCMAKE_CXX_COMPILER=${{ matrix.config.cpp }}
|
||||
make -j2
|
||||
cmake .. -DCMAKE_BUILD_TYPE=Release -DCMAKE_C_COMPILER=${{ matrix.config.c }} -DCMAKE_CXX_COMPILER=${{ matrix.config.cpp }} -DCMAKE_C_FLAGS='${{ matrix.config.flags }}' -DCMAKE_CXX_FLAGS='${{ matrix.config.flags }}' -DCMAKE_POLICY_VERSION_MINIMUM="3.5"
|
||||
make -j$(nproc) p2pool
|
||||
|
||||
- name: Run RandomX tests
|
||||
run: |
|
||||
cd build
|
||||
./p2pool --test
|
||||
make -j$(nproc) randomx-tests
|
||||
external/src/RandomX/randomx-tests
|
||||
|
||||
- name: Build tests
|
||||
run: |
|
||||
cd tests
|
||||
mkdir build
|
||||
cd build
|
||||
cmake .. -DCMAKE_C_COMPILER=${{ matrix.config.c }} -DCMAKE_CXX_COMPILER=${{ matrix.config.cpp }}
|
||||
make -j2
|
||||
cmake .. -DCMAKE_BUILD_TYPE=Release -DCMAKE_C_COMPILER=${{ matrix.config.c }} -DCMAKE_CXX_COMPILER=${{ matrix.config.cpp }} -DCMAKE_C_FLAGS='${{ matrix.config.flags }}' -DCMAKE_CXX_FLAGS='${{ matrix.config.flags }}' -DCMAKE_POLICY_VERSION_MINIMUM="3.5"
|
||||
make -j$(nproc) p2pool_tests
|
||||
|
||||
- name: Run tests
|
||||
run: cd tests/build && ./p2pool_tests
|
||||
run: |
|
||||
cd tests/build
|
||||
unxz *.xz
|
||||
./p2pool_tests
|
||||
|
||||
- name: Archive binary
|
||||
uses: actions/upload-artifact@v2
|
||||
uses: actions/upload-artifact@v4
|
||||
with:
|
||||
name: p2pool-${{ matrix.config.os }}
|
||||
name: p2pool-${{ matrix.config.os }}-${{ matrix.config.c }}
|
||||
path: build/p2pool
|
||||
|
||||
build-ubuntu-static-libs:
|
||||
|
||||
timeout-minutes: 60
|
||||
runs-on: ubuntu-22.04
|
||||
|
||||
strategy:
|
||||
matrix:
|
||||
config:
|
||||
- {flags: "-fuse-linker-plugin -ffunction-sections"}
|
||||
|
||||
steps:
|
||||
- name: Install dependencies
|
||||
run: |
|
||||
sudo add-apt-repository -y ppa:ubuntu-toolchain-r/test
|
||||
sudo apt update
|
||||
sudo apt install -y git build-essential cmake libgss-dev gcc-12 g++-12 xz-utils
|
||||
sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-12 100 --slave /usr/bin/g++ g++ /usr/bin/g++-12 --slave /usr/bin/gcov gcov /usr/bin/gcov-12
|
||||
|
||||
- name: Checkout repository
|
||||
uses: actions/checkout@v4
|
||||
with:
|
||||
submodules: recursive
|
||||
|
||||
- name: Build libcurl
|
||||
run: |
|
||||
cd external/src/curl
|
||||
cmake . -DCMAKE_BUILD_TYPE=Release -DCMAKE_C_FLAGS="-Os -flto=auto ${{ matrix.config.flags }}" -DBUILD_CURL_EXE=OFF -DBUILD_SHARED_LIBS=OFF -DCURL_DISABLE_INSTALL=ON -DCURL_ENABLE_EXPORT_TARGET=OFF -DCURL_DISABLE_HEADERS_API=ON -DCURL_DISABLE_BINDLOCAL=ON -DBUILD_LIBCURL_DOCS=OFF -DBUILD_MISC_DOCS=OFF -DENABLE_CURL_MANUAL=OFF -DCURL_ZLIB=OFF -DCURL_BROTLI=OFF -DCURL_ZSTD=OFF -DCURL_DISABLE_ALTSVC=ON -DCURL_DISABLE_COOKIES=ON -DCURL_DISABLE_DOH=ON -DCURL_DISABLE_GETOPTIONS=ON -DCURL_DISABLE_HSTS=ON -DCURL_DISABLE_LIBCURL_OPTION=ON -DCURL_DISABLE_MIME=ON -DCURL_DISABLE_NETRC=ON -DCURL_DISABLE_NTLM=ON -DCURL_DISABLE_PARSEDATE=ON -DCURL_DISABLE_PROGRESS_METER=ON -DCURL_DISABLE_SHUFFLE_DNS=ON -DCURL_DISABLE_SOCKETPAIR=ON -DCURL_DISABLE_VERBOSE_STRINGS=ON -DCURL_DISABLE_WEBSOCKETS=ON -DHTTP_ONLY=ON -DCURL_ENABLE_SSL=OFF -DUSE_LIBIDN2=OFF -DCURL_USE_LIBPSL=OFF -DCURL_USE_LIBSSH2=OFF -DENABLE_UNIX_SOCKETS=OFF -DCURL_DISABLE_TESTS=ON -DUSE_NGHTTP2=OFF -DBUILD_EXAMPLES=OFF -DP2POOL_BORINGSSL=ON -DCURL_DISABLE_SRP=ON -DCURL_DISABLE_AWS=ON -DCURL_DISABLE_BASIC_AUTH=ON -DCURL_DISABLE_BEARER_AUTH=ON -DCURL_DISABLE_KERBEROS_AUTH=ON -DCURL_DISABLE_NEGOTIATE_AUTH=ON -DOPENSSL_INCLUDE_DIR=../grpc/third_party/boringssl-with-bazel/src/include
|
||||
make -j$(nproc)
|
||||
|
||||
- name: Build libuv
|
||||
run: |
|
||||
cd external/src/libuv
|
||||
mkdir build
|
||||
cd build
|
||||
cmake .. -DCMAKE_BUILD_TYPE=Release -DCMAKE_C_FLAGS='-Os -flto=auto ${{ matrix.config.flags }}' -DBUILD_TESTING=OFF -DLIBUV_BUILD_SHARED=OFF
|
||||
make -j$(nproc)
|
||||
|
||||
- name: Build libzmq
|
||||
run: |
|
||||
cd external/src/libzmq
|
||||
mkdir build
|
||||
cd build
|
||||
cmake .. -DCMAKE_BUILD_TYPE=Release -DCMAKE_C_FLAGS='-Os -flto=auto ${{ matrix.config.flags }}' -DCMAKE_CXX_FLAGS='-Os -flto=auto ${{ matrix.config.flags }}' -DWITH_LIBSODIUM=OFF -DWITH_LIBBSD=OFF -DBUILD_TESTS=OFF -DWITH_DOCS=OFF -DENABLE_DRAFTS=OFF -DBUILD_SHARED=OFF -DCMAKE_POLICY_VERSION_MINIMUM="3.5"
|
||||
make -j$(nproc)
|
||||
|
||||
- name: Build p2pool
|
||||
run: |
|
||||
mkdir build
|
||||
cd build
|
||||
cmake .. -DCMAKE_BUILD_TYPE=Release -DCMAKE_C_FLAGS='${{ matrix.config.flags }} -Wl,-s -Wl,--gc-sections' -DCMAKE_CXX_FLAGS='${{ matrix.config.flags }} -Wl,-s -Wl,--gc-sections' -DSTATIC_LIBS=ON -DCMAKE_POLICY_VERSION_MINIMUM="3.5"
|
||||
make -j$(nproc) p2pool
|
||||
|
||||
- name: Run RandomX tests
|
||||
run: |
|
||||
cd build
|
||||
./p2pool --test
|
||||
make -j$(nproc) randomx-tests
|
||||
external/src/RandomX/randomx-tests
|
||||
|
||||
- name: Build tests
|
||||
run: |
|
||||
cd tests
|
||||
mkdir build
|
||||
cd build
|
||||
cmake .. -DCMAKE_BUILD_TYPE=Release -DCMAKE_C_FLAGS='${{ matrix.config.flags }} -Wl,-s -Wl,--gc-sections' -DCMAKE_CXX_FLAGS='${{ matrix.config.flags }} -Wl,-s -Wl,--gc-sections' -DSTATIC_LIBS=ON -DCMAKE_POLICY_VERSION_MINIMUM="3.5"
|
||||
make -j$(nproc) p2pool_tests
|
||||
|
||||
- name: Run tests
|
||||
run: |
|
||||
cd tests/build
|
||||
unxz *.xz
|
||||
./p2pool_tests
|
||||
|
||||
- name: Archive binary
|
||||
uses: actions/upload-artifact@v4
|
||||
with:
|
||||
name: p2pool-ubuntu-static-libs
|
||||
path: build/p2pool
|
||||
|
||||
build-ubuntu-aarch64:
|
||||
|
||||
timeout-minutes: 60
|
||||
runs-on: ${{ matrix.config.os }}
|
||||
|
||||
strategy:
|
||||
matrix:
|
||||
config:
|
||||
- {os: ubuntu-22.04-arm, flags: "-fuse-linker-plugin -ffunction-sections -mfix-cortex-a53-835769 -mfix-cortex-a53-843419"}
|
||||
|
||||
steps:
|
||||
- name: Install dependencies
|
||||
run: |
|
||||
sudo apt update
|
||||
sudo apt install -y git build-essential cmake xz-utils
|
||||
|
||||
- name: Checkout repository
|
||||
uses: actions/checkout@v4
|
||||
with:
|
||||
submodules: recursive
|
||||
|
||||
- name: Build libcurl
|
||||
run: |
|
||||
cd external/src/curl
|
||||
cmake . -DCMAKE_BUILD_TYPE=Release -DCMAKE_C_FLAGS="-Os -flto=auto ${{ matrix.config.flags }}" -DBUILD_CURL_EXE=OFF -DBUILD_SHARED_LIBS=OFF -DCURL_DISABLE_INSTALL=ON -DCURL_ENABLE_EXPORT_TARGET=OFF -DCURL_DISABLE_HEADERS_API=ON -DCURL_DISABLE_BINDLOCAL=ON -DBUILD_LIBCURL_DOCS=OFF -DBUILD_MISC_DOCS=OFF -DENABLE_CURL_MANUAL=OFF -DCURL_ZLIB=OFF -DCURL_BROTLI=OFF -DCURL_ZSTD=OFF -DCURL_DISABLE_ALTSVC=ON -DCURL_DISABLE_COOKIES=ON -DCURL_DISABLE_DOH=ON -DCURL_DISABLE_GETOPTIONS=ON -DCURL_DISABLE_HSTS=ON -DCURL_DISABLE_LIBCURL_OPTION=ON -DCURL_DISABLE_MIME=ON -DCURL_DISABLE_NETRC=ON -DCURL_DISABLE_NTLM=ON -DCURL_DISABLE_PARSEDATE=ON -DCURL_DISABLE_PROGRESS_METER=ON -DCURL_DISABLE_SHUFFLE_DNS=ON -DCURL_DISABLE_SOCKETPAIR=ON -DCURL_DISABLE_VERBOSE_STRINGS=ON -DCURL_DISABLE_WEBSOCKETS=ON -DHTTP_ONLY=ON -DCURL_ENABLE_SSL=OFF -DUSE_LIBIDN2=OFF -DCURL_USE_LIBPSL=OFF -DCURL_USE_LIBSSH2=OFF -DENABLE_UNIX_SOCKETS=OFF -DCURL_DISABLE_TESTS=ON -DUSE_NGHTTP2=OFF -DBUILD_EXAMPLES=OFF -DP2POOL_BORINGSSL=ON -DCURL_DISABLE_SRP=ON -DCURL_DISABLE_AWS=ON -DCURL_DISABLE_BASIC_AUTH=ON -DCURL_DISABLE_BEARER_AUTH=ON -DCURL_DISABLE_KERBEROS_AUTH=ON -DCURL_DISABLE_NEGOTIATE_AUTH=ON -DOPENSSL_INCLUDE_DIR=../grpc/third_party/boringssl-with-bazel/src/include
|
||||
make -j$(nproc)
|
||||
|
||||
- name: Build libuv
|
||||
run: |
|
||||
cd external/src/libuv
|
||||
mkdir build
|
||||
cd build
|
||||
cmake .. -DCMAKE_BUILD_TYPE=Release -DCMAKE_C_FLAGS='-Os -flto=auto ${{ matrix.config.flags }}' -DBUILD_TESTING=OFF -DLIBUV_BUILD_SHARED=OFF
|
||||
make -j$(nproc)
|
||||
|
||||
- name: Build libzmq
|
||||
run: |
|
||||
cd external/src/libzmq
|
||||
mkdir build
|
||||
cd build
|
||||
cmake .. -DCMAKE_BUILD_TYPE=Release -DCMAKE_C_FLAGS='-Os -flto=auto ${{ matrix.config.flags }}' -DCMAKE_CXX_FLAGS='-Os -flto=auto ${{ matrix.config.flags }}' -DWITH_LIBSODIUM=OFF -DWITH_LIBBSD=OFF -DBUILD_TESTS=OFF -DWITH_DOCS=OFF -DENABLE_DRAFTS=OFF -DBUILD_SHARED=OFF -DCMAKE_POLICY_VERSION_MINIMUM="3.5"
|
||||
make -j$(nproc)
|
||||
|
||||
- name: Build p2pool
|
||||
run: |
|
||||
mkdir build
|
||||
cd build
|
||||
cmake .. -DCMAKE_BUILD_TYPE=Release -DCMAKE_C_FLAGS='${{ matrix.config.flags }} -Wl,-s -Wl,--gc-sections' -DCMAKE_CXX_FLAGS='${{ matrix.config.flags }} -Wl,-s -Wl,--gc-sections' -DSTATIC_LIBS=ON -DARCH_ID=aarch64 -DCMAKE_POLICY_VERSION_MINIMUM="3.5"
|
||||
make -j$(nproc) p2pool
|
||||
|
||||
- name: Run RandomX tests
|
||||
run: |
|
||||
cd build
|
||||
./p2pool --test
|
||||
make -j$(nproc) randomx-tests
|
||||
external/src/RandomX/randomx-tests
|
||||
|
||||
- name: Build tests
|
||||
run: |
|
||||
cd tests
|
||||
mkdir build
|
||||
cd build
|
||||
cmake .. -DCMAKE_BUILD_TYPE=Release -DCMAKE_C_FLAGS='${{ matrix.config.flags }} -Wl,-s -Wl,--gc-sections' -DCMAKE_CXX_FLAGS='${{ matrix.config.flags }} -Wl,-s -Wl,--gc-sections' -DSTATIC_LIBS=ON -DARCH_ID=aarch64 -DCMAKE_POLICY_VERSION_MINIMUM="3.5"
|
||||
make -j$(nproc) p2pool_tests
|
||||
|
||||
- name: Run tests
|
||||
run: |
|
||||
cd tests/build
|
||||
unxz *.xz
|
||||
./p2pool_tests
|
||||
|
||||
- name: Archive binary
|
||||
uses: actions/upload-artifact@v4
|
||||
with:
|
||||
name: p2pool-${{ matrix.config.os }}-aarch64
|
||||
path: build/p2pool
|
||||
|
||||
build-ubuntu-riscv64:
|
||||
|
||||
timeout-minutes: 60
|
||||
runs-on: ${{ matrix.config.os }}
|
||||
|
||||
strategy:
|
||||
matrix:
|
||||
config:
|
||||
- {os: ubuntu-22.04, flags: "-fuse-linker-plugin -ffunction-sections"}
|
||||
|
||||
steps:
|
||||
- name: Setup Alpine Linux
|
||||
uses: jirutka/setup-alpine@v1
|
||||
with:
|
||||
arch: riscv64
|
||||
branch: latest-stable
|
||||
|
||||
- name: Install dependencies
|
||||
run: |
|
||||
sudo apt update
|
||||
sudo apt install -y git build-essential cmake gcc-riscv64-linux-gnu g++-riscv64-linux-gnu binutils-riscv64-linux-gnu xz-utils
|
||||
sudo cp /usr/riscv64-linux-gnu/lib/* /home/runner/rootfs/alpine-latest-riscv64/lib
|
||||
|
||||
- name: Checkout repository
|
||||
uses: actions/checkout@v4
|
||||
with:
|
||||
submodules: recursive
|
||||
|
||||
- name: Build libcurl
|
||||
run: |
|
||||
cd external/src/curl
|
||||
cmake . -DCMAKE_BUILD_TYPE=Release -DCMAKE_TOOLCHAIN_FILE=../../../cmake/riscv64_toolchain.cmake -DCMAKE_C_FLAGS="-Os -flto=auto ${{ matrix.config.flags }}" -DBUILD_CURL_EXE=OFF -DBUILD_SHARED_LIBS=OFF -DCURL_DISABLE_INSTALL=ON -DCURL_ENABLE_EXPORT_TARGET=OFF -DCURL_DISABLE_HEADERS_API=ON -DCURL_DISABLE_BINDLOCAL=ON -DBUILD_LIBCURL_DOCS=OFF -DBUILD_MISC_DOCS=OFF -DENABLE_CURL_MANUAL=OFF -DCURL_ZLIB=OFF -DCURL_BROTLI=OFF -DCURL_ZSTD=OFF -DCURL_DISABLE_ALTSVC=ON -DCURL_DISABLE_COOKIES=ON -DCURL_DISABLE_DOH=ON -DCURL_DISABLE_GETOPTIONS=ON -DCURL_DISABLE_HSTS=ON -DCURL_DISABLE_LIBCURL_OPTION=ON -DCURL_DISABLE_MIME=ON -DCURL_DISABLE_NETRC=ON -DCURL_DISABLE_NTLM=ON -DCURL_DISABLE_PARSEDATE=ON -DCURL_DISABLE_PROGRESS_METER=ON -DCURL_DISABLE_SHUFFLE_DNS=ON -DCURL_DISABLE_SOCKETPAIR=ON -DCURL_DISABLE_VERBOSE_STRINGS=ON -DCURL_DISABLE_WEBSOCKETS=ON -DHTTP_ONLY=ON -DCURL_ENABLE_SSL=OFF -DUSE_LIBIDN2=OFF -DCURL_USE_LIBPSL=OFF -DCURL_USE_LIBSSH2=OFF -DENABLE_UNIX_SOCKETS=OFF -DCURL_DISABLE_TESTS=ON -DUSE_NGHTTP2=OFF -DBUILD_EXAMPLES=OFF -DP2POOL_BORINGSSL=ON -DCURL_DISABLE_SRP=ON -DCURL_DISABLE_AWS=ON -DCURL_DISABLE_BASIC_AUTH=ON -DCURL_DISABLE_BEARER_AUTH=ON -DCURL_DISABLE_KERBEROS_AUTH=ON -DCURL_DISABLE_NEGOTIATE_AUTH=ON -DOPENSSL_INCLUDE_DIR=../grpc/third_party/boringssl-with-bazel/src/include
|
||||
make -j$(nproc)
|
||||
|
||||
- name: Build libuv
|
||||
run: |
|
||||
cd external/src/libuv
|
||||
mkdir build
|
||||
cd build
|
||||
cmake .. -DCMAKE_BUILD_TYPE=Release -DCMAKE_TOOLCHAIN_FILE=../../../cmake/riscv64_toolchain.cmake -DCMAKE_C_FLAGS='-Os -flto=auto ${{ matrix.config.flags }}' -DBUILD_TESTING=OFF -DLIBUV_BUILD_SHARED=OFF
|
||||
make -j$(nproc)
|
||||
|
||||
- name: Build libzmq
|
||||
run: |
|
||||
cd external/src/libzmq
|
||||
mkdir build
|
||||
cd build
|
||||
cmake .. -DCMAKE_BUILD_TYPE=Release -DCMAKE_TOOLCHAIN_FILE=../../../cmake/riscv64_toolchain.cmake -DCMAKE_C_FLAGS='-Os -flto=auto ${{ matrix.config.flags }}' -DCMAKE_CXX_FLAGS='-Os -flto=auto ${{ matrix.config.flags }}' -DWITH_LIBSODIUM=OFF -DWITH_LIBBSD=OFF -DBUILD_TESTS=OFF -DWITH_DOCS=OFF -DENABLE_DRAFTS=OFF -DBUILD_SHARED=OFF -DCMAKE_POLICY_VERSION_MINIMUM="3.5"
|
||||
make -j$(nproc)
|
||||
|
||||
- name: Build p2pool
|
||||
run: |
|
||||
mkdir build
|
||||
cd build
|
||||
cmake .. -DCMAKE_BUILD_TYPE=Release -DCMAKE_TOOLCHAIN_FILE=../cmake/riscv64_toolchain.cmake -DCMAKE_C_FLAGS='${{ matrix.config.flags }} -Wl,-s -Wl,--gc-sections' -DCMAKE_CXX_FLAGS='${{ matrix.config.flags }} -Wl,-s -Wl,--gc-sections' -DSTATIC_LIBS=ON -DARCH_ID=riscv64 -DCMAKE_POLICY_VERSION_MINIMUM="3.5"
|
||||
make -j$(nproc) p2pool
|
||||
|
||||
- name: Run self-test
|
||||
shell: alpine.sh {0}
|
||||
run: build/p2pool --test
|
||||
|
||||
- name: Build RandomX tests
|
||||
run: |
|
||||
cd build
|
||||
make -j$(nproc) randomx-tests
|
||||
|
||||
- name: Run RandomX tests
|
||||
shell: alpine.sh {0}
|
||||
run: build/external/src/RandomX/randomx-tests
|
||||
|
||||
- name: Build tests
|
||||
run: |
|
||||
cd tests
|
||||
mkdir build
|
||||
cd build
|
||||
cmake .. -DCMAKE_BUILD_TYPE=Release -DCMAKE_TOOLCHAIN_FILE=../../cmake/riscv64_toolchain.cmake -DCMAKE_C_FLAGS='${{ matrix.config.flags }} -Wl,-s -Wl,--gc-sections' -DCMAKE_CXX_FLAGS='${{ matrix.config.flags }} -Wl,-s -Wl,--gc-sections' -DSTATIC_LIBS=ON -DARCH_ID=riscv64 -DCMAKE_POLICY_VERSION_MINIMUM="3.5"
|
||||
make -j$(nproc) p2pool_tests
|
||||
|
||||
- name: Prepare test data
|
||||
run: |
|
||||
cd tests/build
|
||||
unxz *.xz
|
||||
|
||||
- name: Run tests
|
||||
shell: alpine.sh {0}
|
||||
run: |
|
||||
cd tests/build
|
||||
./p2pool_tests
|
||||
|
||||
- name: Archive binary
|
||||
uses: actions/upload-artifact@v4
|
||||
with:
|
||||
name: p2pool-${{ matrix.config.os }}-riscv64
|
||||
path: build/p2pool
|
||||
|
||||
build-windows-msys2:
|
||||
|
||||
timeout-minutes: 60
|
||||
runs-on: windows-latest
|
||||
|
||||
strategy:
|
||||
matrix:
|
||||
config:
|
||||
- {c: "gcc", cxx: "g++", flags: "-ffunction-sections -Wno-error=maybe-uninitialized -Wno-error=attributes -Wno-unknown-attributes"}
|
||||
- {c: "clang", cxx: "clang++", flags: "-fuse-ld=lld -Wno-unused-command-line-argument -Wno-nan-infinity-disabled -Wno-unknown-attributes"}
|
||||
|
||||
defaults:
|
||||
run:
|
||||
shell: msys2 {0}
|
||||
|
||||
steps:
|
||||
- name: Checkout repository
|
||||
uses: actions/checkout@v2
|
||||
uses: actions/checkout@v4
|
||||
with:
|
||||
submodules: recursive
|
||||
|
||||
@@ -71,103 +446,230 @@ jobs:
|
||||
uses: eine/setup-msys2@v2
|
||||
with:
|
||||
update: true
|
||||
install: mingw-w64-x86_64-toolchain make mingw-w64-x86_64-cmake mingw-w64-x86_64-zeromq mingw-w64-x86_64-libsodium mingw-w64-x86_64-libuv
|
||||
install: mingw-w64-x86_64-toolchain mingw-w64-x86_64-clang mingw-w64-x86_64-lld mingw-w64-x86_64-cmake make git
|
||||
|
||||
- name: Build p2pool
|
||||
- name: Apply patch
|
||||
run: |
|
||||
mkdir build
|
||||
cd build
|
||||
cmake .. -G "Unix Makefiles"
|
||||
make -j2
|
||||
git apply --verbose --ignore-whitespace --directory=external/src/grpc/third_party/protobuf patches/protobuf/protobuf.patch
|
||||
|
||||
- name: Build tests
|
||||
- name: Build libcurl
|
||||
run: |
|
||||
cd tests
|
||||
mkdir build
|
||||
cd build
|
||||
cmake .. -G "Unix Makefiles"
|
||||
make -j2
|
||||
|
||||
- name: Run tests
|
||||
run: |
|
||||
cd tests/build
|
||||
./p2pool_tests.exe
|
||||
|
||||
- name: Archive binary
|
||||
uses: actions/upload-artifact@v2
|
||||
with:
|
||||
name: p2pool-msys2.exe
|
||||
path: build/p2pool.exe
|
||||
|
||||
build-windows-msbuild:
|
||||
|
||||
runs-on: windows-${{ matrix.config.os }}
|
||||
|
||||
strategy:
|
||||
matrix:
|
||||
config:
|
||||
- {vs: Visual Studio 16 2019, os: 2019, msbuild: "C:\\Program Files (x86)\\Microsoft Visual Studio\\2019\\Enterprise\\MSBuild\\Current\\Bin\\amd64\\", rx: "ON"}
|
||||
- {vs: Visual Studio 17 2022, os: 2022, msbuild: "C:\\Program Files\\Microsoft Visual Studio\\2022\\Enterprise\\Msbuild\\Current\\Bin\\amd64\\", rx: "ON"}
|
||||
- {vs: Visual Studio 17 2022, os: 2022, msbuild: "C:\\Program Files\\Microsoft Visual Studio\\2022\\Enterprise\\Msbuild\\Current\\Bin\\amd64\\", rx: "OFF"}
|
||||
|
||||
steps:
|
||||
- name: Checkout repository
|
||||
uses: actions/checkout@v2
|
||||
with:
|
||||
submodules: recursive
|
||||
|
||||
- name: Setup cmake
|
||||
uses: lukka/get-cmake@latest
|
||||
|
||||
- name: Build p2pool
|
||||
run: |
|
||||
mkdir build
|
||||
cd build
|
||||
cmake .. -G "${{ matrix.config.vs }}" -DWITH_RANDOMX=${{ matrix.config.rx }}
|
||||
& "${{ matrix.config.msbuild }}msbuild" /m /p:Configuration=Release p2pool.vcxproj
|
||||
|
||||
- name: Build tests
|
||||
run: |
|
||||
cd tests
|
||||
mkdir build
|
||||
cd build
|
||||
cmake .. -G "${{ matrix.config.vs }}"
|
||||
& "${{ matrix.config.msbuild }}msbuild" /m /p:Configuration=Release p2pool_tests.vcxproj
|
||||
|
||||
- name: Run tests
|
||||
run: |
|
||||
cd tests/build/Release
|
||||
./p2pool_tests.exe
|
||||
|
||||
- name: Archive binary
|
||||
uses: actions/upload-artifact@v2
|
||||
with:
|
||||
name: p2pool-msbuild-${{ matrix.config.os }}-randomx-${{ matrix.config.rx }}.exe
|
||||
path: build/Release/p2pool.exe
|
||||
|
||||
build-macos:
|
||||
|
||||
runs-on: ${{ matrix.os }}
|
||||
|
||||
strategy:
|
||||
matrix:
|
||||
os: [macos-10.15, macos-11]
|
||||
|
||||
steps:
|
||||
- name: Checkout repository
|
||||
uses: actions/checkout@v2
|
||||
with:
|
||||
submodules: recursive
|
||||
|
||||
- name: Install dependencies
|
||||
run: HOMEBREW_NO_AUTO_UPDATE=1 brew install cmake
|
||||
cd external/src/curl
|
||||
cmake . -DCMAKE_BUILD_TYPE=Release -G "Unix Makefiles" -DCMAKE_C_COMPILER=${{ matrix.config.c }} -DCMAKE_C_FLAGS="-Os ${{ matrix.config.flags }}" -DCURL_TARGET_WINDOWS_VERSION=0x0600 -DBUILD_CURL_EXE=OFF -DBUILD_SHARED_LIBS=OFF -DCURL_DISABLE_INSTALL=ON -DCURL_ENABLE_EXPORT_TARGET=OFF -DCURL_DISABLE_HEADERS_API=ON -DCURL_DISABLE_BINDLOCAL=ON -DBUILD_LIBCURL_DOCS=OFF -DBUILD_MISC_DOCS=OFF -DENABLE_CURL_MANUAL=OFF -DCURL_ZLIB=OFF -DCURL_BROTLI=OFF -DCURL_ZSTD=OFF -DCURL_DISABLE_ALTSVC=ON -DCURL_DISABLE_COOKIES=ON -DCURL_DISABLE_DOH=ON -DCURL_DISABLE_GETOPTIONS=ON -DCURL_DISABLE_HSTS=ON -DCURL_DISABLE_LIBCURL_OPTION=ON -DCURL_DISABLE_MIME=ON -DCURL_DISABLE_NETRC=ON -DCURL_DISABLE_NTLM=ON -DCURL_DISABLE_PARSEDATE=ON -DCURL_DISABLE_PROGRESS_METER=ON -DCURL_DISABLE_SHUFFLE_DNS=ON -DCURL_DISABLE_SOCKETPAIR=ON -DCURL_DISABLE_VERBOSE_STRINGS=ON -DCURL_DISABLE_WEBSOCKETS=ON -DHTTP_ONLY=ON -DCURL_ENABLE_SSL=OFF -DUSE_LIBIDN2=OFF -DCURL_USE_LIBPSL=OFF -DCURL_USE_LIBSSH2=OFF -DENABLE_UNIX_SOCKETS=OFF -DCURL_DISABLE_TESTS=ON -DUSE_NGHTTP2=OFF -DBUILD_EXAMPLES=OFF -DP2POOL_BORINGSSL=ON -DCURL_DISABLE_SRP=ON -DCURL_DISABLE_AWS=ON -DCURL_DISABLE_BASIC_AUTH=ON -DCURL_DISABLE_BEARER_AUTH=ON -DCURL_DISABLE_KERBEROS_AUTH=ON -DCURL_DISABLE_NEGOTIATE_AUTH=ON -DOPENSSL_INCLUDE_DIR=../grpc/third_party/boringssl-with-bazel/src/include
|
||||
make -j$(nproc)
|
||||
|
||||
- name: Build libuv
|
||||
run: |
|
||||
cd external/src/libuv
|
||||
mkdir build
|
||||
cd build
|
||||
cmake ..
|
||||
cmake .. -DCMAKE_BUILD_TYPE=Release -G "Unix Makefiles" -DCMAKE_C_COMPILER=${{ matrix.config.c }} -DCMAKE_C_FLAGS='-Os ${{ matrix.config.flags }}' -DBUILD_TESTING=OFF -DLIBUV_BUILD_SHARED=OFF
|
||||
make -j$(nproc)
|
||||
|
||||
- name: Build libzmq
|
||||
run: |
|
||||
cd external/src/libzmq
|
||||
mkdir build
|
||||
cd build
|
||||
cmake .. -DCMAKE_BUILD_TYPE=Release -G "Unix Makefiles" -DCMAKE_C_COMPILER=${{ matrix.config.c }} -DCMAKE_CXX_COMPILER=${{ matrix.config.cxx }} -DCMAKE_C_FLAGS='-Os ${{ matrix.config.flags }}' -DCMAKE_CXX_FLAGS='-Os ${{ matrix.config.flags }}' -DWITH_LIBSODIUM=OFF -DWITH_LIBBSD=OFF -DBUILD_TESTS=OFF -DZMQ_HAVE_IPC=OFF -DWITH_DOCS=OFF -DENABLE_DRAFTS=OFF -DBUILD_SHARED=OFF -DCMAKE_POLICY_VERSION_MINIMUM="3.5"
|
||||
make -j$(nproc)
|
||||
|
||||
- name: Build p2pool
|
||||
run: |
|
||||
mkdir build
|
||||
cd build
|
||||
cmake .. -DCMAKE_BUILD_TYPE=Release -G "Unix Makefiles" -DCMAKE_C_COMPILER=${{ matrix.config.c }} -DCMAKE_CXX_COMPILER=${{ matrix.config.cxx }} -DCMAKE_C_FLAGS="${{ matrix.config.flags }} -Wl,-s -Wl,--gc-sections" -DCMAKE_CXX_FLAGS="${{ matrix.config.flags }} -Wl,-s -Wl,--gc-sections" -DSTATIC_LIBS=ON -DOPENSSL_NO_ASM=ON -DWITH_LTO=OFF -DCMAKE_POLICY_VERSION_MINIMUM="3.5"
|
||||
make -j$(nproc) p2pool
|
||||
|
||||
- name: Run RandomX tests
|
||||
run: |
|
||||
cd build
|
||||
./p2pool.exe --test
|
||||
make -j$(nproc) randomx-tests
|
||||
external/src/RandomX/randomx-tests.exe
|
||||
|
||||
- name: Build tests
|
||||
run: |
|
||||
cd tests
|
||||
mkdir build
|
||||
cd build
|
||||
cmake .. -DCMAKE_BUILD_TYPE=Release -G "Unix Makefiles" -DCMAKE_C_COMPILER=${{ matrix.config.c }} -DCMAKE_CXX_COMPILER=${{ matrix.config.cxx }} -DCMAKE_C_FLAGS="${{ matrix.config.flags }} -Wl,-s -Wl,--gc-sections" -DCMAKE_CXX_FLAGS="${{ matrix.config.flags }} -Wl,-s -Wl,--gc-sections" -DSTATIC_LIBS=ON -DOPENSSL_NO_ASM=ON
|
||||
make -j$(nproc) p2pool_tests
|
||||
|
||||
- name: Run tests
|
||||
run: |
|
||||
cd tests/build
|
||||
unxz *.xz
|
||||
./p2pool_tests.exe
|
||||
|
||||
- name: Archive binary
|
||||
uses: actions/upload-artifact@v4
|
||||
with:
|
||||
name: p2pool-msys2-${{ matrix.config.c }}.exe
|
||||
path: build/p2pool.exe
|
||||
|
||||
build-windows-msbuild:
|
||||
|
||||
timeout-minutes: 60
|
||||
runs-on: windows-${{ matrix.config.os }}
|
||||
|
||||
strategy:
|
||||
matrix:
|
||||
config:
|
||||
- {vs: Visual Studio 17 2022, os: 2022, vspath: "C:\\Program Files\\Microsoft Visual Studio\\2022\\Enterprise", rx: "ON", upnp: "ON", grpc: "ON", tls: "ON"}
|
||||
- {vs: Visual Studio 17 2022, os: 2022, vspath: "C:\\Program Files\\Microsoft Visual Studio\\2022\\Enterprise", rx: "ON", upnp: "ON", grpc: "OFF", tls: "ON"}
|
||||
- {vs: Visual Studio 17 2022, os: 2022, vspath: "C:\\Program Files\\Microsoft Visual Studio\\2022\\Enterprise", rx: "OFF", upnp: "ON", grpc: "OFF", tls: "ON"}
|
||||
- {vs: Visual Studio 17 2022, os: 2022, vspath: "C:\\Program Files\\Microsoft Visual Studio\\2022\\Enterprise", rx: "OFF", upnp: "OFF", grpc: "OFF", tls: "ON"}
|
||||
- {vs: Visual Studio 17 2022, os: 2022, vspath: "C:\\Program Files\\Microsoft Visual Studio\\2022\\Enterprise", rx: "OFF", upnp: "OFF", grpc: "OFF", tls: "OFF"}
|
||||
|
||||
steps:
|
||||
- name: Checkout repository
|
||||
uses: actions/checkout@v4
|
||||
with:
|
||||
submodules: recursive
|
||||
|
||||
- name: Setup cmake
|
||||
uses: lukka/get-cmake@latest
|
||||
|
||||
- name: Apply patch
|
||||
run: |
|
||||
git apply --verbose --ignore-whitespace --directory=external/src/grpc/third_party/boringssl-with-bazel patches/boringssl/win7.patch
|
||||
|
||||
- name: Build p2pool
|
||||
run: |
|
||||
mkdir build
|
||||
cd build
|
||||
cmake .. -G "${{ matrix.config.vs }}" -DCMAKE_SYSTEM_VERSION="10.0" -DWITH_RANDOMX=${{ matrix.config.rx }} -DWITH_UPNP=${{ matrix.config.upnp }} -DWITH_GRPC=${{ matrix.config.grpc }} -DWITH_TLS=${{ matrix.config.tls }} -DCMAKE_POLICY_VERSION_MINIMUM="3.5"
|
||||
& "${{ matrix.config.vspath }}\\MSBuild\\Current\\Bin\\amd64\\msbuild" -v:m /m /p:Configuration=Release p2pool.vcxproj
|
||||
|
||||
- name: Check Windows 7 compatibility
|
||||
shell: cmd
|
||||
run: |
|
||||
call "${{ matrix.config.vspath }}\\VC\\Auxiliary\\Build\\vcvarsall.bat" amd64
|
||||
dumpbin /IMPORTS build/Release/p2pool.exe > 1.txt
|
||||
findstr /R /C:"^ *[0-9A-F][0-9A-F]* [a-zA-Z][a-zA-Z0-9]*$" 1.txt > 2.txt
|
||||
python tests/src/check_win7.py 2.txt
|
||||
|
||||
- name: Run RandomX tests
|
||||
if: matrix.config.rx == 'ON'
|
||||
run: |
|
||||
build/Release/p2pool.exe --test
|
||||
cd build/external/src/RandomX
|
||||
& "${{ matrix.config.vspath }}\\MSBuild\\Current\\Bin\\amd64\\msbuild" -v:m /m /p:Configuration=Release randomx-tests.vcxproj
|
||||
Release/randomx-tests.exe
|
||||
|
||||
- name: Build tests
|
||||
run: |
|
||||
cd tests
|
||||
mkdir build
|
||||
cd build
|
||||
cmake .. -G "${{ matrix.config.vs }}" -DCMAKE_SYSTEM_VERSION="10.0" -DDEV_WITH_ASAN=ON -DCMAKE_POLICY_VERSION_MINIMUM="3.5"
|
||||
& "${{ matrix.config.vspath }}\\MSBuild\\Current\\Bin\\amd64\\msbuild" -v:m /m /p:Configuration=Debug p2pool_tests.vcxproj
|
||||
|
||||
- name: Run tests
|
||||
shell: cmd
|
||||
run: |
|
||||
cd tests/build/Debug
|
||||
7z x *.xz
|
||||
call "${{ matrix.config.vspath }}\\VC\\Auxiliary\\Build\\vcvarsall.bat" amd64
|
||||
p2pool_tests.exe
|
||||
|
||||
- name: Archive binary
|
||||
uses: actions/upload-artifact@v4
|
||||
with:
|
||||
name: p2pool-vs-${{ matrix.config.os }}-randomx-${{ matrix.config.rx }}-upnp-${{ matrix.config.upnp }}-grpc-${{ matrix.config.grpc }}-tls-${{ matrix.config.tls }}.exe
|
||||
path: build/Release/p2pool.exe
|
||||
|
||||
build-macos:
|
||||
|
||||
timeout-minutes: 60
|
||||
runs-on: macos-13
|
||||
|
||||
steps:
|
||||
- name: Checkout repository
|
||||
uses: actions/checkout@v4
|
||||
with:
|
||||
submodules: recursive
|
||||
|
||||
- name: Build libcurl
|
||||
run: |
|
||||
cd external/src/curl
|
||||
cmake . -DCMAKE_BUILD_TYPE=Release -DCMAKE_C_COMPILER="$(brew --prefix llvm@15)/bin/clang" -DCMAKE_AR="$(brew --prefix llvm@15)/bin/llvm-ar" -DCMAKE_RANLIB="$(brew --prefix llvm@15)/bin/llvm-ranlib" -DCMAKE_C_FLAGS="-Os -flto -target x86_64-apple-macos10.13 -Wno-overriding-t-option" -DBUILD_CURL_EXE=OFF -DBUILD_SHARED_LIBS=OFF -DCURL_DISABLE_INSTALL=ON -DCURL_ENABLE_EXPORT_TARGET=OFF -DCURL_DISABLE_HEADERS_API=ON -DCURL_DISABLE_BINDLOCAL=ON -DBUILD_LIBCURL_DOCS=OFF -DBUILD_MISC_DOCS=OFF -DENABLE_CURL_MANUAL=OFF -DCURL_ZLIB=OFF -DCURL_BROTLI=OFF -DCURL_ZSTD=OFF -DCURL_DISABLE_ALTSVC=ON -DCURL_DISABLE_COOKIES=ON -DCURL_DISABLE_DOH=ON -DCURL_DISABLE_GETOPTIONS=ON -DCURL_DISABLE_HSTS=ON -DCURL_DISABLE_LIBCURL_OPTION=ON -DCURL_DISABLE_MIME=ON -DCURL_DISABLE_NETRC=ON -DCURL_DISABLE_NTLM=ON -DCURL_DISABLE_PARSEDATE=ON -DCURL_DISABLE_PROGRESS_METER=ON -DCURL_DISABLE_SHUFFLE_DNS=ON -DCURL_DISABLE_SOCKETPAIR=ON -DCURL_DISABLE_VERBOSE_STRINGS=ON -DCURL_DISABLE_WEBSOCKETS=ON -DHTTP_ONLY=ON -DCURL_ENABLE_SSL=OFF -DUSE_LIBIDN2=OFF -DCURL_USE_LIBPSL=OFF -DCURL_USE_LIBSSH2=OFF -DENABLE_UNIX_SOCKETS=OFF -DCURL_DISABLE_TESTS=ON -DUSE_NGHTTP2=OFF -DBUILD_EXAMPLES=OFF -DP2POOL_BORINGSSL=ON -DCURL_DISABLE_SRP=ON -DCURL_DISABLE_AWS=ON -DCURL_DISABLE_BASIC_AUTH=ON -DCURL_DISABLE_BEARER_AUTH=ON -DCURL_DISABLE_KERBEROS_AUTH=ON -DCURL_DISABLE_NEGOTIATE_AUTH=ON -DOPENSSL_INCLUDE_DIR=../grpc/third_party/boringssl-with-bazel/src/include
|
||||
make -j4
|
||||
|
||||
- name: Build libuv
|
||||
run: |
|
||||
cd external/src/libuv
|
||||
mkdir build
|
||||
cd build
|
||||
cmake .. -DCMAKE_BUILD_TYPE=Release -DCMAKE_C_COMPILER="$(brew --prefix llvm@15)/bin/clang" -DCMAKE_AR="$(brew --prefix llvm@15)/bin/llvm-ar" -DCMAKE_RANLIB="$(brew --prefix llvm@15)/bin/llvm-ranlib" -DCMAKE_C_FLAGS='-Os -flto -target x86_64-apple-macos10.13 -Wno-overriding-t-option' -DBUILD_TESTING=OFF -DLIBUV_BUILD_SHARED=OFF
|
||||
make -j4
|
||||
|
||||
- name: Build libzmq
|
||||
run: |
|
||||
cd external/src/libzmq
|
||||
mkdir build
|
||||
cd build
|
||||
cmake .. -DCMAKE_BUILD_TYPE=Release -DCMAKE_C_COMPILER="$(brew --prefix llvm@15)/bin/clang" -DCMAKE_CXX_COMPILER="$(brew --prefix llvm@15)/bin/clang++" -DCMAKE_AR="$(brew --prefix llvm@15)/bin/llvm-ar" -DCMAKE_RANLIB="$(brew --prefix llvm@15)/bin/llvm-ranlib" -DCMAKE_C_FLAGS='-Os -flto -target x86_64-apple-macos10.13 -Wno-overriding-t-option' -DCMAKE_CXX_FLAGS='-Os -flto -target x86_64-apple-macos10.13 -Wno-overriding-t-option' -DWITH_LIBSODIUM=OFF -DWITH_LIBBSD=OFF -DBUILD_TESTS=OFF -DWITH_DOCS=OFF -DENABLE_DRAFTS=OFF -DBUILD_SHARED=OFF
|
||||
make -j4
|
||||
|
||||
- name: Build p2pool
|
||||
run: |
|
||||
mkdir build
|
||||
cd build
|
||||
cmake .. -DCMAKE_BUILD_TYPE=Release -DCMAKE_C_COMPILER="$(brew --prefix llvm@15)/bin/clang" -DCMAKE_CXX_COMPILER="$(brew --prefix llvm@15)/bin/clang++" -DCMAKE_AR="$(brew --prefix llvm@15)/bin/llvm-ar" -DCMAKE_RANLIB="$(brew --prefix llvm@15)/bin/llvm-ranlib" -DCMAKE_C_FLAGS='-flto -target x86_64-apple-macos10.13 -Wno-overriding-t-option' -DCMAKE_CXX_FLAGS='-flto -target x86_64-apple-macos10.13 -Wno-overriding-t-option' -DCMAKE_ASM_FLAGS='-target x86_64-apple-macos10.13' -DSTATIC_LIBS=ON
|
||||
make -j4 p2pool
|
||||
|
||||
- name: Run RandomX tests
|
||||
run: |
|
||||
cd build
|
||||
./p2pool --test
|
||||
make -j4 randomx-tests
|
||||
external/src/RandomX/randomx-tests
|
||||
|
||||
- name: Build tests
|
||||
run: |
|
||||
cd tests
|
||||
mkdir build
|
||||
cd build
|
||||
cmake .. -DCMAKE_BUILD_TYPE=Release -DCMAKE_C_COMPILER="$(brew --prefix llvm@15)/bin/clang" -DCMAKE_CXX_COMPILER="$(brew --prefix llvm@15)/bin/clang++" -DCMAKE_AR="$(brew --prefix llvm@15)/bin/llvm-ar" -DCMAKE_RANLIB="$(brew --prefix llvm@15)/bin/llvm-ranlib" -DCMAKE_C_FLAGS='-flto -target x86_64-apple-macos10.13 -Wno-overriding-t-option' -DCMAKE_CXX_FLAGS='-flto -target x86_64-apple-macos10.13 -Wno-overriding-t-option' -DCMAKE_ASM_FLAGS='-target x86_64-apple-macos10.13' -DSTATIC_LIBS=ON
|
||||
make -j4 p2pool_tests
|
||||
|
||||
- name: Run tests
|
||||
run: |
|
||||
cd tests/build
|
||||
unxz *.xz
|
||||
./p2pool_tests
|
||||
|
||||
- name: Archive binary
|
||||
uses: actions/upload-artifact@v4
|
||||
with:
|
||||
name: p2pool-macos-13
|
||||
path: build/p2pool
|
||||
|
||||
build-macos-aarch64:
|
||||
|
||||
timeout-minutes: 30
|
||||
runs-on: macos-14
|
||||
|
||||
steps:
|
||||
- name: Checkout repository
|
||||
uses: actions/checkout@v4
|
||||
with:
|
||||
submodules: recursive
|
||||
|
||||
- name: Build libcurl
|
||||
run: |
|
||||
cd external/src/curl
|
||||
cmake . -DCMAKE_BUILD_TYPE=Release -DCMAKE_C_COMPILER="$(brew --prefix llvm@15)/bin/clang" -DCMAKE_AR="$(brew --prefix llvm@15)/bin/llvm-ar" -DCMAKE_RANLIB="$(brew --prefix llvm@15)/bin/llvm-ranlib" -DCMAKE_C_FLAGS="-Os -target arm64-apple-macos-11" -DBUILD_CURL_EXE=OFF -DBUILD_SHARED_LIBS=OFF -DCURL_DISABLE_INSTALL=ON -DCURL_ENABLE_EXPORT_TARGET=OFF -DCURL_DISABLE_HEADERS_API=ON -DCURL_DISABLE_BINDLOCAL=ON -DBUILD_LIBCURL_DOCS=OFF -DBUILD_MISC_DOCS=OFF -DENABLE_CURL_MANUAL=OFF -DCURL_ZLIB=OFF -DCURL_BROTLI=OFF -DCURL_ZSTD=OFF -DCURL_DISABLE_ALTSVC=ON -DCURL_DISABLE_COOKIES=ON -DCURL_DISABLE_DOH=ON -DCURL_DISABLE_GETOPTIONS=ON -DCURL_DISABLE_HSTS=ON -DCURL_DISABLE_LIBCURL_OPTION=ON -DCURL_DISABLE_MIME=ON -DCURL_DISABLE_NETRC=ON -DCURL_DISABLE_NTLM=ON -DCURL_DISABLE_PARSEDATE=ON -DCURL_DISABLE_PROGRESS_METER=ON -DCURL_DISABLE_SHUFFLE_DNS=ON -DCURL_DISABLE_SOCKETPAIR=ON -DCURL_DISABLE_VERBOSE_STRINGS=ON -DCURL_DISABLE_WEBSOCKETS=ON -DHTTP_ONLY=ON -DCURL_ENABLE_SSL=OFF -DUSE_LIBIDN2=OFF -DCURL_USE_LIBPSL=OFF -DCURL_USE_LIBSSH2=OFF -DENABLE_UNIX_SOCKETS=OFF -DCURL_DISABLE_TESTS=ON -DUSE_NGHTTP2=OFF -DBUILD_EXAMPLES=OFF -DP2POOL_BORINGSSL=ON -DCURL_DISABLE_SRP=ON -DCURL_DISABLE_AWS=ON -DCURL_DISABLE_BASIC_AUTH=ON -DCURL_DISABLE_BEARER_AUTH=ON -DCURL_DISABLE_KERBEROS_AUTH=ON -DCURL_DISABLE_NEGOTIATE_AUTH=ON -DOPENSSL_INCLUDE_DIR=../grpc/third_party/boringssl-with-bazel/src/include
|
||||
make -j3
|
||||
|
||||
- name: Build libuv
|
||||
run: |
|
||||
cd external/src/libuv
|
||||
mkdir build
|
||||
cd build
|
||||
cmake .. -DCMAKE_BUILD_TYPE=Release -DCMAKE_C_COMPILER="$(brew --prefix llvm@15)/bin/clang" -DCMAKE_AR="$(brew --prefix llvm@15)/bin/llvm-ar" -DCMAKE_RANLIB="$(brew --prefix llvm@15)/bin/llvm-ranlib" -DCMAKE_C_FLAGS='-Os -target arm64-apple-macos-11' -DBUILD_TESTING=OFF -DLIBUV_BUILD_SHARED=OFF
|
||||
make -j3
|
||||
|
||||
- name: Build libzmq
|
||||
@@ -175,31 +677,160 @@ jobs:
|
||||
cd external/src/libzmq
|
||||
mkdir build
|
||||
cd build
|
||||
cmake .. -DWITH_TLS=OFF -DWITH_LIBSODIUM=OFF
|
||||
cmake .. -DCMAKE_BUILD_TYPE=Release -DCMAKE_C_COMPILER="$(brew --prefix llvm@15)/bin/clang" -DCMAKE_CXX_COMPILER="$(brew --prefix llvm@15)/bin/clang++" -DCMAKE_AR="$(brew --prefix llvm@15)/bin/llvm-ar" -DCMAKE_RANLIB="$(brew --prefix llvm@15)/bin/llvm-ranlib" -DCMAKE_C_FLAGS='-Os -target arm64-apple-macos-11' -DCMAKE_CXX_FLAGS='-Os -target arm64-apple-macos-11' -DWITH_LIBSODIUM=OFF -DWITH_LIBBSD=OFF -DBUILD_TESTS=OFF -DWITH_DOCS=OFF -DENABLE_DRAFTS=OFF -DBUILD_SHARED=OFF
|
||||
make -j3
|
||||
|
||||
- name: Build p2pool
|
||||
run: |
|
||||
mkdir build
|
||||
cd build
|
||||
cmake .. -DSTATIC_BINARY=ON
|
||||
make -j3
|
||||
cmake .. -DCMAKE_BUILD_TYPE=Release -DCMAKE_C_COMPILER="$(brew --prefix llvm@15)/bin/clang" -DCMAKE_CXX_COMPILER="$(brew --prefix llvm@15)/bin/clang++" -DCMAKE_AR="$(brew --prefix llvm@15)/bin/llvm-ar" -DCMAKE_RANLIB="$(brew --prefix llvm@15)/bin/llvm-ranlib" -DCMAKE_C_FLAGS="-target arm64-apple-macos-11" -DCMAKE_CXX_FLAGS="-target arm64-apple-macos-11" -DSTATIC_LIBS=ON -DWITH_LTO=OFF -DARCH_ID=aarch64
|
||||
make -j3 p2pool
|
||||
|
||||
- name: Run RandomX tests
|
||||
run: |
|
||||
cd build
|
||||
./p2pool --test
|
||||
make -j3 randomx-tests
|
||||
external/src/RandomX/randomx-tests
|
||||
|
||||
- name: Build tests
|
||||
run: |
|
||||
cd tests
|
||||
mkdir build
|
||||
cd build
|
||||
cmake .. -DSTATIC_LIBS=ON
|
||||
make -j3
|
||||
cmake .. -DCMAKE_BUILD_TYPE=Release -DCMAKE_C_COMPILER="$(brew --prefix llvm@15)/bin/clang" -DCMAKE_CXX_COMPILER="$(brew --prefix llvm@15)/bin/clang++" -DCMAKE_AR="$(brew --prefix llvm@15)/bin/llvm-ar" -DCMAKE_RANLIB="$(brew --prefix llvm@15)/bin/llvm-ranlib" -DCMAKE_C_FLAGS="-target arm64-apple-macos-11" -DCMAKE_CXX_FLAGS="-target arm64-apple-macos-11" -DSTATIC_LIBS=ON -DWITH_LTO=OFF -DARCH_ID=aarch64
|
||||
make -j3 p2pool_tests
|
||||
|
||||
- name: Run tests
|
||||
run: |
|
||||
cd tests/build
|
||||
unxz *.xz
|
||||
./p2pool_tests
|
||||
|
||||
- name: Archive binary
|
||||
uses: actions/upload-artifact@v2
|
||||
uses: actions/upload-artifact@v4
|
||||
with:
|
||||
name: p2pool-${{ matrix.os }}
|
||||
name: p2pool-macos-11-aarch64
|
||||
path: build/p2pool
|
||||
|
||||
build-freebsd:
|
||||
|
||||
timeout-minutes: 60
|
||||
runs-on: ${{ matrix.os.host }}
|
||||
|
||||
strategy:
|
||||
matrix:
|
||||
os:
|
||||
- name: freebsd
|
||||
architecture: x86-64
|
||||
version: '13.3'
|
||||
host: ubuntu-latest
|
||||
|
||||
steps:
|
||||
- name: Checkout repository
|
||||
uses: actions/checkout@v4
|
||||
with:
|
||||
submodules: recursive
|
||||
|
||||
- name: Delete unused files
|
||||
run: |
|
||||
rm -rf .git
|
||||
rm -rf external/lib
|
||||
|
||||
- name: Build p2pool
|
||||
uses: cross-platform-actions/action@v0.24.0
|
||||
with:
|
||||
operating_system: ${{ matrix.os.name }}
|
||||
architecture: ${{ matrix.os.architecture }}
|
||||
version: ${{ matrix.os.version }}
|
||||
memory: 12G
|
||||
cpu_count: 4
|
||||
shell: bash
|
||||
run: |
|
||||
sudo pkg install -y cmake
|
||||
cd external/src/curl
|
||||
cmake . -DCMAKE_BUILD_TYPE=Release -DCMAKE_C_FLAGS="-Os -flto" -DBUILD_CURL_EXE=OFF -DBUILD_SHARED_LIBS=OFF -DCURL_DISABLE_INSTALL=ON -DCURL_ENABLE_EXPORT_TARGET=OFF -DCURL_DISABLE_HEADERS_API=ON -DCURL_DISABLE_BINDLOCAL=ON -DBUILD_LIBCURL_DOCS=OFF -DBUILD_MISC_DOCS=OFF -DENABLE_CURL_MANUAL=OFF -DCURL_ZLIB=OFF -DCURL_BROTLI=OFF -DCURL_ZSTD=OFF -DCURL_DISABLE_ALTSVC=ON -DCURL_DISABLE_COOKIES=ON -DCURL_DISABLE_DOH=ON -DCURL_DISABLE_GETOPTIONS=ON -DCURL_DISABLE_HSTS=ON -DCURL_DISABLE_LIBCURL_OPTION=ON -DCURL_DISABLE_MIME=ON -DCURL_DISABLE_NETRC=ON -DCURL_DISABLE_NTLM=ON -DCURL_DISABLE_PARSEDATE=ON -DCURL_DISABLE_PROGRESS_METER=ON -DCURL_DISABLE_SHUFFLE_DNS=ON -DCURL_DISABLE_SOCKETPAIR=ON -DCURL_DISABLE_VERBOSE_STRINGS=ON -DCURL_DISABLE_WEBSOCKETS=ON -DHTTP_ONLY=ON -DCURL_ENABLE_SSL=OFF -DUSE_LIBIDN2=OFF -DCURL_USE_LIBPSL=OFF -DCURL_USE_LIBSSH2=OFF -DENABLE_UNIX_SOCKETS=OFF -DCURL_DISABLE_TESTS=ON -DUSE_NGHTTP2=OFF -DBUILD_EXAMPLES=OFF -DP2POOL_BORINGSSL=ON -DCURL_DISABLE_SRP=ON -DCURL_DISABLE_AWS=ON -DCURL_DISABLE_BASIC_AUTH=ON -DCURL_DISABLE_BEARER_AUTH=ON -DCURL_DISABLE_KERBEROS_AUTH=ON -DCURL_DISABLE_NEGOTIATE_AUTH=ON -DOPENSSL_INCLUDE_DIR=../grpc/third_party/boringssl-with-bazel/src/include
|
||||
make -j4
|
||||
cd ../libuv
|
||||
mkdir build
|
||||
cd build
|
||||
cmake .. -DCMAKE_BUILD_TYPE=Release -DCMAKE_C_FLAGS='-Os -flto' -DBUILD_TESTING=OFF -DLIBUV_BUILD_SHARED=OFF
|
||||
make -j4
|
||||
cd ../../libzmq
|
||||
mkdir build
|
||||
cd build
|
||||
cmake .. -DCMAKE_BUILD_TYPE=Release -DCMAKE_C_FLAGS='-Os -flto' -DCMAKE_CXX_FLAGS='-Os -flto' -DWITH_LIBSODIUM=OFF -DWITH_LIBBSD=OFF -DBUILD_TESTS=OFF -DWITH_DOCS=OFF -DENABLE_DRAFTS=OFF -DBUILD_SHARED=OFF
|
||||
make -j4
|
||||
cd ../../../..
|
||||
mkdir build
|
||||
cd build
|
||||
cmake .. -DCMAKE_BUILD_TYPE=Release -DSTATIC_LIBS=ON
|
||||
make -j4 p2pool
|
||||
./p2pool --test
|
||||
make -j4 randomx-tests
|
||||
external/src/RandomX/randomx-tests
|
||||
cd ../tests
|
||||
mkdir build
|
||||
cd build
|
||||
cmake .. -DCMAKE_BUILD_TYPE=Release -DSTATIC_LIBS=ON
|
||||
make -j4 p2pool_tests
|
||||
unxz *.xz
|
||||
./p2pool_tests
|
||||
|
||||
- name: Archive binary
|
||||
uses: actions/upload-artifact@v4
|
||||
with:
|
||||
name: p2pool-${{ matrix.os.name }}-${{ matrix.os.version }}
|
||||
path: build/p2pool
|
||||
|
||||
build-openbsd:
|
||||
|
||||
timeout-minutes: 60
|
||||
runs-on: ${{ matrix.os.host }}
|
||||
|
||||
strategy:
|
||||
matrix:
|
||||
os:
|
||||
- name: openbsd
|
||||
architecture: x86-64
|
||||
version: '7.4'
|
||||
host: ubuntu-latest
|
||||
|
||||
steps:
|
||||
- name: Checkout repository
|
||||
uses: actions/checkout@v4
|
||||
with:
|
||||
submodules: recursive
|
||||
|
||||
- name: Delete unused files
|
||||
run: |
|
||||
rm -rf .git
|
||||
rm -rf external/lib
|
||||
|
||||
- name: Build p2pool
|
||||
uses: cross-platform-actions/action@v0.24.0
|
||||
with:
|
||||
operating_system: ${{ matrix.os.name }}
|
||||
architecture: ${{ matrix.os.architecture }}
|
||||
version: ${{ matrix.os.version }}
|
||||
memory: 12G
|
||||
cpu_count: 4
|
||||
shell: bash
|
||||
run: |
|
||||
sudo pkg_add -I cmake libuv zeromq curl
|
||||
mkdir build && cd build
|
||||
cmake .. -DCMAKE_BUILD_TYPE=Release
|
||||
make -j4 p2pool
|
||||
cd ../tests
|
||||
mkdir build && cd build
|
||||
cmake .. -DCMAKE_BUILD_TYPE=Release
|
||||
make -j4 p2pool_tests
|
||||
unxz *.xz
|
||||
./p2pool_tests
|
||||
|
||||
- name: Archive binary
|
||||
uses: actions/upload-artifact@v4
|
||||
with:
|
||||
name: p2pool-${{ matrix.os.name }}-${{ matrix.os.version }}
|
||||
path: build/p2pool
|
||||
|
||||
@@ -0,0 +1,40 @@
|
||||
name: clang-tidy
|
||||
|
||||
on:
|
||||
push:
|
||||
branches: ["master"]
|
||||
paths-ignore:
|
||||
- 'docker-compose/**'
|
||||
- 'docs/**'
|
||||
- 'README.md'
|
||||
|
||||
pull_request:
|
||||
|
||||
jobs:
|
||||
clang-tidy:
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
steps:
|
||||
- name: Install clang
|
||||
run: |
|
||||
wget https://apt.llvm.org/llvm.sh
|
||||
chmod +x llvm.sh
|
||||
sudo ./llvm.sh 21
|
||||
sudo apt-get install -y clang-tidy-21
|
||||
clang-tidy-21 --verify-config
|
||||
|
||||
- name: Checkout repository
|
||||
uses: actions/checkout@v4
|
||||
with:
|
||||
submodules: recursive
|
||||
|
||||
- name: cmake p2pool
|
||||
run: |
|
||||
mkdir build
|
||||
cd build
|
||||
cmake .. -DCMAKE_EXPORT_COMPILE_COMMANDS=ON -DCMAKE_C_COMPILER=clang-21 -DCMAKE_CXX_COMPILER=clang++-21 -DDEV_CLANG_TIDY=ON -DSTATIC_LIBS=ON -DCMAKE_POLICY_VERSION_MINIMUM="3.5"
|
||||
|
||||
- name: Run clang-tidy
|
||||
run: |
|
||||
cd src
|
||||
clang-tidy-21 *.cpp -p ../build -checks=bugprone-*,clang-analyzer-*,llvm-*,cppcoreguidelines-pro-type-cstyle-cast,cppcoreguidelines-rvalue-reference-param-not-moved,hicpp-use-emplace,hicpp-use-override,-bugprone-easily-swappable-parameters,-bugprone-empty-catch,-llvm-include-order -warnings-as-errors=* -header-filter=^[^\./]
|
||||
@@ -13,16 +13,21 @@ name: "CodeQL"
|
||||
|
||||
on:
|
||||
push:
|
||||
branches: [ master ]
|
||||
branches: ["master"]
|
||||
paths-ignore:
|
||||
- 'docker-compose/**'
|
||||
- 'docs/**'
|
||||
- 'README.md'
|
||||
|
||||
pull_request:
|
||||
# The branches below must be a subset of the branches above
|
||||
branches: [ master ]
|
||||
|
||||
schedule:
|
||||
- cron: '44 11 * * 0'
|
||||
|
||||
jobs:
|
||||
analyze:
|
||||
name: Analyze
|
||||
timeout-minutes: 180
|
||||
runs-on: ubuntu-latest
|
||||
permissions:
|
||||
actions: read
|
||||
@@ -40,16 +45,16 @@ jobs:
|
||||
steps:
|
||||
- name: Install dependencies
|
||||
run: |
|
||||
sudo apt update && sudo apt install git build-essential cmake libuv1-dev libzmq3-dev libsodium-dev libpgm-dev libnorm-dev libgss-dev
|
||||
sudo apt update && sudo apt install git build-essential cmake libuv1-dev libzmq3-dev libgss-dev libcurl4-openssl-dev libidn2-0-dev
|
||||
|
||||
- name: Checkout repository
|
||||
uses: actions/checkout@v2
|
||||
uses: actions/checkout@v4
|
||||
with:
|
||||
submodules: true
|
||||
submodules: recursive
|
||||
|
||||
# Initializes the CodeQL tools for scanning.
|
||||
- name: Initialize CodeQL
|
||||
uses: github/codeql-action/init@v1
|
||||
uses: github/codeql-action/init@v3
|
||||
with:
|
||||
languages: ${{ matrix.language }}
|
||||
# If you wish to specify custom queries, you can do so here or in a config file.
|
||||
@@ -57,21 +62,13 @@ jobs:
|
||||
# Prefix the list here with "+" to use these queries and those in the config file.
|
||||
# queries: ./path/to/local/query, your-org/your-repo/queries@main
|
||||
|
||||
# Autobuild attempts to build any compiled languages (C/C++, C#, or Java).
|
||||
# If this step fails, then you should remove it and run the build manually (see below)
|
||||
- name: Autobuild
|
||||
uses: github/codeql-action/autobuild@v1
|
||||
|
||||
# ℹ️ Command-line programs to run using the OS shell.
|
||||
# 📚 https://git.io/JvXDl
|
||||
|
||||
# ✏️ If the Autobuild fails above, remove it and uncomment the following three lines
|
||||
# and modify them (or add more) to build your code if your project
|
||||
# uses a compiled language
|
||||
|
||||
#- run: |
|
||||
# make bootstrap
|
||||
# make release
|
||||
- run: |
|
||||
cmake . -DCMAKE_BUILD_TYPE=Release -DCMAKE_POLICY_VERSION_MINIMUM="3.5"
|
||||
make -j$(nproc) p2pool
|
||||
|
||||
- name: Perform CodeQL Analysis
|
||||
uses: github/codeql-action/analyze@v1
|
||||
uses: github/codeql-action/analyze@v3
|
||||
|
||||
@@ -0,0 +1,91 @@
|
||||
name: Code coverage
|
||||
|
||||
on:
|
||||
push:
|
||||
branches: ["master"]
|
||||
paths-ignore:
|
||||
- 'docker-compose/**'
|
||||
- 'docs/**'
|
||||
- 'README.md'
|
||||
|
||||
pull_request:
|
||||
|
||||
jobs:
|
||||
coverage:
|
||||
|
||||
timeout-minutes: 60
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
steps:
|
||||
- name: Install dependencies
|
||||
run: |
|
||||
sudo apt update
|
||||
sudo apt install -y cmake libuv1-dev libzmq3-dev libgss-dev libcurl4-openssl-dev libidn2-0-dev lcov xz-utils
|
||||
|
||||
- name: Install clang
|
||||
run: |
|
||||
wget https://apt.llvm.org/llvm.sh
|
||||
chmod +x llvm.sh
|
||||
sudo ./llvm.sh 21 all
|
||||
|
||||
- name: Checkout repository
|
||||
uses: actions/checkout@v4
|
||||
with:
|
||||
submodules: recursive
|
||||
|
||||
- name: Build tests
|
||||
run: |
|
||||
cd tests
|
||||
mkdir build
|
||||
cd build
|
||||
cmake .. -DCMAKE_BUILD_TYPE=Release -DDEV_DEBUG=ON -DWITH_COVERAGE=ON -DCMAKE_C_COMPILER=clang-21 -DCMAKE_CXX_COMPILER=clang++-21 -DCMAKE_POLICY_VERSION_MINIMUM="3.5"
|
||||
make -j$(nproc) p2pool_tests
|
||||
|
||||
- name: Run tests
|
||||
run: |
|
||||
cd tests/build
|
||||
unxz *.xz
|
||||
LLVM_PROFILE_FILE="p2pool_tests.profraw" ./p2pool_tests
|
||||
|
||||
- name: Merge profile data
|
||||
run: |
|
||||
cd tests/build
|
||||
llvm-profdata-21 merge -sparse ./p2pool_tests.profraw -o ./p2pool_tests.profdata
|
||||
|
||||
- name: Export profile data
|
||||
run: |
|
||||
cd tests/build
|
||||
llvm-cov-21 export ./p2pool_tests -format=lcov -instr-profile=./p2pool_tests.profdata > coverage.info
|
||||
|
||||
- name: Run genhtml
|
||||
run: |
|
||||
cd tests/build
|
||||
genhtml --demangle-cpp -o coverage coverage.info
|
||||
|
||||
- name: Checkout GitHub Pages repository
|
||||
uses: actions/checkout@v4
|
||||
with:
|
||||
repository: SChernykh/SChernykh.github.io
|
||||
token: ${{ secrets.PAGES_DEPLOY_TOKEN }}
|
||||
path: gh-pages
|
||||
|
||||
- name: Copy coverage report to GitHub Pages repo
|
||||
run: |
|
||||
rm -rf gh-pages/p2pool-coverage
|
||||
cp -r tests/build/coverage gh-pages/p2pool-coverage
|
||||
|
||||
- name: Commit and push coverage report
|
||||
run: |
|
||||
cd gh-pages
|
||||
git config user.name "github-actions[bot]"
|
||||
git config user.email "github-actions[bot]@users.noreply.github.com"
|
||||
git add p2pool-coverage
|
||||
git commit -m "Update p2pool coverage report"
|
||||
git push
|
||||
|
||||
- name: Archive coverage data
|
||||
if: '!cancelled()'
|
||||
uses: actions/upload-artifact@v4
|
||||
with:
|
||||
name: p2pool-coverage
|
||||
path: tests/build/coverage
|
||||
@@ -2,41 +2,83 @@ name: cppcheck
|
||||
|
||||
on:
|
||||
push:
|
||||
branches: [ master ]
|
||||
branches: ["master"]
|
||||
paths-ignore:
|
||||
- 'docker-compose/**'
|
||||
- 'docs/**'
|
||||
- 'README.md'
|
||||
|
||||
pull_request:
|
||||
branches: [ master ]
|
||||
|
||||
schedule:
|
||||
- cron: '57 0 * * *'
|
||||
|
||||
jobs:
|
||||
cppcheck-ubuntu:
|
||||
|
||||
timeout-minutes: 240
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
steps:
|
||||
- name: Install cppcheck
|
||||
run: sudo apt update && sudo apt install cppcheck
|
||||
|
||||
- name: Checkout repository
|
||||
uses: actions/checkout@v2
|
||||
uses: actions/checkout@v4
|
||||
with:
|
||||
submodules: true
|
||||
submodules: recursive
|
||||
|
||||
- name: Checkout cppcheck
|
||||
run: |
|
||||
git clone https://github.com/danmar/cppcheck cppcheck-main
|
||||
|
||||
- name: Build cppcheck
|
||||
run: |
|
||||
cd cppcheck-main
|
||||
make -j$(nproc) cppcheck
|
||||
|
||||
- name: cmake p2pool
|
||||
run: |
|
||||
mkdir build
|
||||
cd build
|
||||
cmake .. -DCMAKE_EXPORT_COMPILE_COMMANDS=ON -DSTATIC_LIBS=ON -DWITH_GRPC=OFF -DCMAKE_POLICY_VERSION_MINIMUM="3.5"
|
||||
python ../cppcheck/remove_external.py compile_commands.json
|
||||
|
||||
- name: Run cppcheck
|
||||
run: |
|
||||
cd cppcheck
|
||||
./run.sh
|
||||
|
||||
- name: Archive full error list
|
||||
if: '!cancelled()'
|
||||
uses: actions/upload-artifact@v4
|
||||
with:
|
||||
name: errors_full-linux
|
||||
path: cppcheck/errors_full.txt
|
||||
|
||||
- name: Archive checkers report
|
||||
if: '!cancelled()'
|
||||
uses: actions/upload-artifact@v4
|
||||
with:
|
||||
name: checkers_report-linux
|
||||
path: cppcheck/checkers_report.txt
|
||||
|
||||
cppcheck-windows:
|
||||
|
||||
timeout-minutes: 120
|
||||
runs-on: windows-latest
|
||||
|
||||
steps:
|
||||
- name: Install cppcheck
|
||||
run: choco install cppcheck
|
||||
|
||||
- name: Checkout repository
|
||||
uses: actions/checkout@v2
|
||||
uses: actions/checkout@v4
|
||||
with:
|
||||
submodules: true
|
||||
submodules: recursive
|
||||
|
||||
- name: Checkout cppcheck
|
||||
run: |
|
||||
git clone https://github.com/danmar/cppcheck cppcheck-main
|
||||
|
||||
- name: Build cppcheck
|
||||
run: |
|
||||
cd cppcheck-main
|
||||
& "C:\\Program Files\\Microsoft Visual Studio\\2022\\Enterprise\\Msbuild\\Current\\Bin\\amd64\\msbuild.exe" -v:m /m /p:Configuration=Release /p:Platform=x64
|
||||
|
||||
- name: Setup cmake
|
||||
uses: lukka/get-cmake@latest
|
||||
@@ -45,9 +87,23 @@ jobs:
|
||||
run: |
|
||||
mkdir build
|
||||
cd build
|
||||
cmake .. -G "Visual Studio 17 2022"
|
||||
cmake .. -G "Visual Studio 17 2022" -DSTATIC_LIBS=ON -DCMAKE_POLICY_VERSION_MINIMUM="3.5"
|
||||
|
||||
- name: Run cppcheck
|
||||
run: |
|
||||
cd cppcheck
|
||||
./run.cmd
|
||||
|
||||
- name: Archive full error list
|
||||
if: '!cancelled()'
|
||||
uses: actions/upload-artifact@v4
|
||||
with:
|
||||
name: errors_full-windows
|
||||
path: cppcheck/errors_full.txt
|
||||
|
||||
- name: Archive checkers report
|
||||
if: '!cancelled()'
|
||||
uses: actions/upload-artifact@v4
|
||||
with:
|
||||
name: checkers_report-windows
|
||||
path: cppcheck/checkers_report.txt
|
||||
|
||||
@@ -10,9 +10,14 @@ name: Microsoft C++ Code Analysis
|
||||
|
||||
on:
|
||||
push:
|
||||
branches: [ master ]
|
||||
branches: ["master"]
|
||||
paths-ignore:
|
||||
- 'docker-compose/**'
|
||||
- 'docs/**'
|
||||
- 'README.md'
|
||||
|
||||
pull_request:
|
||||
branches: [ master ]
|
||||
|
||||
schedule:
|
||||
- cron: '40 10 * * 0'
|
||||
|
||||
@@ -24,23 +29,24 @@ env:
|
||||
jobs:
|
||||
analyze:
|
||||
name: Analyze
|
||||
timeout-minutes: 240
|
||||
runs-on: windows-latest
|
||||
|
||||
steps:
|
||||
- name: Checkout repository
|
||||
uses: actions/checkout@v2
|
||||
uses: actions/checkout@v4
|
||||
with:
|
||||
submodules: true
|
||||
submodules: recursive
|
||||
|
||||
- name: Configure CMake
|
||||
run: cmake -B ${{ env.build }} -DCMAKE_BUILD_TYPE=${{ env.config }}
|
||||
run: cmake -B ${{ env.build }} -DCMAKE_BUILD_TYPE=${{ env.config }} -DCMAKE_POLICY_VERSION_MINIMUM="3.5"
|
||||
|
||||
# Build is not required unless generated source files are used
|
||||
# - name: Build CMake
|
||||
# run: cmake --build ${{ env.build }}
|
||||
|
||||
- name: Initialize MSVC Code Analysis
|
||||
uses: microsoft/msvc-code-analysis-action@47ecec99bf7ce0399ed85cbb5012b6f24eab5959
|
||||
uses: microsoft/msvc-code-analysis-action@96315324a485db21449515180214ecb78c16a1c5
|
||||
# Provide a unique ID to access the sarif output path
|
||||
id: run-analysis
|
||||
with:
|
||||
@@ -48,16 +54,17 @@ jobs:
|
||||
buildConfiguration: ${{ env.config }}
|
||||
# Ruleset file that will determine what checks will be run
|
||||
ruleset: NativeRecommendedRules.ruleset
|
||||
ignoredPaths: ${{ github.workspace }}/external
|
||||
|
||||
# Upload SARIF file to GitHub Code Scanning Alerts
|
||||
- name: Upload SARIF to GitHub
|
||||
uses: github/codeql-action/upload-sarif@v1
|
||||
uses: github/codeql-action/upload-sarif@v3
|
||||
with:
|
||||
sarif_file: ${{ steps.run-analysis.outputs.sarif }}
|
||||
|
||||
# Upload SARIF file as an Artifact to download and view
|
||||
- name: Upload SARIF as an Artifact
|
||||
uses: actions/upload-artifact@v2
|
||||
uses: actions/upload-artifact@v4
|
||||
with:
|
||||
name: sarif-file
|
||||
path: ${{ steps.run-analysis.outputs.sarif }}
|
||||
|
||||
@@ -0,0 +1,28 @@
|
||||
name: source-snapshot
|
||||
|
||||
on:
|
||||
push:
|
||||
branches: ["master"]
|
||||
|
||||
pull_request:
|
||||
|
||||
jobs:
|
||||
source-snapshot:
|
||||
runs-on: ubuntu-22.04
|
||||
|
||||
steps:
|
||||
- name: Checkout repository
|
||||
uses: actions/checkout@v4
|
||||
with:
|
||||
submodules: recursive
|
||||
|
||||
- name: Compress source code
|
||||
run: |
|
||||
mkdir build
|
||||
XZ_OPT=-e9 tar --exclude=".git" --exclude="build" -f build/p2pool_source.tar.xz -c ../p2pool --xz
|
||||
|
||||
- name: Archive source code
|
||||
uses: actions/upload-artifact@v4
|
||||
with:
|
||||
name: p2pool_source.tar.xz
|
||||
path: build/p2pool_source.tar.xz
|
||||
@@ -0,0 +1,421 @@
|
||||
name: Sync test
|
||||
|
||||
on:
|
||||
push:
|
||||
branches: ["master"]
|
||||
paths-ignore:
|
||||
- 'docker-compose/**'
|
||||
- 'docs/**'
|
||||
- 'README.md'
|
||||
|
||||
pull_request:
|
||||
|
||||
schedule:
|
||||
- cron: '47 0/3 * * *'
|
||||
|
||||
jobs:
|
||||
sync-test-ubuntu-tsan:
|
||||
|
||||
timeout-minutes: 60
|
||||
runs-on: ubuntu-22.04
|
||||
|
||||
steps:
|
||||
- name: Install dependencies
|
||||
run: |
|
||||
sudo add-apt-repository -y ppa:ubuntu-toolchain-r/test
|
||||
sudo apt update
|
||||
sudo apt install -y git build-essential cmake gcc-12 g++-12
|
||||
|
||||
- name: Checkout repository
|
||||
uses: actions/checkout@v4
|
||||
with:
|
||||
submodules: recursive
|
||||
|
||||
- name: Build libcurl
|
||||
run: |
|
||||
cd external/src/curl
|
||||
cmake . -DCMAKE_C_COMPILER=gcc-12 -DCMAKE_C_FLAGS='-fsanitize=thread -Og -fno-omit-frame-pointer -g' -DBUILD_CURL_EXE=OFF -DBUILD_SHARED_LIBS=OFF -DCURL_DISABLE_INSTALL=ON -DCURL_ENABLE_EXPORT_TARGET=OFF -DCURL_DISABLE_HEADERS_API=ON -DCURL_DISABLE_BINDLOCAL=ON -DBUILD_LIBCURL_DOCS=OFF -DBUILD_MISC_DOCS=OFF -DENABLE_CURL_MANUAL=OFF -DCURL_ZLIB=OFF -DCURL_BROTLI=OFF -DCURL_ZSTD=OFF -DCURL_DISABLE_ALTSVC=ON -DCURL_DISABLE_COOKIES=ON -DCURL_DISABLE_DOH=ON -DCURL_DISABLE_GETOPTIONS=ON -DCURL_DISABLE_HSTS=ON -DCURL_DISABLE_LIBCURL_OPTION=ON -DCURL_DISABLE_MIME=ON -DCURL_DISABLE_NETRC=ON -DCURL_DISABLE_NTLM=ON -DCURL_DISABLE_PARSEDATE=ON -DCURL_DISABLE_PROGRESS_METER=ON -DCURL_DISABLE_SHUFFLE_DNS=ON -DCURL_DISABLE_SOCKETPAIR=ON -DCURL_DISABLE_VERBOSE_STRINGS=ON -DCURL_DISABLE_WEBSOCKETS=ON -DHTTP_ONLY=ON -DCURL_ENABLE_SSL=OFF -DUSE_LIBIDN2=OFF -DCURL_USE_LIBPSL=OFF -DCURL_USE_LIBSSH2=OFF -DENABLE_UNIX_SOCKETS=OFF -DCURL_DISABLE_TESTS=ON -DUSE_NGHTTP2=OFF -DBUILD_EXAMPLES=OFF -DP2POOL_BORINGSSL=ON -DCURL_DISABLE_SRP=ON -DCURL_DISABLE_AWS=ON -DCURL_DISABLE_BASIC_AUTH=ON -DCURL_DISABLE_BEARER_AUTH=ON -DCURL_DISABLE_KERBEROS_AUTH=ON -DCURL_DISABLE_NEGOTIATE_AUTH=ON -DOPENSSL_INCLUDE_DIR=../grpc/third_party/boringssl-with-bazel/src/include
|
||||
make -j$(nproc)
|
||||
|
||||
- name: Build libuv
|
||||
run: |
|
||||
cd external/src/libuv
|
||||
mkdir build
|
||||
cd build
|
||||
cmake .. -DCMAKE_C_COMPILER=gcc-12 -DCMAKE_C_FLAGS='-fsanitize=thread -Og -fno-omit-frame-pointer -g' -DBUILD_TESTING=OFF -DLIBUV_BUILD_SHARED=OFF
|
||||
make -j$(nproc)
|
||||
|
||||
- name: Build libzmq
|
||||
run: |
|
||||
cd external/src/libzmq
|
||||
mkdir build
|
||||
cd build
|
||||
cmake .. -DCMAKE_C_COMPILER=gcc-12 -DCMAKE_CXX_COMPILER=g++-12 -DCMAKE_C_FLAGS='-fsanitize=thread -Og -fno-omit-frame-pointer -g' -DCMAKE_CXX_FLAGS='-fsanitize=thread -Og -fno-omit-frame-pointer -g' -DWITH_LIBSODIUM=OFF -DWITH_LIBBSD=OFF -DBUILD_TESTS=OFF -DWITH_DOCS=OFF -DENABLE_DRAFTS=OFF -DBUILD_SHARED=OFF -DCMAKE_POLICY_VERSION_MINIMUM="3.5"
|
||||
make -j$(nproc)
|
||||
|
||||
- name: Build p2pool
|
||||
run: |
|
||||
mkdir build
|
||||
cd build
|
||||
cmake .. -DDEV_TEST_SYNC=ON -DDEV_WITH_TSAN=ON -DCMAKE_C_COMPILER=gcc-12 -DCMAKE_CXX_COMPILER=g++-12 -DCMAKE_C_FLAGS='-fsanitize=thread -Og -fno-omit-frame-pointer -g' -DCMAKE_CXX_FLAGS='-fsanitize=thread -Og -fno-omit-frame-pointer -g' -DWITH_LTO=OFF -DSTATIC_LIBS=ON -DCMAKE_POLICY_VERSION_MINIMUM="3.5"
|
||||
make -j$(nproc) p2pool
|
||||
|
||||
- name: Run p2pool
|
||||
run: |
|
||||
cd build
|
||||
mkdir data
|
||||
python ../tests/src/stratum_dummy.py 1 &
|
||||
python ../tests/src/stratum_dummy.py 2 &
|
||||
python ../tests/src/stratum_dummy.py 3 &
|
||||
sudo sysctl vm.mmap_rnd_bits=28
|
||||
TSAN_OPTIONS="suppressions=../tests/src/tsan_sup.txt halt_on_error=1 history_size=4" ./p2pool --host node.monerodevs.org --rpc-port 18089 --zmq-port 18084 --host node.richfowler.net --rpc-port 18089 --zmq-port 18084 --rpc-ssl --wallet 44MnN1f3Eto8DZYUWuE5XZNUtE3vcRzt2j6PzqWpPau34e6Cf4fAxt6X2MBmrm6F9YMEiMNjN6W4Shn4pLcfNAja621jwyg ${{ secrets.MM_PARAMS }} --mini --out-peers 200 --data-api data --local-api --loglevel 6
|
||||
|
||||
- name: Check p2pool.log
|
||||
run: |
|
||||
cd build
|
||||
grep 'Synchronization finished successfully' p2pool.log
|
||||
|
||||
- name: Archive p2pool.log
|
||||
uses: actions/upload-artifact@v4
|
||||
with:
|
||||
name: p2pool_ubuntu_data_tsan
|
||||
path: |
|
||||
build/*.log
|
||||
build/data/
|
||||
|
||||
sync-test-ubuntu-msan:
|
||||
timeout-minutes: 60
|
||||
runs-on: ubuntu-22.04
|
||||
|
||||
steps:
|
||||
- name: Install dependencies
|
||||
run: |
|
||||
sudo apt update
|
||||
sudo apt install -y git build-essential cmake ninja-build
|
||||
|
||||
- name: Install clang
|
||||
run: |
|
||||
wget https://apt.llvm.org/llvm.sh
|
||||
chmod +x llvm.sh
|
||||
sudo ./llvm.sh 21 all
|
||||
|
||||
- name: Build libcxx_msan
|
||||
run: |
|
||||
git clone --depth=1 https://github.com/llvm/llvm-project -b release/21.x
|
||||
cd llvm-project
|
||||
mkdir build
|
||||
cmake -G Ninja -S runtimes -B build -DLLVM_ENABLE_RUNTIMES="libcxx;libcxxabi" -DCMAKE_C_COMPILER=clang-21 -DCMAKE_CXX_COMPILER=clang++-21 -DLLVM_USE_SANITIZER=MemoryWithOrigins -DLIBCXXABI_USE_LLVM_UNWINDER=OFF
|
||||
ninja -C build cxx cxxabi
|
||||
cd build
|
||||
mkdir /tmp/libcxx_msan
|
||||
cp -r include /tmp/libcxx_msan
|
||||
cp -r lib /tmp/libcxx_msan
|
||||
|
||||
- name: Checkout repository
|
||||
uses: actions/checkout@v4
|
||||
with:
|
||||
submodules: recursive
|
||||
|
||||
- name: Build libcurl
|
||||
run: |
|
||||
cd external/src/curl
|
||||
cmake . -DCMAKE_BUILD_TYPE=Debug -DCMAKE_C_COMPILER=clang-21 -DCMAKE_C_FLAGS='-fsanitize=memory -fsanitize-recover -fsanitize-memory-track-origins -O0 -fno-omit-frame-pointer -g3' -DBUILD_CURL_EXE=OFF -DBUILD_SHARED_LIBS=OFF -DCURL_DISABLE_INSTALL=ON -DCURL_ENABLE_EXPORT_TARGET=OFF -DCURL_DISABLE_HEADERS_API=ON -DCURL_DISABLE_BINDLOCAL=ON -DBUILD_LIBCURL_DOCS=OFF -DBUILD_MISC_DOCS=OFF -DENABLE_CURL_MANUAL=OFF -DCURL_ZLIB=OFF -DCURL_BROTLI=OFF -DCURL_ZSTD=OFF -DCURL_DISABLE_ALTSVC=ON -DCURL_DISABLE_COOKIES=ON -DCURL_DISABLE_DOH=ON -DCURL_DISABLE_GETOPTIONS=ON -DCURL_DISABLE_HSTS=ON -DCURL_DISABLE_LIBCURL_OPTION=ON -DCURL_DISABLE_MIME=ON -DCURL_DISABLE_NETRC=ON -DCURL_DISABLE_NTLM=ON -DCURL_DISABLE_PARSEDATE=ON -DCURL_DISABLE_PROGRESS_METER=ON -DCURL_DISABLE_SHUFFLE_DNS=ON -DCURL_DISABLE_SOCKETPAIR=ON -DCURL_DISABLE_VERBOSE_STRINGS=ON -DCURL_DISABLE_WEBSOCKETS=ON -DHTTP_ONLY=ON -DCURL_ENABLE_SSL=OFF -DUSE_LIBIDN2=OFF -DCURL_USE_LIBPSL=OFF -DCURL_USE_LIBSSH2=OFF -DENABLE_UNIX_SOCKETS=OFF -DCURL_DISABLE_TESTS=ON -DUSE_NGHTTP2=OFF -DBUILD_EXAMPLES=OFF -DP2POOL_BORINGSSL=ON -DCURL_DISABLE_SRP=ON -DCURL_DISABLE_AWS=ON -DCURL_DISABLE_BASIC_AUTH=ON -DCURL_DISABLE_BEARER_AUTH=ON -DCURL_DISABLE_KERBEROS_AUTH=ON -DCURL_DISABLE_NEGOTIATE_AUTH=ON -DOPENSSL_INCLUDE_DIR=../grpc/third_party/boringssl-with-bazel/src/include
|
||||
make -j$(nproc)
|
||||
|
||||
- name: Build libuv
|
||||
run: |
|
||||
cd external/src/libuv
|
||||
mkdir build
|
||||
cd build
|
||||
cmake .. -DCMAKE_BUILD_TYPE=Debug -DCMAKE_C_COMPILER=clang-21 -DCMAKE_C_FLAGS='-fsanitize=memory -fsanitize-recover -fsanitize-memory-track-origins -O0 -fno-omit-frame-pointer -g3' -DBUILD_TESTING=OFF -DLIBUV_BUILD_SHARED=OFF
|
||||
make -j$(nproc)
|
||||
|
||||
- name: Build libzmq
|
||||
run: |
|
||||
cd external/src/libzmq
|
||||
mkdir build
|
||||
cd build
|
||||
cmake .. -DCMAKE_BUILD_TYPE=Debug -DCMAKE_C_COMPILER=clang-21 -DCMAKE_CXX_COMPILER=clang++-21 -DCMAKE_C_FLAGS='-fsanitize=memory -fsanitize-recover -fsanitize-memory-track-origins -O0 -fno-omit-frame-pointer -g3' -DCMAKE_CXX_FLAGS='-nostdinc++ -nostdlib++ -fsanitize=memory -fsanitize-recover -fsanitize-memory-track-origins -isystem /tmp/libcxx_msan/include/c++/v1 -O0 -fno-omit-frame-pointer -g3' -DWITH_LIBSODIUM=OFF -DWITH_LIBBSD=OFF -DBUILD_TESTS=OFF -DWITH_DOCS=OFF -DENABLE_DRAFTS=OFF -DBUILD_SHARED=OFF -DCMAKE_POLICY_VERSION_MINIMUM="3.5"
|
||||
make -j$(nproc)
|
||||
|
||||
- name: Build p2pool
|
||||
run: |
|
||||
mkdir build
|
||||
cd build
|
||||
cmake .. -DCMAKE_BUILD_TYPE=Debug -DCMAKE_C_COMPILER=clang-21 -DCMAKE_CXX_COMPILER=clang++-21 -DCMAKE_C_FLAGS='-fsanitize=memory -fsanitize-recover -fsanitize-memory-track-origins -fno-omit-frame-pointer' -DCMAKE_CXX_FLAGS='-nostdinc++ -nostdlib++ -fsanitize=memory -fsanitize-recover -fsanitize-memory-track-origins -isystem /tmp/libcxx_msan/include/c++/v1 -L/tmp/libcxx_msan/lib -Wl,-rpath /tmp/libcxx_msan/lib -lc++ -lc++abi -Wno-unused-command-line-argument -fuse-ld=lld-21 -fno-omit-frame-pointer' -DDEV_TEST_SYNC=ON -DDEV_WITH_MSAN=ON -DWITH_LTO=OFF -DSTATIC_LIBS=ON -DCMAKE_POLICY_VERSION_MINIMUM="3.5"
|
||||
make -j$(nproc) p2pool
|
||||
|
||||
- name: Run p2pool
|
||||
run: |
|
||||
cd build
|
||||
mkdir data
|
||||
python ../tests/src/stratum_dummy.py 1 &
|
||||
python ../tests/src/stratum_dummy.py 2 &
|
||||
python ../tests/src/stratum_dummy.py 3 &
|
||||
sudo sysctl vm.mmap_rnd_bits=28
|
||||
MSAN_OPTIONS="halt_on_error=1" ./p2pool --host node.monerodevs.org --rpc-port 18089 --zmq-port 18084 --host node.richfowler.net --rpc-port 18089 --zmq-port 18084 --rpc-ssl --wallet 44MnN1f3Eto8DZYUWuE5XZNUtE3vcRzt2j6PzqWpPau34e6Cf4fAxt6X2MBmrm6F9YMEiMNjN6W4Shn4pLcfNAja621jwyg ${{ secrets.MM_PARAMS }} --out-peers 50 --data-api data --local-api --loglevel 6
|
||||
|
||||
- name: Check p2pool.log
|
||||
run: |
|
||||
cd build
|
||||
grep 'Synchronization finished successfully' p2pool.log
|
||||
|
||||
- name: Archive p2pool.log
|
||||
uses: actions/upload-artifact@v4
|
||||
with:
|
||||
name: p2pool_ubuntu_data_msan
|
||||
path: |
|
||||
build/*.log
|
||||
build/data/
|
||||
|
||||
sync-test-ubuntu-ubsan:
|
||||
|
||||
timeout-minutes: 60
|
||||
runs-on: ubuntu-22.04
|
||||
|
||||
steps:
|
||||
- name: Install dependencies
|
||||
run: |
|
||||
sudo add-apt-repository -y ppa:ubuntu-toolchain-r/test
|
||||
sudo apt update
|
||||
sudo apt install -y git build-essential cmake libuv1-dev libzmq3-dev libgss-dev libcurl4-openssl-dev libidn2-0-dev gcc-12 g++-12
|
||||
|
||||
- name: Checkout repository
|
||||
uses: actions/checkout@v4
|
||||
with:
|
||||
submodules: recursive
|
||||
|
||||
- name: Build p2pool
|
||||
run: |
|
||||
mkdir build
|
||||
cd build
|
||||
cmake .. -DDEV_TEST_SYNC=ON -DDEV_WITH_UBSAN=ON -DCMAKE_C_COMPILER=gcc-12 -DCMAKE_CXX_COMPILER=g++-12 -DWITH_LTO=OFF -DCMAKE_POLICY_VERSION_MINIMUM="3.5"
|
||||
make -j$(nproc) p2pool
|
||||
|
||||
- name: Run p2pool
|
||||
run: |
|
||||
cd build
|
||||
mkdir data
|
||||
python ../tests/src/stratum_dummy.py 1 &
|
||||
python ../tests/src/stratum_dummy.py 2 &
|
||||
python ../tests/src/stratum_dummy.py 3 &
|
||||
sudo sysctl vm.mmap_rnd_bits=28
|
||||
UBSAN_OPTIONS="suppressions=../tests/src/ubsan_sup.txt halt_on_error=1" ./p2pool --host node.monerodevs.org --rpc-port 18089 --zmq-port 18084 --host node.richfowler.net --rpc-port 18089 --zmq-port 18084 --rpc-ssl --wallet 44MnN1f3Eto8DZYUWuE5XZNUtE3vcRzt2j6PzqWpPau34e6Cf4fAxt6X2MBmrm6F9YMEiMNjN6W4Shn4pLcfNAja621jwyg ${{ secrets.MM_PARAMS }} --mini --out-peers 200 --data-api data --local-api --loglevel 6
|
||||
|
||||
- name: Check p2pool.log
|
||||
run: |
|
||||
cd build
|
||||
grep 'Synchronization finished successfully' p2pool.log
|
||||
|
||||
- name: Archive p2pool.log
|
||||
uses: actions/upload-artifact@v4
|
||||
with:
|
||||
name: p2pool_ubuntu_data_ubsan
|
||||
path: |
|
||||
build/*.log
|
||||
build/data/
|
||||
|
||||
sync-test-ubuntu-asan:
|
||||
|
||||
timeout-minutes: 60
|
||||
runs-on: ubuntu-22.04
|
||||
|
||||
steps:
|
||||
- name: Install dependencies
|
||||
run: |
|
||||
sudo add-apt-repository -y ppa:ubuntu-toolchain-r/test
|
||||
sudo apt update
|
||||
sudo apt install -y git build-essential cmake libuv1-dev libzmq3-dev libgss-dev libcurl4-openssl-dev libidn2-0-dev gcc-12 g++-12
|
||||
|
||||
- name: Checkout repository
|
||||
uses: actions/checkout@v4
|
||||
with:
|
||||
submodules: recursive
|
||||
|
||||
- name: Build p2pool
|
||||
run: |
|
||||
mkdir build
|
||||
cd build
|
||||
cmake .. -DDEV_TEST_SYNC=ON -DDEV_WITH_ASAN=ON -DCMAKE_C_COMPILER=gcc-12 -DCMAKE_CXX_COMPILER=g++-12 -DCMAKE_C_FLAGS="-fno-omit-frame-pointer -fsanitize=address -Og -g" -DCMAKE_CXX_FLAGS="-fno-omit-frame-pointer -fsanitize=address -Og -g" -DWITH_LTO=OFF -DCMAKE_POLICY_VERSION_MINIMUM="3.5"
|
||||
make -j$(nproc) p2pool
|
||||
|
||||
- name: Run p2pool
|
||||
run: |
|
||||
cd build
|
||||
mkdir data
|
||||
python ../tests/src/stratum_dummy.py 1 &
|
||||
python ../tests/src/stratum_dummy.py 2 &
|
||||
python ../tests/src/stratum_dummy.py 3 &
|
||||
sudo sysctl vm.mmap_rnd_bits=28
|
||||
ASAN_OPTIONS="detect_stack_use_after_return=1 atexit=1" ./p2pool --host node.monerodevs.org --rpc-port 18089 --zmq-port 18084 --host node.richfowler.net --rpc-port 18089 --zmq-port 18084 --rpc-ssl --wallet 44MnN1f3Eto8DZYUWuE5XZNUtE3vcRzt2j6PzqWpPau34e6Cf4fAxt6X2MBmrm6F9YMEiMNjN6W4Shn4pLcfNAja621jwyg ${{ secrets.MM_PARAMS }} --mini --out-peers 200 --data-api data --local-api --loglevel 6
|
||||
|
||||
- name: Check p2pool.log
|
||||
run: |
|
||||
cd build
|
||||
grep 'Synchronization finished successfully' p2pool.log
|
||||
|
||||
- name: Archive p2pool.log
|
||||
uses: actions/upload-artifact@v4
|
||||
with:
|
||||
name: p2pool_ubuntu_data_asan
|
||||
path: |
|
||||
build/*.log
|
||||
build/data/
|
||||
|
||||
sync-test-macos:
|
||||
|
||||
timeout-minutes: 60
|
||||
runs-on: ${{ matrix.config.os }}
|
||||
|
||||
strategy:
|
||||
matrix:
|
||||
config:
|
||||
- {os: macos-13, flags: ""}
|
||||
- {os: macos-14, flags: "-target arm64-apple-macos-11"}
|
||||
|
||||
steps:
|
||||
- name: Checkout repository
|
||||
uses: actions/checkout@v4
|
||||
with:
|
||||
submodules: recursive
|
||||
|
||||
- name: Build libcurl
|
||||
run: |
|
||||
cd external/src/curl
|
||||
cmake . -DCMAKE_C_COMPILER="$(brew --prefix llvm@15)/bin/clang" -DCMAKE_AR="$(brew --prefix llvm@15)/bin/llvm-ar" -DCMAKE_RANLIB="$(brew --prefix llvm@15)/bin/llvm-ranlib" -DCMAKE_C_FLAGS="${{ matrix.config.flags }}" -DBUILD_CURL_EXE=OFF -DBUILD_SHARED_LIBS=OFF -DCURL_DISABLE_INSTALL=ON -DCURL_ENABLE_EXPORT_TARGET=OFF -DCURL_DISABLE_HEADERS_API=ON -DCURL_DISABLE_BINDLOCAL=ON -DBUILD_LIBCURL_DOCS=OFF -DBUILD_MISC_DOCS=OFF -DENABLE_CURL_MANUAL=OFF -DCURL_ZLIB=OFF -DCURL_BROTLI=OFF -DCURL_ZSTD=OFF -DCURL_DISABLE_ALTSVC=ON -DCURL_DISABLE_COOKIES=ON -DCURL_DISABLE_DOH=ON -DCURL_DISABLE_GETOPTIONS=ON -DCURL_DISABLE_HSTS=ON -DCURL_DISABLE_LIBCURL_OPTION=ON -DCURL_DISABLE_MIME=ON -DCURL_DISABLE_NETRC=ON -DCURL_DISABLE_NTLM=ON -DCURL_DISABLE_PARSEDATE=ON -DCURL_DISABLE_PROGRESS_METER=ON -DCURL_DISABLE_SHUFFLE_DNS=ON -DCURL_DISABLE_SOCKETPAIR=ON -DCURL_DISABLE_VERBOSE_STRINGS=ON -DCURL_DISABLE_WEBSOCKETS=ON -DHTTP_ONLY=ON -DCURL_ENABLE_SSL=OFF -DUSE_LIBIDN2=OFF -DCURL_USE_LIBPSL=OFF -DCURL_USE_LIBSSH2=OFF -DENABLE_UNIX_SOCKETS=OFF -DCURL_DISABLE_TESTS=ON -DUSE_NGHTTP2=OFF -DBUILD_EXAMPLES=OFF -DP2POOL_BORINGSSL=ON -DCURL_DISABLE_SRP=ON -DCURL_DISABLE_AWS=ON -DCURL_DISABLE_BASIC_AUTH=ON -DCURL_DISABLE_BEARER_AUTH=ON -DCURL_DISABLE_KERBEROS_AUTH=ON -DCURL_DISABLE_NEGOTIATE_AUTH=ON -DOPENSSL_INCLUDE_DIR=../grpc/third_party/boringssl-with-bazel/src/include
|
||||
make -j4
|
||||
|
||||
- name: Build libuv
|
||||
run: |
|
||||
cd external/src/libuv
|
||||
mkdir build
|
||||
cd build
|
||||
cmake .. -DCMAKE_C_COMPILER="$(brew --prefix llvm@15)/bin/clang" -DCMAKE_AR="$(brew --prefix llvm@15)/bin/llvm-ar" -DCMAKE_RANLIB="$(brew --prefix llvm@15)/bin/llvm-ranlib" -DCMAKE_C_FLAGS='${{ matrix.config.flags }}' -DBUILD_TESTING=OFF -DLIBUV_BUILD_SHARED=OFF
|
||||
make -j4
|
||||
|
||||
- name: Build libzmq
|
||||
run: |
|
||||
cd external/src/libzmq
|
||||
mkdir build
|
||||
cd build
|
||||
cmake .. -DCMAKE_C_COMPILER="$(brew --prefix llvm@15)/bin/clang" -DCMAKE_CXX_COMPILER="$(brew --prefix llvm@15)/bin/clang++" -DCMAKE_AR="$(brew --prefix llvm@15)/bin/llvm-ar" -DCMAKE_RANLIB="$(brew --prefix llvm@15)/bin/llvm-ranlib" -DCMAKE_C_FLAGS='${{ matrix.config.flags }}' -DCMAKE_CXX_FLAGS='${{ matrix.config.flags }}' -DWITH_LIBSODIUM=OFF -DWITH_LIBBSD=OFF -DBUILD_TESTS=OFF -DWITH_DOCS=OFF -DENABLE_DRAFTS=OFF -DBUILD_SHARED=OFF
|
||||
make -j4
|
||||
|
||||
- name: Build p2pool
|
||||
run: |
|
||||
mkdir build
|
||||
cd build
|
||||
cmake .. -DCMAKE_C_COMPILER="$(brew --prefix llvm@15)/bin/clang" -DCMAKE_CXX_COMPILER="$(brew --prefix llvm@15)/bin/clang++" -DCMAKE_AR="$(brew --prefix llvm@15)/bin/llvm-ar" -DCMAKE_RANLIB="$(brew --prefix llvm@15)/bin/llvm-ranlib" -DCMAKE_C_FLAGS='${{ matrix.config.flags }}' -DCMAKE_CXX_FLAGS='${{ matrix.config.flags }}' -DWITH_LTO=OFF -DSTATIC_LIBS=ON -DDEV_TEST_SYNC=ON -DDEV_DEBUG=ON
|
||||
make -j4 p2pool
|
||||
|
||||
- name: Run p2pool
|
||||
run: |
|
||||
cd build
|
||||
mkdir data
|
||||
python3 ../tests/src/stratum_dummy.py 1 &
|
||||
python3 ../tests/src/stratum_dummy.py 2 &
|
||||
python3 ../tests/src/stratum_dummy.py 3 &
|
||||
./p2pool --host node.monerodevs.org --rpc-port 18089 --zmq-port 18084 --host node.richfowler.net --rpc-port 18089 --zmq-port 18084 --rpc-ssl --wallet 44MnN1f3Eto8DZYUWuE5XZNUtE3vcRzt2j6PzqWpPau34e6Cf4fAxt6X2MBmrm6F9YMEiMNjN6W4Shn4pLcfNAja621jwyg ${{ secrets.MM_PARAMS }} --mini --out-peers 200 --data-api data --local-api --loglevel 6
|
||||
|
||||
- name: Check p2pool.log
|
||||
run: |
|
||||
cd build
|
||||
grep 'Synchronization finished successfully' p2pool.log
|
||||
|
||||
- name: Archive p2pool.log
|
||||
uses: actions/upload-artifact@v4
|
||||
with:
|
||||
name: p2pool_${{ matrix.config.os }}_data
|
||||
path: |
|
||||
build/*.log
|
||||
build/data/
|
||||
|
||||
sync-test-windows-debug-asan:
|
||||
|
||||
timeout-minutes: 60
|
||||
runs-on: windows-2022
|
||||
|
||||
steps:
|
||||
- name: Checkout repository
|
||||
uses: actions/checkout@v4
|
||||
with:
|
||||
submodules: recursive
|
||||
|
||||
- name: Setup cmake
|
||||
uses: lukka/get-cmake@latest
|
||||
|
||||
- name: Build p2pool
|
||||
run: |
|
||||
mkdir build
|
||||
cd build
|
||||
cmake .. -G "Visual Studio 17 2022" -DCMAKE_SYSTEM_VERSION="10.0" -DDEV_TEST_SYNC=ON -DDEV_WITH_ASAN=ON -DCMAKE_POLICY_VERSION_MINIMUM="3.5"
|
||||
& "C:\\Program Files\\Microsoft Visual Studio\\2022\\Enterprise\\Msbuild\\Current\\Bin\\amd64\\msbuild" -v:m /m /p:Configuration=Debug p2pool.vcxproj
|
||||
|
||||
- name: Run p2pool
|
||||
shell: cmd
|
||||
run: |
|
||||
call "C:\\Program Files\\Microsoft Visual Studio\\2022\\Enterprise\\VC\\Auxiliary\\Build\\vcvarsall.bat" amd64
|
||||
cd build/Debug
|
||||
mkdir data
|
||||
start python ../../tests/src/stratum_dummy.py 1
|
||||
start python ../../tests/src/stratum_dummy.py 2
|
||||
start python ../../tests/src/stratum_dummy.py 3
|
||||
p2pool.exe --host node.monerodevs.org --rpc-port 18089 --zmq-port 18084 --host node.richfowler.net --rpc-port 18089 --zmq-port 18084 --rpc-ssl --wallet 44MnN1f3Eto8DZYUWuE5XZNUtE3vcRzt2j6PzqWpPau34e6Cf4fAxt6X2MBmrm6F9YMEiMNjN6W4Shn4pLcfNAja621jwyg ${{ secrets.MM_PARAMS }} --mini --out-peers 200 --data-api data --local-api --loglevel 6
|
||||
|
||||
- name: Check p2pool.log
|
||||
run: |
|
||||
cd build/Debug
|
||||
findstr /C:"Synchronization finished successfully" p2pool.log
|
||||
|
||||
- name: Archive p2pool.log
|
||||
uses: actions/upload-artifact@v4
|
||||
with:
|
||||
name: p2pool_windows_data_debug_asan
|
||||
path: |
|
||||
build/Debug/*.log
|
||||
build/Debug/data/
|
||||
|
||||
sync-test-windows-leaks:
|
||||
|
||||
timeout-minutes: 60
|
||||
runs-on: windows-2022
|
||||
|
||||
steps:
|
||||
- name: Checkout repository
|
||||
uses: actions/checkout@v4
|
||||
with:
|
||||
submodules: recursive
|
||||
|
||||
- name: Setup cmake
|
||||
uses: lukka/get-cmake@latest
|
||||
|
||||
- name: Build p2pool
|
||||
run: |
|
||||
mkdir build
|
||||
cd build
|
||||
cmake .. -G "Visual Studio 17 2022" -DCMAKE_SYSTEM_VERSION="10.0" -DDEV_TEST_SYNC=ON -DDEV_TRACK_MEMORY=ON -DCMAKE_POLICY_VERSION_MINIMUM="3.5"
|
||||
& "C:\\Program Files\\Microsoft Visual Studio\\2022\\Enterprise\\Msbuild\\Current\\Bin\\amd64\\msbuild" -v:m /m /p:Configuration=RelWithDebInfo p2pool.vcxproj
|
||||
|
||||
- name: Run p2pool
|
||||
run: |
|
||||
cd build/RelWithDebInfo
|
||||
mkdir data
|
||||
Start-Process python -ArgumentList "../../tests/src/stratum_dummy.py 1"
|
||||
Start-Process python -ArgumentList "../../tests/src/stratum_dummy.py 2"
|
||||
Start-Process python -ArgumentList "../../tests/src/stratum_dummy.py 3"
|
||||
./p2pool.exe --host node.monerodevs.org --rpc-port 18089 --zmq-port 18084 --host node.richfowler.net --rpc-port 18089 --zmq-port 18084 --rpc-ssl --wallet 44MnN1f3Eto8DZYUWuE5XZNUtE3vcRzt2j6PzqWpPau34e6Cf4fAxt6X2MBmrm6F9YMEiMNjN6W4Shn4pLcfNAja621jwyg ${{ secrets.MM_PARAMS }} --mini --out-peers 200 --data-api data --local-api --loglevel 6
|
||||
|
||||
- name: Check p2pool.log
|
||||
run: |
|
||||
cd build/RelWithDebInfo
|
||||
Remove-Item p2pool.cache -Force
|
||||
findstr /C:"Synchronization finished successfully" p2pool.log
|
||||
|
||||
- name: Archive p2pool.log
|
||||
if: '!cancelled()'
|
||||
uses: actions/upload-artifact@v4
|
||||
with:
|
||||
name: p2pool_windows_data_leaks
|
||||
path: |
|
||||
build/RelWithDebInfo/p2pool.*
|
||||
build/RelWithDebInfo/data/
|
||||
@@ -1,2 +1,3 @@
|
||||
.vscode
|
||||
build
|
||||
logs
|
||||
|
||||
+10
@@ -19,3 +19,13 @@
|
||||
[submodule "external/src/robin-hood-hashing"]
|
||||
path = external/src/robin-hood-hashing
|
||||
url = https://github.com/SChernykh/robin-hood-hashing
|
||||
[submodule "external/src/curl"]
|
||||
path = external/src/curl
|
||||
url = https://github.com/SChernykh/curl
|
||||
[submodule "external/src/miniupnp"]
|
||||
path = external/src/miniupnp
|
||||
url = https://github.com/SChernykh/miniupnp
|
||||
[submodule "external/src/grpc"]
|
||||
path = external/src/grpc
|
||||
url = https://github.com/SChernykh/grpc
|
||||
branch = v1.61.x
|
||||
|
||||
@@ -0,0 +1 @@
|
||||
SChernykh <15806605+SChernykh@users.noreply.github.com> sech1 <sech1@sech1>
|
||||
+357
-39
@@ -1,26 +1,105 @@
|
||||
cmake_minimum_required(VERSION 2.8.12)
|
||||
cmake_minimum_required(VERSION 3.10)
|
||||
project(p2pool)
|
||||
|
||||
include(cmake/standard.cmake)
|
||||
|
||||
message(STATUS "Build environment:
|
||||
System processor: ${CMAKE_SYSTEM_PROCESSOR}
|
||||
C compiler: ${CMAKE_C_COMPILER} (${CMAKE_C_COMPILER_ID})
|
||||
CXX compiler: ${CMAKE_CXX_COMPILER} (${CMAKE_CXX_COMPILER_ID})
|
||||
")
|
||||
|
||||
set_property(GLOBAL PROPERTY USE_FOLDERS ON)
|
||||
|
||||
option(STATIC_BINARY "Build static binary" OFF)
|
||||
option(STATIC_LIBS "Link libuv and libzmq statically" OFF)
|
||||
option(WITH_RANDOMX "Include the RandomX library in the build. If this is turned off, p2pool will rely on monerod for verifying RandomX hashes" ON)
|
||||
option(WITH_LTO "Use link-time compiler optimization (if linking fails for you, run cmake with -DWITH_LTO=OFF)" ON)
|
||||
option(WITH_UPNP "Include UPnP support. If this is turned off, p2pool will not be able to configure port forwarding on UPnP-enabled routers." ON)
|
||||
option(WITH_GRPC "Include gRPC support. If this is turned off, p2pool will not be able to merge mine with Tari." ON)
|
||||
option(WITH_TLS "Include TLS support. If this is turned off, p2pool will not support Stratum TLS connections, and lack many other security features. It's recommended to keep it ON!" ON)
|
||||
|
||||
set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${CMAKE_SOURCE_DIR}/cmake")
|
||||
option(WITH_MERGE_MINING_DONATION "Merge mine donations to the author. This doesn't affect your hashrate or payouts in any way - only unused merge mining capacity will be utilised. If you merge mine yourself, your settings will take priority." ON)
|
||||
|
||||
if (${CMAKE_VERSION} VERSION_GREATER "3.5.2")
|
||||
set_property(DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR} PROPERTY VS_STARTUP_PROJECT p2pool)
|
||||
option(DEV_TEST_SYNC "[Developer only] Sync test, stop p2pool after sync is complete" OFF)
|
||||
option(DEV_WITH_TSAN "[Developer only] Compile with thread sanitizer" OFF)
|
||||
option(DEV_WITH_MSAN "[Developer only] Compile with memory sanitizer" OFF)
|
||||
option(DEV_WITH_UBSAN "[Developer only] Compile with undefined behavior sanitizer" OFF)
|
||||
option(DEV_WITH_ASAN "[Developer only] Compile with address sanitizer" OFF)
|
||||
option(DEV_CLANG_TIDY "[Developer only] Compile for clang-tidy" OFF)
|
||||
option(DEV_TRACK_MEMORY "[Developer only] Track memory allocations" OFF)
|
||||
option(DEV_DEBUG "[Developer only] Compile a debug build" OFF)
|
||||
|
||||
set_property(DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR} PROPERTY VS_STARTUP_PROJECT p2pool)
|
||||
|
||||
if (CMAKE_CXX_COMPILER_ID MATCHES MSVC)
|
||||
include(cmake/msvc_libs.cmake)
|
||||
endif()
|
||||
|
||||
if (WITH_GRPC)
|
||||
add_definitions(-DWITH_GRPC)
|
||||
include(cmake/grpc.cmake)
|
||||
|
||||
add_subdirectory(external/src/Tari)
|
||||
elseif (WITH_TLS)
|
||||
add_subdirectory(cmake/ssl)
|
||||
include_directories(external/src/grpc/third_party/boringssl-with-bazel/src/include)
|
||||
endif()
|
||||
|
||||
if (WITH_RANDOMX)
|
||||
add_definitions(-DWITH_RANDOMX)
|
||||
add_subdirectory(external/src/RandomX)
|
||||
set(LIBS randomx)
|
||||
set(LIBS ${LIBS} randomx)
|
||||
endif()
|
||||
|
||||
if (WITH_UPNP)
|
||||
add_definitions(-DWITH_UPNP)
|
||||
add_subdirectory(external/src/miniupnp/miniupnpc)
|
||||
set(LIBS ${LIBS} libminiupnpc-static)
|
||||
endif()
|
||||
|
||||
if (WITH_MERGE_MINING_DONATION)
|
||||
add_definitions(-DWITH_MERGE_MINING_DONATION)
|
||||
endif()
|
||||
|
||||
if (DEV_TEST_SYNC)
|
||||
add_definitions(-DDEV_TEST_SYNC)
|
||||
endif()
|
||||
|
||||
if (DEV_WITH_TSAN)
|
||||
add_definitions(-DDEV_WITH_TSAN)
|
||||
endif()
|
||||
|
||||
if (DEV_WITH_MSAN)
|
||||
add_definitions(-DDEV_WITH_MSAN)
|
||||
endif()
|
||||
|
||||
if (DEV_WITH_UBSAN)
|
||||
add_definitions(-DDEV_WITH_UBSAN)
|
||||
endif()
|
||||
|
||||
if (DEV_WITH_ASAN)
|
||||
add_definitions(-DDEV_WITH_ASAN)
|
||||
endif()
|
||||
|
||||
if (DEV_CLANG_TIDY)
|
||||
add_definitions(-DDEV_CLANG_TIDY)
|
||||
endif()
|
||||
|
||||
if (DEV_TRACK_MEMORY)
|
||||
add_definitions(-DDEV_TRACK_MEMORY)
|
||||
endif()
|
||||
|
||||
if (DEV_DEBUG)
|
||||
add_definitions(-DDEV_DEBUG)
|
||||
endif()
|
||||
|
||||
include(cmake/flags.cmake)
|
||||
|
||||
set(HEADERS
|
||||
external/src/crypto/sha256.h
|
||||
external/src/cryptonote/crypto-ops.h
|
||||
external/src/llhttp/llhttp.h
|
||||
external/src/hardforks/hardforks.h
|
||||
src/block_cache.h
|
||||
src/block_template.h
|
||||
src/common.h
|
||||
@@ -31,6 +110,9 @@ set(HEADERS
|
||||
src/keccak.h
|
||||
src/log.h
|
||||
src/mempool.h
|
||||
src/merge_mining_client.h
|
||||
src/merge_mining_client_json_rpc.h
|
||||
src/merkle.h
|
||||
src/p2p_server.h
|
||||
src/p2pool.h
|
||||
src/p2pool_api.h
|
||||
@@ -41,7 +123,6 @@ set(HEADERS
|
||||
src/side_chain.h
|
||||
src/stratum_server.h
|
||||
src/tcp_server.h
|
||||
src/tcp_server.inl
|
||||
src/util.h
|
||||
src/uv_util.h
|
||||
src/wallet.h
|
||||
@@ -49,11 +130,10 @@ set(HEADERS
|
||||
)
|
||||
|
||||
set(SOURCES
|
||||
external/src/crypto/sha256.c
|
||||
external/src/cryptonote/crypto-ops-data.c
|
||||
external/src/cryptonote/crypto-ops.c
|
||||
external/src/llhttp/api.c
|
||||
external/src/llhttp/http.c
|
||||
external/src/llhttp/llhttp.c
|
||||
external/src/hardforks/hardforks.cpp
|
||||
src/block_cache.cpp
|
||||
src/block_template.cpp
|
||||
src/console_commands.cpp
|
||||
@@ -64,6 +144,9 @@ set(SOURCES
|
||||
src/main.cpp
|
||||
src/memory_leak_debug.cpp
|
||||
src/mempool.cpp
|
||||
src/merge_mining_client.cpp
|
||||
src/merge_mining_client_json_rpc.cpp
|
||||
src/merkle.cpp
|
||||
src/p2p_server.cpp
|
||||
src/p2pool.cpp
|
||||
src/p2pool_api.cpp
|
||||
@@ -72,87 +155,322 @@ set(SOURCES
|
||||
src/pow_hash.cpp
|
||||
src/side_chain.cpp
|
||||
src/stratum_server.cpp
|
||||
src/tcp_server.cpp
|
||||
src/util.cpp
|
||||
src/wallet.cpp
|
||||
src/zmq_reader.cpp
|
||||
)
|
||||
|
||||
if (AMD64)
|
||||
set(SOURCES ${SOURCES} src/keccak_bmi.cpp)
|
||||
if (CMAKE_C_COMPILER_ID MATCHES GNU OR CMAKE_C_COMPILER_ID MATCHES Clang)
|
||||
set_source_files_properties(src/keccak_bmi.cpp PROPERTIES COMPILE_FLAGS "${CMAKE_CXX_FLAGS} -mbmi")
|
||||
endif()
|
||||
endif()
|
||||
|
||||
if (WITH_RANDOMX)
|
||||
set(HEADERS ${HEADERS} src/miner.h)
|
||||
set(SOURCES ${SOURCES} src/miner.cpp)
|
||||
else()
|
||||
set(HEADERS ${HEADERS} external/src/RandomX/src/cpu.hpp)
|
||||
set(SOURCES ${SOURCES} external/src/RandomX/src/cpu.cpp)
|
||||
endif()
|
||||
|
||||
if (WITH_GRPC)
|
||||
set(HEADERS ${HEADERS} src/merge_mining_client_tari.h)
|
||||
set(SOURCES ${SOURCES} src/merge_mining_client_tari.cpp)
|
||||
endif()
|
||||
|
||||
if (WITH_TLS)
|
||||
add_definitions(-DWITH_TLS)
|
||||
|
||||
set(HEADERS ${HEADERS} src/tls.h)
|
||||
set(SOURCES ${SOURCES} src/tls.cpp)
|
||||
endif()
|
||||
|
||||
source_group(TREE "${CMAKE_CURRENT_SOURCE_DIR}" PREFIX "Header Files" FILES ${HEADERS})
|
||||
source_group(TREE "${CMAKE_CURRENT_SOURCE_DIR}" PREFIX "Source Files" FILES ${SOURCES})
|
||||
|
||||
include(CheckFunctionExists)
|
||||
|
||||
if (STATIC_BINARY)
|
||||
add_definitions(-DCURL_STATICLIB)
|
||||
|
||||
check_function_exists(__nss_module_disable_loading HAVE_NSS_MODULE_DISABLE_LOADING)
|
||||
|
||||
if (HAVE_NSS_MODULE_DISABLE_LOADING)
|
||||
add_definitions(-DHAVE_NSS_MODULE_DISABLE_LOADING)
|
||||
endif()
|
||||
endif()
|
||||
|
||||
if (NOT ((CMAKE_CXX_COMPILER_ID MATCHES MSVC) OR STATIC_BINARY OR STATIC_LIBS))
|
||||
include(FindCURL)
|
||||
endif()
|
||||
|
||||
if (CURL_INCLUDE_DIRS)
|
||||
include_directories(${CURL_INCLUDE_DIRS})
|
||||
else()
|
||||
include_directories(external/src/curl/include)
|
||||
endif()
|
||||
|
||||
if ((CMAKE_CXX_COMPILER_ID MATCHES MSVC) OR STATIC_BINARY OR STATIC_LIBS)
|
||||
set(UV_INCLUDE_DIR external/src/libuv/include)
|
||||
set(ZMQ_INCLUDE_DIR external/src/libzmq/include)
|
||||
else()
|
||||
find_path(UV_INCLUDE_DIR NAMES uv.h PATH_SUFFIXES "include")
|
||||
find_path(ZMQ_INCLUDE_DIR NAMES zmq.h PATH_SUFFIXES "include")
|
||||
endif()
|
||||
|
||||
include_directories(src)
|
||||
include_directories(external/src)
|
||||
include_directories(external/src/crypto)
|
||||
include_directories(external/src/cryptonote)
|
||||
include_directories(external/src/libuv/include)
|
||||
include_directories(${UV_INCLUDE_DIR})
|
||||
include_directories(external/src/cppzmq)
|
||||
include_directories(external/src/libzmq/include)
|
||||
include_directories(external/src/llhttp)
|
||||
include_directories(${ZMQ_INCLUDE_DIR})
|
||||
if (WITH_RANDOMX)
|
||||
include_directories(external/src/RandomX/src)
|
||||
endif()
|
||||
include_directories(external/src/rapidjson/include)
|
||||
include_directories(external/src/robin-hood-hashing/src/include)
|
||||
if (WITH_UPNP)
|
||||
include_directories(external/src/miniupnp/miniupnpc/include)
|
||||
endif()
|
||||
|
||||
if (WIN32)
|
||||
set(LIBS ${LIBS} ws2_32 iphlpapi userenv psapi)
|
||||
set(LIBS ${LIBS} ws2_32 iphlpapi userenv psapi dnsapi dbghelp advapi32)
|
||||
if (CMAKE_CXX_COMPILER_ID MATCHES GNU)
|
||||
set(LIBS ${LIBS} bcrypt)
|
||||
endif()
|
||||
add_definitions(-DCURL_STATICLIB)
|
||||
add_definitions(-DWIN32_LEAN_AND_MEAN)
|
||||
add_definitions(-D_WIN32_WINNT=0x0600)
|
||||
elseif (CMAKE_SYSTEM_NAME STREQUAL FreeBSD)
|
||||
set(LIBS ${LIBS} pthread)
|
||||
elseif (NOT APPLE)
|
||||
set(LIBS ${LIBS} pthread gss dl)
|
||||
set(LIBS ${LIBS} pthread)
|
||||
endif()
|
||||
|
||||
if (CMAKE_CXX_COMPILER_ID MATCHES MSVC)
|
||||
find_library(ZMQ_LIBRARY_DEBUG NAMES libzmq-v142-mt-sgd-4_3_5 PATHS "external/lib/libzmq/Debug")
|
||||
find_library(ZMQ_LIBRARY NAMES libzmq-v142-mt-s-4_3_5 PATHS "external/lib/libzmq/Release")
|
||||
find_library(UV_LIBRARY_DEBUG NAMES uv_a PATHS "external/lib/libuv/Debug")
|
||||
find_library(UV_LIBRARY NAMES uv_a PATHS "external/lib/libuv/Release")
|
||||
elseif (CMAKE_CXX_COMPILER_ID MATCHES GNU OR CMAKE_CXX_COMPILER_ID MATCHES Clang)
|
||||
if (CMAKE_CXX_COMPILER_ID MATCHES GNU OR CMAKE_CXX_COMPILER_ID MATCHES Clang)
|
||||
find_library(ZMQ_LIBRARY_DEBUG NAMES zmq libzmq.a)
|
||||
find_library(ZMQ_LIBRARY NAMES zmq libzmq.a)
|
||||
find_library(UV_LIBRARY_DEBUG NAMES uv libuv.a)
|
||||
find_library(UV_LIBRARY NAMES uv libuv.a)
|
||||
find_library(SODIUM_LIBRARY sodium)
|
||||
if (WIN32)
|
||||
find_library(CURL_LIBRARY_DEBUG NAMES libcurl-d.a PATHS "external/src/curl/lib" NO_DEFAULT_PATH)
|
||||
find_library(CURL_LIBRARY NAMES libcurl.a PATHS "external/src/curl/lib" NO_DEFAULT_PATH)
|
||||
else()
|
||||
if (CURL_LIBRARIES)
|
||||
set(CURL_LIBRARY_DEBUG ${CURL_LIBRARIES})
|
||||
set(CURL_LIBRARY ${CURL_LIBRARIES})
|
||||
else()
|
||||
find_library(CURL_LIBRARY_DEBUG NAMES curl-d)
|
||||
find_library(CURL_LIBRARY NAMES curl)
|
||||
endif()
|
||||
endif()
|
||||
endif()
|
||||
|
||||
find_library(PGM_LIBRARY pgm)
|
||||
find_library(NORM_LIBRARY norm)
|
||||
|
||||
if (PGM_LIBRARY)
|
||||
set(LIBS ${LIBS} ${PGM_LIBRARY})
|
||||
if(APPLE)
|
||||
find_library(FOUNDATION_LIB Foundation)
|
||||
find_library(CORE_FOUNDATION_LIB CoreFoundation)
|
||||
find_library(SYSTEM_CONFIGURATION_LIB SystemConfiguration)
|
||||
set(LIBS ${LIBS} ${FOUNDATION_LIB} ${CORE_FOUNDATION_LIB} ${SYSTEM_CONFIGURATION_LIB})
|
||||
endif()
|
||||
|
||||
if (NORM_LIBRARY)
|
||||
set(LIBS ${LIBS} ${NORM_LIBRARY})
|
||||
add_definitions(-DZMQ_STATIC)
|
||||
|
||||
include(CheckIncludeFile)
|
||||
|
||||
check_include_file(asm/hwcap.h HAVE_HWCAP)
|
||||
if(HAVE_HWCAP)
|
||||
add_definitions(-DHAVE_HWCAP)
|
||||
endif()
|
||||
|
||||
if (SODIUM_LIBRARY)
|
||||
set(LIBS ${LIBS} ${SODIUM_LIBRARY})
|
||||
include(CheckCXXSourceCompiles)
|
||||
|
||||
check_cxx_source_compiles("int main(){ return __builtin_clzll(1);}" HAVE_BUILTIN_CLZLL)
|
||||
check_cxx_source_compiles("#include <intrin.h>\n#pragma intrinsic(_BitScanReverse64)\nint main(){unsigned long r;_BitScanReverse64(&r,1);return static_cast<int>(r);}" HAVE_BITSCANREVERSE64)
|
||||
check_cxx_source_compiles("#include <sched.h>\nint main(){sched_param param;return sched_setscheduler(0, SCHED_IDLE, ¶m);}" HAVE_SCHED)
|
||||
|
||||
include(CheckCSourceCompiles)
|
||||
|
||||
set(CMAKE_REQUIRED_LIBRARIES "resolv")
|
||||
|
||||
check_c_source_compiles("int main() { return 0; }" HAVE_RESOLV_LIB)
|
||||
|
||||
if (NOT HAVE_RESOLV_LIB)
|
||||
set(CMAKE_REQUIRED_LIBRARIES)
|
||||
endif()
|
||||
|
||||
add_definitions(/DZMQ_STATIC)
|
||||
check_c_source_compiles("
|
||||
#include <sys/types.h>
|
||||
#include <netinet/in.h>
|
||||
#include <arpa/nameser.h>
|
||||
#include <resolv.h>
|
||||
#include <stdio.h>
|
||||
#include <memory.h>
|
||||
|
||||
int main(int argc, char* argv[])
|
||||
{
|
||||
if (argc < 2) {
|
||||
return 1;
|
||||
}
|
||||
|
||||
res_init();
|
||||
|
||||
uint8_t answer[4096];
|
||||
const int anslen = res_query(argv[1], ns_c_in, ns_t_txt, answer, sizeof(answer));
|
||||
|
||||
if (anslen > (int) sizeof(answer)) {
|
||||
return 1;
|
||||
}
|
||||
|
||||
ns_msg handle;
|
||||
ns_initparse(answer, anslen, &handle);
|
||||
|
||||
for (int rrnum = 0, n = ns_msg_count(handle, ns_s_an); rrnum < n; ++rrnum) {
|
||||
ns_rr rr;
|
||||
if ((ns_parserr(&handle, ns_s_an, rrnum, &rr) == 0) && (ns_rr_type(rr) == ns_t_txt)) {
|
||||
for (const uint8_t* data = ns_rr_rdata(rr), *e = data + ns_rr_rdlen(rr); data < e;) {
|
||||
const int k = *(data++);
|
||||
if (k && (data + k <= e)) {
|
||||
char buf[256];
|
||||
memcpy(buf, data, k);
|
||||
buf[k] = 0;
|
||||
puts(buf);
|
||||
}
|
||||
data += k;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return 0;
|
||||
}" HAVE_RES_QUERY)
|
||||
|
||||
check_c_source_compiles("
|
||||
#define _GNU_SOURCE
|
||||
#include <pthread.h>
|
||||
|
||||
int main()
|
||||
{
|
||||
pthread_setname_np(pthread_self(), \"Main\");
|
||||
return 0;
|
||||
}" HAVE_PTHREAD_SETNAME_NP)
|
||||
|
||||
set(CMAKE_REQUIRED_LIBRARIES)
|
||||
|
||||
if (HAVE_BUILTIN_CLZLL)
|
||||
add_definitions(-DHAVE_BUILTIN_CLZLL)
|
||||
endif()
|
||||
|
||||
if (HAVE_BITSCANREVERSE64)
|
||||
add_definitions(-DHAVE_BITSCANREVERSE64)
|
||||
endif()
|
||||
|
||||
if (HAVE_SCHED)
|
||||
add_definitions(-DHAVE_SCHED)
|
||||
endif()
|
||||
|
||||
if (HAVE_RES_QUERY)
|
||||
add_definitions(-DHAVE_RES_QUERY)
|
||||
if (HAVE_RESOLV_LIB)
|
||||
set(LIBS ${LIBS} resolv)
|
||||
endif()
|
||||
endif()
|
||||
|
||||
if (HAVE_PTHREAD_SETNAME_NP)
|
||||
add_definitions(-DHAVE_PTHREAD_SETNAME_NP)
|
||||
endif()
|
||||
|
||||
check_c_source_compiles("#include <gnu/libc-version.h>\nint main() { return (gnu_get_libc_version() && gnu_get_libc_release()) ? 0 : 1; }" HAVE_GLIBC)
|
||||
|
||||
if (HAVE_GLIBC)
|
||||
add_definitions(-DHAVE_GLIBC)
|
||||
endif()
|
||||
|
||||
add_definitions("-DRAPIDJSON_PARSE_DEFAULT_FLAGS=kParseTrailingCommasFlag")
|
||||
|
||||
if (WIN32 AND (CMAKE_BUILD_TYPE STREQUAL "Release"))
|
||||
add_definitions(-DNDEBUG)
|
||||
endif()
|
||||
|
||||
include(cmake/git.cmake)
|
||||
|
||||
add_executable(${CMAKE_PROJECT_NAME} ${HEADERS} ${SOURCES})
|
||||
|
||||
if (STATIC_BINARY)
|
||||
add_custom_command(TARGET ${CMAKE_PROJECT_NAME} POST_BUILD COMMAND ${CMAKE_STRIP} ${CMAKE_PROJECT_NAME})
|
||||
if (STATIC_BINARY OR STATIC_LIBS)
|
||||
if ((CMAKE_BUILD_TYPE STREQUAL "Release") AND (NOT (DEV_WITH_TSAN OR DEV_WITH_MSAN OR DEV_WITH_UBSAN OR DEV_WITH_ASAN)))
|
||||
if (WIN32)
|
||||
add_custom_command(TARGET ${CMAKE_PROJECT_NAME} POST_BUILD COMMAND ${CMAKE_STRIP} "${CMAKE_PROJECT_NAME}.exe")
|
||||
else()
|
||||
add_custom_command(TARGET ${CMAKE_PROJECT_NAME} POST_BUILD COMMAND ${CMAKE_STRIP} ${CMAKE_PROJECT_NAME})
|
||||
endif()
|
||||
endif()
|
||||
|
||||
set(STATIC_LIBS "")
|
||||
|
||||
if (WITH_RANDOMX)
|
||||
set(STATIC_LIBS randomx)
|
||||
endif()
|
||||
|
||||
if (CMAKE_SYSTEM_NAME STREQUAL FreeBSD)
|
||||
if (WITH_UPNP)
|
||||
set(STATIC_LIBS ${STATIC_LIBS} libminiupnpc-static)
|
||||
endif()
|
||||
|
||||
if (WIN32)
|
||||
set(STATIC_LIBS ${STATIC_LIBS} ws2_32 iphlpapi userenv psapi dnsapi dbghelp)
|
||||
if ((CMAKE_CXX_COMPILER_ID MATCHES GNU) OR (CMAKE_CXX_COMPILER_ID MATCHES Clang))
|
||||
set(STATIC_LIBS ${STATIC_LIBS} bcrypt pthread)
|
||||
endif()
|
||||
elseif (CMAKE_SYSTEM_NAME STREQUAL FreeBSD)
|
||||
set(STATIC_LIBS ${STATIC_LIBS} pthread)
|
||||
elseif (NOT APPLE)
|
||||
set(STATIC_LIBS ${STATIC_LIBS} pthread dl)
|
||||
elseif (APPLE)
|
||||
find_library(FOUNDATION_LIB Foundation)
|
||||
find_library(CORE_FOUNDATION_LIB CoreFoundation)
|
||||
find_library(SYSTEM_CONFIGURATION_LIB SystemConfiguration)
|
||||
set(STATIC_LIBS ${STATIC_LIBS} ${FOUNDATION_LIB} ${CORE_FOUNDATION_LIB} ${SYSTEM_CONFIGURATION_LIB})
|
||||
else()
|
||||
set(STATIC_LIBS ${STATIC_LIBS} pthread)
|
||||
endif()
|
||||
|
||||
if (HAVE_RES_QUERY AND HAVE_RESOLV_LIB)
|
||||
set(STATIC_LIBS ${STATIC_LIBS} resolv)
|
||||
endif()
|
||||
|
||||
if (WITH_GRPC)
|
||||
set(STATIC_LIBS ${STATIC_LIBS} Tari_gRPC grpc grpc++ libprotobuf)
|
||||
elseif(WITH_TLS)
|
||||
set(STATIC_LIBS ${STATIC_LIBS} ssl crypto)
|
||||
endif()
|
||||
|
||||
if ((CMAKE_CXX_COMPILER_ID MATCHES GNU) AND (CMAKE_CXX_COMPILER_VERSION VERSION_LESS 9))
|
||||
set(STATIC_LIBS ${STATIC_LIBS} stdc++fs)
|
||||
endif()
|
||||
|
||||
target_link_libraries(${CMAKE_PROJECT_NAME}
|
||||
"${CMAKE_SOURCE_DIR}/external/src/libzmq/build/lib/libzmq.a"
|
||||
"${CMAKE_SOURCE_DIR}/external/src/libuv/build/libuv_a.a"
|
||||
"${CMAKE_SOURCE_DIR}/external/src/libuv/build/libuv.a"
|
||||
debug "${CMAKE_SOURCE_DIR}/external/src/curl/lib/libcurl-d.a"
|
||||
optimized "${CMAKE_SOURCE_DIR}/external/src/curl/lib/libcurl.a"
|
||||
${STATIC_LIBS}
|
||||
)
|
||||
else()
|
||||
target_link_libraries(${CMAKE_PROJECT_NAME} debug ${ZMQ_LIBRARY_DEBUG} debug ${UV_LIBRARY_DEBUG} optimized ${ZMQ_LIBRARY} optimized ${UV_LIBRARY} ${LIBS})
|
||||
if (WITH_GRPC)
|
||||
set(LIBS ${LIBS} Tari_gRPC grpc grpc++ libprotobuf)
|
||||
elseif(WITH_TLS)
|
||||
set(LIBS ${LIBS} ssl crypto)
|
||||
endif()
|
||||
|
||||
if ((CMAKE_CXX_COMPILER_ID MATCHES GNU) AND (CMAKE_CXX_COMPILER_VERSION VERSION_LESS 9))
|
||||
set(LIBS ${LIBS} stdc++fs)
|
||||
endif()
|
||||
|
||||
target_link_libraries(${CMAKE_PROJECT_NAME} debug ${ZMQ_LIBRARY_DEBUG} debug ${UV_LIBRARY_DEBUG} debug ${CURL_LIBRARY_DEBUG} optimized ${ZMQ_LIBRARY} optimized ${UV_LIBRARY} optimized ${CURL_LIBRARY} ${LIBS})
|
||||
endif()
|
||||
|
||||
message(STATUS "Summary of build options:
|
||||
C compiler: ${CMAKE_C_COMPILER} (${CMAKE_C_COMPILER_ID})
|
||||
CXX compiler: ${CMAKE_CXX_COMPILER} (${CMAKE_CXX_COMPILER_ID})
|
||||
C_FLAGS: ${CMAKE_C_FLAGS}
|
||||
CXX_FLAGS: ${CMAKE_CXX_FLAGS}
|
||||
")
|
||||
|
||||
+6
-3
@@ -1,4 +1,4 @@
|
||||
FROM ubuntu:latest
|
||||
FROM debian:12-slim
|
||||
|
||||
RUN set -e && \
|
||||
apt-get update -q -y --no-install-recommends && \
|
||||
@@ -12,7 +12,8 @@ RUN set -e && \
|
||||
libsodium-dev \
|
||||
libpgm-dev \
|
||||
libnorm-dev \
|
||||
libgss-dev
|
||||
libgss-dev \
|
||||
libcurl4-openssl-dev
|
||||
|
||||
ADD . /usr/src/p2pool
|
||||
WORKDIR /usr/src/p2pool
|
||||
@@ -24,7 +25,7 @@ RUN git submodule update --init --recursive && \
|
||||
|
||||
# ---
|
||||
|
||||
FROM ubuntu:latest
|
||||
FROM debian:12-slim
|
||||
COPY --from=0 /usr/src/p2pool/build/p2pool /
|
||||
|
||||
RUN set -e && \
|
||||
@@ -32,6 +33,7 @@ RUN set -e && \
|
||||
DEBIAN_FRONTEND="noninteractive" apt-get install -q -y --no-install-recommends \
|
||||
libzmq5 \
|
||||
libuv1 \
|
||||
libcurl4 \
|
||||
&& \
|
||||
apt-get clean
|
||||
|
||||
@@ -43,6 +45,7 @@ USER p2pool
|
||||
|
||||
EXPOSE 3333
|
||||
EXPOSE 37889
|
||||
EXPOSE 37888
|
||||
|
||||
VOLUME /home/p2pool/.p2pool
|
||||
|
||||
|
||||
@@ -2,11 +2,15 @@
|
||||
|
||||
Decentralized pool for Monero mining.
|
||||
|
||||
Pool status and monitoring pages can be found at https://p2pool.io/, https://p2pool.io/mini/ and https://p2pool.observer/
|
||||
Pool status and monitoring pages can be found at https://p2pool.io/, https://p2pool.io/mini/ and https://p2pool.observer/, https://mini.p2pool.observer/
|
||||
|
||||
These are 3rd-party pages. If they are down, it doesn't mean there is a problem with P2Pool itself - it keeps mining always thanks to its decentralized nature.
|
||||
|
||||
### Build Status
|
||||
|
||||

|
||||

|
||||
|
||||

|
||||

|
||||

|
||||
@@ -14,17 +18,21 @@ Pool status and monitoring pages can be found at https://p2pool.io/, https://p2p
|
||||
<img alt="Coverity Scan Build Status"
|
||||
src="https://scan.coverity.com/projects/23659/badge.svg"/>
|
||||
</a>
|
||||

|
||||
# Contents
|
||||
- [Pool mining vs Solo mining vs P2Pool mining](#pool-mining-vs-solo-mining-vs-p2pool-mining)
|
||||
- [Features](#features)
|
||||
- [How PPLNS works in P2Pool](#how-pplns-works-in-p2pool)
|
||||
- [How payouts work in P2Pool](#how-payouts-work-in-p2pool)
|
||||
- [Default P2Pool parameters](#default-p2pool-parameters)
|
||||
- [Monero version support](#monero-version-support)
|
||||
- [How to mine on P2Pool](#how-to-mine-on-p2pool)
|
||||
- [General Considerations](#general-considerations)
|
||||
- [GUI for P2Pool](#gui-for-p2pool)
|
||||
- [Merge mining](#merge-mining)
|
||||
- [GNU/Linux](#gnulinux)
|
||||
- [Windows](#windows)
|
||||
- [Build instructions](#build-instructions)
|
||||
- [Reproducible builds](#reproducible-builds)
|
||||
- [Donations](#donations)
|
||||
|
||||
## Pool mining vs Solo mining vs P2Pool mining
|
||||
@@ -35,80 +43,130 @@ Here's the comparison table of the different ways of mining. While pool mining i
|
||||
|-|-|-|-|-|-|-|-|
|
||||
|Centralized pool|Regular|0-3%|0.001-0.01 XMR|Yes|Less stable due to pool server outages|Pool admin controls your mined funds, what you mine and can execute network attacks|Only miner software is required
|
||||
|Solo|Rare|0%|0.6 XMR or more|No|As stable as your Monero node|100% under your control|Monero node + optional miner
|
||||
|**P2Pool**|Regular|0%|~0.0003 XMR|No|As stable as your Monero node|100% under your control|Monero node + P2Pool node + miner
|
||||
|**P2Pool**|Regular|0%|~0.00027 XMR|No|Very stable: node failover and multiple Monero nodes are supported|100% under your control|Monero node(s) + P2Pool node(s) + optional miner(s)
|
||||
|
||||
## Features
|
||||
|
||||
* Decentralized: no central server that can be shutdown/blocked. P2Pool uses a separate blockchain to merge mine with Monero. Pool admin can't go rogue or be pressured to do an attack on the network because there is no pool admin!
|
||||
* Permissionless: there is no one to decide who can mine on the pool and who can't.
|
||||
* Trustless: there is no pool wallet, funds are never in custody. All pool blocks pay out to miners immediately.
|
||||
* Trustless: there is no pool wallet, funds are never in custody. All pool blocks pay out to miners directly.
|
||||
* PPLNS payout scheme
|
||||
* **0% fee**
|
||||
* **0 XMR payout fee**
|
||||
* **~0.0003 XMR minimal payout**
|
||||
* **~0.00027 XMR minimal payout**
|
||||
* Fast block times, down to 1 second
|
||||
* Uncle blocks are supported to avoid orphans - all your shares will be accounted for!
|
||||
* Configurable PPLNS window size and block time
|
||||
* Advanced mempool picking algorithm, it creates blocks with better reward than what monerod solo mining does
|
||||
* Password protected private pools
|
||||
* Highly reliable configurations are supported (multiple P2Pool nodes mining to the same wallet, each P2Pool node can use multiple Monero nodes and switch on the fly if an issue is detected)
|
||||
|
||||
## How PPLNS works in P2Pool
|
||||
## How payouts work in P2Pool
|
||||
|
||||
First you need to find a pool share. This share will stay in PPLNS window for 2160 pool blocks (6 hours). The moment P2Pool finds a Monero block and you have at least 1 pool share in PPLNS window, you'll get a payout! Monero block reward is split between all miner wallets in PPLNS window. Each miner gets a part of block reward proportional to the total difficulty of his/her shares in PPLNS window.
|
||||
First you need to find a pool share. This share will stay in [PPLNS](https://en.wikipedia.org/wiki/Mining_pool#Pay-per-last-N-shares) window for up to 2160 pool blocks (6 hours, auto adjustable to balance payout sizes and frequency). The moment P2Pool finds a Monero block and you have at least 1 pool share in PPLNS window, you'll get a payout! Monero block reward is split between all miner wallets in PPLNS window. Each miner gets a part of block reward proportional to the total difficulty of his/her shares in PPLNS window.
|
||||
|
||||
**NOTE** If P2Pool doesn't have enough hashrate to find Monero blocks faster than every 6 hours on average (~15 MH/s), **not all your pool shares will result in a payout**. Even if pool hashrate is higher, bad luck can sometimes result in a share going through PPLNS window without a payout. But in the long run it will be compensated by other shares receiving multiple payouts - your payouts will average out to what you'd get with regular pool mining.
|
||||
|
||||
## Default P2Pool parameters
|
||||
|
||||
* Block time: 10 seconds
|
||||
* PPLNS window: 2160 blocks (6 hours)
|
||||
* Minimum payout = Monero block reward/2160, ~0.0003 XMR
|
||||
* PPLNS window: up to 2160 blocks (6 hours, auto adjustable to balance payout sizes and frequency)
|
||||
* Minimum payout = Monero block reward/2160, ~0.00027 XMR
|
||||
|
||||
## Monero version support
|
||||
|
||||
Monero will undergo a network upgrade on July 16th, 2022 (block 2,668,888). In order to continue mining after that date, you must update both Monero and P2Pool software to the latest available versions as soon as they are released.
|
||||
- The latest Monero network upgrade happened on August 13th, 2022 (block 2,688,888).
|
||||
- The latest P2Pool network upgrade happened on October 12th, 2024 at 20:00 UTC.
|
||||
|
||||
In order to continue mining on P2Pool, you must update both Monero and P2Pool software to the latest available versions as soon as they are released.
|
||||
|
||||
|Monero protocol version|Required Monero software version|Required P2Pool version
|
||||
|-|-|-|
|
||||
|v14 (active until July 16th, 2022)|v0.17.3.0 or newer|v1.0 or newer
|
||||
|v15, v16 (active after July 16th, 2022)|v0.18.0.0 or newer|v2.0 or newer
|
||||
|v15, v16 (active after August 13th, 2022)|v0.18.0.0 or newer, v0.18.4.2 is recommended|v4.0 or newer
|
||||
|
||||
## How to mine on P2Pool
|
||||
|
||||
### General Considerations
|
||||
|
||||
- In order to mine on P2Pool, a synced Monero node using monerod v0.17.3.0 or newer is required. If you do not currently have one configured, you can find instructions to do so [here](https://sethforprivacy.com/guides/run-a-monero-node-advanced/).
|
||||
- It is highly recommended that you create a separate restricted user account for mining. While P2Pool has been battle-tested for a long time now, any software may have unknown bugs/vulnerabilities.
|
||||
- You have to use a primary wallet address for mining. Subaddresses and integrated addresses are not supported, just like with monerod solo mining.
|
||||
- Starting from P2Pool v1.7, you can add the `--mini` parameter to your P2Pool command to connect to the **p2pool-mini** sidechain. Note that it will also change the default p2p port from 37889 to 37888.
|
||||
- In order to mine on P2Pool, a synced Monero node using monerod v0.18.0.0 or newer is required. If you don't currently have one, you can download the [official Monero binaries](https://www.getmonero.org/downloads/), start `monerod` on your PC and wait until it's fully synced. Advanced Monero node setup instructions are [here](https://sethforprivacy.com/guides/run-a-monero-node-advanced/).
|
||||
- It is highly recommended that you create a separate restricted user account (in your OS) for mining. While P2Pool has been battle-tested for a long time now, any software may have unknown bugs/vulnerabilities.
|
||||
- You have to use a primary wallet address (the one starting with `4`) for mining. Subaddresses and integrated addresses are not supported, just like with monerod solo mining.
|
||||
- You can add the `--mini` parameter to your P2Pool command to connect to the **p2pool-mini** sidechain. Note that it will also change the default p2p port from 37889 to 37888.
|
||||
- Check that ports 18080 (Monero p2p port) and 37889/37888 (P2Pool/P2Pool mini p2p port) are open in your firewall to ensure better connectivity. If you're mining from a computer behind NAT (like a router) you could consider forwarding the ports to your local machine.
|
||||
- You can connect multiple miners to the same P2Pool node. The more the better!
|
||||
- The below steps assume that you run everything on the same machine. If it's not the case, change `127.0.0.1` to appropriate IP addresses for your setup.
|
||||
- The steps below assume that you run everything on the same machine. If it's not the case, change `127.0.0.1` to appropriate IP addresses for your setup.
|
||||
- It is highly recommended to create a new mainnet wallet for P2Pool mining because **wallet addresses are public on P2Pool**.
|
||||
|
||||
**Wallet software compatible with P2Pool payouts**
|
||||
- [Official Monero CLI and GUI v0.17.2.3 and newer](https://www.getmonero.org/downloads/)
|
||||
- [Monerujo v2.1.0 "Vertant" and newer](https://www.monerujo.io/)
|
||||
- [Cake Wallet v4.2.7 and newer](https://cakewallet.com/)
|
||||
- [Official Monero CLI and GUI v0.18.0.0 and newer](https://www.getmonero.org/downloads/)
|
||||
- [Monerujo v3.0.2 "Fluorine Fermi" and newer](https://www.monerujo.io/)
|
||||
- [Cake Wallet v4.4.5 and newer](https://cakewallet.com/)
|
||||
- [Monero.com by Cake Wallet](https://monero.com/)
|
||||
- [Feather Wallet v1.0.0 and newer](https://featherwallet.org/)
|
||||
- [Feather Wallet v2.1.0 and newer](https://featherwallet.org/)
|
||||
- [MyMonero](https://mymonero.com/)
|
||||
|
||||
### GUI for P2Pool
|
||||
|
||||
- [Gupax](https://github.com/hinto-janai/gupax) project aims to provide an easy to use cross-platform GUI to configure and run P2Pool & [XMRig](https://github.com/xmrig/xmrig).
|
||||
|
||||
### Merge mining
|
||||
|
||||
Merge mining is available in P2Pool since the fork that happened on October 12th, 2024. Version 4.0 or newer is required to use it.
|
||||
|
||||
Blockchains that will support [Merge mining RPC API](https://github.com/SChernykh/p2pool/blob/master/docs/MERGE_MINING.MD#proposed-rpc-api):
|
||||
- [Townforge](https://townforge.net/) supports it in their [tmp-mm branch](https://git.townforge.net/townforge/townforge/src/branch/tmp-mm) (not released yet)
|
||||
- [DarkFi](https://dark.fi/) is going to support it, but it's [not ready yet](https://github.com/darkrenaissance/darkfi/issues/244)
|
||||
```
|
||||
p2pool.exe --wallet YOUR_MONERO_WALLET_ADDRESS --merge-mine IP:port YOUR_WALLET_ADDRESS_ON_ANOTHER_BLOCKCHAIN
|
||||
```
|
||||
|
||||
Blockchains that support merge mining already: [Tari](https://www.tari.com/)
|
||||
|
||||
Tari uses their own gRPC API and requires a different command line:
|
||||
```
|
||||
./p2pool --wallet YOUR_MONERO_WALLET_ADDRESS --merge-mine tari://TARI_NODE_IP:18102 TARI_WALLET_ADDRESS
|
||||
```
|
||||
and on the Tari side
|
||||
```
|
||||
./minotari_node --grpc-enabled --mining-enabled
|
||||
```
|
||||
TARI_NODE_IP is 127.0.0.1 if you run both on the same machine (recommended).
|
||||
|
||||
Merge mining is available on Tari's mainnet:
|
||||
- Download [Tari suite](https://github.com/tari-project/tari/releases/latest) for your OS
|
||||
- Run Minotari node and wait until in synchronizes
|
||||
- Run Minotari console wallet to create a Tari wallet
|
||||
- Copy the "Tari Address one-sided" from the "Receive" tab of the wallet
|
||||
- Paste it into the P2Pool command line above
|
||||
- Everything is ready now to start merge mining Monero and Tari!
|
||||
|
||||
Note that Tari will be mined in solo mode (only full Tari blocks can be mined for now). This doesn't affect P2Pool payouts - they will stay the same.
|
||||
|
||||
### GNU/Linux
|
||||
|
||||
1. Download the latest P2Pool binaries [here](https://github.com/SChernykh/p2pool/releases/latest).
|
||||
- Alternatively, grab the latest source code for P2Pool and [build it](#build-instructions).
|
||||
2. Download the latest XMRig (linux-static-x64) binary [here](https://github.com/xmrig/xmrig/releases/latest).
|
||||
3. Prepare enough huge pages (required for each instance of monerod/P2Pool/XMRig):
|
||||
3. Prepare enough huge pages (each of monerod/P2Pool/XMRig needs them):
|
||||
```
|
||||
sudo sysctl vm.nr_hugepages=3072
|
||||
```
|
||||
4. Check that ports 18080 (Monero p2p port) and 37889/37888 (P2Pool/P2Pool mini p2p port) are open in your local firewall to ensure better connectivity.
|
||||
5. Start `monerod` with the following command/options:
|
||||
```
|
||||
./monerod --zmq-pub tcp://127.0.0.1:18083 --disable-dns-checkpoints --enable-dns-blocklist
|
||||
./monerod --zmq-pub tcp://127.0.0.1:18083 --out-peers 32 --in-peers 64 --add-priority-node=p2pmd.xmrvsbeast.com:18080 --add-priority-node=nodes.hashvault.pro:18080 --enforce-dns-checkpointing --enable-dns-blocklist
|
||||
```
|
||||
**Note:** The `--zmq-pub` option is required for P2Pool to work properly.
|
||||
**Note:**
|
||||
The `--zmq-pub` option is required for P2Pool to work properly.
|
||||
|
||||
`--out-peers 32 --in-peers 64` is needed to (1) have many connections to other nodes and (2) limit incoming connection count because it can grow uncontrollably and cause problems when it goes above 1000 (open files limit in Linux). If your network connection's **upload** bandwidth is less than **10 Mbit**, use `--out-peers 8 --in-peers 16` instead.
|
||||
|
||||
`--add-priority-node=p2pmd.xmrvsbeast.com:18080 --add-priority-node=nodes.hashvault.pro:18080` is needed to have guaranteed good working nodes in your connected peers.
|
||||
|
||||
`--enforce-dns-checkpointing` is needed to combat the selfish mining attempts by malicious actors
|
||||
|
||||
`--enable-dns-blocklist` is needed to ban known bad nodes
|
||||
|
||||
|
||||
6. Start P2Pool with the following command/options:
|
||||
```
|
||||
@@ -154,24 +212,35 @@ nocreate
|
||||
2. Download the latest XMRig binary [here](https://github.com/xmrig/xmrig/releases/latest).
|
||||
3. Expand the P2Pool binaries into an appropriate location (`%USERPROFILE%/bin` or `C:/bin/` are good options)
|
||||
4. Expand XMRig binary into an appropriate location (the same folder as P2Pool is fine).
|
||||
5. Prepare huge pages to work properly (each instance of monerod/P2Pool/XMRig needs them):
|
||||
5. Prepare huge pages to work properly (each of monerod/P2Pool/XMRig needs them):
|
||||
- On Windows 10 or above, run XMRig at least once as Administrator (right-click Run As Administrator)
|
||||
- On earlier versions of Windows, you'll need to run XMRig as Administrator at least once per login.
|
||||
6. Open a command prompt and navigate to the folder where you extracted P2Pool.
|
||||
6. Create "Monero" folder inside extracted P2Pool folder and copy Monero binaries there.
|
||||
7. Open a command prompt and navigate to the folder where you extracted P2Pool.
|
||||
|
||||
**Note:** *When running the below commands, Windows Firewall may prompt to allow connections, click "Allow" if prompted.*
|
||||
|
||||
7. Start `monerod` with the following command/options:
|
||||
8. Start `monerod` with the following command/options:
|
||||
```
|
||||
.\Monero\monerod.exe --zmq-pub tcp://127.0.0.1:18083 --disable-dns-checkpoints --enable-dns-blocklist
|
||||
.\Monero\monerod.exe --zmq-pub tcp://127.0.0.1:18083 --out-peers 32 --in-peers 64 --add-priority-node=p2pmd.xmrvsbeast.com:18080 --add-priority-node=nodes.hashvault.pro:18080 --enforce-dns-checkpointing --enable-dns-blocklist
|
||||
```
|
||||
**Note:** The `--zmq-pub` option is required for P2Pool to work properly.
|
||||
8. Start P2Pool with the following command/options:
|
||||
**Note:**
|
||||
The `--zmq-pub` option is required for P2Pool to work properly.
|
||||
|
||||
`--out-peers 32 --in-peers 64` is needed to (1) have many connections to other nodes and (2) limit incoming connection count because it can grow uncontrollably and cause problems when it goes above 1000 (open files limit in Linux). If your network connection's **upload** bandwidth is less than **10 Mbit**, use `--out-peers 8 --in-peers 16` instead.
|
||||
|
||||
`--add-priority-node=p2pmd.xmrvsbeast.com:18080 --add-priority-node=nodes.hashvault.pro:18080` is needed to have guaranteed good working nodes in your connected peers.
|
||||
|
||||
`--enforce-dns-checkpointing` is needed to combat the selfish mining attempts by malicious actors
|
||||
|
||||
`--enable-dns-blocklist` is needed to ban known bad nodes
|
||||
|
||||
9. Start P2Pool with the following command/options:
|
||||
```
|
||||
.\p2pool.exe --host 127.0.0.1 --wallet YOUR_WALLET_ADDRESS
|
||||
.\p2pool.exe --host 127.0.0.1 --wallet YOUR_WALLET_ADDRESS --mini
|
||||
```
|
||||
9. Wait until the initial P2Pool sync is finished (shouldn't take more than 5-10 minutes).
|
||||
10. Start XMRig with the following command/options:
|
||||
10. Wait until the initial P2Pool sync is finished (shouldn't take more than 5-10 minutes).
|
||||
11. Start XMRig with the following command/options:
|
||||
```
|
||||
.\xmrig.exe -o 127.0.0.1:3333
|
||||
```
|
||||
@@ -180,27 +249,31 @@ nocreate
|
||||
```
|
||||
xmrig.exe -u x+10000 -o 127.0.0.1:3333
|
||||
```
|
||||
11. XMRig should connect and start mining!
|
||||
12. *(Optional but highly recommended)* You can create a Quickstart by creating a batch (.bat) file with the following contents and placing it in your P2Pool directory along with `xmrig.exe`.
|
||||
12. XMRig should connect and start mining!
|
||||
13. *(Optional but highly recommended)* You can create a Quickstart by creating a batch (.bat) file with the following contents and placing it in your P2Pool directory along with `xmrig.exe`.
|
||||
```
|
||||
@ECHO OFF
|
||||
start cmd /k %~dp0\Monero\monerod.exe --zmq-pub tcp://127.0.0.1:18083 --disable-dns-checkpoints --enable-dns-blocklist
|
||||
start cmd /k %~dp0\Monero\monerod.exe --zmq-pub tcp://127.0.0.1:18083 --out-peers 32 --in-peers 64 --add-priority-node=p2pmd.xmrvsbeast.com:18080 --add-priority-node=nodes.hashvault.pro:18080 --enforce-dns-checkpointing --enable-dns-blocklist
|
||||
ECHO Wait until the Monero daemon shows fully synced before continuing. This can take some time. Type 'status' in other window to check progress.
|
||||
PAUSE
|
||||
start cmd /k %~dp0\p2pool.exe --wallet YOUR_WALLET_ADDRESS
|
||||
start cmd /k %~dp0\p2pool.exe --wallet YOUR_WALLET_ADDRESS --mini
|
||||
ECHO Wait until the daemon shows fully synced before continuing. This can take some time.
|
||||
PAUSE
|
||||
%~dp0\xmrig.exe -u x+30000 -o 127.0.0.1
|
||||
%~dp0\xmrig.exe -o 127.0.0.1
|
||||
```
|
||||
|
||||
## Build instructions
|
||||
Please see the relevant instructions for your platform:
|
||||
Only 64-bit builds are supported, in particular ARMv7 or older CPUs are not supported. The reason is that RandomX hashing algorithm is too slow in 32-bit mode, and P2Pool needs to check new blocks very fast to keep up with other nodes.
|
||||
|
||||
### Prerequisites
|
||||
- cmake >= 3.10
|
||||
- C++ compiler with C++17 support. GCC-8, Clang-13 and MSVC-2019 have been tested and confirmed to work, older compilers may fail to build P2Pool.
|
||||
|
||||
### Ubuntu 20.04
|
||||
|
||||
Run the following commands to install the necessary prerequisites, clone this repo, and build P2Pool locally on Ubuntu 20.04:
|
||||
```
|
||||
sudo apt update && sudo apt install git build-essential cmake libuv1-dev libzmq3-dev libsodium-dev libpgm-dev libnorm-dev libgss-dev
|
||||
sudo apt update && sudo apt install git build-essential cmake libuv1-dev libzmq3-dev libsodium-dev libpgm-dev libnorm-dev libgss-dev libcurl4-openssl-dev libidn2-0-dev
|
||||
git clone --recursive https://github.com/SChernykh/p2pool
|
||||
cd p2pool
|
||||
mkdir build && cd build
|
||||
@@ -208,9 +281,11 @@ cmake ..
|
||||
make -j$(nproc)
|
||||
```
|
||||
|
||||
### Arch Linux [AUR](https://wiki.archlinux.org/title/Arch_User_Repository)
|
||||
### [Arch Linux](https://archlinux.org/packages/extra/x86_64/p2pool/)
|
||||
|
||||
Make the package: [p2pool-git](https://aur.archlinux.org/packages/p2pool-git/)
|
||||
```
|
||||
pacman -S p2pool
|
||||
```
|
||||
|
||||
### [Nix/NixOS](https://nixos.org)
|
||||
|
||||
@@ -224,12 +299,12 @@ nix shell github:nixos/nix/master
|
||||
|
||||
Run the binary:
|
||||
```
|
||||
nix run git+https://github.com/SChernykh/p2pool?ref=master
|
||||
nix run git+https://github.com/SChernykh/p2pool?ref=master&submodules=1
|
||||
```
|
||||
|
||||
Run the binary with arguments:
|
||||
```
|
||||
nix run git+https://github.com/SChernykh/p2pool?ref=master -- --help
|
||||
nix run git+https://github.com/SChernykh/p2pool?ref=master&submodules=1 -- --help
|
||||
```
|
||||
|
||||
### Windows
|
||||
@@ -251,7 +326,7 @@ Alternatively, you can select "Clone a repository" within the GUI, then select "
|
||||
|
||||
Run the following commands to install the necessary prerequisites, clone this repo, and build P2Pool locally on your Mac:
|
||||
```
|
||||
brew update && brew install git cmake libuv zmq libpgm
|
||||
brew update && brew install git cmake libuv zmq libpgm curl
|
||||
git clone --recursive https://github.com/SChernykh/p2pool
|
||||
cd p2pool
|
||||
mkdir build && cd build
|
||||
@@ -263,7 +338,7 @@ make -j$(sysctl -n hw.logicalcpu)
|
||||
|
||||
Run the following commands to install the necessary prerequisites, clone this repo, and build P2Pool locally on FreeBSD:
|
||||
```
|
||||
pkg install git cmake libuv libzmq4
|
||||
pkg install git cmake libuv libzmq4 curl
|
||||
git clone --recursive https://github.com/SChernykh/p2pool
|
||||
cd p2pool
|
||||
mkdir build && cd build
|
||||
@@ -271,6 +346,41 @@ cmake ..
|
||||
make
|
||||
```
|
||||
|
||||
### Android (Termux)
|
||||
|
||||
Run the following commands to install the necessary prerequisites, clone this repo, and build P2Pool locally in Termux:
|
||||
```
|
||||
pkg install git build-essential cmake libuv libzmq libcurl
|
||||
git clone --recursive https://github.com/SChernykh/p2pool
|
||||
cd p2pool
|
||||
mkdir build && cd build
|
||||
cmake ..
|
||||
make -j$(nproc)
|
||||
```
|
||||
|
||||
## Reproducible builds
|
||||
|
||||
Starting from v4.9, P2Pool uses [reproducible builds](https://en.wikipedia.org/wiki/Reproducible_builds) to create the release binaries. This allows verification that no vulnerabilities or backdoors have been introduced during the compilation process, and that the compiled binaries correspond to the source code.
|
||||
|
||||
It removes the need for trust that the author or maintainer of the code is not malicious/compromised, and that the build server is not compromised.
|
||||
|
||||
Anyone can run the same build script on the same source code, and get the same release binaries in the end, confirming their authenticity.
|
||||
|
||||
Prerequisites: Ubuntu with Docker and Git installed.
|
||||
|
||||
Example of building v4.9 release binaries:
|
||||
|
||||
```
|
||||
git clone --branch v4.9 --recursive https://github.com/SChernykh/p2pool
|
||||
p2pool/scripts/release/build_all.sh v4.9
|
||||
```
|
||||
The binaries will be created in `p2pool/scripts/release` folder. First time you run it, it will take up to several hours to first build the Docker image with all the necessary tools in it. Wait until all builds are finished and then run
|
||||
```
|
||||
cd p2pool/scripts/release
|
||||
./gen_sums.sh
|
||||
```
|
||||
to generate the hash sums and compare them with the official release's hash sums.
|
||||
|
||||
## Donations
|
||||
|
||||
If you'd like to support further development of Monero P2Pool, you're welcome to send any amount of XMR to the following address:
|
||||
@@ -278,3 +388,13 @@ If you'd like to support further development of Monero P2Pool, you're welcome to
|
||||
```
|
||||
44MnN1f3Eto8DZYUWuE5XZNUtE3vcRzt2j6PzqWpPau34e6Cf4fAxt6X2MBmrm6F9YMEiMNjN6W4Shn4pLcfNAja621jwyg
|
||||
```
|
||||
|
||||
Starting from v4.6, P2Pool will also have an ability to merge mine donations for the author.
|
||||
|
||||
Note that this will not affect your hashrate or payouts in any way. P2Pool will always (100% of the time) keep mining to your configured Monero wallet address, but it might also use the available merge mining capacity to donate to the author.
|
||||
|
||||
If you merge mine yourself, your settings will take priority.
|
||||
|
||||
The merge mining donation runs without a donation server - there is no "phoning home" to a server, everything is done through the P2Pool's network in a decentralized way.
|
||||
|
||||
To opt out of this, build P2Pool with `-DWITH_MERGE_MINING_DONATION=OFF` in cmake command line. Due to the architecture of the decentralized P2Pool network, your node will still relay donation messages to other nodes even if you opted out (but it will not process them).
|
||||
|
||||
@@ -0,0 +1,9 @@
|
||||
set(CMAKE_CROSSCOMPILING TRUE)
|
||||
|
||||
set(CMAKE_SYSTEM_NAME Linux)
|
||||
set(CMAKE_SYSTEM_PROCESSOR aarch64)
|
||||
|
||||
set(CMAKE_C_COMPILER clang)
|
||||
set(CMAKE_CXX_COMPILER clang++)
|
||||
set(CMAKE_ASM_COMPILER aarch64-linux-gnu-as)
|
||||
set(CMAKE_STRIP aarch64-linux-gnu-strip)
|
||||
+133
-26
@@ -1,19 +1,67 @@
|
||||
set(CMAKE_CXX_STANDARD_REQUIRED ON)
|
||||
set(CMAKE_CXX_EXTENSIONS OFF)
|
||||
set(CMAKE_CXX_STANDARD 14)
|
||||
|
||||
set(CMAKE_C_STANDARD 99)
|
||||
set(CMAKE_C_STANDARD_REQUIRED ON)
|
||||
|
||||
if (CMAKE_CXX_COMPILER_ID MATCHES GNU)
|
||||
set(WARNING_FLAGS "-Wall -Wextra -Werror")
|
||||
set(OPTIMIZATION_FLAGS "-Ofast -s")
|
||||
set(GENERAL_FLAGS "-pthread")
|
||||
|
||||
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${WARNING_FLAGS} ${OPTIMIZATION_FLAGS}")
|
||||
set(CMAKE_C_FLAGS_RELEASE "${CMAKE_C_FLAGS_RELEASE} ${WARNING_FLAGS} ${OPTIMIZATION_FLAGS}")
|
||||
if (ARMv8)
|
||||
set(GENERAL_FLAGS "${GENERAL_FLAGS} -mfix-cortex-a53-835769 -mfix-cortex-a53-843419")
|
||||
endif()
|
||||
|
||||
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${WARNING_FLAGS} ${OPTIMIZATION_FLAGS}")
|
||||
set(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} ${WARNING_FLAGS} ${OPTIMIZATION_FLAGS}")
|
||||
if (DEV_WITH_TSAN)
|
||||
set(GENERAL_FLAGS "${GENERAL_FLAGS} -fno-omit-frame-pointer -fsanitize=thread")
|
||||
endif()
|
||||
|
||||
if (DEV_WITH_UBSAN)
|
||||
set(GENERAL_FLAGS "${GENERAL_FLAGS} -fno-omit-frame-pointer -fsanitize=undefined")
|
||||
endif()
|
||||
|
||||
if (DEV_WITH_ASAN)
|
||||
set(GENERAL_FLAGS "${GENERAL_FLAGS} -fno-omit-frame-pointer -fsanitize=address")
|
||||
endif()
|
||||
|
||||
set(WARNING_FLAGS "-Wall -Wextra -Wcast-qual -Wlogical-op -Wundef -Wformat=2 -Wpointer-arith -Werror -Wno-error=inline -Wno-error=unused-function -Wno-error=strict-overflow")
|
||||
|
||||
if (CMAKE_CXX_COMPILER_VERSION VERSION_GREATER 7.5.0)
|
||||
set(WARNING_FLAGS "${WARNING_FLAGS} -Wstrict-overflow=2")
|
||||
endif()
|
||||
|
||||
if (NOT (CMAKE_CXX_COMPILER_VERSION VERSION_LESS 15))
|
||||
set(WARNING_FLAGS "${WARNING_FLAGS} -Wno-cpp")
|
||||
endif()
|
||||
|
||||
if (DISABLE_WARNINGS)
|
||||
set(WARNING_FLAGS "-w")
|
||||
endif()
|
||||
|
||||
if (DEV_WITH_TSAN OR DEV_WITH_UBSAN OR DEV_WITH_ASAN OR DEV_DEBUG OR (CMAKE_BUILD_TYPE STREQUAL "Debug") OR (CMAKE_BUILD_TYPE STREQUAL "RelWithDebInfo"))
|
||||
add_definitions(-DDEBUG_BUILD)
|
||||
if (CMAKE_BUILD_TYPE STREQUAL "Debug")
|
||||
set(OPTIMIZATION_FLAGS "-O0")
|
||||
else()
|
||||
set(OPTIMIZATION_FLAGS "-Og")
|
||||
endif()
|
||||
set(OPTIMIZATION_FLAGS "${OPTIMIZATION_FLAGS} -g3 -ftrapv")
|
||||
else()
|
||||
set(OPTIMIZATION_FLAGS "-O3 -ffast-math -s")
|
||||
endif()
|
||||
|
||||
if (WITH_LTO AND (CMAKE_BUILD_TYPE STREQUAL "Release"))
|
||||
set(OPTIMIZATION_FLAGS "${OPTIMIZATION_FLAGS} -flto=auto -fuse-linker-plugin")
|
||||
endif()
|
||||
|
||||
if (CMAKE_CXX_COMPILER_VERSION VERSION_LESS 9)
|
||||
set(OPTIMIZATION_FLAGS "${OPTIMIZATION_FLAGS} -fno-associative-math")
|
||||
endif()
|
||||
|
||||
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${GENERAL_FLAGS} ${WARNING_FLAGS} ${OPTIMIZATION_FLAGS}")
|
||||
set(CMAKE_C_FLAGS_DEBUG "")
|
||||
set(CMAKE_C_FLAGS_RELEASE "")
|
||||
set(CMAKE_C_FLAGS_RELWITHDEBINFO "")
|
||||
set(CMAKE_C_FLAGS_MINSIZEREL "")
|
||||
|
||||
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${GENERAL_FLAGS} ${WARNING_FLAGS} ${OPTIMIZATION_FLAGS}")
|
||||
set(CMAKE_CXX_FLAGS_DEBUG "")
|
||||
set(CMAKE_CXX_FLAGS_RELEASE "")
|
||||
set(CMAKE_CXX_FLAGS_RELWITHDEBINFO "")
|
||||
set(CMAKE_CXX_FLAGS_MINSIZEREL "")
|
||||
|
||||
if (WIN32)
|
||||
set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -static")
|
||||
@@ -25,26 +73,85 @@ if (CMAKE_CXX_COMPILER_ID MATCHES GNU)
|
||||
endif()
|
||||
endif()
|
||||
elseif (CMAKE_CXX_COMPILER_ID MATCHES MSVC)
|
||||
set(GENERAL_FLAGS "/MP /EHa /permissive-")
|
||||
set(WARNING_FLAGS "/Wall /WX /sdl")
|
||||
set(SECURITY_FLAGS "/GS /guard:cf")
|
||||
set(OPTIMIZATION_FLAGS "/O2 /Oi /Ob2 /Ot /DNDEBUG /GL")
|
||||
set(OPTIMIZATION_FLAGS "/O2 /Oi /Ob2 /Ot /Oy /DNDEBUG /GL")
|
||||
|
||||
set(CMAKE_C_FLAGS_DEBUG "${WARNING_FLAGS} ${SECURITY_FLAGS} /Od /Ob0 /Zi /MTd /fsanitize=address")
|
||||
set(CMAKE_CXX_FLAGS_DEBUG "${WARNING_FLAGS} ${SECURITY_FLAGS} /Od /Ob0 /Zi /MTd /fsanitize=address")
|
||||
if (DISABLE_WARNINGS)
|
||||
set(WARNING_FLAGS "/W0")
|
||||
endif()
|
||||
|
||||
set(CMAKE_C_FLAGS_RELEASE "${WARNING_FLAGS} ${SECURITY_FLAGS} ${OPTIMIZATION_FLAGS} /MT")
|
||||
set(CMAKE_CXX_FLAGS_RELEASE "${WARNING_FLAGS} ${SECURITY_FLAGS} ${OPTIMIZATION_FLAGS} /MT")
|
||||
if (DEV_DEBUG OR (CMAKE_BUILD_TYPE STREQUAL "Debug") OR (CMAKE_BUILD_TYPE STREQUAL "RelWithDebInfo"))
|
||||
add_definitions(-DDEBUG_BUILD)
|
||||
endif()
|
||||
|
||||
set(CMAKE_C_FLAGS_RELWITHDEBINFO "${WARNING_FLAGS} ${SECURITY_FLAGS} /Ob1 /Ot /Zi /MT")
|
||||
set(CMAKE_CXX_FLAGS_RELWITHDEBINFO "${WARNING_FLAGS} ${SECURITY_FLAGS} /Ob1 /Ot /Zi /MT")
|
||||
set(CMAKE_C_FLAGS_DEBUG "${GENERAL_FLAGS} ${WARNING_FLAGS} ${SECURITY_FLAGS} /Od /Ob0 /Zi /MTd")
|
||||
set(CMAKE_CXX_FLAGS_DEBUG "${GENERAL_FLAGS} ${WARNING_FLAGS} ${SECURITY_FLAGS} /Od /Ob0 /Zi /MTd")
|
||||
|
||||
if (DEV_WITH_ASAN)
|
||||
set(CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS_DEBUG} /fsanitize=address")
|
||||
set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} /fsanitize=address")
|
||||
endif()
|
||||
|
||||
set(CMAKE_C_FLAGS_RELEASE "${GENERAL_FLAGS} ${WARNING_FLAGS} ${SECURITY_FLAGS} ${OPTIMIZATION_FLAGS} /MT")
|
||||
set(CMAKE_CXX_FLAGS_RELEASE "${GENERAL_FLAGS} ${WARNING_FLAGS} ${SECURITY_FLAGS} ${OPTIMIZATION_FLAGS} /MT")
|
||||
|
||||
set(CMAKE_C_FLAGS_RELWITHDEBINFO "${GENERAL_FLAGS} ${WARNING_FLAGS} ${SECURITY_FLAGS} /Ob1 /Ot /Zi /MT")
|
||||
set(CMAKE_CXX_FLAGS_RELWITHDEBINFO "${GENERAL_FLAGS} ${WARNING_FLAGS} ${SECURITY_FLAGS} /Ob1 /Ot /Zi /MT")
|
||||
|
||||
set(CMAKE_EXE_LINKER_FLAGS_RELEASE "${CMAKE_EXE_LINKER_FLAGS_RELEASE} /LTCG")
|
||||
elseif (CMAKE_CXX_COMPILER_ID MATCHES Clang)
|
||||
set(WARNING_FLAGS "-Wall -Wextra -Wno-undefined-internal -Werror")
|
||||
set(OPTIMIZATION_FLAGS "-Ofast -funroll-loops -fmerge-all-constants")
|
||||
if (WIN32)
|
||||
set(GENERAL_FLAGS "")
|
||||
set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -static")
|
||||
else()
|
||||
set(GENERAL_FLAGS "-pthread")
|
||||
endif()
|
||||
|
||||
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${WARNING_FLAGS} ${OPTIMIZATION_FLAGS}")
|
||||
set(CMAKE_C_FLAGS_RELEASE "${CMAKE_C_FLAGS_RELEASE} ${WARNING_FLAGS} ${OPTIMIZATION_FLAGS}")
|
||||
if (ARMv8)
|
||||
set(GENERAL_FLAGS "${GENERAL_FLAGS} -mfix-cortex-a53-835769")
|
||||
endif()
|
||||
|
||||
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${WARNING_FLAGS} ${OPTIMIZATION_FLAGS}")
|
||||
set(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} ${WARNING_FLAGS} ${OPTIMIZATION_FLAGS}")
|
||||
set(WARNING_FLAGS "-Wall -Wextra -Wno-unused-function -Wno-undefined-internal -Wno-unknown-warning-option -Wno-nan-infinity-disabled -Wunreachable-code-aggressive -Wmissing-prototypes -Wmissing-variable-declarations -Werror")
|
||||
|
||||
if (NOT (CMAKE_CXX_COMPILER_VERSION VERSION_LESS 20))
|
||||
set(WARNING_FLAGS "${WARNING_FLAGS} -Wno-cpp")
|
||||
endif()
|
||||
|
||||
if (DISABLE_WARNINGS)
|
||||
set(WARNING_FLAGS "-w")
|
||||
endif()
|
||||
|
||||
if (DEV_WITH_MSAN OR DEV_DEBUG OR (CMAKE_BUILD_TYPE STREQUAL "Debug") OR (CMAKE_BUILD_TYPE STREQUAL "RelWithDebInfo"))
|
||||
add_definitions(-DDEBUG_BUILD)
|
||||
if (CMAKE_BUILD_TYPE STREQUAL "Debug")
|
||||
set(OPTIMIZATION_FLAGS "-O0")
|
||||
else()
|
||||
set(OPTIMIZATION_FLAGS "-Og")
|
||||
endif()
|
||||
set(OPTIMIZATION_FLAGS "${OPTIMIZATION_FLAGS} -g3 -ftrapv")
|
||||
else()
|
||||
set(OPTIMIZATION_FLAGS "-O3 -ffast-math -funroll-loops -fmerge-all-constants")
|
||||
endif()
|
||||
|
||||
if (WITH_LTO AND (CMAKE_BUILD_TYPE STREQUAL "Release"))
|
||||
set(OPTIMIZATION_FLAGS "${OPTIMIZATION_FLAGS} -flto")
|
||||
endif()
|
||||
|
||||
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${GENERAL_FLAGS} ${WARNING_FLAGS} ${OPTIMIZATION_FLAGS}")
|
||||
set(CMAKE_C_FLAGS_DEBUG "")
|
||||
set(CMAKE_C_FLAGS_RELEASE "")
|
||||
set(CMAKE_C_FLAGS_RELWITHDEBINFO "")
|
||||
set(CMAKE_C_FLAGS_MINSIZEREL "")
|
||||
|
||||
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${GENERAL_FLAGS} ${WARNING_FLAGS} ${OPTIMIZATION_FLAGS}")
|
||||
set(CMAKE_CXX_FLAGS_DEBUG "")
|
||||
set(CMAKE_CXX_FLAGS_RELEASE "")
|
||||
set(CMAKE_CXX_FLAGS_RELWITHDEBINFO "")
|
||||
set(CMAKE_CXX_FLAGS_MINSIZEREL "")
|
||||
|
||||
if (STATIC_BINARY)
|
||||
set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -static")
|
||||
endif()
|
||||
endif()
|
||||
|
||||
@@ -0,0 +1,7 @@
|
||||
set(CMAKE_CROSSCOMPILING TRUE)
|
||||
|
||||
set(CMAKE_SYSTEM_NAME FreeBSD)
|
||||
set(CMAKE_SYSTEM_PROCESSOR aarch64)
|
||||
|
||||
set(CMAKE_C_COMPILER clang)
|
||||
set(CMAKE_CXX_COMPILER clang++)
|
||||
@@ -0,0 +1,7 @@
|
||||
set(CMAKE_CROSSCOMPILING TRUE)
|
||||
|
||||
set(CMAKE_SYSTEM_NAME FreeBSD)
|
||||
set(CMAKE_SYSTEM_PROCESSOR x86_64)
|
||||
|
||||
set(CMAKE_C_COMPILER clang)
|
||||
set(CMAKE_CXX_COMPILER clang++)
|
||||
@@ -0,0 +1,33 @@
|
||||
if (GIT_COMMIT)
|
||||
message(STATUS "GIT_COMMIT is set to ${GIT_COMMIT}")
|
||||
else()
|
||||
set(GIT_COMMIT "unknown")
|
||||
|
||||
find_program(GIT_EXECUTABLE git)
|
||||
|
||||
if (GIT_EXECUTABLE)
|
||||
execute_process(COMMAND "${GIT_EXECUTABLE}" rev-parse --short=7 HEAD
|
||||
WORKING_DIRECTORY ${CMAKE_CURRENT_LIST_DIR}
|
||||
RESULT_VARIABLE RET
|
||||
OUTPUT_VARIABLE COMMIT
|
||||
OUTPUT_STRIP_TRAILING_WHITESPACE)
|
||||
|
||||
if (RET EQUAL 0)
|
||||
set(GIT_COMMIT "${COMMIT}")
|
||||
|
||||
execute_process(COMMAND git status --porcelain
|
||||
WORKING_DIRECTORY ${CMAKE_CURRENT_LIST_DIR}
|
||||
RESULT_VARIABLE RET
|
||||
OUTPUT_VARIABLE GIT_UNSTAGED
|
||||
OUTPUT_STRIP_TRAILING_WHITESPACE)
|
||||
|
||||
if(GIT_UNSTAGED OR RET)
|
||||
set(GIT_COMMIT "${GIT_COMMIT} (dirty)")
|
||||
endif()
|
||||
endif()
|
||||
endif()
|
||||
|
||||
message(STATUS "You are currently on commit ${GIT_COMMIT}")
|
||||
endif()
|
||||
|
||||
add_compile_definitions(GIT_COMMIT="${GIT_COMMIT}")
|
||||
@@ -0,0 +1,45 @@
|
||||
set(protobuf_INSTALL OFF CACHE BOOL "Install protobuf binaries and files")
|
||||
set(protobuf_BUILD_TESTS OFF CACHE BOOL "Build protobuf tests")
|
||||
set(protobuf_BUILD_PROTOC_BINARIES OFF CACHE BOOL "Build libprotoc and protoc compiler")
|
||||
set(protobuf_BUILD_LIBUPB OFF CACHE BOOL "Build libupb")
|
||||
set(protobuf_BUILD_SHARED_LIBS OFF CACHE BOOL "Build protobuf Shared Libraries")
|
||||
set(protobuf_DISABLE_RTTI ON CACHE BOOL "Remove runtime type information in the binaries")
|
||||
set(protobuf_WITH_ZLIB OFF CACHE BOOL "Build with zlib support")
|
||||
|
||||
set(utf8_range_ENABLE_TESTS OFF CACHE BOOL "Build test suite")
|
||||
set(utf8_range_ENABLE_INSTALL OFF CACHE BOOL "Configure installation")
|
||||
|
||||
set(RE2_BUILD_TESTING OFF CACHE BOOL "enable testing for RE2")
|
||||
|
||||
set(gRPC_BUILD_CODEGEN OFF CACHE BOOL "Build codegen")
|
||||
set(gRPC_DOWNLOAD_ARCHIVES OFF CACHE BOOL "Download archives for empty 3rd party directories")
|
||||
set(gRPC_BUILD_GRPC_CPP_PLUGIN OFF CACHE BOOL "Build grpc_cpp_plugin")
|
||||
set(gRPC_BUILD_GRPC_CSHARP_PLUGIN OFF CACHE BOOL "Build grpc_csharp_plugin")
|
||||
set(gRPC_BUILD_GRPC_NODE_PLUGIN OFF CACHE BOOL "Build grpc_node_plugin")
|
||||
set(gRPC_BUILD_GRPC_OBJECTIVE_C_PLUGIN OFF CACHE BOOL "Build grpc_objective_c_plugin")
|
||||
set(gRPC_BUILD_GRPC_PHP_PLUGIN OFF CACHE BOOL "Build grpc_php_plugin")
|
||||
set(gRPC_BUILD_GRPC_PYTHON_PLUGIN OFF CACHE BOOL "Build grpc_python_plugin")
|
||||
set(gRPC_BUILD_GRPC_RUBY_PLUGIN OFF CACHE BOOL "Build grpc_ruby_plugin")
|
||||
|
||||
set(gRPC_MSVC_STATIC_RUNTIME ON CACHE BOOL "Link gRPC with static msvc runtime libraries")
|
||||
|
||||
set(CARES_STATIC ON CACHE BOOL "Build as a static library")
|
||||
set(CARES_SHARED OFF CACHE BOOL "Build as a shared library")
|
||||
set(CARES_INSTALL OFF CACHE BOOL "Create installation targets (chain builders may want to disable this)")
|
||||
set(CARES_BUILD_TOOLS OFF CACHE BOOL "Build tools")
|
||||
|
||||
if ((CMAKE_C_COMPILER_ID MATCHES MSVC) OR (CMAKE_CXX_COMPILER_ID MATCHES MSVC))
|
||||
include_directories(external/src/common)
|
||||
endif()
|
||||
|
||||
add_definitions(-DPROTOBUF_ENABLE_DEBUG_LOGGING_MAY_LEAK_PII=0)
|
||||
|
||||
add_definitions(-DGRPC_NO_RLS)
|
||||
add_definitions(-DGRPC_NO_XDS)
|
||||
|
||||
add_subdirectory(external/src/grpc)
|
||||
|
||||
include_directories(external/src/grpc/third_party/abseil-cpp)
|
||||
include_directories(external/src/grpc/third_party/boringssl-with-bazel/src/include)
|
||||
include_directories(external/src/grpc/third_party/protobuf/src)
|
||||
include_directories(external/src/grpc/include)
|
||||
@@ -0,0 +1,9 @@
|
||||
set(CMAKE_SYSTEM_NAME Darwin)
|
||||
set(CMAKE_CROSSCOMPILING TRUE)
|
||||
|
||||
set(CMAKE_SYSTEM_PROCESSOR aarch64)
|
||||
|
||||
set(CMAKE_C_COMPILER /usr/local/bin/aarch64-apple-darwin24.5-clang)
|
||||
set(CMAKE_CXX_COMPILER /usr/local/bin/aarch64-apple-darwin24.5-clang++)
|
||||
set(CMAKE_ASM_COMPILER /usr/local/bin/aarch64-apple-darwin24.5-as)
|
||||
set(CMAKE_STRIP /usr/local/bin/aarch64-apple-darwin24.5-strip)
|
||||
@@ -0,0 +1,9 @@
|
||||
set(CMAKE_SYSTEM_NAME Darwin)
|
||||
set(CMAKE_CROSSCOMPILING TRUE)
|
||||
|
||||
set(CMAKE_SYSTEM_PROCESSOR x86_64)
|
||||
|
||||
set(CMAKE_C_COMPILER /usr/local/bin/x86_64-apple-darwin24.5-clang)
|
||||
set(CMAKE_CXX_COMPILER /usr/local/bin/x86_64-apple-darwin24.5-clang++)
|
||||
set(CMAKE_ASM_COMPILER /usr/local/bin/x86_64-apple-darwin24.5-as)
|
||||
set(CMAKE_STRIP /usr/local/bin/x86_64-apple-darwin24.5-strip)
|
||||
@@ -0,0 +1,73 @@
|
||||
set(CMAKE_VS_WINDOWS_TARGET_PLATFORM_VERSION 10.0)
|
||||
|
||||
add_definitions(-D_DISABLE_VECTOR_ANNOTATION)
|
||||
add_definitions(-D_DISABLE_STRING_ANNOTATION)
|
||||
|
||||
set(BUILD_TESTING OFF CACHE BOOL "")
|
||||
set(LIBUV_BUILD_SHARED OFF CACHE BOOL "")
|
||||
set(WITH_LIBSODIUM OFF CACHE BOOL "")
|
||||
set(WITH_LIBBSD OFF CACHE BOOL "")
|
||||
set(BUILD_TESTS OFF CACHE BOOL "")
|
||||
set(ZMQ_HAVE_IPC OFF CACHE BOOL "")
|
||||
set(WITH_DOCS OFF CACHE BOOL "")
|
||||
set(ENABLE_DRAFTS OFF CACHE BOOL "")
|
||||
set(BUILD_SHARED OFF CACHE BOOL "")
|
||||
set(ENABLE_CLANG OFF CACHE BOOL "")
|
||||
|
||||
set(CURL_TARGET_WINDOWS_VERSION "0x0600" CACHE STRING "")
|
||||
set(BUILD_CURL_EXE OFF CACHE BOOL "")
|
||||
set(BUILD_SHARED_LIBS OFF CACHE BOOL "")
|
||||
set(CURL_DISABLE_INSTALL ON CACHE BOOL "")
|
||||
set(CURL_ENABLE_EXPORT_TARGET OFF CACHE BOOL "")
|
||||
set(CURL_DISABLE_HEADERS_API ON CACHE BOOL "")
|
||||
set(CURL_DISABLE_BINDLOCAL ON CACHE BOOL "")
|
||||
set(BUILD_LIBCURL_DOCS OFF CACHE BOOL "")
|
||||
set(BUILD_MISC_DOCS OFF CACHE BOOL "")
|
||||
set(ENABLE_CURL_MANUAL OFF CACHE BOOL "")
|
||||
set(CURL_ZLIB OFF CACHE BOOL "")
|
||||
set(CURL_BROTLI OFF CACHE BOOL "")
|
||||
set(CURL_ZSTD OFF CACHE BOOL "")
|
||||
set(CURL_DISABLE_ALTSVC ON CACHE BOOL "")
|
||||
set(CURL_DISABLE_COOKIES ON CACHE BOOL "")
|
||||
set(CURL_DISABLE_DOH ON CACHE BOOL "")
|
||||
set(CURL_DISABLE_GETOPTIONS ON CACHE BOOL "")
|
||||
set(CURL_DISABLE_HSTS ON CACHE BOOL "")
|
||||
set(CURL_DISABLE_LIBCURL_OPTION ON CACHE BOOL "")
|
||||
set(CURL_DISABLE_MIME ON CACHE BOOL "")
|
||||
set(CURL_DISABLE_NETRC ON CACHE BOOL "")
|
||||
set(CURL_DISABLE_NTLM ON CACHE BOOL "")
|
||||
set(CURL_DISABLE_PARSEDATE ON CACHE BOOL "")
|
||||
set(CURL_DISABLE_PROGRESS_METER ON CACHE BOOL "")
|
||||
set(CURL_DISABLE_SHUFFLE_DNS ON CACHE BOOL "")
|
||||
set(CURL_DISABLE_SOCKETPAIR ON CACHE BOOL "")
|
||||
set(CURL_DISABLE_VERBOSE_STRINGS ON CACHE BOOL "")
|
||||
set(CURL_DISABLE_WEBSOCKETS ON CACHE BOOL "")
|
||||
set(HTTP_ONLY ON CACHE BOOL "")
|
||||
set(CURL_ENABLE_SSL OFF CACHE BOOL "")
|
||||
set(USE_LIBIDN2 OFF CACHE BOOL "")
|
||||
set(CURL_USE_LIBPSL OFF CACHE BOOL "")
|
||||
set(CURL_USE_LIBSSH2 OFF CACHE BOOL "")
|
||||
set(ENABLE_UNIX_SOCKETS OFF CACHE BOOL "")
|
||||
set(CURL_DISABLE_TESTS ON CACHE BOOL "")
|
||||
set(USE_NGHTTP2 OFF CACHE BOOL "")
|
||||
set(BUILD_EXAMPLES OFF CACHE BOOL "")
|
||||
set(CURL_DISABLE_SRP ON CACHE BOOL "")
|
||||
set(CURL_STATIC_CRT ON CACHE BOOL "")
|
||||
|
||||
if (WITH_TLS)
|
||||
set(P2POOL_BORINGSSL ON CACHE BOOL "")
|
||||
set(OPENSSL_INCLUDE_DIR "../grpc/third_party/boringssl-with-bazel/src/include" CACHE STRING "")
|
||||
endif()
|
||||
|
||||
add_subdirectory(external/src/curl)
|
||||
add_subdirectory(external/src/libuv)
|
||||
add_subdirectory(external/src/libzmq)
|
||||
|
||||
set(CURL_LIBRARY_DEBUG libcurl_static)
|
||||
set(CURL_LIBRARY libcurl_static)
|
||||
|
||||
set(UV_LIBRARY_DEBUG uv_a)
|
||||
set(UV_LIBRARY uv_a)
|
||||
|
||||
set(ZMQ_LIBRARY_DEBUG libzmq-static)
|
||||
set(ZMQ_LIBRARY libzmq-static)
|
||||
@@ -0,0 +1,8 @@
|
||||
set(CMAKE_SYSTEM_NAME Linux)
|
||||
set(CMAKE_CROSSCOMPILING TRUE)
|
||||
|
||||
set(CMAKE_SYSTEM_PROCESSOR riscv64)
|
||||
|
||||
set(CMAKE_C_COMPILER /usr/bin/riscv64-linux-gnu-gcc)
|
||||
set(CMAKE_CXX_COMPILER /usr/bin/riscv64-linux-gnu-g++)
|
||||
set(CMAKE_STRIP /usr/bin/riscv64-linux-gnu-strip)
|
||||
@@ -0,0 +1,9 @@
|
||||
set(CMAKE_CROSSCOMPILING TRUE)
|
||||
|
||||
set(CMAKE_SYSTEM_NAME Linux)
|
||||
set(CMAKE_SYSTEM_PROCESSOR riscv64)
|
||||
|
||||
set(CMAKE_C_COMPILER clang)
|
||||
set(CMAKE_CXX_COMPILER clang++)
|
||||
set(CMAKE_ASM_COMPILER riscv64-linux-gnu-as)
|
||||
set(CMAKE_STRIP riscv64-linux-gnu-strip)
|
||||
@@ -0,0 +1,31 @@
|
||||
cmake_minimum_required(VERSION 3.12)
|
||||
|
||||
project(P2Pool_SSL LANGUAGES C CXX)
|
||||
|
||||
if (CMAKE_CXX_COMPILER_ID MATCHES MSVC)
|
||||
set(CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS_DEBUG} /W0 /Zi /Od /Ob0 /MP /MTd")
|
||||
set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} /W0 /Zi /Od /Ob0 /MP /MTd")
|
||||
set(CMAKE_C_FLAGS_RELEASE "${CMAKE_C_FLAGS_RELEASE} /W0 /O1 /Ob2 /Oi /Os /Oy /MP /MT")
|
||||
set(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} /W0 /O1 /Ob2 /Oi /Os /Oy /MP /MT")
|
||||
set(CMAKE_C_FLAGS_RELWITHDEBINFO "${CMAKE_C_FLAGS_RELWITHDEBINFO} /W0 /Ob1 /Ot /Zi /MP /MT")
|
||||
set(CMAKE_CXX_FLAGS_RELWITHDEBINFO "${CMAKE_CXX_FLAGS_RELWITHDEBINFO} /W0 /Ob1 /Ot /Zi /MP /MT")
|
||||
else()
|
||||
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Os -w")
|
||||
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Os -w")
|
||||
endif()
|
||||
|
||||
if(CMAKE_GENERATOR MATCHES "Visual Studio")
|
||||
if(CMAKE_VERSION VERSION_LESS 3.13)
|
||||
message(WARNING "Disabling SSL assembly support because CMake version ${CMAKE_VERSION} is too old (less than 3.13)")
|
||||
set(OPENSSL_NO_ASM ON)
|
||||
else()
|
||||
include(CheckLanguage)
|
||||
check_language(ASM_NASM)
|
||||
if(NOT CMAKE_ASM_NASM_COMPILER)
|
||||
message(WARNING "Disabling SSL assembly support because NASM could not be found")
|
||||
set(OPENSSL_NO_ASM ON)
|
||||
endif()
|
||||
endif()
|
||||
endif()
|
||||
|
||||
add_subdirectory(../../external/src/grpc/third_party/boringssl-with-bazel BoringSSL)
|
||||
@@ -0,0 +1,21 @@
|
||||
set(CMAKE_CXX_EXTENSIONS OFF)
|
||||
set(CMAKE_CXX_STANDARD 17)
|
||||
set(CMAKE_CXX_STANDARD_REQUIRED ON)
|
||||
|
||||
set(CMAKE_C_STANDARD 11)
|
||||
set(CMAKE_C_STANDARD_REQUIRED ON)
|
||||
|
||||
if(NOT ARCH_ID)
|
||||
if(CMAKE_SYSTEM_PROCESSOR STREQUAL "")
|
||||
set(CMAKE_SYSTEM_PROCESSOR ${CMAKE_HOST_SYSTEM_PROCESSOR})
|
||||
endif()
|
||||
string(TOLOWER "${CMAKE_SYSTEM_PROCESSOR}" ARCH_ID)
|
||||
endif()
|
||||
|
||||
if (ARCH_ID MATCHES "^(aarch64|arm64|armv8-a)$")
|
||||
set(ARMv8 1)
|
||||
endif()
|
||||
|
||||
if (ARCH_ID MATCHES "^(x86_64|x86-64|amd64)$")
|
||||
set(AMD64 1)
|
||||
endif()
|
||||
@@ -0,0 +1,8 @@
|
||||
set(CMAKE_CROSSCOMPILING TRUE)
|
||||
|
||||
set(CMAKE_SYSTEM_NAME Windows)
|
||||
set(CMAKE_SYSTEM_VERSION 6.0)
|
||||
set(CMAKE_SYSTEM_PROCESSOR x86_64)
|
||||
|
||||
set(CMAKE_C_COMPILER clang)
|
||||
set(CMAKE_CXX_COMPILER clang++)
|
||||
@@ -1,10 +1,14 @@
|
||||
../src/
|
||||
../external/src/
|
||||
../external/src/crypto/
|
||||
../external/src/cryptonote/
|
||||
../external/src/libuv/
|
||||
../external/src/cppzmq/
|
||||
../external/src/libzmq/
|
||||
../external/src/llhttp/
|
||||
../external/src/RandomX/src/
|
||||
../external/src/rapidjson/include
|
||||
../external/src/robin-hood-hashing/src/include
|
||||
../external/src/libzmq/include/
|
||||
../external/src/miniupnp/miniupnpc/include/
|
||||
../external/src/randomx/src/
|
||||
../external/src/rapidjson/include/
|
||||
../external/src/robin-hood-hashing/src/include/
|
||||
../external/src/grpc/include/
|
||||
../external/src/grpc/third_party/abseil-cpp/
|
||||
../external/src/grpc/third_party/protobuf/src/
|
||||
|
||||
@@ -0,0 +1,15 @@
|
||||
import sys
|
||||
import json
|
||||
|
||||
f = open(sys.argv[1])
|
||||
data = json.load(f)
|
||||
f.close()
|
||||
|
||||
v = []
|
||||
for el in data:
|
||||
if not ("/external/" in el['file']):
|
||||
v.append(el)
|
||||
|
||||
f = open(sys.argv[1], 'w')
|
||||
json.dump(v, f, indent=2)
|
||||
f.close()
|
||||
+13
-2
@@ -1,8 +1,19 @@
|
||||
@echo off
|
||||
"C:\Program Files\cppcheck\cppcheck.exe" --project=..\build\p2pool.vcxproj --project-configuration="Release|x64" -DZMQ_STATIC --platform=win64 --std=c++14 --enable=all --inconclusive --inline-suppr --template="{file}:{line}:{id}{inconclusive: INCONCLUSIVE} {message}" --includes-file=includes.txt --suppressions-list=suppressions.txt --output-file=errors_full.txt
|
||||
findstr /V /C:"external\src" errors_full.txt > errors_filtered.txt
|
||||
"..\cppcheck-main\bin\cppcheck.exe" ../src/*.cpp -D__cppcheck__ -DSIZE_MAX=UINT64_MAX -DRAPIDJSON_ENDIAN=RAPIDJSON_LITTLEENDIAN -D_WIN32=1 -D_WIN64=1 -DWIN32=1 -D_WINDOWS=1 -DNDEBUG=1 -DWITH_GRPC=1 -DPROTOBUF_ENABLE_DEBUG_LOGGING_MAY_LEAK_PII=0 -DWITH_RANDOMX=1 -DWITH_UPNP=1 -DWITH_TLS=1 -DWITH_MERGE_MINING_DONATION=1 -DCURL_STATICLIB=1 -DWIN32_LEAN_AND_MEAN=1 -D_WIN32_WINNT=0x0600 -D_DISABLE_VECTOR_ANNOTATION=1 -D_DISABLE_STRING_ANNOTATION=1 -DZMQ_STATIC=1 -DZMQ_VERSION=40306 -DHAVE_BITSCANREVERSE64=1 -DRAPIDJSON_PARSE_DEFAULT_FLAGS=kParseTrailingCommasFlag -DMINIUPNP_STATICLIB=1 -DCARES_STATICLIB=1 -DCMAKE_INTDIR="Release" -D__SSE2__=1 -D_MSC_VER=1929 --platform=win64 --std=c++17 --enable=all --inconclusive --inline-suppr --template="{file}:{line}:{id}{inconclusive: INCONCLUSIVE} {message}" --includes-file=includes.txt --suppressions-list=suppressions.txt --output-file=errors_full.txt --max-ctu-depth=3 --check-level=exhaustive --checkers-report=checkers_report.txt
|
||||
|
||||
findstr /V /C:"external\src" errors_full.txt > errors_filtered0.txt
|
||||
findstr /V /C:":checkersReport" errors_filtered0.txt > errors_filtered.txt
|
||||
|
||||
findstr /C:"There were critical errors" checkers_report.txt > checkers_report_filtered.txt
|
||||
|
||||
for /f %%i in ("errors_filtered.txt") do set size=%%~zi
|
||||
if %size% gtr 0 (
|
||||
type errors_filtered.txt
|
||||
exit 1
|
||||
)
|
||||
|
||||
for /f %%i in ("checkers_report_filtered.txt") do set size2=%%~zi
|
||||
if %size2% gtr 0 (
|
||||
type checkers_report_filtered.txt
|
||||
exit 1
|
||||
)
|
||||
|
||||
+12
-2
@@ -1,7 +1,17 @@
|
||||
#!/bin/bash
|
||||
cppcheck ../src -DZMQ_STATIC --platform=unix64 --std=c++14 --enable=all --inconclusive --inline-suppr --template="{file}:{line}:{id}{inconclusive: INCONCLUSIVE} {message}" -I ../src/ -I ../external/src/ -I ../external/src/cryptonote/ -I ../external/src/libuv/ -I ../external/src/cppzmq/ -I ../external/src/libzmq/ -I ../external/src/llhttp/ -I ../external/src/RandomX/src/ -I ../external/src/rapidjson/include -I ../external/src/robin-hood-hashing/src/include --suppressions-list=suppressions.txt --output-file=errors_full.txt
|
||||
grep -v 'external' errors_full.txt | grep -v 'unmatchedSuppression' > errors_filtered.txt
|
||||
../cppcheck-main/cppcheck --project=../build/compile_commands.json -D__cppcheck__ -DSIZE_MAX=UINT64_MAX -DRAPIDJSON_ENDIAN=RAPIDJSON_LITTLEENDIAN -DRAPIDJSON_64BIT=1 -D__SSE2__=1 -D__BYTE_ORDER__=1 -D__ORDER_LITTLE_ENDIAN__=1 -D__linux__=1 -D__x86_64 -D_M_AMD64 -D_M_X64 --platform=unix64 --std=c++17 --enable=all --inconclusive --inline-suppr --template="{file}:{line}:{id}{inconclusive: INCONCLUSIVE} {message}" --suppressions-list=suppressions.txt --output-file=errors_full.txt --max-ctu-depth=3 --check-level=exhaustive --checkers-report=checkers_report.txt
|
||||
|
||||
grep -v 'external' errors_full.txt > errors_filtered0.txt
|
||||
grep -v ':checkersReport' errors_filtered0.txt > errors_filtered.txt
|
||||
|
||||
grep 'There were critical errors' checkers_report.txt > checkers_report_filtered.txt
|
||||
|
||||
if [ -s errors_filtered.txt ]; then
|
||||
cat errors_filtered.txt
|
||||
exit 1
|
||||
fi
|
||||
|
||||
if [ -s checkers_report_filtered.txt ]; then
|
||||
cat checkers_report_filtered.txt
|
||||
exit 1
|
||||
fi
|
||||
|
||||
@@ -1,6 +1,4 @@
|
||||
unmatchedSuppression
|
||||
missingIncludeSystem
|
||||
unusedFunction
|
||||
useStlAlgorithm
|
||||
functionStatic
|
||||
functionConst
|
||||
unmatchedSuppression
|
||||
|
||||
@@ -1,42 +0,0 @@
|
||||
##
|
||||
# Monero Wallet Address for mining rewards (replace this with your own address)
|
||||
WALLET_ADDRESS="44MnN1f3Eto8DZYUWuE5XZNUtE3vcRzt2j6PzqWpPau34e6Cf4fAxt6X2MBmrm6F9YMEiMNjN6W4Shn4pLcfNAja621jwyg"
|
||||
|
||||
##
|
||||
# p2pool settings
|
||||
#
|
||||
# Use p2pool-mini (uncomment to enable)
|
||||
#P2POOL_MINI="--mini"
|
||||
#
|
||||
# Which port to listen for miner connections
|
||||
P2POOL_STRATUM_PORT=3333
|
||||
#
|
||||
# How much logging - (Less) 0 - 6 (More)
|
||||
P2POOL_LOGLEVEL=2
|
||||
|
||||
|
||||
##
|
||||
# Monero Node Settings
|
||||
#
|
||||
# Version of Monero to build. Must be v0.17.3.0 or later for p2pool support. "latest" pulls the most recent release tag
|
||||
MONERO_GIT_TAG=latest
|
||||
#
|
||||
# Limit the size of the blockchain on disk (comment to disable)
|
||||
PRUNE_NODE="--prune-blockchain"
|
||||
#
|
||||
# Other monerod commandline options
|
||||
MONERO_EXTRA_OPTIONS=""
|
||||
|
||||
|
||||
##
|
||||
# Xmrig Miner Settings
|
||||
#
|
||||
# Submit shares at a lower fixed difficulty to show mining progress (comment to disable, edit to customize)
|
||||
FIXED_MINING_DIFFICULTY="-u x+500000"
|
||||
#
|
||||
# set process priority (0 idle, 2 normal to 5 highest)
|
||||
MINING_CPU_PRIORITY="--cpu-priority=2"
|
||||
#
|
||||
# Other XMRIG commandline options
|
||||
# See: https://xmrig.com/docs/miner/command-line-options
|
||||
XMRIG_EXTRA_OPTIONS=""
|
||||
+20
-15
@@ -8,6 +8,8 @@ Run your own <b>Monero Node + P2Pool + XMRig</b> in Docker
|
||||
[Install Docker](https://docs.docker.com/engine/install/)
|
||||
[Install Docker Compose](https://docs.docker.com/compose/install/)
|
||||
|
||||
Note: The docker compose plugin uses the command "docker compose" while the pip installed command is "docker-compose".
|
||||
|
||||
#### Clone the P2Pool project
|
||||
```
|
||||
git clone --recursive https://github.com/SChernykh/p2pool
|
||||
@@ -16,37 +18,40 @@ git clone --recursive https://github.com/SChernykh/p2pool
|
||||
#### Configure your Monero address for mining rewards
|
||||
```
|
||||
cd p2pool/docker-compose
|
||||
vi .env
|
||||
./configure
|
||||
```
|
||||
**WALLET_ADDRESS** is the only setting that needs to be updated in that file
|
||||
Make sure to set your own monero **Wallet Address**. The default is to donate mining to P2Pool development.
|
||||
|
||||
#### Build the docker containers
|
||||
```
|
||||
docker-compose build
|
||||
docker compose build --no-cache
|
||||
```
|
||||
|
||||
#### Run the node, pool, and CPU miner
|
||||
#### Run the node, pool, and CPU miner (or updated configuration)
|
||||
```
|
||||
docker-compose up
|
||||
docker compose up
|
||||
```
|
||||
|
||||
#### Optional
|
||||
* Open ports 18080 (Monero p2p port) and 37889 (P2Pool p2p port) or 37888 (P2Pool-mini p2p port) in your firewall to ensure better connectivity. If you're mining from a computer behind NAT (like a router) you could consider forwarding the ports to your local machine
|
||||
* An XMRig CPU miner is included by default, but you can connect additional miners to this same p2pool node using port 3333
|
||||
* An XMRig CPU miner is included by default, but you can connect additional miners to this same p2pool node using port 3333 (or alternate if configured) when you set it as "exposed" in the configuration
|
||||
* Configure your kernel for maximum mining performance: [XMRig RandomX Optimization Guide](https://xmrig.com/docs/miner/randomx-optimization-guide)
|
||||
* Small miners can mine on p2pool-mini by editing the .env file
|
||||
* Many optional configurations and customizations are available by running './configure'
|
||||
|
||||
|
||||
#### Other usefull commands
|
||||
* You can **run everythng in the background** by adding the "-d" argument to the "docker-compose up" command: ```docker-compose up -d```
|
||||
* You can **stop everything** with CTRL-C or ```docker-compose down```
|
||||
* You can see logs when running in the background for with the "docker logs" command: ```docker logs -f p2pool-xmrig``` or ```docker logs -f p2pool-p2pool``` or ```docker logs -f p2pool-monero```
|
||||
* You can pause mining with: ```docker-compose pause xmrig``` and resume mining with: ```docker-compose unpause xmrig```
|
||||
* You can disable mining with: ```docker-compose stop xmrig``` and re-enable mining with: ```docker-compose start xmrig```
|
||||
* You can **run everything in the background** by adding the "-d" argument to the "docker compose up" command: ```docker compose up -d```
|
||||
* You can **stop everything** with CTRL-C or ```docker compose down```
|
||||
* You can **update** by building new images with the ```--no-cache``` option. Example: ```docker compose build --no-cache``` or just update Monero with: ```docker compose build --no-cache monero``` followed by ```docker compose up```
|
||||
* You can see logs when running in the background for with the "docker compose logs" command: ```docker compose logs -f```
|
||||
* You can pause mining with: ```docker compose pause xmrig``` and resume mining with: ```docker compose unpause xmrig```
|
||||
* You can disable mining with: ```docker compose stop xmrig``` and re-enable mining with: ```docker compose start xmrig```
|
||||
* You can view your Server Statistics using a web browser if you enabled that feature in the configuration at: http://localhost:3380 (or alternate port as configured)
|
||||
|
||||
|
||||
#### Uninstall
|
||||
Change to p2pool/docker-compose directory
|
||||
Stop and remove all containers: ```docker-compose down```
|
||||
Remove the p2pool data: ```docker volume rm p2pool```
|
||||
Change to p2pool/docker-compose directory <br />
|
||||
Stop and remove all containers: ```docker compose down``` <br />
|
||||
Remove the p2pool data: ```docker volume rm p2pool``` <br />
|
||||
Remove the p2pool-mini data: ```docker volume rm p2pool-mini``` <br />
|
||||
Remove the monero data: ```docker volume rm monero```
|
||||
|
||||
@@ -0,0 +1,14 @@
|
||||
FROM python:3.10.5-bullseye
|
||||
|
||||
WORKDIR /app
|
||||
|
||||
ADD requirements.txt /app/
|
||||
RUN /usr/local/bin/pip3 install -r requirements.txt
|
||||
|
||||
ADD configure.py /app/
|
||||
ADD defaults /app/
|
||||
ADD current_config.jinja2 /app/
|
||||
ADD docker-compose.jinja2 /app/
|
||||
|
||||
ENTRYPOINT ["/usr/local/bin/python3"]
|
||||
CMD ["/app/configure.py"]
|
||||
Executable
+951
@@ -0,0 +1,951 @@
|
||||
#!/bin/env python3
|
||||
import sys
|
||||
import time
|
||||
import json
|
||||
from jinja2 import Template
|
||||
import npyscreen
|
||||
|
||||
# Help text in a box at the bottom of the screen
|
||||
class HelpBoxBase(npyscreen.BoxTitle):
|
||||
def splitlines(self):
|
||||
all_help = []
|
||||
for fld, msg in self.help_msgs.items():
|
||||
if fld[-1] != ":":
|
||||
fld += ":"
|
||||
message = [m.lstrip() for m in msg if m != ""]
|
||||
helpline = f"{fld:<28}{'. '.join(message)}"
|
||||
all_help.append(helpline)
|
||||
all_help.append("")
|
||||
return all_help
|
||||
|
||||
def display_help_message(self, field):
|
||||
self.set_values(
|
||||
self.help_msgs.get(field, "No help availabe for {}".format(field))
|
||||
)
|
||||
self.clear()
|
||||
self.display()
|
||||
|
||||
|
||||
class P2PoolHelpBox(HelpBoxBase):
|
||||
help_msgs = {
|
||||
"Wallet Address:": [
|
||||
"Your monero wallet address for receiving mining reqards",
|
||||
"",
|
||||
"Note: You have to use a primary wallet address for mining",
|
||||
" Subaddresses and integrated addresses are not supported!",
|
||||
],
|
||||
"P2Pool Sidechain:": [
|
||||
"Which P2Pool sidechain to mine on",
|
||||
" use main for faster miners",
|
||||
" use mini for slower miners",
|
||||
],
|
||||
"Enable Server Statistics": [
|
||||
"Provide access to your P2Pool server statictics via a web interface",
|
||||
],
|
||||
"Statistics Port:": [
|
||||
"Port number (or IP:Port) to expose web access to your P2Pool server",
|
||||
"statictics",
|
||||
],
|
||||
"Expose Stratum Port": [
|
||||
"Expose the P2Pool stratum port to your network so external miners",
|
||||
"can connect",
|
||||
"Note: You may choose to open this port in your hosts firewall and/or",
|
||||
" router to allow miners outside your network to connect",
|
||||
],
|
||||
"Stratum Port:": [
|
||||
"Port number (or IP:Port) to expose P2Pool stratum to your network to",
|
||||
"allow external miners to connect",
|
||||
"Note: You may choose to open this port in your hosts firewall and/or",
|
||||
" router to allow miners outside your network to connect",
|
||||
],
|
||||
"P2Pool Log Level:": [
|
||||
"Verbosity of the log; (Less) 0 - 6 (More)",
|
||||
],
|
||||
"Enable Autodiff": [
|
||||
"Use automatic difficulty adjustment for miners connected to stratum",
|
||||
],
|
||||
"Enable Light Mode": [
|
||||
"Don't allocate RandomX dataset, saves 2GB of RAM",
|
||||
],
|
||||
"Disable Cache": [
|
||||
"Disable p2pool.cache (not recommended)",
|
||||
],
|
||||
"Additional P2Pool Options:": [
|
||||
"Additional options to pass to p2pool commandline",
|
||||
"",
|
||||
"Note: Advanced - Only add options if you know what you are doing",
|
||||
" See ouput of 'p2pool --help' for available options",
|
||||
],
|
||||
"Next": [
|
||||
"Next configuration menu",
|
||||
],
|
||||
"Save": [
|
||||
"Save current configuration and exit",
|
||||
],
|
||||
"Cancel": [
|
||||
"Exit without saving",
|
||||
],
|
||||
}
|
||||
|
||||
|
||||
class MoneroHelpBox(HelpBoxBase):
|
||||
help_msgs = {
|
||||
"Configure Monero Node": [
|
||||
"Configure and run a Monero Node",
|
||||
"",
|
||||
"Note: You must either configure a local node or specify a public node",
|
||||
],
|
||||
"Monero Version:": [
|
||||
"Version of Monero to build; 'latest' for the most recent release",
|
||||
"",
|
||||
"Note: Must be v0.17.3.0 or later for p2pool support",
|
||||
" See: https://github.com/monero-project/monero/tags",
|
||||
],
|
||||
"Prune Blockchain": [
|
||||
"Prune the Monero node to limit the size of the blockchain on disk",
|
||||
],
|
||||
"Monero Log Level:": [
|
||||
"Verbosity of the log; (Less) 0 - 4 (More)",
|
||||
"",
|
||||
"Note: settings above 0 are very noisy",
|
||||
],
|
||||
"Expose RPC Port": [
|
||||
"Expose restricted RPC API port to your network so external services",
|
||||
"(wallets for example) can connect. Port 18083 (ZMQ-pub) will also be exposed.",
|
||||
"Note: You may choose to open this port in your hosts firewall and/or",
|
||||
" router to allow services outside your network to connect",
|
||||
],
|
||||
"RPC Port:": [
|
||||
"TCP port to listen on for RPC connections",
|
||||
],
|
||||
"RPC Login:": [
|
||||
"Specify username[:password] required to connect to the RPC API",
|
||||
],
|
||||
"Limit Data Rates": [
|
||||
"Set a limit value for incoming and outgoing data transfer",
|
||||
],
|
||||
"Rate Limit Up:": [
|
||||
"Set outgoing data transfer limit [kB/s]",
|
||||
],
|
||||
"Rate Limit Down:": [
|
||||
"Set incoming data transfer limit [kB/s]",
|
||||
],
|
||||
"Sync Pruned Blocks": [
|
||||
"Accept pruned blocks instead of pruning yourself to save",
|
||||
"network transfer",
|
||||
],
|
||||
"Fast Block Sync": [
|
||||
'Sync up most of the way by using embedded, "known" (old) block',
|
||||
"hashes without calculating the block hash to verify the proof of work",
|
||||
"",
|
||||
"Note: Faster initial sync by trusting the monerod binary",
|
||||
],
|
||||
"Public Node:": [
|
||||
"Public Monero Node to Use",
|
||||
"",
|
||||
"Note: The public node must have both Monero RPC and zmq-pub ports",
|
||||
" available",
|
||||
],
|
||||
"Node Login:": [
|
||||
"Specify username[:password] required to connect to public monero",
|
||||
"node RPC API (if required)",
|
||||
],
|
||||
"Additional monerod Options:": [
|
||||
"Additional options to pass to monerod commandline",
|
||||
"",
|
||||
"Note: Advanced - Only add options if you know what you are doing",
|
||||
" See 'https://monerodocs.org/interacting/monerod-reference/'",
|
||||
],
|
||||
"Prev": [
|
||||
"Previous configuration menu",
|
||||
],
|
||||
"Next": [
|
||||
"Next configuration menu",
|
||||
],
|
||||
"Save": [
|
||||
"Save current configuration and exit",
|
||||
],
|
||||
"Cancel": [
|
||||
"Exit without saving",
|
||||
],
|
||||
}
|
||||
|
||||
|
||||
class XMRigHelpBox(HelpBoxBase):
|
||||
help_msgs = {
|
||||
"Configure XMRig CPU Miner": [
|
||||
"Configure and run an XMRig CPU Miner",
|
||||
"",
|
||||
"Note: You must either configure am XMRig CPU Miner or expose the",
|
||||
" P2Pool stratum port and connect an external miner, or both",
|
||||
],
|
||||
"Username:": [
|
||||
"Set a username for the miner",
|
||||
],
|
||||
"Use Fixed Difficulty": [
|
||||
"Used a fixed minig difficulty",
|
||||
"",
|
||||
"Note: Allows you to see XMRig submitting shares below P2Pool threshold",
|
||||
],
|
||||
"Fixed Difficulty:": [
|
||||
"Set a fixed mining difficulty",
|
||||
"",
|
||||
"Note: Allows you to see XMRig submitting shares below P2Pool threshold",
|
||||
],
|
||||
"CPU Use %:": [
|
||||
"Maximum CPU threads count (in percentage) hint for autoconfig",
|
||||
"Note: Applies to cores only. If you have HyperThreading enabled you",
|
||||
" should divide this value by 2 (use 0-50%). Reference:",
|
||||
" https://github.com/xmrig/xmrig/issues/1670#issuecomment-644433778",
|
||||
],
|
||||
"CPU Priority:": [
|
||||
"Set process priority (0 idle, 2 normal to 5 highest)",
|
||||
],
|
||||
"Additional XMRig Options:": [
|
||||
"Additional options to pass to xmrig",
|
||||
"",
|
||||
"Note: Advanced - Only add options if you know what you are doing",
|
||||
" See 'https://xmrig.com/docs/miner/command-line-options'",
|
||||
],
|
||||
"Prev": [
|
||||
"Previous configuration menu",
|
||||
],
|
||||
"Save": [
|
||||
"Save current configuration and exit",
|
||||
],
|
||||
"Cancel": [
|
||||
"Exit without saving",
|
||||
],
|
||||
}
|
||||
|
||||
|
||||
##
|
||||
# Custom (integer) values for title slider
|
||||
class IntegerSlider(npyscreen.Slider):
|
||||
def translate_value(self):
|
||||
from_val = int(str(self.value).split(".")[0])
|
||||
out_of_val = int(str(self.out_of).split(".")[0])
|
||||
if from_val >= 1000:
|
||||
from_val = str(from_val / 1000).split(".")[0] + "K"
|
||||
out_of_val = str(out_of_val / 1000).split(".")[0] + "K"
|
||||
return "{}/{}".format(from_val, out_of_val)
|
||||
|
||||
|
||||
class TitleIntegerSlider(npyscreen.TitleSlider):
|
||||
_entry_type = IntegerSlider
|
||||
|
||||
|
||||
##
|
||||
# Patched updateDependents for FormControlCheckbox
|
||||
class PatchedFormControlCheckbox(npyscreen.FormControlCheckbox):
|
||||
def updateDependents(self):
|
||||
if self.value:
|
||||
for w in self._visibleWhenSelected:
|
||||
try:
|
||||
w.fc_visible
|
||||
except AttributeError:
|
||||
w.fc_visible = {}
|
||||
w.fc_visible[self.name] = True
|
||||
for w in self._notVisibleWhenSelected:
|
||||
try:
|
||||
w.fc_visible
|
||||
except AttributeError:
|
||||
w.fc_visible = {}
|
||||
w.fc_visible[self.name] = False
|
||||
else:
|
||||
for w in self._visibleWhenSelected:
|
||||
try:
|
||||
w.fc_visible
|
||||
except AttributeError:
|
||||
w.fc_visible = {}
|
||||
w.fc_visible[self.name] = False
|
||||
for w in self._notVisibleWhenSelected:
|
||||
try:
|
||||
w.fc_visible
|
||||
except AttributeError:
|
||||
w.fc_visible = {}
|
||||
w.fc_visible[self.name] = True
|
||||
for w in self._visibleWhenSelected + self._notVisibleWhenSelected:
|
||||
w.hidden = False in w.fc_visible.values()
|
||||
w.editable = not False in w.fc_visible.values()
|
||||
self.parent.display()
|
||||
|
||||
def set_value(self, value):
|
||||
self.value = value
|
||||
self.display()
|
||||
|
||||
def display(self):
|
||||
self.updateDependents()
|
||||
super()
|
||||
|
||||
|
||||
class PrevButton(npyscreen.Button):
|
||||
def whenToggled(self):
|
||||
self.value = False
|
||||
self.parent.prev_form()
|
||||
|
||||
|
||||
class NextButton(npyscreen.Button):
|
||||
def whenToggled(self):
|
||||
self.value = False
|
||||
self.parent.next_form()
|
||||
|
||||
|
||||
class SaveButton(npyscreen.Button):
|
||||
def whenToggled(self):
|
||||
self.find_parent_app().save_and_exit()
|
||||
|
||||
|
||||
class CancelButton(npyscreen.Button):
|
||||
def whenToggled(self):
|
||||
self.find_parent_app().cancel_and_exit()
|
||||
|
||||
|
||||
##
|
||||
# Config Forms Base Class
|
||||
class ConfigFormBase(npyscreen.FormBaseNew):
|
||||
name_size = 20
|
||||
indent = 5
|
||||
current_config = None
|
||||
defaults = None
|
||||
ALLOW_RESIZE = False
|
||||
|
||||
def while_editing(self, arg):
|
||||
self.help.display_help_message(arg.name)
|
||||
self.display()
|
||||
|
||||
def get_default_config(self):
|
||||
# Return defaults
|
||||
if self.defaults is None:
|
||||
with open("defaults") as defaults_file:
|
||||
self.defaults = json.load(defaults_file)
|
||||
return self.defaults
|
||||
|
||||
def get_current_config(self):
|
||||
# Return current config
|
||||
if self.current_config is None:
|
||||
# Read current config
|
||||
with open("/docker-compose/current_config") as current_config:
|
||||
self.current_config = json.load(current_config)
|
||||
return self.current_config
|
||||
|
||||
def reset_defaults(self, arg):
|
||||
# Set config to default values
|
||||
ok = npyscreen.notify_ok_cancel(
|
||||
"Set current form values to defaults", title="Reset to Defaults"
|
||||
)
|
||||
if not ok:
|
||||
return
|
||||
defaults = self.get_default_config()
|
||||
self.set_config(defaults)
|
||||
|
||||
|
||||
##
|
||||
# P2Pool Configuration Form
|
||||
class P2PoolConfigForm(ConfigFormBase):
|
||||
def create(self):
|
||||
# Add Hot-Key Controls
|
||||
self.add_handlers({"^D": self.reset_defaults})
|
||||
# Add P2Pool Configuration
|
||||
self.add(
|
||||
npyscreen.TitleText,
|
||||
name="## P2Pool Configuration",
|
||||
editable=False,
|
||||
begin_entry_at=50,
|
||||
)
|
||||
self.wallet_address = self.add(
|
||||
npyscreen.TitleText,
|
||||
name="Wallet Address:",
|
||||
value="",
|
||||
begin_entry_at=self.name_size,
|
||||
relx=self.indent,
|
||||
)
|
||||
self.nextrely += 1
|
||||
self.sidechain = self.add(
|
||||
npyscreen.TitleSelectOne,
|
||||
name="P2Pool Sidechain:",
|
||||
values=["main", "mini"],
|
||||
scroll_exit=True,
|
||||
max_height=2,
|
||||
value=[
|
||||
0,
|
||||
],
|
||||
begin_entry_at=self.name_size,
|
||||
relx=self.indent,
|
||||
)
|
||||
self.nextrely += 1
|
||||
self.enable_statistics = self.add(
|
||||
PatchedFormControlCheckbox,
|
||||
name="Enable Server Statistics",
|
||||
value=True,
|
||||
begin_entry_at=self.name_size,
|
||||
relx=self.indent,
|
||||
)
|
||||
self.statistics_port = self.add(
|
||||
npyscreen.TitleText,
|
||||
name="Statistics Port:",
|
||||
value="3334",
|
||||
begin_entry_at=self.name_size,
|
||||
relx=self.indent,
|
||||
)
|
||||
self.enable_statistics.addVisibleWhenSelected(self.statistics_port)
|
||||
self.nextrely += 1
|
||||
self.expose_stratum_port = self.add(
|
||||
PatchedFormControlCheckbox,
|
||||
name="Expose Stratum Port",
|
||||
value=True,
|
||||
begin_entry_at=self.name_size,
|
||||
relx=self.indent,
|
||||
)
|
||||
self.stratum_port = self.add(
|
||||
npyscreen.TitleText,
|
||||
name="Stratum Port:",
|
||||
value="3333",
|
||||
begin_entry_at=self.name_size,
|
||||
relx=self.indent,
|
||||
)
|
||||
self.expose_stratum_port.addVisibleWhenSelected(self.stratum_port)
|
||||
self.nextrely += 1
|
||||
self.p2pool_log_level = self.add(
|
||||
TitleIntegerSlider,
|
||||
name="P2Pool Log Level:",
|
||||
out_of=6,
|
||||
value=3,
|
||||
lowest=0,
|
||||
step=1,
|
||||
width=43,
|
||||
begin_entry_at=20,
|
||||
label=True,
|
||||
block_color=None,
|
||||
relx=self.indent,
|
||||
)
|
||||
self.nextrely += 1
|
||||
self.autodiff = self.add(
|
||||
PatchedFormControlCheckbox,
|
||||
name="Enable Autodiff",
|
||||
value=True,
|
||||
begin_entry_at=self.name_size,
|
||||
relx=self.indent,
|
||||
)
|
||||
self.nextrely += 1
|
||||
self.light_mode = self.add(
|
||||
PatchedFormControlCheckbox,
|
||||
name="Enable Light Mode",
|
||||
value=False,
|
||||
begin_entry_at=self.name_size,
|
||||
relx=self.indent,
|
||||
)
|
||||
self.nextrely += 1
|
||||
self.no_cache = self.add(
|
||||
npyscreen.Checkbox,
|
||||
name="Disable Cache",
|
||||
value=False,
|
||||
begin_entry_at=self.name_size,
|
||||
relx=self.indent,
|
||||
)
|
||||
self.nextrely += 1
|
||||
self.p2pool_extra = self.add(
|
||||
npyscreen.TitleText,
|
||||
name="Additional P2Pool Options:",
|
||||
value="",
|
||||
begin_entry_at=self.name_size + 10,
|
||||
relx=self.indent,
|
||||
)
|
||||
self.nextrely += 1
|
||||
self.nextrely += 1
|
||||
# Add "Next", "Save", and "Cancel" buttons
|
||||
self.next_button = self.add(NextButton, name="Next", relx=1)
|
||||
self.nextrely -= 1
|
||||
self.save_button = self.add(SaveButton, name="Save", relx=8)
|
||||
self.nextrely -= 1
|
||||
self.cancel_button = self.add(CancelButton, name="Cancel", relx=15)
|
||||
self.nextrely += 1
|
||||
# Add Help Box
|
||||
self.help = self.add(
|
||||
P2PoolHelpBox,
|
||||
name="Commands: ^D: Load Defaults - ^C: Exit Without Saving",
|
||||
values=[""],
|
||||
editable=False,
|
||||
)
|
||||
# Start with current config
|
||||
self.set_config(self.get_current_config())
|
||||
|
||||
def next_form(self):
|
||||
self.find_parent_app().switchForm("MONERO")
|
||||
|
||||
def set_config(self, config):
|
||||
self.wallet_address.set_value(config["wallet_address"])
|
||||
self.sidechain.set_value(config["sidechain"])
|
||||
self.enable_statistics.set_value(config["enable_statistics"])
|
||||
self.statistics_port.set_value(config["statistics_port"])
|
||||
self.expose_stratum_port.set_value(config["expose_stratum_port"])
|
||||
self.stratum_port.set_value(config["stratum_port"])
|
||||
self.p2pool_log_level.set_value(config["p2pool_log_level"])
|
||||
self.autodiff.set_value(config["enable_autodiff"])
|
||||
self.light_mode.set_value(config["light_mode"])
|
||||
self.no_cache.value = config["no_cache"]
|
||||
self.p2pool_extra.set_value(config["p2pool_options"])
|
||||
self.DISPLAY()
|
||||
|
||||
def get_config(self):
|
||||
config = {
|
||||
"wallet_address": self.wallet_address.value,
|
||||
"sidechain": self.sidechain.value,
|
||||
"enable_statistics": self.enable_statistics.value,
|
||||
"statistics_port": self.statistics_port.value,
|
||||
"expose_stratum_port": self.expose_stratum_port.value,
|
||||
"stratum_port": self.stratum_port.value,
|
||||
"p2pool_log_level": self.p2pool_log_level.value,
|
||||
"enable_autodiff": self.autodiff.value,
|
||||
"light_mode": self.light_mode.value,
|
||||
"no_cache": self.no_cache.value,
|
||||
"p2pool_options": self.p2pool_extra.value,
|
||||
}
|
||||
return config
|
||||
|
||||
|
||||
##
|
||||
# Monero Configuration Form
|
||||
class MoneroConfigForm(ConfigFormBase):
|
||||
def create(self):
|
||||
# Add Hot-Key Controls
|
||||
self.add_handlers({"^D": self.reset_defaults})
|
||||
# Add Monero Configuration
|
||||
self.add(
|
||||
npyscreen.TitleText,
|
||||
name="## Monero Node Configuration",
|
||||
editable=False,
|
||||
begin_entry_at=50,
|
||||
)
|
||||
self.configure_monero_node = self.add(
|
||||
PatchedFormControlCheckbox,
|
||||
name="Configure Monero Node",
|
||||
value=True,
|
||||
relx=self.indent,
|
||||
)
|
||||
self.nextrely += 1
|
||||
self.monero_git_tag = self.add(
|
||||
npyscreen.TitleText,
|
||||
name="Monero Version:",
|
||||
value="latest",
|
||||
begin_entry_at=self.name_size,
|
||||
relx=self.indent,
|
||||
)
|
||||
self.configure_monero_node.addVisibleWhenSelected(self.monero_git_tag)
|
||||
self.prune_node = self.add(
|
||||
PatchedFormControlCheckbox,
|
||||
name="Prune Blockchain",
|
||||
value=True,
|
||||
begin_entry_at=self.name_size,
|
||||
relx=self.indent,
|
||||
)
|
||||
self.configure_monero_node.addVisibleWhenSelected(self.prune_node)
|
||||
self.monero_log_level = self.add(
|
||||
TitleIntegerSlider,
|
||||
name="Monero Log Level:",
|
||||
out_of=4,
|
||||
value=0,
|
||||
lowest=0,
|
||||
step=1,
|
||||
width=43,
|
||||
begin_entry_at=20,
|
||||
label=True,
|
||||
block_color=None,
|
||||
relx=self.indent,
|
||||
)
|
||||
self.configure_monero_node.addVisibleWhenSelected(self.monero_log_level)
|
||||
self.nextrely += 1
|
||||
self.expose_rpc_port = self.add(
|
||||
PatchedFormControlCheckbox,
|
||||
name="Expose RPC Port",
|
||||
value=False,
|
||||
relx=self.indent,
|
||||
)
|
||||
self.configure_monero_node.addVisibleWhenSelected(self.expose_rpc_port)
|
||||
self.rpc_port = self.add(
|
||||
npyscreen.TitleText,
|
||||
name="RPC Port:",
|
||||
value="18081",
|
||||
begin_entry_at=self.name_size,
|
||||
relx=self.indent,
|
||||
)
|
||||
self.configure_monero_node.addVisibleWhenSelected(self.rpc_port)
|
||||
self.expose_rpc_port.addVisibleWhenSelected(self.rpc_port)
|
||||
self.rpc_login = self.add(
|
||||
npyscreen.TitleText,
|
||||
name="RPC Login:",
|
||||
value="",
|
||||
begin_entry_at=self.name_size,
|
||||
relx=self.indent,
|
||||
)
|
||||
self.expose_rpc_port.addVisibleWhenSelected(self.rpc_login)
|
||||
self.configure_monero_node.addVisibleWhenSelected(self.rpc_login)
|
||||
self.nextrely += 1
|
||||
self.limit_data_rates = self.add(
|
||||
PatchedFormControlCheckbox,
|
||||
name="Limit Data Rates",
|
||||
value=False,
|
||||
begin_entry_at=self.name_size,
|
||||
relx=self.indent,
|
||||
)
|
||||
self.configure_monero_node.addVisibleWhenSelected(self.limit_data_rates)
|
||||
self.rate_limit_up = self.add(
|
||||
npyscreen.TitleText,
|
||||
name="Rate Limit Up:",
|
||||
value="2048",
|
||||
begin_entry_at=self.name_size,
|
||||
relx=self.indent,
|
||||
)
|
||||
self.limit_data_rates.addVisibleWhenSelected(self.rate_limit_up)
|
||||
self.configure_monero_node.addVisibleWhenSelected(self.rate_limit_up)
|
||||
self.rate_limit_down = self.add(
|
||||
npyscreen.TitleText,
|
||||
name="Rate Limit Down:",
|
||||
value="8192",
|
||||
begin_entry_at=self.name_size,
|
||||
relx=self.indent,
|
||||
)
|
||||
self.limit_data_rates.addVisibleWhenSelected(self.rate_limit_down)
|
||||
self.configure_monero_node.addVisibleWhenSelected(self.rate_limit_down)
|
||||
self.nextrely += 1
|
||||
self.sync_pruned_blocks = self.add(
|
||||
npyscreen.Checkbox,
|
||||
name="Sync Pruned Blocks",
|
||||
value=True,
|
||||
begin_entry_at=self.name_size,
|
||||
relx=self.indent,
|
||||
)
|
||||
self.configure_monero_node.addVisibleWhenSelected(self.sync_pruned_blocks)
|
||||
self.prune_node.addVisibleWhenSelected(self.sync_pruned_blocks)
|
||||
self.fast_sync = self.add(
|
||||
npyscreen.Checkbox,
|
||||
name="Fast Block Sync",
|
||||
value=True,
|
||||
begin_entry_at=self.name_size,
|
||||
relx=self.indent,
|
||||
)
|
||||
self.configure_monero_node.addVisibleWhenSelected(self.fast_sync)
|
||||
self.nextrely += 1
|
||||
self.public_node = self.add(
|
||||
npyscreen.TitleText,
|
||||
name="Public Node:",
|
||||
value="",
|
||||
begin_entry_at=self.name_size,
|
||||
relx=self.indent,
|
||||
)
|
||||
self.configure_monero_node.addInvisibleWhenSelected(self.public_node)
|
||||
self.node_login = self.add(
|
||||
npyscreen.TitleText,
|
||||
name="Node Login:",
|
||||
value="",
|
||||
begin_entry_at=self.name_size,
|
||||
relx=self.indent,
|
||||
)
|
||||
self.configure_monero_node.addInvisibleWhenSelected(self.node_login)
|
||||
self.nextrely += 1
|
||||
self.monero_extra = self.add(
|
||||
npyscreen.TitleText,
|
||||
name="Additional monerod Options:",
|
||||
value="",
|
||||
begin_entry_at=self.name_size + 10,
|
||||
relx=self.indent,
|
||||
)
|
||||
self.configure_monero_node.addVisibleWhenSelected(self.monero_extra)
|
||||
self.nextrely += 1
|
||||
self.nextrely += 1
|
||||
# Add "Prev", "Next", "Save", and "Cancel" buttons
|
||||
self.prev_button = self.add(PrevButton, name="Prev", relx=1)
|
||||
self.nextrely -= 1
|
||||
self.next_button = self.add(NextButton, name="Next", relx=8)
|
||||
self.nextrely -= 1
|
||||
self.save_button = self.add(SaveButton, name="Save", relx=15)
|
||||
self.nextrely -= 1
|
||||
self.cancel_button = self.add(CancelButton, name="Cancel", relx=22)
|
||||
self.nextrely += 1
|
||||
# Add Help Box
|
||||
self.help = self.add(
|
||||
MoneroHelpBox,
|
||||
name="Commands: ^D: Load Defaults - ^C: Exit Without Saving",
|
||||
values=[""],
|
||||
editable=False,
|
||||
)
|
||||
# Start with current config
|
||||
self.set_config(self.get_current_config())
|
||||
|
||||
def prev_form(self):
|
||||
self.find_parent_app().switchForm("MAIN")
|
||||
|
||||
def next_form(self):
|
||||
self.find_parent_app().switchForm("XMRIG")
|
||||
|
||||
def set_config(self, config):
|
||||
self.configure_monero_node.set_value(config["configure_monero"])
|
||||
self.monero_git_tag.set_value(config["monero_version"])
|
||||
self.prune_node.value = config["prune_blockchain"]
|
||||
self.monero_log_level.set_value(config["monero_log_level"])
|
||||
self.expose_rpc_port.set_value(config["expose_rpc_port"])
|
||||
self.rpc_port.set_value(config["rpc_port"])
|
||||
self.rpc_login.set_value(config["rpc_login"])
|
||||
self.limit_data_rates.set_value(config["limit_data_rates"])
|
||||
self.rate_limit_up.set_value(config["rate_limit_up"])
|
||||
self.rate_limit_down.set_value(config["rate_limit_down"])
|
||||
self.sync_pruned_blocks.value = config["sync_pruned_blocks"]
|
||||
self.fast_sync.value = config["fast_sync"]
|
||||
self.monero_extra.set_value(config["monero_options"])
|
||||
self.public_node.set_value(config["public_monero_node"])
|
||||
self.node_login.set_value(config["monero_node_login"])
|
||||
self.DISPLAY()
|
||||
|
||||
def get_config(self):
|
||||
config = {
|
||||
"configure_monero": self.configure_monero_node.value,
|
||||
"monero_version": self.monero_git_tag.value,
|
||||
"prune_blockchain": self.prune_node.value,
|
||||
"monero_log_level": self.monero_log_level.value,
|
||||
"expose_rpc_port": self.expose_rpc_port.value,
|
||||
"rpc_port": self.rpc_port.value,
|
||||
"rpc_login": self.rpc_login.value,
|
||||
"limit_data_rates": self.limit_data_rates.value,
|
||||
"rate_limit_up": self.rate_limit_up.value,
|
||||
"rate_limit_down": self.rate_limit_down.value,
|
||||
"sync_pruned_blocks": self.sync_pruned_blocks.value,
|
||||
"fast_sync": self.fast_sync.value,
|
||||
"monero_options": self.monero_extra.value,
|
||||
"public_monero_node": self.public_node.value,
|
||||
"monero_node_login": self.node_login.value,
|
||||
}
|
||||
return config
|
||||
|
||||
|
||||
##
|
||||
# XMRig Configuration Form
|
||||
class XMRigConfigForm(ConfigFormBase):
|
||||
def create(self):
|
||||
# Add Hot-Key Controls
|
||||
self.add_handlers({"^D": self.reset_defaults})
|
||||
# Hidden caryover from P2Pool form
|
||||
self.autodiff = self.add(
|
||||
PatchedFormControlCheckbox,
|
||||
name="Enable Autodiff",
|
||||
value=True,
|
||||
begin_entry_at=self.name_size,
|
||||
relx=self.indent,
|
||||
)
|
||||
self.autodiff.hide = True
|
||||
self.autodiff.editable = False
|
||||
self.nextrely -= 1
|
||||
# Add XMRig Configuration
|
||||
self.add(
|
||||
npyscreen.TitleText,
|
||||
name="## XMRig Miner Configuration",
|
||||
editable=False,
|
||||
begin_entry_at=50,
|
||||
)
|
||||
self.configure_xmrig_miner = self.add(
|
||||
PatchedFormControlCheckbox,
|
||||
name="Configure XMRig CPU Miner",
|
||||
value=True,
|
||||
relx=self.indent,
|
||||
)
|
||||
self.nextrely += 1
|
||||
self.username = self.add(
|
||||
npyscreen.TitleText,
|
||||
name="Username:",
|
||||
value="",
|
||||
begin_entry_at=self.name_size,
|
||||
relx=self.indent,
|
||||
)
|
||||
self.configure_xmrig_miner.addVisibleWhenSelected(self.username)
|
||||
self.nextrely += 1
|
||||
self.use_fixed_difficulty = self.add(
|
||||
PatchedFormControlCheckbox,
|
||||
name="Use Fixed Difficulty",
|
||||
value=True,
|
||||
relx=self.indent,
|
||||
)
|
||||
self.configure_xmrig_miner.addVisibleWhenSelected(self.use_fixed_difficulty)
|
||||
self.autodiff.addInvisibleWhenSelected(self.use_fixed_difficulty)
|
||||
self.fixed_difficulty = self.add(
|
||||
TitleIntegerSlider,
|
||||
name="Fixed Difficulty:",
|
||||
out_of=2000000,
|
||||
value=500000,
|
||||
lowest=50000,
|
||||
step=50000,
|
||||
width=51,
|
||||
begin_entry_at=20,
|
||||
label=True,
|
||||
relx=self.indent,
|
||||
)
|
||||
self.configure_xmrig_miner.addVisibleWhenSelected(self.fixed_difficulty)
|
||||
self.use_fixed_difficulty.addVisibleWhenSelected(self.fixed_difficulty)
|
||||
self.autodiff.addInvisibleWhenSelected(self.fixed_difficulty)
|
||||
self.nextrely += 1
|
||||
self.cpu_threads = self.add(
|
||||
TitleIntegerSlider,
|
||||
name="CPU Use %:",
|
||||
out_of=100,
|
||||
value=100,
|
||||
lowest=1,
|
||||
step=10,
|
||||
width=48,
|
||||
begin_entry_at=20,
|
||||
label=True,
|
||||
relx=self.indent,
|
||||
)
|
||||
self.configure_xmrig_miner.addVisibleWhenSelected(self.cpu_threads)
|
||||
self.nextrely += 1
|
||||
self.cpu_priority = self.add(
|
||||
TitleIntegerSlider,
|
||||
name="CPU Priority:",
|
||||
out_of=5,
|
||||
value=2,
|
||||
lowest=0,
|
||||
step=1,
|
||||
width=48,
|
||||
begin_entry_at=20,
|
||||
label=True,
|
||||
relx=self.indent,
|
||||
)
|
||||
self.configure_xmrig_miner.addVisibleWhenSelected(self.cpu_priority)
|
||||
self.nextrely += 1
|
||||
self.xmrig_extra = self.add(
|
||||
npyscreen.TitleText,
|
||||
name="Additional XMRig Options:",
|
||||
value="",
|
||||
begin_entry_at=self.name_size + 10,
|
||||
relx=self.indent,
|
||||
)
|
||||
self.configure_xmrig_miner.addVisibleWhenSelected(self.xmrig_extra)
|
||||
self.nextrely += 1
|
||||
self.nextrely += 1
|
||||
# Add "Prev", "Save", and "Cancel" buttons
|
||||
self.prev_button = self.add(PrevButton, name="Prev", relx=1)
|
||||
self.nextrely -= 1
|
||||
self.save_button = self.add(SaveButton, name="Save", relx=8)
|
||||
self.nextrely -= 1
|
||||
self.cancel_button = self.add(CancelButton, name="Cancel", relx=15)
|
||||
self.nextrely += 1
|
||||
# Add Help Box
|
||||
self.help = self.add(
|
||||
XMRigHelpBox,
|
||||
name="Commands: ^D: Load Defaults - ^C: Exit Without Saving",
|
||||
values=[""],
|
||||
editable=False,
|
||||
)
|
||||
# Start with current config
|
||||
self.set_config(self.get_current_config())
|
||||
|
||||
def prev_form(self):
|
||||
self.find_parent_app().switchForm("MONERO")
|
||||
|
||||
def next_form(self):
|
||||
self.find_parent_app().switchForm(None)
|
||||
|
||||
def beforeEditing(self):
|
||||
# Cary autodiff value from P2Pool config form
|
||||
enable_autodiff = self.find_parent_app().get_p2pool_config()["enable_autodiff"]
|
||||
self.autodiff.set_value(enable_autodiff)
|
||||
|
||||
def set_config(self, config):
|
||||
self.configure_xmrig_miner.set_value(config["configure_xmrig"])
|
||||
self.username.set_value(config["xmrig_username"])
|
||||
self.use_fixed_difficulty.set_value(config["use_fixed_difficulty"])
|
||||
self.fixed_difficulty.set_value(config["fixed_difficulty"])
|
||||
self.cpu_threads.set_value(config["cpu_percent"])
|
||||
self.cpu_priority.set_value(config["cpu_priority"])
|
||||
self.xmrig_extra.set_value(config["xmrig_options"])
|
||||
self.DISPLAY()
|
||||
|
||||
def get_config(self):
|
||||
config = {
|
||||
"configure_xmrig": self.configure_xmrig_miner.value,
|
||||
"xmrig_username": self.username.value,
|
||||
"use_fixed_difficulty": self.use_fixed_difficulty.value,
|
||||
"fixed_difficulty": self.fixed_difficulty.value,
|
||||
"cpu_percent": self.cpu_threads.value,
|
||||
"cpu_priority": self.cpu_priority.value,
|
||||
"xmrig_options": self.xmrig_extra.value,
|
||||
}
|
||||
return config
|
||||
|
||||
|
||||
##
|
||||
# Our P2Pool configuration App
|
||||
class ConfigApp(npyscreen.NPSAppManaged):
|
||||
current_config = None
|
||||
defaults = None
|
||||
|
||||
def onStart(self):
|
||||
self.p2pool_form = self.addForm(
|
||||
"MAIN",
|
||||
P2PoolConfigForm,
|
||||
name="P2Pool for docker-compose: P2Pool Configuration",
|
||||
minimum_lines=35,
|
||||
minimum_columns=80,
|
||||
)
|
||||
self.monero_form = self.addForm(
|
||||
"MONERO",
|
||||
MoneroConfigForm,
|
||||
name="P2Pool for docker-compose: Monero Configuration",
|
||||
minimum_lines=35,
|
||||
minimum_columns=80,
|
||||
)
|
||||
self.xmrig_form = self.addForm(
|
||||
"XMRIG",
|
||||
XMRigConfigForm,
|
||||
name="P2Pool for docker-compose: XMRig Configuration",
|
||||
minimum_lines=35,
|
||||
minimum_columns=80,
|
||||
)
|
||||
|
||||
def get_p2pool_config(self):
|
||||
return self.p2pool_form.get_config()
|
||||
|
||||
def get_config(self):
|
||||
p2pool_config = self.p2pool_form.get_config()
|
||||
monero_config = self.monero_form.get_config()
|
||||
xmrig_config = self.xmrig_form.get_config()
|
||||
return p2pool_config | monero_config | xmrig_config
|
||||
|
||||
def save_and_exit(self):
|
||||
# Get config from all forms
|
||||
config = self.get_config()
|
||||
# Save "current config" values file
|
||||
with open("current_config.jinja2", "r") as current_config:
|
||||
template = current_config.read()
|
||||
rendered = Template(template).render(config)
|
||||
with open("/docker-compose/current_config", "w") as current_config:
|
||||
current_config.write(rendered)
|
||||
# Render and save docker-compose file
|
||||
with open("docker-compose.jinja2", "r") as compose_file:
|
||||
template = compose_file.read()
|
||||
rendered = Template(template).render(config, trim_blocks=True)
|
||||
with open("/docker-compose/docker-compose.yml", "w") as compose_file:
|
||||
compose_file.write(rendered)
|
||||
npyscreen.notify("Saved current settings", title="Saved")
|
||||
self.switchForm(None)
|
||||
self.saved = True
|
||||
|
||||
def cancel_and_exit(self):
|
||||
self.switchForm(None)
|
||||
self.saved = False
|
||||
|
||||
|
||||
##
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
try:
|
||||
time.sleep(1) # Give docker a second to initialize the terminal
|
||||
App = ConfigApp()
|
||||
App.run()
|
||||
print("\n\n")
|
||||
if App.saved:
|
||||
print("Configuration Saved")
|
||||
else:
|
||||
print("Configuration Aborted")
|
||||
sys.exit(1)
|
||||
except KeyboardInterrupt:
|
||||
print("Configuration Aborted")
|
||||
sys.exit(1)
|
||||
@@ -0,0 +1,35 @@
|
||||
{
|
||||
"wallet_address": {{ wallet_address | tojson(indent=2) }},
|
||||
"configure_monero": {{ configure_monero | tojson(indent=2) }},
|
||||
"configure_xmrig": {{ configure_xmrig | tojson(indent=2) }},
|
||||
"sidechain": {{ sidechain | tojson(indent=2) }},
|
||||
"enable_statistics": {{ enable_statistics | tojson(indent=2) }},
|
||||
"statistics_port": {{ statistics_port | tojson(indent=2) }},
|
||||
"expose_stratum_port": {{ expose_stratum_port | tojson(indent=2) }},
|
||||
"stratum_port": {{ stratum_port | tojson(indent=2) }},
|
||||
"p2pool_log_level": {{ p2pool_log_level | int | tojson(indent=2) }},
|
||||
"enable_autodiff": {{ enable_autodiff | tojson(indent=2) }},
|
||||
"light_mode": {{ light_mode | tojson(indent=2) }},
|
||||
"no_cache": {{ no_cache | tojson(indent=2) }},
|
||||
"p2pool_options": {{ p2pool_options | tojson(indent=2) }},
|
||||
"monero_version": {{ monero_version | tojson(indent=2) }},
|
||||
"prune_blockchain": {{ prune_blockchain | tojson(indent=2) }},
|
||||
"monero_log_level": {{ monero_log_level | int | tojson(indent=2) }},
|
||||
"expose_rpc_port": {{ expose_rpc_port | tojson(indent=2) }},
|
||||
"rpc_port": {{ rpc_port | tojson(indent=2) }},
|
||||
"rpc_login": {{ rpc_login | tojson(indent=2) }},
|
||||
"limit_data_rates": {{ limit_data_rates | tojson(indent=2) }},
|
||||
"rate_limit_up": {{ rate_limit_up | tojson(indent=2) }},
|
||||
"rate_limit_down": {{ rate_limit_down | tojson(indent=2) }},
|
||||
"sync_pruned_blocks": {{ sync_pruned_blocks | tojson(indent=2) }},
|
||||
"fast_sync": {{ fast_sync | tojson(indent=2) }},
|
||||
"monero_options": {{ monero_options | tojson(indent=2) }},
|
||||
"public_monero_node": {{ public_monero_node | tojson(indent=2) }},
|
||||
"monero_node_login": {{ monero_node_login | tojson(indent=2) }},
|
||||
"xmrig_username": {{ xmrig_username | tojson(indent=2) }},
|
||||
"use_fixed_difficulty": {{ use_fixed_difficulty | tojson(indent=2) }},
|
||||
"fixed_difficulty": {{ fixed_difficulty | int | tojson(indent=2) }},
|
||||
"cpu_percent": {{ cpu_percent | int | tojson(indent=2) }},
|
||||
"cpu_priority": {{ cpu_priority | int | tojson(indent=2) }},
|
||||
"xmrig_options": {{ xmrig_options | tojson(indent=2) }}
|
||||
}
|
||||
@@ -0,0 +1,35 @@
|
||||
{
|
||||
"wallet_address": "44MnN1f3Eto8DZYUWuE5XZNUtE3vcRzt2j6PzqWpPau34e6Cf4fAxt6X2MBmrm6F9YMEiMNjN6W4Shn4pLcfNAja621jwyg",
|
||||
"configure_monero": true,
|
||||
"configure_xmrig": true,
|
||||
"sidechain": [0],
|
||||
"enable_statistics": true,
|
||||
"statistics_port": "3380",
|
||||
"expose_stratum_port": false,
|
||||
"stratum_port": "3333",
|
||||
"p2pool_log_level": 3,
|
||||
"enable_autodiff": true,
|
||||
"light_mode": false,
|
||||
"no_cache": false,
|
||||
"p2pool_options": "",
|
||||
"monero_version": "latest",
|
||||
"prune_blockchain": true,
|
||||
"monero_log_level": 0,
|
||||
"expose_rpc_port": false,
|
||||
"rpc_port": "18081",
|
||||
"rpc_login": "",
|
||||
"limit_data_rates": false,
|
||||
"rate_limit_up": "2048",
|
||||
"rate_limit_down": "8192",
|
||||
"sync_pruned_blocks": true,
|
||||
"fast_sync": true,
|
||||
"monero_options": "",
|
||||
"public_monero_node": "",
|
||||
"monero_node_login": "",
|
||||
"xmrig_username": "p2pool",
|
||||
"use_fixed_difficulty": true,
|
||||
"fixed_difficulty": 500000,
|
||||
"cpu_percent": 100,
|
||||
"cpu_priority": 2,
|
||||
"xmrig_options": ""
|
||||
}
|
||||
@@ -0,0 +1,187 @@
|
||||
---
|
||||
version: '3.4'
|
||||
|
||||
networks:
|
||||
p2pool:
|
||||
driver: bridge
|
||||
|
||||
volumes:
|
||||
p2pool:
|
||||
{% if sidechain[0] == 0 %}
|
||||
name: p2pool
|
||||
{% else %}
|
||||
name: p2pool-mini
|
||||
{% endif %}
|
||||
|
||||
{% if configure_monero == True %}
|
||||
monero:
|
||||
name: monero
|
||||
{% endif %}
|
||||
|
||||
services:
|
||||
p2pool:
|
||||
image: p2pool:latest
|
||||
build: ../
|
||||
container_name: p2pool-p2pool
|
||||
networks:
|
||||
- p2pool
|
||||
privileged: true
|
||||
ports:
|
||||
{% if sidechain[0] == 0 %}
|
||||
- 37888:37888/tcp
|
||||
{% else %}
|
||||
- 37889:37889/tcp
|
||||
{% endif %}
|
||||
{% if expose_stratum_port == True %}
|
||||
- {{ stratum_port }}:3333/tcp
|
||||
{% endif %}
|
||||
volumes:
|
||||
- p2pool:/home/p2pool/.p2pool:rw
|
||||
- /dev/null:/home/p2pool/.p2pool/p2pool.log:rw
|
||||
- /dev/hugepages:/dev/hugepages:rw
|
||||
{% if configure_monero == True %}
|
||||
depends_on:
|
||||
- monero
|
||||
{% endif %}
|
||||
restart: unless-stopped
|
||||
command: >-
|
||||
{% if configure_monero == True %}
|
||||
--host monero
|
||||
{% else %}
|
||||
--host {{ public_monero_node }}
|
||||
--rpc-login {{ monero_node_login }}
|
||||
{% endif %}
|
||||
--wallet {{ wallet_address }}
|
||||
--loglevel {{ p2pool_log_level | int }}
|
||||
{% if sidechain[0] == 1 %}
|
||||
--mini
|
||||
{% endif %}
|
||||
{% if enable_autodiff == False %}
|
||||
--no-autodiff
|
||||
{% endif %}
|
||||
{% if enable_statistics == True %}
|
||||
--local-api
|
||||
--data-api /home/p2pool/.p2pool
|
||||
{% endif %}
|
||||
{% if light_mode == True %}
|
||||
--light-mode
|
||||
{% endif %}
|
||||
{% if no_cache == True %}
|
||||
--no-cache
|
||||
{% endif %}
|
||||
{% if rpc_login != "" %}
|
||||
--rpc-login {{ rpc_login }}
|
||||
{% endif %}
|
||||
{% if p2pool_options != "" %}
|
||||
{{ p2pool_options }}
|
||||
{% endif %}
|
||||
|
||||
|
||||
{% if enable_statistics == True %}
|
||||
statistics:
|
||||
image: statistics:latest
|
||||
build:
|
||||
context: statistics
|
||||
container_name: p2pool-statistics
|
||||
networks:
|
||||
- p2pool
|
||||
ports:
|
||||
- {{ statistics_port }}:80/tcp
|
||||
volumes:
|
||||
- p2pool:/data:ro
|
||||
depends_on:
|
||||
- p2pool
|
||||
restart: unless-stopped
|
||||
{% endif %}
|
||||
|
||||
|
||||
{% if configure_monero == True %}
|
||||
monero:
|
||||
image: monero:latest
|
||||
build:
|
||||
context: monero
|
||||
args:
|
||||
- MONERO_GIT_TAG={{ monero_version }}
|
||||
container_name: p2pool-monero
|
||||
networks:
|
||||
- p2pool
|
||||
ports:
|
||||
- 18080:18080/tcp
|
||||
{% if expose_rpc_port == True %}
|
||||
- {{ rpc_port }}:18081/tcp
|
||||
- 18083:18083/tcp
|
||||
{% endif %}
|
||||
volumes:
|
||||
- monero:/home/monero/.bitmonero:rw
|
||||
- /dev/null:/home/monero/.bitmonero/bitmonero.log:rw
|
||||
- /dev/hugepages:/dev/hugepages:rw
|
||||
restart: unless-stopped
|
||||
command: >-
|
||||
--zmq-pub tcp://0.0.0.0:18083
|
||||
--enforce-dns-checkpointing
|
||||
--enable-dns-blocklist
|
||||
--out-peers 16
|
||||
--in-peers 32
|
||||
--add-priority-node=nodes.hashvault.pro:18080
|
||||
--add-priority-node=p2pmd.xmrvsbeast.com:18080
|
||||
--non-interactive
|
||||
--p2p-bind-ip=0.0.0.0
|
||||
--p2p-bind-port=18080
|
||||
--rpc-bind-ip=0.0.0.0
|
||||
--rpc-bind-port=18081
|
||||
--restricted-rpc
|
||||
--confirm-external-bind
|
||||
--log-level={{ monero_log_level | int }}
|
||||
{% if prune_blockchain == True %}
|
||||
--prune-blockchain
|
||||
{% if sync_pruned_blocks == True %}
|
||||
--sync-pruned-blocks
|
||||
{% endif %}
|
||||
{% endif %}
|
||||
{% if rpc_login != "" %}
|
||||
--rpc-login {{ rpc_login }}
|
||||
{% endif %}
|
||||
{% if limit_data_rates == True %}
|
||||
--limit-rate-up {{ rate_limit_up }}
|
||||
--limit-rate-down {{ rate_limit_down }}
|
||||
{% endif %}
|
||||
{% if fast_sync == True %}
|
||||
--fast-block-sync=1
|
||||
{% else %}
|
||||
--fast-block-sync=0
|
||||
{% endif %}
|
||||
{% if monero_options != "" %}
|
||||
{{ monero_options }}
|
||||
{% endif %}
|
||||
{% endif %}
|
||||
|
||||
|
||||
{% if configure_xmrig == True %}
|
||||
xmrig:
|
||||
image: xmrig:latest
|
||||
build: xmrig
|
||||
container_name: p2pool-xmrig
|
||||
networks:
|
||||
- p2pool
|
||||
privileged: true
|
||||
volumes:
|
||||
- /dev:/dev:ro
|
||||
- /lib/modules:/lib/modules:ro
|
||||
- /dev/hugepages:/dev/hugepages:rw
|
||||
depends_on:
|
||||
- p2pool
|
||||
restart: unless-stopped
|
||||
command: >-
|
||||
--randomx-1gb-pages
|
||||
-o p2pool:3333
|
||||
{% if enable_autodiff == False and use_fixed_difficulty == True %}
|
||||
-u {{ xmrig_username }}+{{ fixed_difficulty | int }}
|
||||
{% else %}
|
||||
-u {{ xmrig_username }}
|
||||
{% endif %}
|
||||
--cpu-max-threads-hint={{ cpu_percent | int }}
|
||||
--cpu-priority={{ cpu_priority | int }}
|
||||
{% if xmrig_options != "" %}
|
||||
{{ xmrig_options }}
|
||||
{% endif %}
|
||||
{% endif %}
|
||||
@@ -0,0 +1,3 @@
|
||||
npyscreen==4.10.5
|
||||
MarkupSafe==2.0.1
|
||||
jinja2==3.1.6
|
||||
+44
@@ -0,0 +1,44 @@
|
||||
#!/bin/bash
|
||||
echo ""
|
||||
echo ""
|
||||
echo "Verifying Requirements:"
|
||||
DOCKER_VER=$(docker version -f "{{.Server.Version}}" 2> /dev/null)
|
||||
if [ -z "$DOCKER_VER" ]; then
|
||||
echo "Docker not found; install it: https://docs.docker.com/engine/install/"
|
||||
exit 1
|
||||
fi
|
||||
MIN_DOCKER_VER=19.0.3
|
||||
if { echo "$MIN_DOCKER_VER"; echo "$DOCKER_VER"; } | sort --version-sort --check=quiet; then
|
||||
echo "Docker Found; OK"
|
||||
else
|
||||
echo "Docker version less than $MIN_DOCKER_VER; upgrade it: https://docs.docker.com/engine/install/"
|
||||
exit 1
|
||||
fi
|
||||
docker compose version 2>&1 > /dev/null
|
||||
COMPOSE_PLUGIN_RC=$?
|
||||
docker-compose --version 2>&1 > /dev/null
|
||||
COMPOSE_CLI_RC=$?
|
||||
if [ "$COMPOSE_PLUGIN_RC" -eq 0 ] || [ "$COMPOSE_CLI_RC" -eq 0 ]; then
|
||||
echo "Docker Compose found; OK"
|
||||
if [ "$COMPOSE_PLUGIN_RC" -eq 0 ]; then
|
||||
COMPOSE_COMMAND="docker compose"
|
||||
else
|
||||
COMPOSE_COMMAND="docker-compose"
|
||||
fi
|
||||
else
|
||||
echo "Docker Compose not found; install it: https://docs.docker.com/compose/install/compose-plugin/"
|
||||
exit 1
|
||||
fi
|
||||
echo ""
|
||||
echo ""
|
||||
echo "Building and Running P2Pool docker-compose Configuration"
|
||||
docker build -t p2pool_config:latest cfg
|
||||
docker run -it --rm -v $PWD:/docker-compose --user $(id -u):$(id -g) p2pool_config:latest
|
||||
CONFIGURE_RC=$?
|
||||
echo ""
|
||||
echo ""
|
||||
if [ "$CONFIGURE_RC" -eq 0 ]; then
|
||||
echo "P2Pool is configured. Start the project with: $COMPOSE_COMMAND up --build -d"
|
||||
else
|
||||
exit 1
|
||||
fi
|
||||
@@ -0,0 +1,37 @@
|
||||
{
|
||||
"wallet_address": "44MnN1f3Eto8DZYUWuE5XZNUtE3vcRzt2j6PzqWpPau34e6Cf4fAxt6X2MBmrm6F9YMEiMNjN6W4Shn4pLcfNAja621jwyg",
|
||||
"configure_monero": true,
|
||||
"configure_xmrig": true,
|
||||
"sidechain": [
|
||||
0
|
||||
],
|
||||
"enable_statistics": true,
|
||||
"statistics_port": "3380",
|
||||
"expose_stratum_port": false,
|
||||
"stratum_port": "3333",
|
||||
"p2pool_log_level": 3,
|
||||
"enable_autodiff": true,
|
||||
"light_mode": false,
|
||||
"no_cache": false,
|
||||
"p2pool_options": "",
|
||||
"monero_version": "latest",
|
||||
"prune_blockchain": true,
|
||||
"monero_log_level": 0,
|
||||
"expose_rpc_port": false,
|
||||
"rpc_port": "18081",
|
||||
"rpc_login": "",
|
||||
"limit_data_rates": false,
|
||||
"rate_limit_up": "2048",
|
||||
"rate_limit_down": "8192",
|
||||
"sync_pruned_blocks": true,
|
||||
"fast_sync": true,
|
||||
"monero_options": "",
|
||||
"public_monero_node": "",
|
||||
"monero_node_login": "",
|
||||
"xmrig_username": "p2pool",
|
||||
"use_fixed_difficulty": true,
|
||||
"fixed_difficulty": 500000,
|
||||
"cpu_percent": 100,
|
||||
"cpu_priority": 2,
|
||||
"xmrig_options": ""
|
||||
}
|
||||
@@ -7,22 +7,86 @@ networks:
|
||||
|
||||
volumes:
|
||||
p2pool:
|
||||
|
||||
name: p2pool
|
||||
|
||||
|
||||
|
||||
monero:
|
||||
name: monero
|
||||
|
||||
|
||||
services:
|
||||
p2pool:
|
||||
image: p2pool:latest
|
||||
build: ../
|
||||
container_name: p2pool-p2pool
|
||||
networks:
|
||||
- p2pool
|
||||
privileged: true
|
||||
ports:
|
||||
|
||||
- 37888:37888/tcp
|
||||
|
||||
|
||||
volumes:
|
||||
- p2pool:/home/p2pool/.p2pool:rw
|
||||
- /dev/null:/home/p2pool/.p2pool/p2pool.log:rw
|
||||
- /dev/hugepages:/dev/hugepages:rw
|
||||
|
||||
depends_on:
|
||||
- monero
|
||||
|
||||
restart: unless-stopped
|
||||
command: >-
|
||||
|
||||
--host monero
|
||||
|
||||
--wallet 44MnN1f3Eto8DZYUWuE5XZNUtE3vcRzt2j6PzqWpPau34e6Cf4fAxt6X2MBmrm6F9YMEiMNjN6W4Shn4pLcfNAja621jwyg
|
||||
--loglevel 3
|
||||
|
||||
|
||||
|
||||
--local-api
|
||||
--data-api /home/p2pool/.p2pool
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
statistics:
|
||||
image: statistics:latest
|
||||
build:
|
||||
context: statistics
|
||||
container_name: p2pool-statistics
|
||||
networks:
|
||||
- p2pool
|
||||
ports:
|
||||
- 3380:80/tcp
|
||||
volumes:
|
||||
- p2pool:/data:ro
|
||||
depends_on:
|
||||
- p2pool
|
||||
restart: unless-stopped
|
||||
|
||||
|
||||
|
||||
|
||||
monero:
|
||||
image: monero:latest
|
||||
build:
|
||||
context: monero
|
||||
args:
|
||||
- MONERO_GIT_TAG=${MONERO_GIT_TAG}
|
||||
- MONERO_GIT_TAG=latest
|
||||
container_name: p2pool-monero
|
||||
networks:
|
||||
- p2pool
|
||||
ports:
|
||||
- 18080:18080/tcp
|
||||
|
||||
volumes:
|
||||
- monero:/home/monero/.bitmonero:rw
|
||||
- /dev/null:/home/monero/.bitmonero/bitmonero.log:rw
|
||||
@@ -30,39 +94,35 @@ services:
|
||||
restart: unless-stopped
|
||||
command: >-
|
||||
--zmq-pub tcp://0.0.0.0:18083
|
||||
--disable-dns-checkpoints
|
||||
--enforce-dns-checkpointing
|
||||
--enable-dns-blocklist
|
||||
--out-peers 16
|
||||
--in-peers 32
|
||||
--add-priority-node=nodes.hashvault.pro:18080
|
||||
--add-priority-node=p2pmd.xmrvsbeast.com:18080
|
||||
--non-interactive
|
||||
--p2p-bind-ip=0.0.0.0
|
||||
--p2p-bind-port=18080
|
||||
--rpc-bind-ip=0.0.0.0
|
||||
--rpc-bind-port=18081
|
||||
--restricted-rpc
|
||||
--confirm-external-bind
|
||||
${PRUNE_NODE}
|
||||
${MONERO_EXTRA_OPTIONS}
|
||||
--log-level=0
|
||||
|
||||
--prune-blockchain
|
||||
|
||||
--sync-pruned-blocks
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
--fast-block-sync=1
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
p2pool:
|
||||
image: p2pool:latest
|
||||
build: ../
|
||||
container_name: p2pool-p2pool
|
||||
networks:
|
||||
- p2pool
|
||||
ports:
|
||||
- ${P2POOL_STRATUM_PORT}:3333/tcp
|
||||
- 37888:37888/tcp
|
||||
- 37889:37889/tcp
|
||||
volumes:
|
||||
- p2pool:/home/p2pool/.p2pool:rw
|
||||
- /dev/null:/home/p2pool/.p2pool/p2pool.log:rw
|
||||
- /dev/hugepages:/dev/hugepages:rw
|
||||
depends_on:
|
||||
- monero
|
||||
restart: unless-stopped
|
||||
command: >-
|
||||
--host monero
|
||||
--wallet ${WALLET_ADDRESS}
|
||||
--loglevel ${P2POOL_LOGLEVEL}
|
||||
${P2POOL_MINI}
|
||||
|
||||
xmrig:
|
||||
image: xmrig:latest
|
||||
@@ -79,8 +139,11 @@ services:
|
||||
- p2pool
|
||||
restart: unless-stopped
|
||||
command: >-
|
||||
${FIXED_MINING_DIFFICULTY}
|
||||
${MINING_CPU_PRIORITY}
|
||||
${XMRIG_EXTRA_OPTIONS}
|
||||
--randomx-1gb-pages
|
||||
-o p2pool:3333
|
||||
|
||||
-u p2pool
|
||||
|
||||
--cpu-max-threads-hint=100
|
||||
--cpu-priority=2
|
||||
|
||||
|
||||
@@ -1,79 +1,76 @@
|
||||
FROM ubuntu:latest
|
||||
# Multistage docker build, requires docker 17.05
|
||||
|
||||
# builder stage
|
||||
FROM ubuntu:22.04 as builder
|
||||
ARG MONERO_GIT_TAG="latest"
|
||||
|
||||
RUN set -e && \
|
||||
apt-get update -q -y --no-install-recommends && \
|
||||
DEBIAN_FRONTEND="noninteractive" apt-get install -q -y --no-install-recommends \
|
||||
git \
|
||||
ca-certificates \
|
||||
build-essential \
|
||||
pkg-config \
|
||||
cmake \
|
||||
libuv1-dev \
|
||||
libzmq3-dev \
|
||||
libsodium-dev \
|
||||
libpgm-dev \
|
||||
libnorm-dev \
|
||||
libgss-dev \
|
||||
libssl-dev \
|
||||
libzmq3-dev \
|
||||
libunbound-dev \
|
||||
libsodium-dev \
|
||||
libunwind8-dev \
|
||||
liblzma-dev \
|
||||
libreadline6-dev \
|
||||
libldns-dev \
|
||||
libexpat1-dev \
|
||||
libpgm-dev \
|
||||
qttools5-dev-tools \
|
||||
libhidapi-dev \
|
||||
libusb-1.0-0-dev \
|
||||
libprotobuf-dev \
|
||||
protobuf-compiler \
|
||||
libudev-dev \
|
||||
libboost-chrono-dev \
|
||||
libboost-date-time-dev \
|
||||
libboost-filesystem-dev \
|
||||
libboost-locale-dev \
|
||||
libboost-program-options-dev \
|
||||
libboost-regex-dev \
|
||||
libboost-serialization-dev \
|
||||
libboost-system-dev \
|
||||
libboost-thread-dev \
|
||||
ccache \
|
||||
doxygen \
|
||||
graphviz
|
||||
SHELL ["/bin/bash", "-euxo", "pipefail", "-c"]
|
||||
|
||||
WORKDIR /usr/src
|
||||
RUN git clone --recursive https://github.com/monero-project/monero && \
|
||||
RUN apt-get update -q -y --no-install-recommends && \
|
||||
DEBIAN_FRONTEND="noninteractive" apt-get install -q -y --no-install-recommends \
|
||||
autoconf \
|
||||
automake \
|
||||
autotools-dev \
|
||||
bsdmainutils \
|
||||
build-essential \
|
||||
ca-certificates \
|
||||
ccache \
|
||||
cmake \
|
||||
curl \
|
||||
doxygen \
|
||||
git \
|
||||
graphviz \
|
||||
libtool libssl-dev libzmq3-dev libunbound-dev libsodium-dev libunwind8-dev liblzma-dev libreadline6-dev libexpat1-dev \
|
||||
qttools5-dev-tools libhidapi-dev libusb-1.0-0-dev libprotobuf-dev protobuf-compiler libudev-dev libboost-chrono-dev libboost-date-time-dev \
|
||||
libboost-filesystem-dev libboost-locale-dev libboost-program-options-dev libboost-regex-dev libboost-serialization-dev libboost-system-dev libboost-thread-dev \
|
||||
pkg-config \
|
||||
python3 \
|
||||
gperf
|
||||
|
||||
WORKDIR /src
|
||||
|
||||
RUN git clone --recursive --branch release-v0.18 https://github.com/monero-project/monero && \
|
||||
cd monero && \
|
||||
if [ "x$MONERO_GIT_TAG" = "xlatest" ]; then MONERO_GIT_TAG=$(git describe --tags $(git rev-list --tags --max-count=1)); fi && \
|
||||
git checkout $MONERO_GIT_TAG && \
|
||||
git submodule sync && git submodule update --init --force --recursive && \
|
||||
make release-static -j$(nproc)
|
||||
curl -L -O https://p2pool.io/checkpoints/checkpoints.dat && \
|
||||
curl -L -O https://p2pool.io/checkpoints/checkpoints.patch && \
|
||||
git apply checkpoints.patch && \
|
||||
cp -f checkpoints.dat src/blocks && \
|
||||
make -j$(nproc)
|
||||
|
||||
# ---
|
||||
|
||||
FROM ubuntu:latest
|
||||
# runtime stage
|
||||
FROM ubuntu:22.04
|
||||
|
||||
COPY --from=0 /usr/src/monero/build/Linux/*/release/bin/* /
|
||||
COPY --from=0 /src/monero/build/Linux/*/release/bin /usr/local/bin/
|
||||
|
||||
RUN set -e && \
|
||||
apt-get update -q -y --no-install-recommends && \
|
||||
SHELL ["/bin/bash", "-euxo", "pipefail", "-c"]
|
||||
|
||||
RUN apt-get update -q -y --no-install-recommends && \
|
||||
DEBIAN_FRONTEND="noninteractive" apt-get install -q -y --no-install-recommends \
|
||||
libgssapi-krb5-2 \
|
||||
&& \
|
||||
apt-get clean
|
||||
ca-certificates \
|
||||
netcat \
|
||||
libboost-chrono-dev libboost-filesystem-dev libboost-program-options-dev libboost-regex-dev libboost-thread-dev \
|
||||
libzmq5 \
|
||||
libreadline8 \
|
||||
libhidapi-libusb0 \
|
||||
libunbound8 \
|
||||
&& \
|
||||
apt-get clean && \
|
||||
rm -rf /var/lib/apt
|
||||
|
||||
RUN groupadd -r monero -g 1000 && \
|
||||
useradd -u 1000 -r -g monero -s /sbin/nologin -c "monero node user" monero
|
||||
RUN mkdir -p /home/monero/.bitmonero && \
|
||||
chown monero.monero /home/monero /home/monero/.bitmonero
|
||||
adduser --uid 1000 --gid 1000 --system --disabled-password monero && \
|
||||
mkdir -p /home/monero/.bitmonero && \
|
||||
chown -R monero:monero /home/monero/.bitmonero
|
||||
|
||||
USER monero
|
||||
WORKDIR /home/monero
|
||||
|
||||
EXPOSE 18080 18081 18083
|
||||
|
||||
VOLUME /home/monero/.bitmonero
|
||||
|
||||
WORKDIR /home/monero
|
||||
ENTRYPOINT ["/monerod"]
|
||||
ENTRYPOINT ["/usr/local/bin/monerod"]
|
||||
|
||||
@@ -0,0 +1,10 @@
|
||||
FROM python:slim
|
||||
|
||||
COPY app /app
|
||||
|
||||
WORKDIR /app
|
||||
RUN pip install -r requirements.txt
|
||||
|
||||
STOPSIGNAL SIGINT
|
||||
|
||||
CMD ["/app/p2pool_statistics.py"]
|
||||
+89
@@ -0,0 +1,89 @@
|
||||
#!/usr/bin/env python3
|
||||
import json
|
||||
from datetime import datetime
|
||||
from prefixed import Float
|
||||
import humanfriendly
|
||||
from flask import Flask, render_template
|
||||
|
||||
app = Flask(__name__)
|
||||
|
||||
|
||||
##
|
||||
# Add some custom jinja filters
|
||||
def timeago(value):
|
||||
"""Format a date time to human friendly time ago"""
|
||||
if value is None:
|
||||
return ""
|
||||
if type(value) is int:
|
||||
dt = datetime.fromtimestamp(value).replace(microsecond=0)
|
||||
now = datetime.now().replace(microsecond=0)
|
||||
return humanfriendly.format_timespan(now - dt)
|
||||
|
||||
|
||||
app.jinja_env.filters["timeago"] = timeago
|
||||
|
||||
|
||||
def human_numbers(value):
|
||||
"""Format a number in human readable format"""
|
||||
if value is None:
|
||||
return ""
|
||||
return "{:!.3h}".format(Float(value))
|
||||
|
||||
|
||||
app.jinja_env.filters["humanize"] = human_numbers
|
||||
|
||||
|
||||
##
|
||||
# Get Pool Instance Birth Date
|
||||
def birthdate():
|
||||
try:
|
||||
with open("/data/p2pool.blocks") as reader:
|
||||
first_block = reader.readline().rstrip()
|
||||
bday_ts = int(first_block.split(" ")[0])
|
||||
bday = timeago(bday_ts)
|
||||
return bday
|
||||
except Exception as e:
|
||||
return "unknown time"
|
||||
|
||||
|
||||
##
|
||||
# The App Routes
|
||||
@app.route("/")
|
||||
def render():
|
||||
try:
|
||||
my_bday = birthdate()
|
||||
with open("/data/stats_mod", "r") as reader:
|
||||
stats_mod = json.loads(reader.read())
|
||||
with open("/data/pool/stats", "r") as reader:
|
||||
pool_stats = json.loads(reader.read())
|
||||
with open("/data/network/stats", "r") as reader:
|
||||
network_stats = json.loads(reader.read())
|
||||
with open("/data/local/stratum", "r") as reader:
|
||||
local_stats = json.loads(reader.read())
|
||||
workers = local_stats["workers"][:30] # limit workers output list
|
||||
workers_concat = []
|
||||
for w in workers:
|
||||
w_list = w.split(",")
|
||||
w_list[1] = humanfriendly.format_timespan(int(w_list[1]))
|
||||
w_list[2] = human_numbers(int(w_list[2]))
|
||||
workers_concat.append(w_list)
|
||||
workers_concat = sorted(workers_concat, key=lambda x: int(x[3]), reverse=True)
|
||||
for w in workers_concat:
|
||||
w[3] = human_numbers(int(w[3]))
|
||||
return render_template(
|
||||
"index.html",
|
||||
my_bday=my_bday,
|
||||
stats_mod=stats_mod,
|
||||
pool_stats=pool_stats,
|
||||
network_stats=network_stats,
|
||||
local_stats=local_stats,
|
||||
workers=workers_concat,
|
||||
)
|
||||
except Exception as e:
|
||||
return render_template("oops.html", error=str(e))
|
||||
|
||||
|
||||
##
|
||||
# main()
|
||||
if __name__ == "__main__":
|
||||
app.run(debug=False, host="0.0.0.0", port=80)
|
||||
@@ -0,0 +1,3 @@
|
||||
flask
|
||||
prefixed
|
||||
humanfriendly
|
||||
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
Binary file not shown.
|
After Width: | Height: | Size: 5.6 KiB |
File diff suppressed because one or more lines are too long
@@ -0,0 +1,189 @@
|
||||
<!doctype html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
|
||||
<link rel="stylesheet" href="{{url_for('static', filename='bootstrap.min.css')}}">
|
||||
<title>Monero P2Pool Server Statistics</title>
|
||||
</head>
|
||||
<body style="font-size:85%;">
|
||||
<script src="{{url_for('static', filename='jquery-3.2.1.slim.min.js')}}"></script>
|
||||
<script src="{{url_for('static', filename='popper.min.js')}}"></script>
|
||||
<script src="{{url_for('static', filename='bootstrap.min.js')}}"></script>
|
||||
<div style="text-align:center;">
|
||||
<img src="{{url_for('static', filename='monero-symbol-480.png')}}" width="75px" height="75px" alt="Monero"/>
|
||||
<h1 style="color: #FF6600;">P2Pool Server Statistics</h1>
|
||||
</div>
|
||||
|
||||
<div class="card-group">
|
||||
<div class="col-sm-4 grid-margin stretch-card">
|
||||
<div class="card">
|
||||
<div class="card-header text-black mb-1 pb-1" style="text-align: center; background-color: #FF6600;"><h2>Local Pool</h2></div>
|
||||
<div class="card-body mb-0 pb-0">
|
||||
<h6 class="card-subtitle text-muted" style="font-size:80%;">(note: stats reset on restart)</h6>
|
||||
<div class="table-responsive table-hover table-condensed table-striped">
|
||||
<table class="table">
|
||||
<tbody>
|
||||
<tr>
|
||||
<td>Hashrate 15 Minutes</td>
|
||||
<td>{{ local_stats["hashrate_15m"]|humanize }}H/s</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Hashrate 1 Hour</td>
|
||||
<td>{{ local_stats["hashrate_1h"]|humanize }}H/s</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Hashrate 24 Hours</td>
|
||||
<td>{{ local_stats["hashrate_24h"]|humanize }}H/s</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Shares Found</td>
|
||||
<td>{{ local_stats["shares_found"] }}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Shares Failed</td>
|
||||
<td>{{ local_stats["shares_failed"] }}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Current Effort</td>
|
||||
<td>{{ local_stats["current_effort"] }}%</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Average Effort</td>
|
||||
<td>{{ local_stats["average_effort"] }}%</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Total Hashes</td>
|
||||
<td>{{ local_stats["total_hashes"]|humanize }}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Miner Connections</td>
|
||||
<td>{{ local_stats["incoming_connections"] }}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Block reward share</td>
|
||||
<td>{{ local_stats["block_reward_share_percent"] }}%</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Workers
|
||||
<h6 class="card-subtitle text-muted" style="font-size:80%;">(note: limited to the first 30 workers)</h6>
|
||||
</td>
|
||||
<td>
|
||||
<table style="font-size:65%;">
|
||||
<tr>
|
||||
<th>IP:Port</th>
|
||||
<th>Uptime</th>
|
||||
<th>Difficulty</th>
|
||||
<th>Hashrate</th>
|
||||
<th>Name</th>
|
||||
</tr>
|
||||
{% for w in workers %}
|
||||
<tr>
|
||||
{% for w_detail in w %}
|
||||
<td>{{ w_detail }}</td>
|
||||
{% endfor %}
|
||||
</tr>
|
||||
{% endfor %}
|
||||
</table>
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="col-sm-4 grid-margin stretch-card">
|
||||
<div class="card">
|
||||
<div class="card-header text-black mb-1 pb-1" style="text-align: center; background-color: #FF6600;"><h2>Global Pool</h2></div>
|
||||
<div class="card-body mb-0 pb-0">
|
||||
<h6 class="card-subtitle text-muted" style="font-size:80%;"> </h6>
|
||||
<div class="table-responsive table-hover table-condensed table-striped">
|
||||
<table class="table">
|
||||
<tbody>
|
||||
<tr>
|
||||
<td>Hash Rate</td>
|
||||
<td>{{ pool_stats["pool_statistics"]["hashRate"]|humanize }}H/s</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Round Hashes</td>
|
||||
<td>{{ stats_mod["pool"]["roundHashes"]|humanize }}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Last Block Found</td>
|
||||
<td>{{ pool_stats["pool_statistics"]["lastBlockFound"] }} <br>
|
||||
{{ pool_stats["pool_statistics"]["lastBlockFoundTime"]|timeago }} ago</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Payout Method</td>
|
||||
<td>{{ pool_stats["pool_list"]|join(',') }}<br>2160 block window (~6 hours)</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
<h6 class="card-subtitle text-muted" style="font-size:80%;">(since instance birth: {{ my_bday }} ago)</h6>
|
||||
<div class="table-responsive table-hover table-condensed table-striped">
|
||||
<table class="table">
|
||||
<tbody>
|
||||
<tr>
|
||||
<td>Total Hashes</td>
|
||||
<td>{{ pool_stats["pool_statistics"]["totalHashes"]|humanize }}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Blocks Found</td>
|
||||
<td>{{ pool_stats["pool_statistics"]["totalBlocksFound"] }}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Known Miners</td>
|
||||
<td>{{ pool_stats["pool_statistics"]["miners"] }}</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="col-sm-4 grid-margin stretch-card">
|
||||
<div class="card">
|
||||
<div class="card-header text-black mb-1 pb-1" style="text-align: center; background-color: #FF6600;"><h2>Monero Network</h2></div>
|
||||
<div class="card-body mb-0 pb-0">
|
||||
<h6 class="card-subtitle text-muted" style="font-size:80%;"> </h6>
|
||||
<div class="table-responsive table-hover table-condensed table-striped">
|
||||
<table class="table">
|
||||
<tbody>
|
||||
<tr>
|
||||
<td>Height</td>
|
||||
<td>{{ network_stats["height"] }}<br>
|
||||
{{ network_stats["timestamp"]|timeago }} ago</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Difficulty</td>
|
||||
<td>{{ network_stats["difficulty"]|humanize }}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Reward</td>
|
||||
<td>0.{{ network_stats["reward"] }} Monero</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Head Hash</td>
|
||||
<td>{{ network_stats["hash"] }}</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<script>
|
||||
window.setInterval('refresh()', 30000); // Call refresh function every 30000 milliseconds (30 seconds).
|
||||
function refresh() {
|
||||
window .location.reload();
|
||||
}
|
||||
</script>
|
||||
|
||||
</body>
|
||||
</html>
|
||||
@@ -0,0 +1,12 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<title>Oops</title>
|
||||
</head>
|
||||
<body>
|
||||
<h2>Ooops, something went wrong:</h2>
|
||||
{{ error }}
|
||||
(Maybe you need to wait a few minutes for p2pool to start and sync for the first time?)
|
||||
</body>
|
||||
</html>
|
||||
@@ -1,4 +1,4 @@
|
||||
FROM ubuntu:latest
|
||||
FROM ubuntu:22.04
|
||||
|
||||
RUN set -e && \
|
||||
apt-get update -q -y --no-install-recommends && \
|
||||
@@ -20,15 +20,16 @@ RUN git clone https://github.com/xmrig/xmrig.git && \
|
||||
|
||||
# ---
|
||||
|
||||
FROM ubuntu:latest
|
||||
FROM ubuntu:22.04
|
||||
|
||||
COPY --from=0 /usr/src/xmrig/build/xmrig /
|
||||
|
||||
RUN set -e && \
|
||||
apt-get update -q -y --no-install-recommends && \
|
||||
DEBIAN_FRONTEND="noninteractive" apt-get install -q -y --no-install-recommends \
|
||||
libssl1.1 \
|
||||
libcrypto++6 \
|
||||
libuv1 \
|
||||
libssl3 \
|
||||
libcrypto++8 \
|
||||
libhwloc15 \
|
||||
&& \
|
||||
apt-get clean
|
||||
|
||||
@@ -0,0 +1,93 @@
|
||||
## Setting up P2Pool as a service controlled by a RC script (FreeBSD, and possibly other)
|
||||
|
||||
In order to use this RC script, it is required to create a `p2pool` user account on the system for this service. An example **passwd(5)** line for this user would be:
|
||||
```
|
||||
p2pool:*:818:818::0:0:Monero P2Pool:/var/db/p2pool:/usr/sbin/nologin
|
||||
```
|
||||
Also an example **group(5)** line:
|
||||
```
|
||||
p2pool:*:818:
|
||||
```
|
||||
|
||||
When creating such an user and a group, make sure the UID and GID aren't being used by any other user/group in the system. The home directory of the user will be used as the data directory of P2Pool; set it to your desired location as needed.
|
||||
|
||||
The RC script assumes the P2Pool executable is installed as `/usr/local/bin/p2pool`.
|
||||
|
||||
### /usr/local/etc/rc.d/p2pool
|
||||
```sh
|
||||
#!/bin/sh
|
||||
|
||||
# PROVIDE: p2pool
|
||||
# REQUIRE: LOGIN FILESYSTEMS
|
||||
# KEYWORD: shutdown
|
||||
|
||||
. /etc/rc.subr
|
||||
|
||||
name=p2pool
|
||||
rcvar=p2pool_enable
|
||||
|
||||
load_rc_config $name
|
||||
|
||||
: ${p2pool_enable:="NO"} ${p2pool_local_api:="NO"}
|
||||
|
||||
[ -z "$p2pool_wallet" ] && exit 1
|
||||
p2pool_user=p2pool
|
||||
p2pool_home="`getent passwd ${p2pool_user} | cut -d : -f 6`"
|
||||
[ -z "$p2pool_home" ] && exit 1
|
||||
p2pool_env="HOME=$p2pool_home"
|
||||
p2pool_chdir="$p2pool_home"
|
||||
procname=/usr/local/bin/p2pool
|
||||
pidfile="$p2pool_home/p2pool.pid"
|
||||
command=/usr/sbin/daemon
|
||||
flags="-p ${pidfile} -f -- ${procname} ${p2pool_flags} --data-dir ${p2pool_home} --wallet ${p2pool_wallet}"
|
||||
[ -n "${p2pool_api_path}" ] && flags="${flags} --data-api ${p2pool_api_path}"
|
||||
if checkyesno p2pool_local_api; then
|
||||
if [ -n "${p2pool_api_path}" ]; then
|
||||
flags="${flags} --local-api"
|
||||
else
|
||||
echo 'Warning: p2pool_local_api="YES" requires p2pool_api_path being set, ignoring' 1>&2
|
||||
fi
|
||||
fi
|
||||
start_precmd="p2pool_prestart"
|
||||
stop_postcmd="rm -f ${pidfile}"
|
||||
|
||||
p2pool_prestart() {
|
||||
if [ -n "${p2pool_api_path}" ]; then
|
||||
[ -d "${p2pool_api_path}" ] || mkdir -p "${p2pool_api_path}"
|
||||
gid="`getent passwd ${p2pool_user} | cut -d : -f 4`"
|
||||
chown ${p2pool_user}:${gid} "${p2pool_api_path}"
|
||||
fi
|
||||
}
|
||||
|
||||
run_rc_command "$1"
|
||||
```
|
||||
|
||||
### Configuration variables in /etc/rc.conf (or /etc/rc.conf.local)
|
||||
|
||||
* `p2pool_enable` Set to `YES` to enable this service; required.
|
||||
* `p2pool_wallet` Your wallet address; required.
|
||||
* `p2pool_api_path` Path to API directory (See p2pool option `--data-api`), this directory will be created automatically if not already exists, on service startup; optional.
|
||||
* `p2pool_local_api` Set to `YES` to enable creation of `local` path in API directory (See p2pool option `--local-api`), requires `p2pool_api_path` also being set; optional.
|
||||
* `p2pool_flags` Additional options you want to pass to p2pool; optional.
|
||||
|
||||
#### Example
|
||||
```sh
|
||||
p2pool_enable="YES"
|
||||
p2pool_wallet="44MnN1f3Eto8DZYUWuE5XZNUtE3vcRzt2j6PzqWpPau34e6Cf4fAxt6X2MBmrm6F9YMEiMNjN6W4Shn4pLcfNAja621jwyg"
|
||||
p2pool_api_path="/tmp/p2pool-api"
|
||||
p2pool_local_api="YES"
|
||||
p2pool_flags="--host 127.0.0.1 --in-peers 200"
|
||||
```
|
||||
|
||||
## /usr/local/etc/newsyslog.conf.d/p2pool.conf (optional)
|
||||
|
||||
You can create this drop-in **newsyslog(8)** configuration file to periodically rotate the P2Pool log file. The drop-in location `/usr/local/etc/newsyslog.conf.d/` assumes that `/etc/newsyslog.conf` contains an `include` directive for searching drop-in configuration files in it.
|
||||
|
||||
This example assumes `/var/db/p2pool` as your P2Pool data directory.
|
||||
|
||||
```
|
||||
# log file owner:group mode count size (KiB) when flags pid file signal
|
||||
/var/db/p2pool/p2pool.log p2pool:p2pool 640 16 65536 @0101T BEJ /var/db/p2pool/p2pool.pid SIGUSR1
|
||||
```
|
||||
|
||||
You should adjust the `count`, `size`, `when` and/or `flags` fields to fit your needs.
|
||||
@@ -0,0 +1,128 @@
|
||||
### P2Pool command line options
|
||||
|
||||
```
|
||||
--wallet Main wallet address (the one that starts with 4...). To mine to a subaddress of this wallet, use it together with --subaddress
|
||||
--subaddress Subaddress to mine to. It must belong to the same wallet that was specified with --wallet parameter
|
||||
--host IP address of your Monero node, default is 127.0.0.1
|
||||
--rpc-port monerod RPC API port number, default is 18081
|
||||
--zmq-port monerod ZMQ pub port number, default is 18083 (same port as in monerod's "--zmq-pub" command line parameter)
|
||||
--stratum Comma-separated list of IP:port for stratum server to listen on
|
||||
--p2p Comma-separated list of IP:port for p2p server to listen on
|
||||
--addpeers Comma-separated list of IP:port of other p2pool nodes to connect to
|
||||
--stratum-ban-time N Number of seconds to ban misbehaving stratum client, default is 600
|
||||
--light-mode Don't allocate RandomX dataset, saves 2GB of RAM
|
||||
--loglevel Verbosity of the log, integer number between 0 and 6
|
||||
--data-dir Path to store general p2pool files (log, cache, peer data, etc.), default is current directory
|
||||
--sidechain-config Name of the p2pool sidechain parameters file (only use it if you run your own sidechain)
|
||||
--data-api Path to the p2pool JSON data (use it in tandem with an external web-server). Not affected by --data-dir setting!
|
||||
--local-api Enable /local/ path in api path for Stratum Server and built-in miner statistics
|
||||
--stratum-api An alias for --local-api
|
||||
--no-cache Disable p2pool.cache
|
||||
--no-color Disable colors in console output
|
||||
--no-randomx Disable internal RandomX hasher: p2pool will use RPC calls to monerod to check PoW hashes
|
||||
--out-peers N Maximum number of outgoing connections for p2p server (any value between 10 and 450)
|
||||
--in-peers N Maximum number of incoming connections for p2p server (any value between 10 and 450)
|
||||
--start-mining N Start built-in miner using N threads (any value between 1 and 64)
|
||||
--mini Connect to p2pool-mini sidechain. Note that it will also change default p2p port from 37889 to 37888
|
||||
--nano Connect to p2pool-nano sidechain. Note that it will also change default p2p port from 37889 to 37890
|
||||
--no-autodiff Disable automatic difficulty adjustment for miners connected to stratum (WARNING: incompatible with Nicehash and MRR)
|
||||
--rpc-login Specify username[:password] required for Monero RPC server
|
||||
--socks5 Specify IP:port of a SOCKS5 proxy to use for outgoing connections
|
||||
--no-dns Disable DNS queries, use only IP addresses to connect to peers (seed node DNS will be unavailable too)
|
||||
--p2p-external-port Port number that your router uses for mapping to your local p2p port. Use it if you are behind a NAT and still want to accept incoming connections
|
||||
--no-upnp Disable UPnP port forwarding
|
||||
--no-igd An alias for --no-upnp
|
||||
--upnp-stratum Port forward Stratum port (it's not forwarded by default)
|
||||
--merge-mine IP:port and wallet address for another blockchain to merge mine with
|
||||
--version Print p2pool's version and build details
|
||||
--tls-cert file Load TLS certificate chain from "file" in the PEM format
|
||||
--tls-cert-key file Load TLS certificate private key from "file" in the PEM format
|
||||
--rpc-ssl Enable SSL on RPC connections to the Monero node
|
||||
--rpc-ssl-fingerprint base64-encoded fingerprint of the Monero node's certificate (optional, use it for certificate pinning)
|
||||
--no-stratum-http Disable HTTP on Stratum ports
|
||||
--full-validation Enables full share validation / increases CPU usage
|
||||
```
|
||||
|
||||
### Example command line
|
||||
|
||||
```
|
||||
p2pool.exe --host 127.0.0.1 --rpc-port 18081 --zmq-port 18083 --wallet YOUR_WALLET_ADDRESS --stratum 0.0.0.0:3333 --p2p 0.0.0.0:37889
|
||||
```
|
||||
|
||||
### Multiple backup hosts
|
||||
|
||||
You can have multiple hosts in command line. If P2Pool detects that the host it's currently using is down or stuck, it will cycle through hosts until it finds a working one. It will not switch back as long as the current host it found is working.
|
||||
|
||||
Each new host uses RPC and zmq-pub port numbers from the previous host (or default 18081/18083 if none were specified). Note that `--rpc-login`, `--rpc-ssl` and `--rpc-ssl-fingerprint` are not copied from the previous host, you must specify it for each host that has username/password or RPC-SSL enabled.
|
||||
|
||||
In the following example, you have local Monero host running on ports 18081/18083 (RPC/zmq-pub), and several backup hosts running on ports 18089/18084.
|
||||
|
||||
|
||||
```
|
||||
p2pool.exe --host 127.0.0.1 --host node.monerodevs.org --rpc-port 18089 --zmq-port 18084 --host node2.monerodevs.org --host node.richfowler.net --wallet YOUR_WALLET_ADDRESS
|
||||
```
|
||||
|
||||
### Merge mining
|
||||
|
||||
Merge mining is available in P2Pool since the fork that happened on October 12th, 2024. Version 4.0 or newer is required to use it.
|
||||
|
||||
- Blockchains that will support [Merge mining RPC API](https://github.com/SChernykh/p2pool/blob/master/docs/MERGE_MINING.MD#proposed-rpc-api)
|
||||
- [Townforge](https://townforge.net/) supports it in their [tmp-mm branch](https://git.townforge.net/townforge/townforge/src/branch/tmp-mm) (not released yet)
|
||||
- [DarkFi](https://dark.fi/) is going to support it, but it's [not ready yet](https://github.com/darkrenaissance/darkfi/issues/244)
|
||||
```
|
||||
p2pool.exe --wallet YOUR_MONERO_WALLET_ADDRESS --merge-mine IP:port YOUR_WALLET_ADDRESS_ON_ANOTHER_BLOCKCHAIN
|
||||
```
|
||||
|
||||
### Tari merge mining
|
||||
|
||||
[Tari](https://www.tari.com/) uses their own gRPC API and requires a different command line:
|
||||
```
|
||||
./p2pool --wallet YOUR_MONERO_WALLET_ADDRESS --merge-mine tari://TARI_NODE_IP:18102 TARI_WALLET_ADDRESS
|
||||
```
|
||||
and on the Tari side
|
||||
```
|
||||
./minotari_node --grpc-enabled --mining-enabled
|
||||
```
|
||||
TARI_NODE_IP is 127.0.0.1 if you run both on the same machine (recommended).
|
||||
|
||||
Merge mining is available on Tari's mainnet:
|
||||
- Download [Tari suite](https://github.com/tari-project/tari/releases/latest) for your OS
|
||||
- Run Minotari node and wait until in synchronizes
|
||||
- Run Minotari console wallet to create a Tari wallet
|
||||
- Copy the interactive wallet address from the "Receive" tab of the wallet
|
||||
- Paste it into the P2Pool command line above
|
||||
- Everything is ready now to start merge mining Monero and Tari!
|
||||
|
||||
Note that Tari will be mined in solo mode (only full Tari blocks can be mined for now). This doesn't affect P2Pool payouts - they will stay the same.
|
||||
|
||||
### TLS
|
||||
|
||||
Starting from v4.1, P2Pool supports SSL/TLS connections to its Stratum port. Port 443 can also be safely used for Stratum connections since v4.1 - P2Pool will detect HTTP requests and respond to them.
|
||||
|
||||
All `--tls...` parameters are optional. If they are not provided, P2Pool will generate a self-signed certificate upon startup.
|
||||
|
||||
If you want to use your own certificate, please refer to your certificate provider's documentation (or OpenSSL documentation) on how to generate the appropriate PEM files.
|
||||
|
||||
Note that you need to use certificate files and `--tls...` parameters to be able to use certificate pinning in XMRig miners that connect to your P2Pool instance.
|
||||
|
||||
`--tls-cert` and `--tls-cert-key` parameters must always be used together.
|
||||
|
||||
### RPC-SSL
|
||||
|
||||
Starting from v4.4, P2Pool supports RPC-SSL connections to Monero nodes. Add `--rpc-ssl` to P2Pool command line to enable it.
|
||||
|
||||
P2Pool supports certificate pinning on RPC-SSL connections via `--rpc-ssl-fingerprint MONERO_NODE_FINGERPRINT_BASE64` parameter. To get your node certificate's fingerprint, run
|
||||
|
||||
```
|
||||
openssl x509 -in rpc_ssl.crt -pubkey -noout -inform pem | openssl pkey -pubin -outform der | openssl dgst -sha256 -binary | openssl enc -base64
|
||||
```
|
||||
|
||||
By default, `rpc_ssl.crt` can be found in Monero data directory: `/home/username/.bitmonero/rpc_ssl.crt` on Linux and `C:\ProgramData\bitmonero\rpc_ssl.crt` on Windows.
|
||||
|
||||
|
||||
### Full validation
|
||||
|
||||
`--full-validation` is a boolean flag and will set the value to true; by default it is false to reduce CPU usage
|
||||
|
||||
Enable this if untrusted sources can submit shares to your p2pool server and you want to verify the validity of the shares PoW. Increases CPU usage.
|
||||
This option is for shared mining services, and not neccessary in local setups.
|
||||
@@ -0,0 +1,47 @@
|
||||
### P2Pool console commands
|
||||
|
||||
Command|Description
|
||||
-|-
|
||||
help|display list of commands
|
||||
status|display p2pool status
|
||||
loglevel **N**|set log level (**N** can be between 0 and 6)
|
||||
addpeers **L**|**L** is a comma-separated list of IP:port of other p2pool nodes to connect to
|
||||
droppeers|disconnect all currently connected peers
|
||||
peers|show all currently connected peers (p2p)
|
||||
workers|show all currently connected workers (stratum)
|
||||
bans|show all banned IPs
|
||||
hosts|show Monero hosts which were configured in the command line
|
||||
next_host|switch to the next Monero host configured in the command line
|
||||
outpeers **N**|set maximum number of outgoing connections (values above 50 are not recommended)
|
||||
inpeers **N**|set maximum number of incoming connections (values above 50 are not recommended)
|
||||
start_mining **T**|start mining (**T** is the number of threads to use, must be between 1 and 64)
|
||||
stop_mining|stop mining
|
||||
exit|terminate p2pool
|
||||
version|show p2pool version
|
||||
|
||||
### Non-interactive console access
|
||||
|
||||
It's possible to send console commands via a local TCP connection. For this, you need to enable the API: `--data-api api --local-api`.
|
||||
|
||||
A sample Python script that sends console commands to P2Pool via TCP:
|
||||
|
||||
```
|
||||
import sys
|
||||
import socket
|
||||
import json
|
||||
|
||||
with open('api/local/console', 'r') as file:
|
||||
data = json.load(file)
|
||||
|
||||
s = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
|
||||
s.connect(('127.0.0.1', data['tcp_port']))
|
||||
|
||||
command = data['cookie'];
|
||||
command += sys.argv[1];
|
||||
command += '\n';
|
||||
|
||||
s.sendall(command.encode('utf-8'))
|
||||
s.close()
|
||||
```
|
||||
|
||||
Run it in P2Pool's directory: `python3 ./p2pool_cmd.py status`
|
||||
@@ -0,0 +1,124 @@
|
||||
## Merge mining tx_extra tag format
|
||||
|
||||
- TX_EXTRA_MERGE_MINING_TAG (1 byte)
|
||||
- A single byte of value `3`
|
||||
- Size (in bytes) of the following fields (1 byte)
|
||||
- Technically a Varint, but it's always a single byte in practice
|
||||
- Merkle tree parameters (1 or multiple bytes - 64-bit value encoded as varint)
|
||||
- Merkle root hash (32 bytes)
|
||||
|
||||
## Merkle tree parameters
|
||||
|
||||
A 64-bit value encoding the total number of aux chains hashed into the Merkle root hash, and an aux nonce that defines the order of aux chains when building the Merkle tree.
|
||||
|
||||
Bit|Description
|
||||
-|-
|
||||
0...2|`N-1` - number of bits used to store `n_aux_chains` (value 0 means 1 bit, ..., value 7 means 8 bits)
|
||||
3...`N`+2|`n_aux_chains-1` (value 0 means 1 chain, and so on)
|
||||
`N`+3...`N`+34|`aux_nonce` (32-bit value)
|
||||
`N`+35...63|reserved (current implementations must set these bits to all 0 when writing and ignore these bits when reading)
|
||||
|
||||
`N` must be the smallest number of bits enough to represent `n_aux_chains-1`
|
||||
|
||||
Reference code: `PoolBlock::encode_merkle_tree_data` and `PoolBlock::decode_merkle_tree_data` in `pool_block.h`
|
||||
|
||||
## Merkle tree construction's first step (Monero-specific)
|
||||
|
||||
If `n_aux_chains` is not a power of 2, their hashes are combined starting from the end of the list of hashes until there are a power of 2 hashes left. Then they're processed normally.
|
||||
|
||||
Example 1: 6 hashes `H0, H1, H2, H3, H4, H5` will be transformed into 4 hashes `H0, H1, H(H2|H3), H(H4|H5)` where `H` is the hash function and `|` is concatenation.
|
||||
|
||||
Example 2: 5 hashes `H0, H1, H2, H3, H4` will be transformed into 4 hashes `H0, H1, H2, H(H3|H4)`
|
||||
|
||||
## The order of hashes in the Merkle tree
|
||||
|
||||
Each of the aux chains must provide a 32-byte value `unique_id` that singles it out from any other chain. Genesis block's hash is a good choice for this value, but it can be anything else really.
|
||||
|
||||
`unique_id` is used to enforce the order in which aux hashes are added to the Merkle tree. This prevents an attack where miners can mine two versions of the same chain (for example when double spending) without any additional cost.
|
||||
|
||||
Forked chains can choose whether to keep their `unique_id` or change it. If they keep it, it will be impossible to merge mine with the chain they forked from beause they will always be assigned the same slot in the Merkle tree.
|
||||
|
||||
A deterministic pseudo-random function `SHA256(unique_id|nonce|"m") % N` is applied to determine which slot is used by which chain. `nonce` is brute-forced until all `N` chains are assigned different slots. This limits `N` to no more than 15-16 in practice.
|
||||
|
||||
Reference code: `get_aux_slot` and `find_aux_nonce` in `merkle.cpp`
|
||||
|
||||
## Proposed RPC API
|
||||
|
||||
P2Pool must be able to get mining jobs from merge mined chains and submit PoW solutions to them. All RPC calls here are sent as HTTP POST requests with `Content-Type: application/json`.
|
||||
|
||||
### merge_mining_get_chain_id
|
||||
|
||||
Gets a unique ID that identifies this merge mined chain and separates it from other chains.
|
||||
|
||||
Example request: `{"jsonrpc":"2.0","id":"0","method":"merge_mining_get_chain_id"}`
|
||||
|
||||
Response: a JSON containing these fields:
|
||||
Field|Description
|
||||
-|-
|
||||
`chain_id`|A unique 32-byte hex-encoded value that identifies this merge mined chain.
|
||||
|
||||
Example response 1: `{"jsonrpc":"2.0","id":"0","result":{"chain_id":"0f28c4960d96647e77e7ab6d13b85bd16c7ca56f45df802cdc763a5e5c0c7863"}}`
|
||||
|
||||
Example response 2: `{"jsonrpc":"2.0","id":"0","error":"something went wrong"}`
|
||||
|
||||
### merge_mining_get_aux_block
|
||||
|
||||
Gets a blob of data (usually a new block for the merge mined chain) and its hash to be used for merge mining.
|
||||
|
||||
Example request: `{"jsonrpc":"2.0","id":"0","method":"merge_mining_get_aux_block","params":{"address":"MERGE_MINED_CHAIN_ADDRESS","aux_hash":"f6952d6eef555ddd87aca66e56b91530222d6e318414816f3ba7cf5bf694bf0f","height":3000000,"prev_id":"ad505b0be8a49b89273e307106fa42133cbd804456724c5e7635bd953215d92a"}}`
|
||||
|
||||
Request: a JSON containing these fields:
|
||||
Field|Description
|
||||
-|-
|
||||
`address`|A wallet address on the merge mined chain
|
||||
`aux_hash`|Merge mining job that is currently being used
|
||||
`height`|Monero height
|
||||
`prev_id`|Hash of the previous Monero block
|
||||
|
||||
Response: a JSON containing these fields:
|
||||
Field|Description
|
||||
-|-
|
||||
`aux_blob`|A hex-encoded blob of data. Merge mined chain defines the contents of this blob. It's opaque to P2Pool and will not be changed by it.
|
||||
`aux_diff`|Mining difficulty (decimal number).
|
||||
`aux_hash`|A 32-byte hex-encoded hash of the `aux_blob`. Merge mined chain defines how exactly this hash is calculated. It's opaque to P2Pool.
|
||||
|
||||
If `aux_hash` is the same as in the request, all other fields will be ignored by P2Pool, so they don't have to be included in the response. Moreover, empty response will be interpreted as a response having the same `aux_hash` as in the request. This enables an efficient polling.
|
||||
|
||||
Example response 1: `{"jsonrpc":"2.0","id":"0","result":{"aux_blob":"4c6f72656d20697073756d","aux_diff":123456,"aux_hash":"f6952d6eef555ddd87aca66e56b91530222d6e318414816f3ba7cf5bf694bf0f"}}`
|
||||
|
||||
Example response 2: `{"jsonrpc":"2.0","id":"0","result":{}}`
|
||||
|
||||
### merge_mining_submit_solution
|
||||
|
||||
Submits a PoW solution for the merge mined chain's block. Note that when merge mining with Monero, the PoW solution is always a Monero block template with merge mining data included in it.
|
||||
|
||||
Example request: `{"jsonrpc":"2.0","id":"0","method":"merge_mining_submit_solution","params":{"aux_blob":"4c6f72656d20697073756d","aux_hash":"f6952d6eef555ddd87aca66e56b91530222d6e318414816f3ba7cf5bf694bf0f","blob":"...","merkle_proof":["hash1","hash2","hash3"],"path":3,"seed_hash":"22c3d47c595ae888b5d7fc304235f92f8854644d4fad38c5680a5d4a81009fcd"}}`
|
||||
|
||||
Request: a JSON containing these fields:
|
||||
Field|Description
|
||||
-|-
|
||||
`aux_blob`|Blob of data returned by `merge_mining_get_aux_block`.
|
||||
`aux_hash`|A 32-byte hex-encoded hash of the `aux_blob` - the same value that was returned by `merge_mining_get_aux_block`.
|
||||
`blob`|Monero block template that has enough PoW to satisfy difficulty returned by `merge_mining_get_aux_block`. It also must have a merge mining tag in tx_extra of the coinbase transaction.
|
||||
`merkle_proof`|A proof that `aux_hash` was included when calculating Merkle root hash from the merge mining tag
|
||||
`path`|A path bitmap (32-bit unsigned integer) that complements `merkle_proof`
|
||||
`seed_hash`|A 32-byte hex-encoded key that is used to [initialize RandomX dataset](https://github.com/tevador/RandomX/blob/master/doc/specs.md#7-dataset)
|
||||
|
||||
Note that `merkle_proof` only contains a vector of 32-byte hashes for `aux_hash` to be combined with. It can be verified by running this pseudo-code and functions from `merkle.cpp` (adapt it to your codebase):
|
||||
|
||||
`verify_merkle_proof(aux_hash, merkle_proof, get_aux_slot(unique_id, aux_nonce, n_aux_chains), n_aux_chains, merkle_root_hash)`
|
||||
|
||||
`aux_nonce` and `n_aux_chains` can be extracted from the Merkle tree parameters (see above).
|
||||
`merkle_root_hash` can be extracted from the merge mining tag (see above).
|
||||
|
||||
`merkle_proof` can also be verified by `verify_merkle_proof(aux_hash, merkle_proof, path, merkle_root_hash)`
|
||||
|
||||
|
||||
Response: a JSON containing these fields:
|
||||
Field|Description
|
||||
-|-
|
||||
`status`|Block submit status
|
||||
|
||||
Example response 1: `{"jsonrpc":"2.0","id":"0","result":{"status":"accepted"}}`
|
||||
|
||||
Example response 2: `{"jsonrpc":"2.0","id":"0","error":{"code":-1,"message":"Block not accepted"}}`
|
||||
@@ -0,0 +1,49 @@
|
||||
## Setting up P2Pool as a systemd service (Linux)
|
||||
|
||||
With this config, P2Pool will run as a service with redirected I/O. It uses `p2pool` user which you should setup beforehand.
|
||||
|
||||
You can execute console commands by running `echo "status" > /run/p2pool/p2pool.control`
|
||||
|
||||
### p2pool.service
|
||||
```
|
||||
[Unit]
|
||||
Description=p2pool daemon
|
||||
After=network-online.target systemd-modules-load.service monerod.service
|
||||
Wants=network-online.target systemd-modules-load.service monerod.service
|
||||
Requires=p2pool.socket
|
||||
|
||||
[Service]
|
||||
Type=exec
|
||||
Sockets=p2pool.socket
|
||||
StandardInput=socket
|
||||
StandardOutput=journal
|
||||
StandardError=journal
|
||||
|
||||
# /usr/local/bin/p2pool.sh simply invokes the p2pool executable with your chosen command-line options.
|
||||
ExecStart=/usr/local/bin/p2pool.sh
|
||||
TimeoutStopSec=60
|
||||
|
||||
# Run as p2pool:p2pool
|
||||
User=p2pool
|
||||
Group=p2pool
|
||||
|
||||
WorkingDirectory=/var/lib/p2pool
|
||||
|
||||
[Install]
|
||||
WantedBy=multi-user.target
|
||||
```
|
||||
|
||||
### p2pool.socket
|
||||
```
|
||||
# FIFO socket for controlling p2pool daemon
|
||||
[Unit]
|
||||
Description=Command FIFO for p2pool daemon
|
||||
|
||||
[Socket]
|
||||
ListenFIFO=/run/p2pool/p2pool.control
|
||||
DirectoryMode=0755
|
||||
SocketMode=0666
|
||||
SocketUser=p2pool
|
||||
SocketGroup=p2pool
|
||||
RemoveOnStop=true
|
||||
```
|
||||
Binary file not shown.
|
After Width: | Height: | Size: 671 B |
@@ -0,0 +1,317 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="utf-8"/>
|
||||
<title>P2Pool - Decentralized Monero mining pool</title>
|
||||
<link rel="shortcut icon" type="image/png" href="favicon-32x32.png"/>
|
||||
<meta name="viewport" content="width=device-width, initial-scale=0.5">
|
||||
<style>
|
||||
a {
|
||||
color: #e09000;
|
||||
-ms-touch-action: none;
|
||||
touch-action: none;
|
||||
}
|
||||
|
||||
a:visited {
|
||||
color: #808080;
|
||||
-ms-touch-action: none;
|
||||
touch-action: none;
|
||||
}
|
||||
|
||||
body {
|
||||
background-color: #383838;
|
||||
color: #e0e0e0;
|
||||
font-family: Arial, sans-serif;
|
||||
font-size: 1.5rem;
|
||||
}
|
||||
|
||||
table {
|
||||
color: #c0c0c0;
|
||||
border-spacing:15px 5px;
|
||||
font-size: 1.5rem;
|
||||
}
|
||||
|
||||
table.menu_page {
|
||||
width: 100%;
|
||||
margin-left: auto;
|
||||
margin-right: auto;
|
||||
}
|
||||
|
||||
details > summary {
|
||||
padding: 0.25rem;
|
||||
font-size: 2.5rem;
|
||||
-ms-touch-action: none;
|
||||
touch-action: none;
|
||||
}
|
||||
|
||||
details > ul > li > span {
|
||||
color: #e09000;
|
||||
}
|
||||
</style>
|
||||
<script>
|
||||
function elapsedTimeStr(ts1, ts2, short_form) {
|
||||
let s = ts2 - ts1;
|
||||
if (s < 0) s = 0;
|
||||
let m = Math.floor(s / 60) % 60;
|
||||
let h = Math.floor(s / 3600) % 24;
|
||||
let d = Math.floor(s / 86400);
|
||||
if (short_form) {
|
||||
if (s >= 86400) return d + 'd';
|
||||
if (s >= 3600) return h + 'h';
|
||||
return m + 'm';
|
||||
}
|
||||
else {
|
||||
let result = m + 'm';
|
||||
if (s >= 3600) result = h + 'h ' + result;
|
||||
if (s >= 86400) result = d + 'd ' + h + 'h';
|
||||
return result;
|
||||
}
|
||||
}
|
||||
|
||||
function set_effort(el, value) {
|
||||
el.innerHTML = value.toFixed(2) + '%';
|
||||
el.style = (value < 100.0) ? "color:#00C000;" : (value < 200.0) ? "color:#E0E000;" : "color:#FF0000;";
|
||||
}
|
||||
|
||||
async function load_data() {
|
||||
init_menu();
|
||||
window.onresize = init_menu;
|
||||
|
||||
let pool_stats_req = await fetch('api/pool/stats');
|
||||
let pool_blocks_req = await fetch('api/pool/blocks');
|
||||
let network_stats_req = await fetch('api/network/stats');
|
||||
let latest_release_req = await fetch('api/latest_release');
|
||||
|
||||
let pool_stats = JSON.parse(await pool_stats_req.text());
|
||||
let pool_blocks = JSON.parse(await pool_blocks_req.text());
|
||||
let network_stats = JSON.parse(await network_stats_req.text());
|
||||
let latest_release = JSON.parse(await latest_release_req.text());
|
||||
|
||||
let pool_hashrate = pool_stats.pool_statistics.hashRate / 1e6;
|
||||
let pplns_duration = pool_stats.pool_statistics.pplnsWeight / pool_stats.pool_statistics.hashRate;
|
||||
let min_payout = 0.6 * pool_stats.pool_statistics.sidechainDifficulty / pool_stats.pool_statistics.pplnsWeight;
|
||||
|
||||
document.getElementById("pool_hashrate").innerHTML = pool_hashrate.toFixed(3) + ' MH/s';
|
||||
document.getElementById("pplns_duration").innerHTML = elapsedTimeStr(0, pplns_duration, 0) + ' ' + Math.floor(pplns_duration % 60) + 's';
|
||||
document.getElementById("pool_miners").innerHTML = pool_stats.pool_statistics.miners;
|
||||
document.getElementById("min_payout").innerHTML = min_payout.toFixed(5) + ' XMR';
|
||||
document.getElementById("latest_release").innerHTML = '<a href="' + latest_release.html_url + '" target="_blank">' + latest_release.name + '</a>';
|
||||
|
||||
let ts = Math.floor(Date.now() / 1000);
|
||||
|
||||
let n = pool_stats.pool_statistics.lastBlockFound;
|
||||
document.getElementById("pool_last_block").innerHTML = n ? ('<a href="/explorer/block/' + n + '" target="_blank">' + n + '</a> (' + elapsedTimeStr(pool_stats.pool_statistics.lastBlockFoundTime, ts, 0) + ' ago)') : 'N/A';
|
||||
document.getElementById("pool_total_blocks").innerHTML = pool_stats.pool_statistics.totalBlocksFound;
|
||||
|
||||
let t = document.getElementById('menu_blocks');
|
||||
let cur_effort = (pool_stats.pool_statistics.totalHashes - ((pool_blocks.length > 0) ? pool_blocks[0].totalHashes : 0)) * 100.0 / network_stats.difficulty;
|
||||
set_effort(document.getElementById("current_effort"), (cur_effort >= 0) ? cur_effort : 0);
|
||||
let total_effort = 0.0;
|
||||
let num_blocks_with_effort = 0;
|
||||
for (let i = 0, m = Math.min(pool_blocks.length, 50); i < m; ++i) {
|
||||
if (t.rows.length <= i + 1) t.insertRow(-1);
|
||||
let row = t.rows[i + 1];
|
||||
while (row.cells.length < 3) row.insertCell(-1);
|
||||
|
||||
let height = row.cells[0];
|
||||
let effort = row.cells[1];
|
||||
let age = row.cells[2];
|
||||
|
||||
n = pool_blocks[i].height;
|
||||
height.innerHTML = '<a href="/explorer/block/' + pool_blocks[i].hash + '" target="_blank">' + n + '</a>';
|
||||
|
||||
if ((i + 1 < pool_blocks.length) && (pool_blocks[i + 1].totalHashes > 0)) {
|
||||
let value = (pool_blocks[i].totalHashes - pool_blocks[i + 1].totalHashes) * 100.0 / pool_blocks[i].difficulty;
|
||||
total_effort += value;
|
||||
++num_blocks_with_effort;
|
||||
set_effort(effort, value);
|
||||
}
|
||||
else {
|
||||
effort.innerHTML = "N/A";
|
||||
}
|
||||
|
||||
age.innerHTML = elapsedTimeStr(pool_blocks[i].ts, ts, 1);
|
||||
}
|
||||
if (num_blocks_with_effort > 0) {
|
||||
let average_effort = total_effort / num_blocks_with_effort;
|
||||
set_effort(document.getElementById("average_effort"), average_effort);
|
||||
}
|
||||
|
||||
let network_hashrate = network_stats.difficulty / 120e6;
|
||||
document.getElementById("monero_hashrate").innerHTML = network_hashrate.toFixed(3) + ' MH/s';
|
||||
document.getElementById("monero_last_block").innerHTML = network_stats.height + ' (' + elapsedTimeStr(network_stats.timestamp, ts, 0) + ' ago)';
|
||||
}
|
||||
|
||||
const menu = ['pool', 'blocks', 'help', 'faq'];
|
||||
|
||||
function init_menu()
|
||||
{
|
||||
let is_mobile = false;
|
||||
|
||||
if (navigator.userAgentData) {
|
||||
is_mobile = navigator.userAgentData.mobile;
|
||||
}
|
||||
else {
|
||||
const mobile_preg = /Android|webOS|iPhone|iPad|iPod|BlackBerry/i;
|
||||
is_mobile = mobile_preg.test(navigator.userAgent) || mobile_preg.test(navigator.platform);
|
||||
}
|
||||
|
||||
let e = document.getElementById('main_menu');
|
||||
|
||||
if (!is_mobile) {
|
||||
e.style.cursor = "pointer";
|
||||
document.querySelectorAll("details > summary").forEach(el => { el.style.cursor = "pointer"; });
|
||||
}
|
||||
|
||||
e.style.width = (window.innerWidth > 1600) ? "1600px" : "100%";
|
||||
|
||||
menu.forEach(element => {
|
||||
let e2 = document.getElementById('menu_' + element);
|
||||
e2.style.width = e.style.width;
|
||||
});
|
||||
}
|
||||
|
||||
function toggle_menu(name) {
|
||||
if (!name) {
|
||||
name = 'pool';
|
||||
}
|
||||
|
||||
menu.forEach(element => {
|
||||
let e = document.getElementById('menu_' + element);
|
||||
let b = document.getElementById('button_' + element);
|
||||
if (element == name) {
|
||||
e.style.display = 'block';
|
||||
b.style.backgroundColor = '#646464';
|
||||
window.location.hash = '#' + name;
|
||||
}
|
||||
else {
|
||||
e.style.display = 'none';
|
||||
b.style.backgroundColor = '#404040';
|
||||
}
|
||||
});
|
||||
}
|
||||
</script>
|
||||
</head>
|
||||
<body onload="load_data();setInterval(load_data, 2000);toggle_menu(window.location.hash.substr(1));">
|
||||
<div style="font-size:3rem;text-align:center;">P2Pool</div><div style="font-size:1.1rem;text-align:center;">Decentralized Monero mining pool</div>
|
||||
<div style="font-size:1rem;text-align:center;">Latest release: <span id="latest_release"><a href="https://github.com/SChernykh/p2pool/releases/latest" target="_blank">P2Pool</a></span></div>
|
||||
<br>
|
||||
<table id="main_menu" style="width:100%;margin-left:auto;margin-right:auto;table-layout:fixed;text-align:center;-ms-touch-action:none;touch-action:none;"><tr>
|
||||
<td onclick="toggle_menu('pool')" id="button_pool">Pool</td>
|
||||
<td onclick="toggle_menu('blocks')" id="button_blocks">Blocks</td>
|
||||
<td onclick="toggle_menu('help')" id="button_help">Get started</td>
|
||||
<td onclick="toggle_menu('faq')" id="button_faq">FAQ</td>
|
||||
</tr></table>
|
||||
<br>
|
||||
<table id="menu_pool" class="menu_page">
|
||||
<tr><td></td><td style="width:17rem;">Pool</td><td>Network</td></tr>
|
||||
<tr><td style="padding-bottom: 1rem;"></td><td></td><td></td></tr>
|
||||
<tr><td>Hashrate</td><td><span id="pool_hashrate">N/A</span></td><td><span id="monero_hashrate">N/A</span></td></tr>
|
||||
<tr><td>Miners</td><td><span id="pool_miners">N/A</span></td><td></td></tr>
|
||||
<tr><td>PPLNS window</td><td><span id="pplns_duration">N/A</span></td><td></td></tr>
|
||||
<tr><td>Last block</td><td><span id="pool_last_block">N/A</span></td><td><span id="monero_last_block">N/A</span></td></tr>
|
||||
<tr><td>Total blocks</td><td><span id="pool_total_blocks">N/A</span></td><td></td></tr>
|
||||
<tr><td>Current effort</td><td><span id="current_effort">N/A</span></td><td></td></tr>
|
||||
<tr><td>Average effort<br><div style="text-align:center;font-size:0.9rem">last 50 blocks</div></td><td><span id="average_effort">N/A</span></td><td></td></tr>
|
||||
<tr><td> </td><td></td><td></td></tr>
|
||||
<tr><td>Fee</td><td>0%</td><td></td></tr>
|
||||
<tr><td>Min payout</td><td><span id="min_payout">0.00027 XMR</span></td><td></td></tr>
|
||||
<tr><td>Payout scheme</td><td><a href="https://en.wikipedia.org/wiki/Mining_pool#Pay-per-last-N-shares" target="_blank">PPLNS</a></td><td></td></tr>
|
||||
<tr><td> </td><td></td><td></td></tr>
|
||||
<tr><td>Statistics</td><td><a href="https://p2pool.observer/" target="_blank">P2Pool observer</a></td><td></td></tr>
|
||||
</table>
|
||||
<table id="menu_blocks" class="menu_page">
|
||||
<tr><td style="padding-right:5rem;">Height</td><td style="padding-right:5rem;">Effort</td><td>Age</td></tr>
|
||||
</table>
|
||||
<table id="menu_help" class="menu_page"><tr><td>
|
||||
|
||||
<details><summary>P2Pool video guide</summary>
|
||||
<ul>
|
||||
<li>A detailed <a href="https://www.youtube.com/watch?v=NbxbRu-2GWI" target="_blank">video guide</a> to install P2Pool and start mining
|
||||
</ul>
|
||||
</details>
|
||||
|
||||
<details><summary>Setup Monero wallet</summary>
|
||||
Wallets with confirmed P2Pool support<br>
|
||||
<span style="font-size:0.9rem;color:#e09000;">You might not see P2Pool payouts in other wallets if they're not updated!</span>
|
||||
<ul>
|
||||
<li>Official <a href="https://www.getmonero.org/downloads/" target="_blank">Monero CLI and GUI v0.18.1.0</a> and newer
|
||||
<li><a href="https://play.google.com/store/apps/details?id=com.m2049r.xmrwallet" target="_blank">Monerujo v3.0.2 "Fluorine Fermi"</a> and newer
|
||||
<li><a href="https://play.google.com/store/apps/details?id=com.cakewallet.cake_wallet" target="_blank">Cake Wallet v4.4.5</a> and newer
|
||||
<li><a href="https://featherwallet.org/" target="_blank">Feather Wallet v2.1.0</a> and newer
|
||||
<li><a href="https://mymonero.com/" target="_blank">MyMonero</a>
|
||||
</ul>
|
||||
It's highly recommended to create a new wallet for mining because wallet addresses are public on p2pool. You have to use the primary wallet address for mining. Subaddresses and integrated addresses are not supported, just like with monerod solo mining.
|
||||
</details>
|
||||
|
||||
<details><summary>Setup Monero node</summary>
|
||||
<ul>
|
||||
<li>Download the latest Monero <a href="https://www.getmonero.org/downloads/" target="_blank">release</a>
|
||||
<li>[Optional] Open port <span>18080</span> (Monero p2p port) in your firewall to ensure better connectivity
|
||||
<li>Run <span>./monerod --zmq-pub tcp://127.0.0.1:18083 --out-peers 32 --in-peers 64 --add-priority-node=p2pmd.xmrvsbeast.com:18080 --add-priority-node=nodes.hashvault.pro:18080 --enforce-dns-checkpointing --enable-dns-blocklist</span>
|
||||
<li>If your network connection's upload bandwidth is less than 10 Mbit, use <span>--out-peers 8 --in-peers 16</span> instead.
|
||||
<li>Wait until it's fully synchronized. If you didn't run Monero node before, it can take up to several days to synchronize (5-6 hours on a modern PC with fast SSD and fast Internet connection). You can add <span>--prune-blockchain</span> argument to the command line to run a pruned node (3-4 times less disk usage)
|
||||
</ul></details>
|
||||
|
||||
<details><summary>Setup P2Pool node</summary>
|
||||
<ul>
|
||||
<li>Download the latest P2Pool <a href="https://github.com/SChernykh/p2pool/releases/latest" target="_blank">release</a>
|
||||
<li>[Optional] Open port <span>37889</span> (P2Pool port) or <span>37888</span> (P2Pool mini port) in your firewall to ensure better connectivity
|
||||
<li>Run <span>./p2pool --host 127.0.0.1 --wallet YOUR_WALLET_ADDRESS</span>
|
||||
<li>It should take no more than 5-10 minutes to synchronize
|
||||
</ul></details>
|
||||
|
||||
<details><summary>Miner software</summary>
|
||||
<ul>
|
||||
<li><a href="https://xmrig.com/" target="_blank">XMRig</a> is recommended. <a href="https://xmrig.com/proxy" target="_blank">XMRig Proxy</a> is fully supported.
|
||||
<li>Once P2Pool sync is complete, XMRig should be able to connect to the stratum server on port <span>3333</span>
|
||||
<li>Run <span>./xmrig -o 127.0.0.1:3333</span>. Note that you don't need to specify wallet address for xmrig. Wallet address set in xmrig config will be ignored!
|
||||
<li>To set custom fixed difficulty for your miner (for example, <span>10000</span>), run <span>./xmrig -u x+10000 -o 127.0.0.1:3333</span>
|
||||
<li>To connect another mining rig to your P2Pool node, run <span>./xmrig -o YOUR_P2POOL_NODE_IP:3333</span> on that mining rig
|
||||
</ul></details>
|
||||
|
||||
<details><summary>Checking your progress</summary>
|
||||
<ul>
|
||||
<li>You can enter your wallet address at <a href="https://p2pool.observer/" target="_blank">P2Pool Observer</a>
|
||||
<li>P2Pool Observer for P2Pool mini can be found <a href="https://mini.p2pool.observer/" target="_blank">here</a>
|
||||
<li>You will find your wallet's statistics there only after you've mined at least 1 P2Pool share
|
||||
</ul>
|
||||
</details>
|
||||
|
||||
<details><summary>Help and support</summary>
|
||||
P2Pool is a decentralized community, there is no dedicated support. You can reach and get help from other miners on:
|
||||
<ul>
|
||||
<li>IRC channels: <span>#p2pool-log</span> (<span>#p2pool-mini</span> for P2Pool mini) on <a href="https://libera.chat/" target="_blank">Libera.Chat</a>
|
||||
<li>Reddit: <a href="https://reddit.com/r/MoneroMining/" target="_blank">r/MoneroMining</a>
|
||||
</ul></details>
|
||||
</td></tr></table>
|
||||
<table id="menu_faq" class="menu_page"><tr><td>
|
||||
<ul>
|
||||
<li><span style="font-size:2rem;color:#e09000;">What are system requirements to run P2Pool?</span>
|
||||
<ul><li>P2Pool needs 0.5 GB disc space and 2.6 GB RAM to run (0.6 GB RAM in light mode). Add this to monerod requirements if you run both on the same machine. Add <span style="color:#808080;">--light-mode</span> to p2pool command line to reduce the memory usage to 0.6 GB, or <span style="color:#808080;">--no-randomx --no-cache</span> to reduce the memory usage to less than 100 MB.</ul><br>
|
||||
<li><span style="font-size:2rem;color:#e09000;">Does P2Pool work with XMRig Proxy?</span>
|
||||
<ul><li>Yes, P2Pool fully supports <a href="https://xmrig.com/proxy" target="_blank">XMRig Proxy</a>.</ul><br>
|
||||
<li><span style="font-size:2rem;color:#e09000;">Does monerod have to be run on the same machine as P2Pool?</span>
|
||||
<ul><li>No, you can run them on different machines and even connect multiple p2pool instances to a single server running monerod</ul><br>
|
||||
<li><span style="font-size:2rem;color:#e09000;">Does P2Pool work with pruned Monero node?</span>
|
||||
<ul><li>Yes, you can use pruned Monero node to mine on P2Pool</ul><br>
|
||||
<li><span style="font-size:2rem;color:#e09000;">Does P2Pool require incoming connections to work properly?</span>
|
||||
<ul><li>P2Pool (and Monero) can work with only outgoing connections, but it's recommended to open ports 18080 (Monero) and 37889/37888 (P2Pool/P2Pool mini) for better connectivity with the rest of the network.</ul><br>
|
||||
<li><span style="font-size:2rem;color:#e09000;">I have been mining for several hours and still got no rewards?</span>
|
||||
<ul><li>P2Pool doesn't work exactly like regular pools - there's no "pending balance" here. You need to find a pool share first and then wait for P2Pool to find a Monero block. You'll get a payout to your XMR wallet as soon as a block is found and you have shares in PPLNS window. It can take several days to a week to find a share if your hashrate is low. Type "status" command in P2Pool console or visit <a href="https://p2pool.observer/" target="_blank">P2Pool observer</a> to check your progress.</ul><br>
|
||||
<li><span style="font-size:2rem;color:#e09000;">I am mining but I can't find any shares</span>
|
||||
<ul><li>First check for any warnings and errors in P2Pool console and logs. If everything works fine, you can check the <a href="https://p2pool.observer/calculate-share-time" target="_blank">average share time calculator</a> to get an idea how often you should find a share with your hashrate. If this time is more than 1 day, it's recommended to switch to P2Pool mini by adding <span style="color:#808080;">--mini</span> to P2Pool command line.</ul><br>
|
||||
<li><span style="font-size:2rem;color:#e09000;">I get an error "monerod RPC ... is incompatible, update to RPC >= v3.8"</span>
|
||||
<ul><li>Use monerod v0.18.0.0 or newer</ul><br>
|
||||
<li><span style="font-size:2rem;color:#e09000;">I get warnings "peer ... is ahead on mainchain (height ..., your height ...). Is your monerod stuck or lagging?"</span>
|
||||
<ul><li>Make sure you add these arguments to monerod command line: <span style="color:#808080;">--zmq-pub tcp://127.0.0.1:18083 --enforce-dns-checkpointing --enable-dns-blocklist</span></ul><br>
|
||||
</ul>
|
||||
</td></tr></table>
|
||||
<br><br>
|
||||
<div style="position:fixed;width:100%;bottom:0;background-color:#383838;font-size:1rem;text-align:center;color:#b0b0b0;">
|
||||
<a href="api/" target="_blank">Pool API</a> | <a href="https://github.com/SChernykh/p2pool" target="_blank">Source</a> | <a href="http://yucmgsbw7nknw7oi3bkuwudvc657g2xcqahhbjyewazusyytapqo4xid.onion/" target="_blank">Onion URL</a><br>
|
||||
Donate to support the project:<br><span style="font-size:0.9rem;color:#b0b0b0;">44MnN1f3Eto8DZYUWuE5XZNUtE3vcRzt2j6PzqWpPau34e6Cf4fAxt6X2MBmrm6F9YMEiMNjN6W4Shn4pLcfNAja621jwyg</span><br>
|
||||
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
||||
Binary file not shown.
|
After Width: | Height: | Size: 671 B |
@@ -0,0 +1,317 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="utf-8"/>
|
||||
<title>P2Pool mini - Decentralized Monero mining pool</title>
|
||||
<link rel="shortcut icon" type="image/png" href="favicon-32x32.png"/>
|
||||
<meta name="viewport" content="width=device-width, initial-scale=0.5">
|
||||
<style>
|
||||
a {
|
||||
color: #e09000;
|
||||
-ms-touch-action: none;
|
||||
touch-action: none;
|
||||
}
|
||||
|
||||
a:visited {
|
||||
color: #808080;
|
||||
-ms-touch-action: none;
|
||||
touch-action: none;
|
||||
}
|
||||
|
||||
body {
|
||||
background-color: #383838;
|
||||
color: #e0e0e0;
|
||||
font-family: Arial, sans-serif;
|
||||
font-size: 1.5rem;
|
||||
}
|
||||
|
||||
table {
|
||||
color: #c0c0c0;
|
||||
border-spacing:15px 5px;
|
||||
font-size: 1.5rem;
|
||||
}
|
||||
|
||||
table.menu_page {
|
||||
width: 100%;
|
||||
margin-left: auto;
|
||||
margin-right: auto;
|
||||
}
|
||||
|
||||
details > summary {
|
||||
padding: 0.25rem;
|
||||
font-size: 2.5rem;
|
||||
-ms-touch-action: none;
|
||||
touch-action: none;
|
||||
}
|
||||
|
||||
details > ul > li > span {
|
||||
color: #e09000;
|
||||
}
|
||||
</style>
|
||||
<script>
|
||||
function elapsedTimeStr(ts1, ts2, short_form) {
|
||||
let s = ts2 - ts1;
|
||||
if (s < 0) s = 0;
|
||||
let m = Math.floor(s / 60) % 60;
|
||||
let h = Math.floor(s / 3600) % 24;
|
||||
let d = Math.floor(s / 86400);
|
||||
if (short_form) {
|
||||
if (s >= 86400) return d + 'd';
|
||||
if (s >= 3600) return h + 'h';
|
||||
return m + 'm';
|
||||
}
|
||||
else {
|
||||
let result = m + 'm';
|
||||
if (s >= 3600) result = h + 'h ' + result;
|
||||
if (s >= 86400) result = d + 'd ' + h + 'h';
|
||||
return result;
|
||||
}
|
||||
}
|
||||
|
||||
function set_effort(el, value) {
|
||||
el.innerHTML = value.toFixed(2) + '%';
|
||||
el.style = (value < 100.0) ? "color:#00C000;" : (value < 200.0) ? "color:#E0E000;" : "color:#FF0000;";
|
||||
}
|
||||
|
||||
async function load_data() {
|
||||
init_menu();
|
||||
window.onresize = init_menu;
|
||||
|
||||
let pool_stats_req = await fetch('api/pool/stats');
|
||||
let pool_blocks_req = await fetch('api/pool/blocks');
|
||||
let network_stats_req = await fetch('api/network/stats');
|
||||
let latest_release_req = await fetch('api/latest_release');
|
||||
|
||||
let pool_stats = JSON.parse(await pool_stats_req.text());
|
||||
let pool_blocks = JSON.parse(await pool_blocks_req.text());
|
||||
let network_stats = JSON.parse(await network_stats_req.text());
|
||||
let latest_release = JSON.parse(await latest_release_req.text());
|
||||
|
||||
let pool_hashrate = pool_stats.pool_statistics.hashRate / 1e6;
|
||||
let pplns_duration = pool_stats.pool_statistics.pplnsWeight / pool_stats.pool_statistics.hashRate;
|
||||
let min_payout = 0.6 * pool_stats.pool_statistics.sidechainDifficulty / pool_stats.pool_statistics.pplnsWeight;
|
||||
|
||||
document.getElementById("pool_hashrate").innerHTML = pool_hashrate.toFixed(3) + ' MH/s';
|
||||
document.getElementById("pplns_duration").innerHTML = elapsedTimeStr(0, pplns_duration, 0) + ' ' + Math.floor(pplns_duration % 60) + 's';
|
||||
document.getElementById("pool_miners").innerHTML = pool_stats.pool_statistics.miners;
|
||||
document.getElementById("min_payout").innerHTML = min_payout.toFixed(5) + ' XMR';
|
||||
document.getElementById("latest_release").innerHTML = '<a href="' + latest_release.html_url + '" target="_blank">' + latest_release.name + '</a>';
|
||||
|
||||
let ts = Math.floor(Date.now() / 1000);
|
||||
|
||||
let n = pool_stats.pool_statistics.lastBlockFound;
|
||||
document.getElementById("pool_last_block").innerHTML = n ? ('<a href="/explorer/block/' + n + '" target="_blank">' + n + '</a> (' + elapsedTimeStr(pool_stats.pool_statistics.lastBlockFoundTime, ts, 0) + ' ago)') : 'N/A';
|
||||
document.getElementById("pool_total_blocks").innerHTML = pool_stats.pool_statistics.totalBlocksFound;
|
||||
|
||||
let t = document.getElementById('menu_blocks');
|
||||
let cur_effort = (pool_stats.pool_statistics.totalHashes - ((pool_blocks.length > 0) ? pool_blocks[0].totalHashes : 0)) * 100.0 / network_stats.difficulty;
|
||||
set_effort(document.getElementById("current_effort"), (cur_effort >= 0) ? cur_effort : 0);
|
||||
let total_effort = 0.0;
|
||||
let num_blocks_with_effort = 0;
|
||||
for (let i = 0, m = Math.min(pool_blocks.length, 50); i < m; ++i) {
|
||||
if (t.rows.length <= i + 1) t.insertRow(-1);
|
||||
let row = t.rows[i + 1];
|
||||
while (row.cells.length < 3) row.insertCell(-1);
|
||||
|
||||
let height = row.cells[0];
|
||||
let effort = row.cells[1];
|
||||
let age = row.cells[2];
|
||||
|
||||
n = pool_blocks[i].height;
|
||||
height.innerHTML = '<a href="/explorer/block/' + pool_blocks[i].hash + '" target="_blank">' + n + '</a>';
|
||||
|
||||
if ((i + 1 < pool_blocks.length) && (pool_blocks[i + 1].totalHashes > 0)) {
|
||||
let value = (pool_blocks[i].totalHashes - pool_blocks[i + 1].totalHashes) * 100.0 / pool_blocks[i].difficulty;
|
||||
total_effort += value;
|
||||
++num_blocks_with_effort;
|
||||
set_effort(effort, value);
|
||||
}
|
||||
else {
|
||||
effort.innerHTML = "N/A";
|
||||
}
|
||||
|
||||
age.innerHTML = elapsedTimeStr(pool_blocks[i].ts, ts, 1);
|
||||
}
|
||||
if (num_blocks_with_effort > 0) {
|
||||
let average_effort = total_effort / num_blocks_with_effort;
|
||||
set_effort(document.getElementById("average_effort"), average_effort);
|
||||
}
|
||||
|
||||
let network_hashrate = network_stats.difficulty / 120e6;
|
||||
document.getElementById("monero_hashrate").innerHTML = network_hashrate.toFixed(3) + ' MH/s';
|
||||
document.getElementById("monero_last_block").innerHTML = network_stats.height + ' (' + elapsedTimeStr(network_stats.timestamp, ts, 0) + ' ago)';
|
||||
}
|
||||
|
||||
const menu = ['pool', 'blocks', 'help', 'faq'];
|
||||
|
||||
function init_menu()
|
||||
{
|
||||
let is_mobile = false;
|
||||
|
||||
if (navigator.userAgentData) {
|
||||
is_mobile = navigator.userAgentData.mobile;
|
||||
}
|
||||
else {
|
||||
const mobile_preg = /Android|webOS|iPhone|iPad|iPod|BlackBerry/i;
|
||||
is_mobile = mobile_preg.test(navigator.userAgent) || mobile_preg.test(navigator.platform);
|
||||
}
|
||||
|
||||
let e = document.getElementById('main_menu');
|
||||
|
||||
if (!is_mobile) {
|
||||
e.style.cursor = "pointer";
|
||||
document.querySelectorAll("details > summary").forEach(el => { el.style.cursor = "pointer"; });
|
||||
}
|
||||
|
||||
e.style.width = (window.innerWidth > 1600) ? "1600px" : "100%";
|
||||
|
||||
menu.forEach(element => {
|
||||
let e2 = document.getElementById('menu_' + element);
|
||||
e2.style.width = e.style.width;
|
||||
});
|
||||
}
|
||||
|
||||
function toggle_menu(name) {
|
||||
if (!name) {
|
||||
name = 'pool';
|
||||
}
|
||||
|
||||
menu.forEach(element => {
|
||||
let e = document.getElementById('menu_' + element);
|
||||
let b = document.getElementById('button_' + element);
|
||||
if (element == name) {
|
||||
e.style.display = 'block';
|
||||
b.style.backgroundColor = '#646464';
|
||||
window.location.hash = '#' + name;
|
||||
}
|
||||
else {
|
||||
e.style.display = 'none';
|
||||
b.style.backgroundColor = '#404040';
|
||||
}
|
||||
});
|
||||
}
|
||||
</script>
|
||||
</head>
|
||||
<body onload="load_data();setInterval(load_data, 2000);toggle_menu(window.location.hash.substr(1));">
|
||||
<div style="font-size:3rem;text-align:center;">P2Pool mini</div><div style="font-size:1.1rem;text-align:center;">Decentralized Monero mining pool</div>
|
||||
<div style="font-size:1rem;text-align:center;">Latest release: <span id="latest_release"><a href="https://github.com/SChernykh/p2pool/releases/latest" target="_blank">P2Pool</a></span></div>
|
||||
<br>
|
||||
<table id="main_menu" style="width:100%;margin-left:auto;margin-right:auto;table-layout:fixed;text-align:center;-ms-touch-action:none;touch-action:none;"><tr>
|
||||
<td onclick="toggle_menu('pool')" id="button_pool">Pool</td>
|
||||
<td onclick="toggle_menu('blocks')" id="button_blocks">Blocks</td>
|
||||
<td onclick="toggle_menu('help')" id="button_help">Get started</td>
|
||||
<td onclick="toggle_menu('faq')" id="button_faq">FAQ</td>
|
||||
</tr></table>
|
||||
<br>
|
||||
<table id="menu_pool" class="menu_page">
|
||||
<tr><td></td><td style="width:17rem;">Pool</td><td>Network</td></tr>
|
||||
<tr><td style="padding-bottom: 1rem;"></td><td></td><td></td></tr>
|
||||
<tr><td>Hashrate</td><td><span id="pool_hashrate">N/A</span></td><td><span id="monero_hashrate">N/A</span></td></tr>
|
||||
<tr><td>Miners</td><td><span id="pool_miners">N/A</span></td><td></td></tr>
|
||||
<tr><td>PPLNS window</td><td><span id="pplns_duration">N/A</span></td><td></td></tr>
|
||||
<tr><td>Last block</td><td><span id="pool_last_block">N/A</span></td><td><span id="monero_last_block">N/A</span></td></tr>
|
||||
<tr><td>Total blocks</td><td><span id="pool_total_blocks">N/A</span></td><td></td></tr>
|
||||
<tr><td>Current effort</td><td><span id="current_effort">N/A</span></td><td></td></tr>
|
||||
<tr><td>Average effort<br><div style="text-align:center;font-size:0.9rem">last 50 blocks</div></td><td><span id="average_effort">N/A</span></td><td></td></tr>
|
||||
<tr><td> </td><td></td><td></td></tr>
|
||||
<tr><td>Fee</td><td>0%</td><td></td></tr>
|
||||
<tr><td>Min payout</td><td><span id="min_payout">0.00027 XMR</span></td><td></td></tr>
|
||||
<tr><td>Payout scheme</td><td><a href="https://en.wikipedia.org/wiki/Mining_pool#Pay-per-last-N-shares" target="_blank">PPLNS</a></td><td></td></tr>
|
||||
<tr><td> </td><td></td><td></td></tr>
|
||||
<tr><td>Statistics</td><td><a href="https://mini.p2pool.observer/" target="_blank">P2Pool observer</a></td><td></td></tr>
|
||||
</table>
|
||||
<table id="menu_blocks" class="menu_page">
|
||||
<tr><td style="padding-right:5rem;">Height</td><td style="padding-right:5rem;">Effort</td><td>Age</td></tr>
|
||||
</table>
|
||||
<table id="menu_help" class="menu_page"><tr><td>
|
||||
|
||||
<details><summary>P2Pool video guide</summary>
|
||||
<ul>
|
||||
<li>A detailed <a href="https://www.youtube.com/watch?v=NbxbRu-2GWI" target="_blank">video guide</a> to install P2Pool and start mining
|
||||
</ul>
|
||||
</details>
|
||||
|
||||
<details><summary>Setup Monero wallet</summary>
|
||||
Wallets with confirmed P2Pool support<br>
|
||||
<span style="font-size:0.9rem;color:#e09000;">You might not see P2Pool payouts in other wallets if they're not updated!</span>
|
||||
<ul>
|
||||
<li>Official <a href="https://www.getmonero.org/downloads/" target="_blank">Monero CLI and GUI v0.18.1.0</a> and newer
|
||||
<li><a href="https://play.google.com/store/apps/details?id=com.m2049r.xmrwallet" target="_blank">Monerujo v3.0.2 "Fluorine Fermi"</a> and newer
|
||||
<li><a href="https://play.google.com/store/apps/details?id=com.cakewallet.cake_wallet" target="_blank">Cake Wallet v4.4.5</a> and newer
|
||||
<li><a href="https://featherwallet.org/" target="_blank">Feather Wallet v2.1.0</a> and newer
|
||||
<li><a href="https://mymonero.com/" target="_blank">MyMonero</a>
|
||||
</ul>
|
||||
It's highly recommended to create a new wallet for mining because wallet addresses are public on p2pool. You have to use the primary wallet address for mining. Subaddresses and integrated addresses are not supported, just like with monerod solo mining.
|
||||
</details>
|
||||
|
||||
<details><summary>Setup Monero node</summary>
|
||||
<ul>
|
||||
<li>Download the latest Monero <a href="https://www.getmonero.org/downloads/" target="_blank">release</a>
|
||||
<li>[Optional] Open port <span>18080</span> (Monero p2p port) in your firewall to ensure better connectivity
|
||||
<li>Run <span>./monerod --zmq-pub tcp://127.0.0.1:18083 --out-peers 32 --in-peers 64 --add-priority-node=p2pmd.xmrvsbeast.com:18080 --add-priority-node=nodes.hashvault.pro:18080 --enforce-dns-checkpointing --enable-dns-blocklist</span>
|
||||
<li>If your network connection's upload bandwidth is less than 10 Mbit, use <span>--out-peers 8 --in-peers 16</span> instead.
|
||||
<li>Wait until it's fully synchronized. If you didn't run Monero node before, it can take up to several days to synchronize (5-6 hours on a modern PC with fast SSD and fast Internet connection). You can add <span>--prune-blockchain</span> argument to the command line to run a pruned node (3-4 times less disk usage)
|
||||
</ul></details>
|
||||
|
||||
<details><summary>Setup P2Pool node</summary>
|
||||
<ul>
|
||||
<li>Download the latest P2Pool <a href="https://github.com/SChernykh/p2pool/releases/latest" target="_blank">release</a>
|
||||
<li>[Optional] Open port <span>37889</span> (P2Pool port) or <span>37888</span> (P2Pool mini port) in your firewall to ensure better connectivity
|
||||
<li>Run <span>./p2pool --host 127.0.0.1 --wallet YOUR_WALLET_ADDRESS --mini</span>
|
||||
<li>It should take no more than 5-10 minutes to synchronize
|
||||
</ul></details>
|
||||
|
||||
<details><summary>Miner software</summary>
|
||||
<ul>
|
||||
<li><a href="https://xmrig.com/" target="_blank">XMRig</a> is recommended. <a href="https://xmrig.com/proxy" target="_blank">XMRig Proxy</a> is fully supported.
|
||||
<li>Once P2Pool sync is complete, XMRig should be able to connect to the stratum server on port <span>3333</span>
|
||||
<li>Run <span>./xmrig -o 127.0.0.1:3333</span>. Note that you don't need to specify wallet address for xmrig. Wallet address set in xmrig config will be ignored!
|
||||
<li>To set custom fixed difficulty for your miner (for example, <span>10000</span>), run <span>./xmrig -u x+10000 -o 127.0.0.1:3333</span>
|
||||
<li>To connect another mining rig to your P2Pool node, run <span>./xmrig -o YOUR_P2POOL_NODE_IP:3333</span> on that mining rig
|
||||
</ul></details>
|
||||
|
||||
<details><summary>Checking your progress</summary>
|
||||
<ul>
|
||||
<li>You can enter your wallet address at <a href="https://p2pool.observer/" target="_blank">P2Pool Observer</a>
|
||||
<li>P2Pool Observer for P2Pool mini can be found <a href="https://mini.p2pool.observer/" target="_blank">here</a>
|
||||
<li>You will find your wallet's statistics there only after you've mined at least 1 P2Pool share
|
||||
</ul>
|
||||
</details>
|
||||
|
||||
<details><summary>Help and support</summary>
|
||||
P2Pool is a decentralized community, there is no dedicated support. You can reach and get help from other miners on:
|
||||
<ul>
|
||||
<li>IRC channels: <span>#p2pool-log</span> (<span>#p2pool-mini</span> for P2Pool mini) on <a href="https://libera.chat/" target="_blank">Libera.Chat</a>
|
||||
<li>Reddit: <a href="https://reddit.com/r/MoneroMining/" target="_blank">r/MoneroMining</a>
|
||||
</ul></details>
|
||||
</td></tr></table>
|
||||
<table id="menu_faq" class="menu_page"><tr><td>
|
||||
<ul>
|
||||
<li><span style="font-size:2rem;color:#e09000;">What are system requirements to run P2Pool?</span>
|
||||
<ul><li>P2Pool needs 0.5 GB disc space and 2.6 GB RAM to run (0.6 GB RAM in light mode). Add this to monerod requirements if you run both on the same machine. Add <span style="color:#808080;">--light-mode</span> to p2pool command line to reduce the memory usage to 0.6 GB, or <span style="color:#808080;">--no-randomx --no-cache</span> to reduce the memory usage to less than 100 MB.</ul><br>
|
||||
<li><span style="font-size:2rem;color:#e09000;">Does P2Pool work with XMRig Proxy?</span>
|
||||
<ul><li>Yes, P2Pool fully supports <a href="https://xmrig.com/proxy" target="_blank">XMRig Proxy</a>.</ul><br>
|
||||
<li><span style="font-size:2rem;color:#e09000;">Does monerod have to be run on the same machine as P2Pool?</span>
|
||||
<ul><li>No, you can run them on different machines and even connect multiple p2pool instances to a single server running monerod</ul><br>
|
||||
<li><span style="font-size:2rem;color:#e09000;">Does P2Pool work with pruned Monero node?</span>
|
||||
<ul><li>Yes, you can use pruned Monero node to mine on P2Pool</ul><br>
|
||||
<li><span style="font-size:2rem;color:#e09000;">Does P2Pool require incoming connections to work properly?</span>
|
||||
<ul><li>P2Pool (and Monero) can work with only outgoing connections, but it's recommended to open ports 18080 (Monero) and 37889/37888 (P2Pool/P2Pool mini) for better connectivity with the rest of the network.</ul><br>
|
||||
<li><span style="font-size:2rem;color:#e09000;">I have been mining for several hours and still got no rewards?</span>
|
||||
<ul><li>P2Pool doesn't work exactly like regular pools - there's no "pending balance" here. You need to find a pool share first and then wait for P2Pool to find a Monero block. You'll get a payout to your XMR wallet as soon as a block is found and you have shares in PPLNS window. It can take several days to a week to find a share if your hashrate is low. Type "status" command in P2Pool console or visit <a href="https://mini.p2pool.observer/" target="_blank">P2Pool observer</a> to check your progress.</ul><br>
|
||||
<li><span style="font-size:2rem;color:#e09000;">I am mining but I can't find any shares</span>
|
||||
<ul><li>First check for any warnings and errors in P2Pool console and logs. If everything works fine, you can check the <a href="https://p2pool.observer/calculate-share-time" target="_blank">average share time calculator</a> to get an idea how often you should find a share with your hashrate. If this time is more than 1 day, it's recommended to switch to P2Pool mini by adding <span style="color:#808080;">--mini</span> to P2Pool command line.</ul><br>
|
||||
<li><span style="font-size:2rem;color:#e09000;">I get an error "monerod RPC ... is incompatible, update to RPC >= v3.8"</span>
|
||||
<ul><li>Use monerod v0.18.0.0 or newer</ul><br>
|
||||
<li><span style="font-size:2rem;color:#e09000;">I get warnings "peer ... is ahead on mainchain (height ..., your height ...). Is your monerod stuck or lagging?"</span>
|
||||
<ul><li>Make sure you add these arguments to monerod command line: <span style="color:#808080;">--zmq-pub tcp://127.0.0.1:18083 --enforce-dns-checkpointing --enable-dns-blocklist</span></ul><br>
|
||||
</ul>
|
||||
</td></tr></table>
|
||||
<br><br>
|
||||
<div style="position:fixed;width:100%;bottom:0;background-color:#383838;font-size:1rem;text-align:center;color:#b0b0b0;">
|
||||
<a href="api/" target="_blank">Pool API</a> | <a href="https://github.com/SChernykh/p2pool" target="_blank">Source</a> | <a href="http://yucmgsbw7nknw7oi3bkuwudvc657g2xcqahhbjyewazusyytapqo4xid.onion/mini/" target="_blank">Onion URL</a><br>
|
||||
Donate to support the project:<br><span style="font-size:0.9rem;color:#b0b0b0;">44MnN1f3Eto8DZYUWuE5XZNUtE3vcRzt2j6PzqWpPau34e6Cf4fAxt6X2MBmrm6F9YMEiMNjN6W4Shn4pLcfNAja621jwyg</span><br>
|
||||
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
||||
Binary file not shown.
|
After Width: | Height: | Size: 671 B |
@@ -0,0 +1,320 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="utf-8"/>
|
||||
<title>P2Pool nano - Decentralized Monero mining pool</title>
|
||||
<link rel="shortcut icon" type="image/png" href="favicon-32x32.png"/>
|
||||
<meta name="viewport" content="width=device-width, initial-scale=0.5">
|
||||
<style>
|
||||
a {
|
||||
color: #e09000;
|
||||
-ms-touch-action: none;
|
||||
touch-action: none;
|
||||
}
|
||||
|
||||
a:visited {
|
||||
color: #808080;
|
||||
-ms-touch-action: none;
|
||||
touch-action: none;
|
||||
}
|
||||
|
||||
body {
|
||||
background-color: #383838;
|
||||
color: #e0e0e0;
|
||||
font-family: Arial, sans-serif;
|
||||
font-size: 1.5rem;
|
||||
}
|
||||
|
||||
table {
|
||||
color: #c0c0c0;
|
||||
border-spacing:15px 5px;
|
||||
font-size: 1.5rem;
|
||||
}
|
||||
|
||||
table.menu_page {
|
||||
width: 100%;
|
||||
margin-left: auto;
|
||||
margin-right: auto;
|
||||
}
|
||||
|
||||
details > summary {
|
||||
padding: 0.25rem;
|
||||
font-size: 2.5rem;
|
||||
-ms-touch-action: none;
|
||||
touch-action: none;
|
||||
}
|
||||
|
||||
details > ul > li > span {
|
||||
color: #e09000;
|
||||
}
|
||||
</style>
|
||||
<script>
|
||||
function elapsedTimeStr(ts1, ts2, short_form) {
|
||||
let s = ts2 - ts1;
|
||||
if (s < 0) s = 0;
|
||||
let m = Math.floor(s / 60) % 60;
|
||||
let h = Math.floor(s / 3600) % 24;
|
||||
let d = Math.floor(s / 86400);
|
||||
if (short_form) {
|
||||
if (s >= 86400) return d + 'd';
|
||||
if (s >= 3600) return h + 'h';
|
||||
return m + 'm';
|
||||
}
|
||||
else {
|
||||
let result = m + 'm';
|
||||
if (s >= 3600) result = h + 'h ' + result;
|
||||
if (s >= 86400) result = d + 'd ' + h + 'h';
|
||||
return result;
|
||||
}
|
||||
}
|
||||
|
||||
function set_effort(el, value) {
|
||||
el.innerHTML = value.toFixed(2) + '%';
|
||||
el.style = (value < 100.0) ? "color:#00C000;" : (value < 200.0) ? "color:#E0E000;" : "color:#FF0000;";
|
||||
}
|
||||
|
||||
async function load_data() {
|
||||
init_menu();
|
||||
window.onresize = init_menu;
|
||||
|
||||
let pool_stats_req = await fetch('api/pool/stats');
|
||||
let pool_blocks_req = await fetch('api/pool/blocks');
|
||||
let network_stats_req = await fetch('api/network/stats');
|
||||
let latest_release_req = await fetch('api/latest_release');
|
||||
|
||||
let pool_stats = JSON.parse(await pool_stats_req.text());
|
||||
let pool_blocks = JSON.parse(await pool_blocks_req.text());
|
||||
let network_stats = JSON.parse(await network_stats_req.text());
|
||||
let latest_release = JSON.parse(await latest_release_req.text());
|
||||
|
||||
let pool_hashrate = pool_stats.pool_statistics.hashRate / 1e6;
|
||||
let pplns_duration = pool_stats.pool_statistics.pplnsWeight / pool_stats.pool_statistics.hashRate;
|
||||
let min_payout = 0.6 * pool_stats.pool_statistics.sidechainDifficulty / pool_stats.pool_statistics.pplnsWeight;
|
||||
|
||||
document.getElementById("pool_hashrate").innerHTML = pool_hashrate.toFixed(3) + ' MH/s';
|
||||
document.getElementById("pplns_duration").innerHTML = elapsedTimeStr(0, pplns_duration, 0) + ' ' + Math.floor(pplns_duration % 60) + 's';
|
||||
document.getElementById("pool_miners").innerHTML = pool_stats.pool_statistics.miners;
|
||||
document.getElementById("min_payout").innerHTML = min_payout.toFixed(5) + ' XMR';
|
||||
document.getElementById("latest_release").innerHTML = '<a href="' + latest_release.html_url + '" target="_blank">' + latest_release.name + '</a>';
|
||||
|
||||
let ts = Math.floor(Date.now() / 1000);
|
||||
|
||||
let n = pool_stats.pool_statistics.lastBlockFound;
|
||||
document.getElementById("pool_last_block").innerHTML = n ? ('<a href="/explorer/block/' + n + '" target="_blank">' + n + '</a> (' + elapsedTimeStr(pool_stats.pool_statistics.lastBlockFoundTime, ts, 0) + ' ago)') : 'N/A';
|
||||
document.getElementById("pool_total_blocks").innerHTML = pool_stats.pool_statistics.totalBlocksFound;
|
||||
|
||||
let t = document.getElementById('menu_blocks');
|
||||
let cur_effort = (pool_stats.pool_statistics.totalHashes - ((pool_blocks.length > 0) ? pool_blocks[0].totalHashes : 0)) * 100.0 / network_stats.difficulty;
|
||||
set_effort(document.getElementById("current_effort"), (cur_effort >= 0) ? cur_effort : 0);
|
||||
let total_effort = 0.0;
|
||||
let num_blocks_with_effort = 0;
|
||||
for (let i = 0, m = Math.min(pool_blocks.length, 50); i < m; ++i) {
|
||||
if (t.rows.length <= i + 1) t.insertRow(-1);
|
||||
let row = t.rows[i + 1];
|
||||
while (row.cells.length < 3) row.insertCell(-1);
|
||||
|
||||
let height = row.cells[0];
|
||||
let effort = row.cells[1];
|
||||
let age = row.cells[2];
|
||||
|
||||
n = pool_blocks[i].height;
|
||||
height.innerHTML = '<a href="/explorer/block/' + pool_blocks[i].hash + '" target="_blank">' + n + '</a>';
|
||||
|
||||
let value = 0.0;
|
||||
|
||||
if ((i + 1 < pool_blocks.length) && (pool_blocks[i + 1].totalHashes > 0)) {
|
||||
value = (pool_blocks[i].totalHashes - pool_blocks[i + 1].totalHashes) * 100.0 / pool_blocks[i].difficulty;
|
||||
}
|
||||
else {
|
||||
value = pool_blocks[i].totalHashes * 100.0 / pool_blocks[i].difficulty;
|
||||
}
|
||||
|
||||
total_effort += value;
|
||||
++num_blocks_with_effort;
|
||||
set_effort(effort, value);
|
||||
|
||||
age.innerHTML = elapsedTimeStr(pool_blocks[i].ts, ts, 1);
|
||||
}
|
||||
if (num_blocks_with_effort > 0) {
|
||||
let average_effort = total_effort / num_blocks_with_effort;
|
||||
set_effort(document.getElementById("average_effort"), average_effort);
|
||||
}
|
||||
|
||||
let network_hashrate = network_stats.difficulty / 120e6;
|
||||
document.getElementById("monero_hashrate").innerHTML = network_hashrate.toFixed(3) + ' MH/s';
|
||||
document.getElementById("monero_last_block").innerHTML = network_stats.height + ' (' + elapsedTimeStr(network_stats.timestamp, ts, 0) + ' ago)';
|
||||
}
|
||||
|
||||
const menu = ['pool', 'blocks', 'help', 'faq'];
|
||||
|
||||
function init_menu()
|
||||
{
|
||||
let is_mobile = false;
|
||||
|
||||
if (navigator.userAgentData) {
|
||||
is_mobile = navigator.userAgentData.mobile;
|
||||
}
|
||||
else {
|
||||
const mobile_preg = /Android|webOS|iPhone|iPad|iPod|BlackBerry/i;
|
||||
is_mobile = mobile_preg.test(navigator.userAgent) || mobile_preg.test(navigator.platform);
|
||||
}
|
||||
|
||||
let e = document.getElementById('main_menu');
|
||||
|
||||
if (!is_mobile) {
|
||||
e.style.cursor = "pointer";
|
||||
document.querySelectorAll("details > summary").forEach(el => { el.style.cursor = "pointer"; });
|
||||
}
|
||||
|
||||
e.style.width = (window.innerWidth > 1600) ? "1600px" : "100%";
|
||||
|
||||
menu.forEach(element => {
|
||||
let e2 = document.getElementById('menu_' + element);
|
||||
e2.style.width = e.style.width;
|
||||
});
|
||||
}
|
||||
|
||||
function toggle_menu(name) {
|
||||
if (!name) {
|
||||
name = 'pool';
|
||||
}
|
||||
|
||||
menu.forEach(element => {
|
||||
let e = document.getElementById('menu_' + element);
|
||||
let b = document.getElementById('button_' + element);
|
||||
if (element == name) {
|
||||
e.style.display = 'block';
|
||||
b.style.backgroundColor = '#646464';
|
||||
window.location.hash = '#' + name;
|
||||
}
|
||||
else {
|
||||
e.style.display = 'none';
|
||||
b.style.backgroundColor = '#404040';
|
||||
}
|
||||
});
|
||||
}
|
||||
</script>
|
||||
</head>
|
||||
<body onload="load_data();setInterval(load_data, 2000);toggle_menu(window.location.hash.substr(1));">
|
||||
<div style="font-size:3rem;text-align:center;">P2Pool nano</div><div style="font-size:1.1rem;text-align:center;">Decentralized Monero mining pool</div>
|
||||
<div style="font-size:1rem;text-align:center;">Latest release: <span id="latest_release"><a href="https://github.com/SChernykh/p2pool/releases/latest" target="_blank">P2Pool</a></span></div>
|
||||
<br>
|
||||
<table id="main_menu" style="width:100%;margin-left:auto;margin-right:auto;table-layout:fixed;text-align:center;-ms-touch-action:none;touch-action:none;"><tr>
|
||||
<td onclick="toggle_menu('pool')" id="button_pool">Pool</td>
|
||||
<td onclick="toggle_menu('blocks')" id="button_blocks">Blocks</td>
|
||||
<td onclick="toggle_menu('help')" id="button_help">Get started</td>
|
||||
<td onclick="toggle_menu('faq')" id="button_faq">FAQ</td>
|
||||
</tr></table>
|
||||
<br>
|
||||
<table id="menu_pool" class="menu_page">
|
||||
<tr><td></td><td style="width:17rem;">Pool</td><td>Network</td></tr>
|
||||
<tr><td style="padding-bottom: 1rem;"></td><td></td><td></td></tr>
|
||||
<tr><td>Hashrate</td><td><span id="pool_hashrate">N/A</span></td><td><span id="monero_hashrate">N/A</span></td></tr>
|
||||
<tr><td>Miners</td><td><span id="pool_miners">N/A</span></td><td></td></tr>
|
||||
<tr><td>PPLNS window</td><td><span id="pplns_duration">N/A</span></td><td></td></tr>
|
||||
<tr><td>Last block</td><td><span id="pool_last_block">N/A</span></td><td><span id="monero_last_block">N/A</span></td></tr>
|
||||
<tr><td>Total blocks</td><td><span id="pool_total_blocks">N/A</span></td><td></td></tr>
|
||||
<tr><td>Current effort</td><td><span id="current_effort">N/A</span></td><td></td></tr>
|
||||
<tr><td>Average effort<br><div style="text-align:center;font-size:0.9rem">last 50 blocks</div></td><td><span id="average_effort">N/A</span></td><td></td></tr>
|
||||
<tr><td> </td><td></td><td></td></tr>
|
||||
<tr><td>Fee</td><td>0%</td><td></td></tr>
|
||||
<tr><td>Min payout</td><td><span id="min_payout">0.00027 XMR</span></td><td></td></tr>
|
||||
<tr><td>Payout scheme</td><td><a href="https://en.wikipedia.org/wiki/Mining_pool#Pay-per-last-N-shares" target="_blank">PPLNS</a></td><td></td></tr>
|
||||
<tr><td> </td><td></td><td></td></tr>
|
||||
<tr><td>Statistics</td><td><a href="https://nano.p2pool.observer/" target="_blank">P2Pool observer</a></td><td></td></tr>
|
||||
</table>
|
||||
<table id="menu_blocks" class="menu_page">
|
||||
<tr><td style="padding-right:5rem;">Height</td><td style="padding-right:5rem;">Effort</td><td>Age</td></tr>
|
||||
</table>
|
||||
<table id="menu_help" class="menu_page"><tr><td>
|
||||
|
||||
<details><summary>P2Pool video guide</summary>
|
||||
<ul>
|
||||
<li>A detailed <a href="https://www.youtube.com/watch?v=NbxbRu-2GWI" target="_blank">video guide</a> to install P2Pool and start mining
|
||||
</ul>
|
||||
</details>
|
||||
|
||||
<details><summary>Setup Monero wallet</summary>
|
||||
Wallets with confirmed P2Pool support<br>
|
||||
<span style="font-size:0.9rem;color:#e09000;">You might not see P2Pool payouts in other wallets if they're not updated!</span>
|
||||
<ul>
|
||||
<li>Official <a href="https://www.getmonero.org/downloads/" target="_blank">Monero CLI and GUI v0.18.1.0</a> and newer
|
||||
<li><a href="https://play.google.com/store/apps/details?id=com.m2049r.xmrwallet" target="_blank">Monerujo v3.0.2 "Fluorine Fermi"</a> and newer
|
||||
<li><a href="https://play.google.com/store/apps/details?id=com.cakewallet.cake_wallet" target="_blank">Cake Wallet v4.4.5</a> and newer
|
||||
<li><a href="https://featherwallet.org/" target="_blank">Feather Wallet v2.1.0</a> and newer
|
||||
<li><a href="https://mymonero.com/" target="_blank">MyMonero</a>
|
||||
</ul>
|
||||
It's highly recommended to create a new wallet for mining because wallet addresses are public on p2pool. You have to use the primary wallet address for mining. Subaddresses and integrated addresses are not supported, just like with monerod solo mining.
|
||||
</details>
|
||||
|
||||
<details><summary>Setup Monero node</summary>
|
||||
<ul>
|
||||
<li>Download the latest Monero <a href="https://www.getmonero.org/downloads/" target="_blank">release</a>
|
||||
<li>[Optional] Open port <span>18080</span> (Monero p2p port) in your firewall to ensure better connectivity
|
||||
<li>Run <span>./monerod --zmq-pub tcp://127.0.0.1:18083 --out-peers 32 --in-peers 64 --add-priority-node=p2pmd.xmrvsbeast.com:18080 --add-priority-node=nodes.hashvault.pro:18080 --enforce-dns-checkpointing --enable-dns-blocklist</span>
|
||||
<li>If your network connection's upload bandwidth is less than 10 Mbit, use <span>--out-peers 8 --in-peers 16</span> instead.
|
||||
<li>Wait until it's fully synchronized. If you didn't run Monero node before, it can take up to several days to synchronize (5-6 hours on a modern PC with fast SSD and fast Internet connection). You can add <span>--prune-blockchain</span> argument to the command line to run a pruned node (3-4 times less disk usage)
|
||||
</ul></details>
|
||||
|
||||
<details><summary>Setup P2Pool node</summary>
|
||||
<ul>
|
||||
<li>Download the latest P2Pool <a href="https://github.com/SChernykh/p2pool/releases/latest" target="_blank">release</a>
|
||||
<li>[Optional] Open port <span>37889</span> (P2Pool port) or <span>37890</span> (P2Pool nano port) in your firewall to ensure better connectivity
|
||||
<li>Run <span>./p2pool --host 127.0.0.1 --wallet YOUR_WALLET_ADDRESS --nano</span>
|
||||
<li>It should take no more than 5-10 minutes to synchronize
|
||||
</ul></details>
|
||||
|
||||
<details><summary>Miner software</summary>
|
||||
<ul>
|
||||
<li><a href="https://xmrig.com/" target="_blank">XMRig</a> is recommended. <a href="https://xmrig.com/proxy" target="_blank">XMRig Proxy</a> is fully supported.
|
||||
<li>Once P2Pool sync is complete, XMRig should be able to connect to the stratum server on port <span>3333</span>
|
||||
<li>Run <span>./xmrig -o 127.0.0.1:3333</span>. Note that you don't need to specify wallet address for xmrig. Wallet address set in xmrig config will be ignored!
|
||||
<li>To set custom fixed difficulty for your miner (for example, <span>10000</span>), run <span>./xmrig -u x+10000 -o 127.0.0.1:3333</span>
|
||||
<li>To connect another mining rig to your P2Pool node, run <span>./xmrig -o YOUR_P2POOL_NODE_IP:3333</span> on that mining rig
|
||||
</ul></details>
|
||||
|
||||
<details><summary>Checking your progress</summary>
|
||||
<ul>
|
||||
<li>You can enter your wallet address at <a href="https://p2pool.observer/" target="_blank">P2Pool Observer</a>
|
||||
<li>P2Pool Observer for P2Pool nano can be found <a href="https://nano.p2pool.observer/" target="_blank">here</a>
|
||||
<li>You will find your wallet's statistics there only after you've mined at least 1 P2Pool share
|
||||
</ul>
|
||||
</details>
|
||||
|
||||
<details><summary>Help and support</summary>
|
||||
P2Pool is a decentralized community, there is no dedicated support. You can reach and get help from other miners on:
|
||||
<ul>
|
||||
<li>IRC channels: <span>#p2pool-log</span> (<span>#p2pool-mini</span> for P2Pool mini) on <a href="https://libera.chat/" target="_blank">Libera.Chat</a>
|
||||
<li>Reddit: <a href="https://reddit.com/r/MoneroMining/" target="_blank">r/MoneroMining</a>
|
||||
</ul></details>
|
||||
</td></tr></table>
|
||||
<table id="menu_faq" class="menu_page"><tr><td>
|
||||
<ul>
|
||||
<li><span style="font-size:2rem;color:#e09000;">What are system requirements to run P2Pool?</span>
|
||||
<ul><li>P2Pool needs 0.5 GB disc space and 2.6 GB RAM to run (0.6 GB RAM in light mode). Add this to monerod requirements if you run both on the same machine. Add <span style="color:#808080;">--light-mode</span> to p2pool command line to reduce the memory usage to 0.6 GB, or <span style="color:#808080;">--no-randomx --no-cache</span> to reduce the memory usage to less than 100 MB.</ul><br>
|
||||
<li><span style="font-size:2rem;color:#e09000;">Does P2Pool work with XMRig Proxy?</span>
|
||||
<ul><li>Yes, P2Pool fully supports <a href="https://xmrig.com/proxy" target="_blank">XMRig Proxy</a>.</ul><br>
|
||||
<li><span style="font-size:2rem;color:#e09000;">Does monerod have to be run on the same machine as P2Pool?</span>
|
||||
<ul><li>No, you can run them on different machines and even connect multiple p2pool instances to a single server running monerod</ul><br>
|
||||
<li><span style="font-size:2rem;color:#e09000;">Does P2Pool work with pruned Monero node?</span>
|
||||
<ul><li>Yes, you can use pruned Monero node to mine on P2Pool</ul><br>
|
||||
<li><span style="font-size:2rem;color:#e09000;">Does P2Pool require incoming connections to work properly?</span>
|
||||
<ul><li>P2Pool (and Monero) can work with only outgoing connections, but it's recommended to open ports 18080 (Monero) and 37889/37888/37890 (P2Pool/P2Pool mini/P2Pool nano) for better connectivity with the rest of the network.</ul><br>
|
||||
<li><span style="font-size:2rem;color:#e09000;">I have been mining for several hours and still got no rewards?</span>
|
||||
<ul><li>P2Pool doesn't work exactly like regular pools - there's no "pending balance" here. You need to find a pool share first and then wait for P2Pool to find a Monero block. You'll get a payout to your XMR wallet as soon as a block is found and you have shares in PPLNS window. It can take several days to a week to find a share if your hashrate is low. Type "status" command in P2Pool console or visit <a href="https://nano.p2pool.observer/" target="_blank">P2Pool observer</a> to check your progress.</ul><br>
|
||||
<li><span style="font-size:2rem;color:#e09000;">I am mining but I can't find any shares</span>
|
||||
<ul><li>First check for any warnings and errors in P2Pool console and logs. If everything works fine, you can check the <a href="https://p2pool.observer/calculate-share-time" target="_blank">average share time calculator</a> to get an idea how often you should find a share with your hashrate. If this time is more than 1 day, it's recommended to switch to P2Pool mini or P2Pool nano by adding <span style="color:#808080;">--mini</span> or <span style="color:#808080;">--nano</span> to P2Pool command line.</ul><br>
|
||||
<li><span style="font-size:2rem;color:#e09000;">I get an error "monerod RPC ... is incompatible, update to RPC >= v3.8"</span>
|
||||
<ul><li>Use monerod v0.18.0.0 or newer</ul><br>
|
||||
<li><span style="font-size:2rem;color:#e09000;">I get warnings "peer ... is ahead on mainchain (height ..., your height ...). Is your monerod stuck or lagging?"</span>
|
||||
<ul><li>Make sure you add these arguments to monerod command line: <span style="color:#808080;">--zmq-pub tcp://127.0.0.1:18083 --enforce-dns-checkpointing --enable-dns-blocklist</span></ul><br>
|
||||
</ul>
|
||||
</td></tr></table>
|
||||
<br><br>
|
||||
<div style="position:fixed;width:100%;bottom:0;background-color:#383838;font-size:1rem;text-align:center;color:#b0b0b0;">
|
||||
<a href="api/" target="_blank">Pool API</a> | <a href="https://github.com/SChernykh/p2pool" target="_blank">Source</a> | <a href="http://yucmgsbw7nknw7oi3bkuwudvc657g2xcqahhbjyewazusyytapqo4xid.onion/nano/" target="_blank">Onion URL</a><br>
|
||||
Donate to support the project:<br><span style="font-size:0.9rem;color:#b0b0b0;">44MnN1f3Eto8DZYUWuE5XZNUtE3vcRzt2j6PzqWpPau34e6Cf4fAxt6X2MBmrm6F9YMEiMNjN6W4Shn4pLcfNAja621jwyg</span><br>
|
||||
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
||||
Vendored
BIN
Binary file not shown.
Vendored
BIN
Binary file not shown.
Vendored
BIN
Binary file not shown.
Binary file not shown.
Binary file not shown.
Vendored
+1
-1
Submodule external/src/RandomX updated: 1adc7d8efd...d341d6a61c
Vendored
+51
@@ -0,0 +1,51 @@
|
||||
cmake_minimum_required(VERSION 3.10)
|
||||
project(Tari_gRPC)
|
||||
|
||||
set(HEADERS
|
||||
proto/gRPC/base_node.pb.h
|
||||
proto/gRPC/block.pb.h
|
||||
proto/gRPC/network.pb.h
|
||||
proto/gRPC/sidechain_types.pb.h
|
||||
proto/gRPC/transaction.pb.h
|
||||
proto/gRPC/types.pb.h
|
||||
proto/gRPC/base_node.grpc.pb.h
|
||||
proto/gRPC/block.grpc.pb.h
|
||||
proto/gRPC/network.grpc.pb.h
|
||||
proto/gRPC/sidechain_types.grpc.pb.h
|
||||
proto/gRPC/transaction.grpc.pb.h
|
||||
proto/gRPC/types.grpc.pb.h
|
||||
proto.h
|
||||
)
|
||||
|
||||
set(SOURCES
|
||||
proto/gRPC/base_node.pb.cc
|
||||
proto/gRPC/block.pb.cc
|
||||
proto/gRPC/network.pb.cc
|
||||
proto/gRPC/sidechain_types.pb.cc
|
||||
proto/gRPC/transaction.pb.cc
|
||||
proto/gRPC/types.pb.cc
|
||||
proto/gRPC/base_node.grpc.pb.cc
|
||||
proto/gRPC/block.grpc.pb.cc
|
||||
proto/gRPC/network.grpc.pb.cc
|
||||
proto/gRPC/sidechain_types.grpc.pb.cc
|
||||
proto/gRPC/transaction.grpc.pb.cc
|
||||
proto/gRPC/types.grpc.pb.cc
|
||||
)
|
||||
|
||||
include_directories(../grpc/third_party/protobuf/src)
|
||||
include_directories(../grpc/include)
|
||||
include_directories(../grpc/third_party/abseil-cpp)
|
||||
|
||||
if (CMAKE_CXX_COMPILER_ID MATCHES MSVC)
|
||||
set(CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS_DEBUG} /W0 /Zi /Od /Ob0 /MP /MTd")
|
||||
set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} /W0 /Zi /Od /Ob0 /MP /MTd")
|
||||
set(CMAKE_C_FLAGS_RELEASE "${CMAKE_C_FLAGS_RELEASE} /W0 /O1 /Ob2 /Oi /Os /Oy /MP /GL /MT /GS /guard:cf")
|
||||
set(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} /W0 /O1 /Ob2 /Oi /Os /Oy /MP /GL /MT /GS /guard:cf")
|
||||
set(CMAKE_C_FLAGS_RELWITHDEBINFO "${CMAKE_C_FLAGS_RELWITHDEBINFO} /W0 /Ob1 /Ot /Zi /MP /MT")
|
||||
set(CMAKE_CXX_FLAGS_RELWITHDEBINFO "${CMAKE_CXX_FLAGS_RELWITHDEBINFO} /W0 /Ob1 /Ot /Zi /MP /MT")
|
||||
else()
|
||||
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Os -w")
|
||||
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Os -w")
|
||||
endif()
|
||||
|
||||
add_library(Tari_gRPC ${HEADERS} ${SOURCES})
|
||||
Vendored
+30
@@ -0,0 +1,30 @@
|
||||
#pragma once
|
||||
|
||||
#ifdef _MSC_VER
|
||||
#pragma warning(push, 0)
|
||||
#pragma warning(disable : 4866)
|
||||
#endif
|
||||
|
||||
#include "proto/gRPC/base_node.pb.h"
|
||||
#include "proto/gRPC/block.pb.h"
|
||||
#include "proto/gRPC/network.pb.h"
|
||||
#include "proto/gRPC/sidechain_types.pb.h"
|
||||
#include "proto/gRPC/transaction.pb.h"
|
||||
#include "proto/gRPC/types.pb.h"
|
||||
|
||||
#include "proto/gRPC/base_node.grpc.pb.h"
|
||||
#include "proto/gRPC/block.grpc.pb.h"
|
||||
#include "proto/gRPC/network.grpc.pb.h"
|
||||
#include "proto/gRPC/sidechain_types.grpc.pb.h"
|
||||
#include "proto/gRPC/transaction.grpc.pb.h"
|
||||
#include "proto/gRPC/types.grpc.pb.h"
|
||||
|
||||
#include <grpc/grpc.h>
|
||||
#include <grpcpp/channel.h>
|
||||
#include <grpcpp/client_context.h>
|
||||
#include <grpcpp/create_channel.h>
|
||||
#include <grpcpp/security/credentials.h>
|
||||
|
||||
#ifdef _MSC_VER
|
||||
#pragma warning(pop)
|
||||
#endif
|
||||
+4
@@ -0,0 +1,4 @@
|
||||
To update the files:
|
||||
|
||||
- Build gRPC in `../../../grpc/.build` folder: `cmake .. && make -j$(nproc)`
|
||||
- Run `../../../grpc/.build/third_party/protobuf/protoc --cpp_out=. --plugin=protoc-gen-grpc=../../../grpc/.build/grpc_cpp_plugin --grpc_out=. --proto_path=../../../grpc/third_party/protobuf/src --proto_path=. *.proto`
|
||||
+1630
File diff suppressed because it is too large
Load Diff
+6478
File diff suppressed because it is too large
Load Diff
+24789
File diff suppressed because it is too large
Load Diff
+25547
File diff suppressed because it is too large
Load Diff
+688
@@ -0,0 +1,688 @@
|
||||
// Copyright 2020. The Tari Project
|
||||
//
|
||||
// Redistribution and use in source and binary forms, with or without modification, are permitted provided that the
|
||||
// following conditions are met:
|
||||
//
|
||||
// 1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following
|
||||
// disclaimer.
|
||||
//
|
||||
// 2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the
|
||||
// following disclaimer in the documentation and/or other materials provided with the distribution.
|
||||
//
|
||||
// 3. Neither the name of the copyright holder nor the names of its contributors may be used to endorse or promote
|
||||
// products derived from this software without specific prior written permission.
|
||||
//
|
||||
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES,
|
||||
// INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
||||
// DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
|
||||
// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
|
||||
// SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
|
||||
// WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE
|
||||
// USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
syntax = "proto3";
|
||||
|
||||
import "types.proto";
|
||||
import "transaction.proto";
|
||||
import "block.proto";
|
||||
import "network.proto";
|
||||
import "sidechain_types.proto";
|
||||
|
||||
package tari.rpc;
|
||||
|
||||
// The gRPC interface for interacting with the base node.
|
||||
service BaseNode {
|
||||
// Lists headers in the current best chain
|
||||
rpc ListHeaders(ListHeadersRequest) returns (stream BlockHeaderResponse);
|
||||
// Get header by hash
|
||||
rpc GetHeaderByHash(GetHeaderByHashRequest) returns (BlockHeaderResponse);
|
||||
// Returns blocks in the current best chain. Currently only supports querying by height
|
||||
rpc GetBlocks(GetBlocksRequest) returns (stream HistoricalBlock);
|
||||
// Returns the block timing for the chain heights
|
||||
rpc GetBlockTiming(HeightRequest) returns (BlockTimingResponse);
|
||||
// Returns the network Constants
|
||||
rpc GetConstants(BlockHeight) returns (ConsensusConstants);
|
||||
// Returns Block Sizes
|
||||
rpc GetBlockSize (BlockGroupRequest) returns (BlockGroupResponse);
|
||||
// Returns Block Fees
|
||||
rpc GetBlockFees (BlockGroupRequest) returns (BlockGroupResponse);
|
||||
// Get Version
|
||||
rpc GetVersion(Empty) returns (BaseNodeGetVersionResponse);
|
||||
// Check for new updates
|
||||
rpc CheckForUpdates(Empty) returns (SoftwareUpdate);
|
||||
// Get coins in circulation
|
||||
rpc GetTokensInCirculation(GetBlocksRequest) returns (stream ValueAtHeightResponse);
|
||||
// Get network difficulties
|
||||
rpc GetNetworkDifficulty(HeightRequest) returns (stream NetworkDifficultyResponse);
|
||||
// Get the block template
|
||||
rpc GetNewBlockTemplate(NewBlockTemplateRequest) returns (NewBlockTemplateResponse);
|
||||
// Construct a new block from a provided template
|
||||
rpc GetNewBlock(NewBlockTemplate) returns (GetNewBlockResult);
|
||||
// Construct a new block from a provided template
|
||||
rpc GetNewBlockWithCoinbases(GetNewBlockWithCoinbasesRequest) returns (GetNewBlockResult);
|
||||
// Construct a new block from a provided template
|
||||
rpc GetNewBlockTemplateWithCoinbases(GetNewBlockTemplateWithCoinbasesRequest) returns (GetNewBlockResult);
|
||||
// Construct a new block and header blob from a provided template
|
||||
rpc GetNewBlockBlob(NewBlockTemplate) returns (GetNewBlockBlobResult);
|
||||
// Submit a new block for propagation
|
||||
rpc SubmitBlock(Block) returns (SubmitBlockResponse);
|
||||
// Submit a new mined block blob for propagation
|
||||
rpc SubmitBlockBlob(BlockBlobRequest) returns (SubmitBlockResponse);
|
||||
// Submit a transaction for propagation
|
||||
rpc SubmitTransaction(SubmitTransactionRequest) returns (SubmitTransactionResponse);
|
||||
// Get the base node sync information
|
||||
rpc GetSyncInfo(Empty) returns (SyncInfoResponse);
|
||||
// Get the base node sync information
|
||||
rpc GetSyncProgress(Empty) returns (SyncProgressResponse);
|
||||
// Get the base node tip information
|
||||
rpc GetTipInfo(Empty) returns (TipInfoResponse);
|
||||
// Search for blocks containing the specified kernels
|
||||
rpc SearchKernels(SearchKernelsRequest) returns (stream HistoricalBlock);
|
||||
// Search for blocks containing the specified commitments
|
||||
rpc SearchUtxos(SearchUtxosRequest) returns (stream HistoricalBlock);
|
||||
// Fetch any utxos that exist in the main chain
|
||||
rpc FetchMatchingUtxos(FetchMatchingUtxosRequest) returns (stream FetchMatchingUtxosResponse);
|
||||
// get all peers from the base node
|
||||
rpc GetPeers(GetPeersRequest) returns (stream GetPeersResponse);
|
||||
rpc GetMempoolTransactions(GetMempoolTransactionsRequest) returns (stream GetMempoolTransactionsResponse);
|
||||
rpc TransactionState(TransactionStateRequest) returns (TransactionStateResponse);
|
||||
// This returns the node's network identity
|
||||
rpc Identify (Empty) returns (NodeIdentity);
|
||||
// Get Base Node network connectivity status
|
||||
rpc GetNetworkStatus(Empty) returns (NetworkStatusResponse);
|
||||
// List currently connected peers
|
||||
rpc ListConnectedPeers(Empty) returns (ListConnectedPeersResponse);
|
||||
// Get mempool stats
|
||||
rpc GetMempoolStats(Empty) returns (MempoolStatsResponse);
|
||||
// Get VNs
|
||||
rpc GetActiveValidatorNodes(GetActiveValidatorNodesRequest) returns (stream GetActiveValidatorNodesResponse);
|
||||
rpc GetValidatorNodeChanges(GetValidatorNodeChangesRequest) returns (GetValidatorNodeChangesResponse);
|
||||
rpc GetShardKey(GetShardKeyRequest) returns (GetShardKeyResponse);
|
||||
// Get templates
|
||||
rpc GetTemplateRegistrations(GetTemplateRegistrationsRequest) returns (stream GetTemplateRegistrationResponse);
|
||||
rpc GetSideChainUtxos(GetSideChainUtxosRequest) returns (stream GetSideChainUtxosResponse);
|
||||
rpc GetNetworkState(GetNetworkStateRequest) returns (GetNetworkStateResponse);
|
||||
// PayRef (Payment Reference) lookup for block explorers and external services
|
||||
rpc SearchPaymentReferences(SearchPaymentReferencesRequest) returns (stream PaymentReferenceResponse);
|
||||
// PayRef (Payment Reference) lookup for block explorers and external services via output hash
|
||||
rpc SearchPaymentReferencesViaOutputHash(FetchMatchingUtxosRequest) returns (stream PaymentReferenceResponse);
|
||||
|
||||
}
|
||||
|
||||
message GetAssetMetadataRequest {
|
||||
bytes asset_public_key = 1;
|
||||
}
|
||||
|
||||
message GetAssetMetadataResponse {
|
||||
string name = 2;
|
||||
string description =3;
|
||||
string image = 4;
|
||||
bytes owner_commitment = 5;
|
||||
OutputFeatures features = 6;
|
||||
uint64 mined_height = 7;
|
||||
bytes mined_in_block = 8;
|
||||
}
|
||||
|
||||
message ListAssetRegistrationsRequest {
|
||||
uint64 offset = 2;
|
||||
uint64 count = 3;
|
||||
}
|
||||
|
||||
message ListAssetRegistrationsResponse {
|
||||
bytes asset_public_key = 1;
|
||||
bytes unique_id = 2;
|
||||
bytes owner_commitment = 3;
|
||||
uint64 mined_height = 4;
|
||||
bytes mined_in_block = 5;
|
||||
OutputFeatures features = 6;
|
||||
bytes script = 7;
|
||||
}
|
||||
|
||||
message GetTokensRequest {
|
||||
bytes asset_public_key = 1;
|
||||
// Optionally get a set of specific unique_ids
|
||||
repeated bytes unique_ids = 2;
|
||||
}
|
||||
|
||||
message GetTokensResponse {
|
||||
bytes unique_id = 1;
|
||||
bytes asset_public_key = 2;
|
||||
bytes owner_commitment = 3;
|
||||
bytes mined_in_block = 4;
|
||||
uint64 mined_height = 5;
|
||||
OutputFeatures features = 6;
|
||||
bytes script = 7;
|
||||
}
|
||||
|
||||
message SubmitBlockResponse {
|
||||
bytes block_hash = 1;
|
||||
}
|
||||
|
||||
message BlockBlobRequest{
|
||||
bytes header_blob = 1;
|
||||
bytes body_blob = 2;
|
||||
}
|
||||
|
||||
/// return type of GetTipInfo
|
||||
message TipInfoResponse {
|
||||
MetaData metadata = 1;
|
||||
bool initial_sync_achieved = 2;
|
||||
BaseNodeState base_node_state = 3;
|
||||
bool failed_checkpoints = 4;
|
||||
}
|
||||
|
||||
enum BaseNodeState{
|
||||
START_UP = 0;
|
||||
HEADER_SYNC = 1;
|
||||
HORIZON_SYNC = 2;
|
||||
CONNECTING = 3;
|
||||
BLOCK_SYNC = 4;
|
||||
LISTENING = 5;
|
||||
SYNC_FAILED = 6;
|
||||
}
|
||||
|
||||
message ReadinessStatus {
|
||||
enum State {
|
||||
NOT_READY = 0;
|
||||
STARTING_UP = 1;
|
||||
|
||||
// Database phase (10-19)
|
||||
DATABASE_INITIALIZING = 10;
|
||||
|
||||
// Recovery phase (20-29)
|
||||
RECOVERING_PREPARING = 20;
|
||||
RECOVERING_REBUILDING = 21;
|
||||
RECOVERING_REBUILDING_DATABASE = 22;
|
||||
|
||||
// Context building phase (30-39)
|
||||
BUILDING_CONTEXT_BLOCKCHAIN = 32;
|
||||
BUILDING_CONTEXT_BOOTSTRAP = 34;
|
||||
|
||||
READY = 100;
|
||||
}
|
||||
|
||||
oneof status {
|
||||
State state = 1;
|
||||
MigrationProgress migration = 2;
|
||||
}
|
||||
uint64 timestamp = 6;
|
||||
|
||||
}
|
||||
|
||||
message MigrationProgress {
|
||||
uint64 current_block = 1;
|
||||
uint64 total_blocks = 2;
|
||||
double progress_percentage = 3;
|
||||
uint64 current_db_version = 4;
|
||||
uint64 target_db_version = 5;
|
||||
}
|
||||
|
||||
/// return type of GetNewBlockTemplate
|
||||
message NewBlockTemplateResponse {
|
||||
NewBlockTemplate new_block_template = 1;
|
||||
bool initial_sync_achieved = 3;
|
||||
MinerData miner_data = 4;
|
||||
}
|
||||
|
||||
/// return type of NewBlockTemplateRequest
|
||||
message NewBlockTemplateRequest{
|
||||
PowAlgo algo = 1;
|
||||
//This field should be moved to optional once optional keyword is standard
|
||||
uint64 max_weight = 2;
|
||||
}
|
||||
|
||||
/// return type of NewBlockTemplateRequest
|
||||
message GetNewBlockTemplateWithCoinbasesRequest{
|
||||
PowAlgo algo = 1;
|
||||
//This field should be moved to optional once optional keyword is standard
|
||||
uint64 max_weight = 2;
|
||||
repeated NewBlockCoinbase coinbases = 3;
|
||||
}
|
||||
|
||||
/// request type of GetNewBlockWithCoinbasesRequest
|
||||
message GetNewBlockWithCoinbasesRequest{
|
||||
NewBlockTemplate new_template = 1;
|
||||
repeated NewBlockCoinbase coinbases = 2;
|
||||
}
|
||||
|
||||
message NewBlockCoinbase{
|
||||
string address = 1;
|
||||
uint64 value = 2;
|
||||
bool stealth_payment= 3;
|
||||
bool revealed_value_proof= 4;
|
||||
bytes coinbase_extra =5;
|
||||
}
|
||||
|
||||
// Network difficulty response
|
||||
message NetworkDifficultyResponse {
|
||||
uint64 difficulty = 1;
|
||||
uint64 estimated_hash_rate = 2;
|
||||
uint64 height = 3;
|
||||
uint64 timestamp = 4;
|
||||
uint64 pow_algo = 5;
|
||||
uint64 sha3x_estimated_hash_rate = 6;
|
||||
uint64 monero_randomx_estimated_hash_rate = 7;
|
||||
uint64 tari_randomx_estimated_hash_rate = 10;
|
||||
UDecimalValue cuckaroo_estimated_hash_rate = 11;
|
||||
uint64 num_coinbases = 8;
|
||||
repeated bytes coinbase_extras = 9;
|
||||
}
|
||||
|
||||
// A generic single value response for a specific height
|
||||
message ValueAtHeightResponse {
|
||||
// This is the total circulating token supply up to date ('mined_rewards + spendable_pre_mine').
|
||||
uint64 circulating_supply = 1;
|
||||
// uint64 spendable_supply = 2; // No longer used
|
||||
// This is the block height the values are valid for.
|
||||
uint64 height = 3;
|
||||
// This is the total mined rewards up to date, including time locked coinbase rewards that is not spendable.
|
||||
uint64 mined_rewards = 4;
|
||||
// This is the total spendable minded rewards up to date, which excludes all coinbase rewards that is
|
||||
// still time locked.
|
||||
uint64 spendable_rewards = 5;
|
||||
// This is the total spendable pre-mine tokens released up to date, i.e. not time-locked anymore.
|
||||
uint64 spendable_pre_mine = 6;
|
||||
// This is the total spendable token supply up to date ('spendable_rewards + spendable_pre_mine').
|
||||
uint64 total_spendable = 7;
|
||||
// This is the total pre-mine tokens in the genesis block, time-locked and not time-locked.
|
||||
uint64 total_pre_mine = 8;
|
||||
// This is the total pre-mine tokens that are still time-locked up to date (`total_pre_mine - spendable_pre_mine`).
|
||||
uint64 time_locked_pre_mine = 9;
|
||||
}
|
||||
|
||||
// A generic uint value
|
||||
message IntegerValue {
|
||||
uint64 value = 1;
|
||||
}
|
||||
|
||||
message BaseNodeGetVersionResponse {
|
||||
string version = 1;
|
||||
uint32 network = 2;
|
||||
}
|
||||
|
||||
/// GetBlockSize / GetBlockFees Request
|
||||
/// Either the starting and ending heights OR the from_tip param must be specified
|
||||
message BlockGroupRequest {
|
||||
// The height from the chain tip (optional)
|
||||
uint64 from_tip = 1;
|
||||
// The starting height (optional)
|
||||
uint64 start_height = 2;
|
||||
// The ending height (optional)
|
||||
uint64 end_height = 3;
|
||||
/// The type of calculation required (optional)
|
||||
/// Defaults to median
|
||||
/// median, mean, quartile, quantile
|
||||
CalcType calc_type = 4;
|
||||
}
|
||||
|
||||
/// GetBlockSize / GetBlockFees Response
|
||||
message BlockGroupResponse {
|
||||
repeated double value = 1;
|
||||
CalcType calc_type = 2;
|
||||
}
|
||||
|
||||
enum CalcType {
|
||||
MEAN = 0;
|
||||
MEDIAN = 1;
|
||||
QUANTILE = 2;
|
||||
QUARTILE = 3;
|
||||
}
|
||||
|
||||
// The request used for querying a function that requires a height, either between 2 points or from the chain tip
|
||||
// If start_height and end_height are set and > 0, they take precedence, otherwise from_tip is used
|
||||
message HeightRequest {
|
||||
// The height from the chain tip (optional)
|
||||
uint64 from_tip = 1;
|
||||
// The starting height (optional)
|
||||
uint64 start_height = 2;
|
||||
// The ending height (optional)
|
||||
uint64 end_height = 3;
|
||||
}
|
||||
|
||||
// The return type of the rpc GetBlockTiming
|
||||
message BlockTimingResponse {
|
||||
uint64 max = 1;
|
||||
uint64 min = 2;
|
||||
double avg = 3;
|
||||
}
|
||||
|
||||
// Request that returns a header based by hash
|
||||
message GetHeaderByHashRequest {
|
||||
// The hash of the block header
|
||||
bytes hash = 1;
|
||||
}
|
||||
|
||||
|
||||
message BlockHeaderResponse {
|
||||
// The block header
|
||||
BlockHeader header = 1;
|
||||
// The number of blocks from the tip of this block (a.k.a depth)
|
||||
uint64 confirmations = 2;
|
||||
// The block reward i.e mining reward + fees
|
||||
uint64 reward = 3;
|
||||
// Achieved difficulty
|
||||
uint64 difficulty = 4;
|
||||
// The number of transactions contained in the block
|
||||
uint32 num_transactions = 5;
|
||||
}
|
||||
|
||||
// The request used for querying headers from the base node. The parameters `from_height` and `num_headers` can be used
|
||||
// to page through the current best chain.
|
||||
message ListHeadersRequest {
|
||||
// The height to start at. Depending on sorting, will either default to use the tip or genesis block, for `SORTING_DESC`
|
||||
// and `SORTING_ASC` respectively, if a value is not provided. The first header returned will be at this height
|
||||
// followed by `num_headers` - 1 headers in the direction specified by `sorting`. If greater than the current tip,
|
||||
// the current tip will be used.
|
||||
uint64 from_height = 1;
|
||||
// The number of headers to return. If not specified, it will default to 10
|
||||
uint64 num_headers = 2;
|
||||
// The ordering to return the headers in. If not specified will default to SORTING_DESC. Note that if `from_height`
|
||||
// is not specified or is 0, if `sorting` is SORTING_DESC, the tip will be used as `from_height`, otherwise the
|
||||
// block at height 0 will be used.
|
||||
Sorting sorting = 3;
|
||||
}
|
||||
|
||||
// The request used for querying blocks in the base node's current best chain. Currently only querying by height is
|
||||
// available. Multiple blocks may be queried.e.g. [189092,100023,122424]. The order in which they are returned is not
|
||||
// guaranteed.
|
||||
message GetBlocksRequest {
|
||||
repeated uint64 heights = 1;
|
||||
}
|
||||
|
||||
// The return type of the rpc GetBlocks. Blocks are not guaranteed to be returned in the order requested.
|
||||
message GetBlocksResponse {
|
||||
repeated HistoricalBlock blocks = 1;
|
||||
}
|
||||
|
||||
enum Sorting {
|
||||
SORTING_DESC = 0;
|
||||
SORTING_ASC = 1;
|
||||
}
|
||||
|
||||
message MetaData {
|
||||
// The current chain height, or the block number of the longest valid chain, or `None` if there is no chain
|
||||
uint64 best_block_height = 1;
|
||||
// The block hash of the current tip of the longest valid chain, or `None` for an empty chain
|
||||
bytes best_block_hash = 2;
|
||||
// The current geometric mean of the pow of the chain tip, or `None` if there is no chain
|
||||
bytes accumulated_difficulty = 5;
|
||||
// This is the min height this node can provide complete blocks for. A 0 here means this node is archival and can provide complete blocks for every height.
|
||||
uint64 pruned_height = 6;
|
||||
uint64 timestamp = 7;
|
||||
}
|
||||
|
||||
message SyncInfoResponse {
|
||||
uint64 tip_height = 1;
|
||||
uint64 local_height = 2;
|
||||
repeated bytes peer_node_id = 3;
|
||||
}
|
||||
|
||||
message SyncProgressResponse {
|
||||
uint64 tip_height = 1;
|
||||
uint64 local_height = 2;
|
||||
SyncState state = 3;
|
||||
string short_desc = 4;
|
||||
uint64 initial_connected_peers = 5;
|
||||
}
|
||||
|
||||
enum SyncState {
|
||||
STARTUP = 0;
|
||||
HEADER_STARTING = 1;
|
||||
HEADER = 2;
|
||||
BLOCK_STARTING = 3;
|
||||
BLOCK = 4;
|
||||
DONE = 5;
|
||||
}
|
||||
|
||||
// This is the message that is returned for a miner after it asks for a new block.
|
||||
message GetNewBlockResult{
|
||||
// This is the header hash of the completed block
|
||||
bytes block_hash = 1;
|
||||
// This is the completed block
|
||||
Block block = 2;
|
||||
bytes merge_mining_hash =3;
|
||||
bytes tari_unique_id =4;
|
||||
MinerData miner_data = 5;
|
||||
bytes vm_key = 6;
|
||||
}
|
||||
|
||||
// This is the message that is returned for a miner after it asks for a new block.
|
||||
message GetNewBlockBlobResult{
|
||||
// This is the header hash of the completed block
|
||||
bytes block_hash = 1;
|
||||
// This is the completed block's header
|
||||
bytes header = 2;
|
||||
// This is the completed block's body
|
||||
bytes block_body = 3;
|
||||
bytes merge_mining_hash =4;
|
||||
bytes utxo_mr = 5;
|
||||
bytes tari_unique_id =6;
|
||||
}
|
||||
|
||||
// This is mining data for the miner asking for a new block
|
||||
message MinerData{
|
||||
PowAlgo algo = 1;
|
||||
uint64 target_difficulty = 2;
|
||||
uint64 reward = 3;
|
||||
// bytes merge_mining_hash =4;
|
||||
uint64 total_fees = 5;
|
||||
}
|
||||
|
||||
// This is the request type for the Search Kernels rpc
|
||||
message SearchKernelsRequest{
|
||||
repeated Signature signatures = 1;
|
||||
}
|
||||
|
||||
// This is the request type for the Search Utxo rpc
|
||||
message SearchUtxosRequest{
|
||||
repeated bytes commitments = 1;
|
||||
}
|
||||
|
||||
message FetchMatchingUtxosRequest {
|
||||
repeated bytes hashes = 1;
|
||||
}
|
||||
|
||||
message FetchMatchingUtxosResponse {
|
||||
TransactionOutput output = 1;
|
||||
}
|
||||
|
||||
// This is the request type of the get all peers rpc call
|
||||
message GetPeersResponse{
|
||||
Peer peer = 1;
|
||||
}
|
||||
|
||||
message GetPeersRequest{}
|
||||
|
||||
message SubmitTransactionRequest {
|
||||
Transaction transaction = 1;
|
||||
}
|
||||
|
||||
message SubmitTransactionResponse {
|
||||
SubmitTransactionResult result =1;
|
||||
}
|
||||
|
||||
enum SubmitTransactionResult {
|
||||
NONE = 0;
|
||||
ACCEPTED = 1;
|
||||
NOT_PROCESSABLE_AT_THIS_TIME = 2;
|
||||
ALREADY_MINED = 3;
|
||||
REJECTED = 4;
|
||||
|
||||
}
|
||||
|
||||
message GetMempoolTransactionsRequest {
|
||||
|
||||
}
|
||||
|
||||
message GetMempoolTransactionsResponse {
|
||||
Transaction transaction = 1;
|
||||
}
|
||||
|
||||
message TransactionStateRequest {
|
||||
Signature excess_sig = 1;
|
||||
}
|
||||
|
||||
message TransactionStateResponse {
|
||||
TransactionLocation result =1;
|
||||
}
|
||||
|
||||
enum TransactionLocation {
|
||||
UNKNOWN = 0;
|
||||
MEMPOOL = 1;
|
||||
MINED = 2;
|
||||
NOT_STORED = 3;
|
||||
}
|
||||
|
||||
message MempoolStatsResponse {
|
||||
uint64 unconfirmed_txs = 2;
|
||||
uint64 reorg_txs = 3;
|
||||
uint64 unconfirmed_weight = 4;
|
||||
}
|
||||
|
||||
message GetActiveValidatorNodesRequest {
|
||||
uint64 height = 1;
|
||||
bytes sidechain_id = 2;
|
||||
}
|
||||
|
||||
message GetActiveValidatorNodesResponse {
|
||||
bytes shard_key = 1;
|
||||
bytes public_key = 2;
|
||||
bytes sidechain_id = 3;
|
||||
}
|
||||
|
||||
message GetValidatorNodeChangesRequest {
|
||||
uint64 epoch = 1;
|
||||
bytes sidechain_id = 2;
|
||||
}
|
||||
|
||||
message ValidatorNodeChange {
|
||||
oneof change {
|
||||
ValidatorNodeChangeAdd add = 1;
|
||||
ValidatorNodeChangeRemove remove = 2;
|
||||
}
|
||||
}
|
||||
|
||||
message ValidatorNodeChangeAdd {
|
||||
uint64 activation_epoch = 1;
|
||||
ValidatorNodeRegistration registration = 2;
|
||||
uint64 minimum_value_promise = 3;
|
||||
bytes shard_key = 4;
|
||||
}
|
||||
|
||||
message ValidatorNodeChangeRemove {
|
||||
bytes public_key = 1;
|
||||
}
|
||||
|
||||
message GetValidatorNodeChangesResponse {
|
||||
repeated ValidatorNodeChange changes = 1;
|
||||
}
|
||||
|
||||
message GetShardKeyRequest {
|
||||
uint64 epoch = 1;
|
||||
bytes public_key = 2;
|
||||
}
|
||||
|
||||
message GetShardKeyResponse {
|
||||
bytes shard_key = 1;
|
||||
}
|
||||
|
||||
message GetTemplateRegistrationsRequest {
|
||||
bytes start_hash = 1;
|
||||
uint64 count = 2;
|
||||
}
|
||||
|
||||
message GetTemplateRegistrationResponse {
|
||||
bytes utxo_hash = 1;
|
||||
TemplateRegistration registration = 2;
|
||||
}
|
||||
|
||||
message BlockInfo {
|
||||
uint64 height = 1;
|
||||
bytes hash = 2;
|
||||
bytes next_block_hash = 3;
|
||||
}
|
||||
|
||||
message GetSideChainUtxosRequest {
|
||||
bytes start_hash = 1;
|
||||
uint64 count = 2;
|
||||
}
|
||||
|
||||
message GetSideChainUtxosResponse {
|
||||
BlockInfo block_info = 1;
|
||||
repeated TransactionOutput outputs = 2;
|
||||
}
|
||||
|
||||
message GetNetworkStateRequest {
|
||||
}
|
||||
|
||||
message GetNetworkStateResponse {
|
||||
// metadata
|
||||
MetaData metadata = 1;
|
||||
// has the base node synced
|
||||
bool initial_sync_achieved = 2;
|
||||
//current state of the base node
|
||||
BaseNodeState base_node_state = 3;
|
||||
// do we have failed checkpoints
|
||||
bool failed_checkpoints = 4;
|
||||
// The block reward of the next tip
|
||||
uint64 reward = 5;
|
||||
// estimate sha3x hash rate
|
||||
uint64 sha3x_estimated_hash_rate = 6;
|
||||
// estimate monero randomx hash rate
|
||||
uint64 monero_randomx_estimated_hash_rate = 7;
|
||||
// estimate tari randomx hash rate
|
||||
uint64 tari_randomx_estimated_hash_rate = 10;
|
||||
// estimate cuckaroo hash rate
|
||||
UDecimalValue cuckaroo_estimated_hash_rate = 12;
|
||||
// number of connections
|
||||
uint64 num_connections = 8;
|
||||
//liveness results
|
||||
repeated LivenessResult liveness_results = 9;
|
||||
// readiness status
|
||||
ReadinessStatus readiness_status = 11;
|
||||
}
|
||||
|
||||
message LivenessResult{
|
||||
// node id
|
||||
bytes peer_node_id = 1;
|
||||
// time to discover
|
||||
uint64 discover_latency = 2;
|
||||
// Dial latency
|
||||
uint64 ping_latency = 3;
|
||||
}
|
||||
|
||||
// PayRef (Payment Reference) search and lookup messages
|
||||
|
||||
// Request to search for outputs by payment reference
|
||||
message SearchPaymentReferencesRequest {
|
||||
// Payment reference as hex string (64 characters)
|
||||
repeated string payment_reference_hex = 1;
|
||||
repeated bytes payment_reference_bytes = 2;
|
||||
// Optional: include spent outputs in results
|
||||
bool include_spent = 3;
|
||||
}
|
||||
|
||||
// Response containing payment reference match
|
||||
message PaymentReferenceResponse {
|
||||
// The payment reference that was found
|
||||
string payment_reference_hex = 1;
|
||||
// Block height where the output was mined
|
||||
uint64 block_height = 2;
|
||||
// Block hash where the output was mined
|
||||
bytes block_hash = 3;
|
||||
// Timestamp when the output was mined
|
||||
uint64 mined_timestamp = 4;
|
||||
// Output commitment (32 bytes)
|
||||
bytes commitment = 5;
|
||||
// Whether this output has been spent
|
||||
bool is_spent = 6;
|
||||
// Height where output was spent - will be 0 for unspent outputs as it is not applicable
|
||||
uint64 spent_height = 7;
|
||||
// Block hash where output was spent - will be empty for unspent outputs
|
||||
bytes spent_block_hash = 8;
|
||||
// Minimum value promise
|
||||
uint64 min_value_promise = 9;
|
||||
// Timestamp when the output was spent - will be 0 for unspent outputs as it is not applicable
|
||||
uint64 spent_timestamp = 10;
|
||||
// Output hash of the output
|
||||
bytes output_hash = 11;
|
||||
}
|
||||
+29
@@ -0,0 +1,29 @@
|
||||
// Generated by the gRPC C++ plugin.
|
||||
// If you make any local change, they will be lost.
|
||||
// source: block.proto
|
||||
|
||||
#include "block.pb.h"
|
||||
#include "block.grpc.pb.h"
|
||||
|
||||
#include <functional>
|
||||
#include <grpcpp/support/async_stream.h>
|
||||
#include <grpcpp/support/async_unary_call.h>
|
||||
#include <grpcpp/impl/channel_interface.h>
|
||||
#include <grpcpp/impl/client_unary_call.h>
|
||||
#include <grpcpp/support/client_callback.h>
|
||||
#include <grpcpp/support/message_allocator.h>
|
||||
#include <grpcpp/support/method_handler.h>
|
||||
#include <grpcpp/impl/rpc_service_method.h>
|
||||
#include <grpcpp/support/server_callback.h>
|
||||
#include <grpcpp/impl/server_callback_handlers.h>
|
||||
#include <grpcpp/server_context.h>
|
||||
#include <grpcpp/impl/service_type.h>
|
||||
#include <grpcpp/support/sync_stream.h>
|
||||
#include <grpcpp/ports_def.inc>
|
||||
namespace tari {
|
||||
namespace rpc {
|
||||
|
||||
} // namespace tari
|
||||
} // namespace rpc
|
||||
#include <grpcpp/ports_undef.inc>
|
||||
|
||||
+59
@@ -0,0 +1,59 @@
|
||||
// Generated by the gRPC C++ plugin.
|
||||
// If you make any local change, they will be lost.
|
||||
// source: block.proto
|
||||
// Original file comments:
|
||||
// Copyright 2020. The Tari Project
|
||||
//
|
||||
// Redistribution and use in source and binary forms, with or without modification, are permitted provided that the
|
||||
// following conditions are met:
|
||||
//
|
||||
// 1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following
|
||||
// disclaimer.
|
||||
//
|
||||
// 2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the
|
||||
// following disclaimer in the documentation and/or other materials provided with the distribution.
|
||||
//
|
||||
// 3. Neither the name of the copyright holder nor the names of its contributors may be used to endorse or promote
|
||||
// products derived from this software without specific prior written permission.
|
||||
//
|
||||
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES,
|
||||
// INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
||||
// DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
|
||||
// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
|
||||
// SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
|
||||
// WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE
|
||||
// USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
#ifndef GRPC_block_2eproto__INCLUDED
|
||||
#define GRPC_block_2eproto__INCLUDED
|
||||
|
||||
#include "block.pb.h"
|
||||
|
||||
#include <functional>
|
||||
#include <grpcpp/generic/async_generic_service.h>
|
||||
#include <grpcpp/support/async_stream.h>
|
||||
#include <grpcpp/support/async_unary_call.h>
|
||||
#include <grpcpp/support/client_callback.h>
|
||||
#include <grpcpp/client_context.h>
|
||||
#include <grpcpp/completion_queue.h>
|
||||
#include <grpcpp/support/message_allocator.h>
|
||||
#include <grpcpp/support/method_handler.h>
|
||||
#include <grpcpp/impl/proto_utils.h>
|
||||
#include <grpcpp/impl/rpc_method.h>
|
||||
#include <grpcpp/support/server_callback.h>
|
||||
#include <grpcpp/impl/server_callback_handlers.h>
|
||||
#include <grpcpp/server_context.h>
|
||||
#include <grpcpp/impl/service_type.h>
|
||||
#include <grpcpp/support/status.h>
|
||||
#include <grpcpp/support/stub_options.h>
|
||||
#include <grpcpp/support/sync_stream.h>
|
||||
#include <grpcpp/ports_def.inc>
|
||||
|
||||
namespace tari {
|
||||
namespace rpc {
|
||||
|
||||
} // namespace rpc
|
||||
} // namespace tari
|
||||
|
||||
|
||||
#include <grpcpp/ports_undef.inc>
|
||||
#endif // GRPC_block_2eproto__INCLUDED
|
||||
+3219
File diff suppressed because it is too large
Load Diff
+3814
File diff suppressed because it is too large
Load Diff
+145
@@ -0,0 +1,145 @@
|
||||
// Copyright 2020. The Tari Project
|
||||
//
|
||||
// Redistribution and use in source and binary forms, with or without modification, are permitted provided that the
|
||||
// following conditions are met:
|
||||
//
|
||||
// 1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following
|
||||
// disclaimer.
|
||||
//
|
||||
// 2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the
|
||||
// following disclaimer in the documentation and/or other materials provided with the distribution.
|
||||
//
|
||||
// 3. Neither the name of the copyright holder nor the names of its contributors may be used to endorse or promote
|
||||
// products derived from this software without specific prior written permission.
|
||||
//
|
||||
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES,
|
||||
// INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
||||
// DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
|
||||
// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
|
||||
// SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
|
||||
// WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE
|
||||
// USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
syntax = "proto3";
|
||||
|
||||
package tari.rpc;
|
||||
|
||||
import "transaction.proto";
|
||||
|
||||
// The BlockHeader contains all the metadata for the block, including proof of work, a link to the previous block
|
||||
// and the transaction kernels.
|
||||
message BlockHeader {
|
||||
// The hash of the block
|
||||
bytes hash = 1;
|
||||
// Version of the block
|
||||
uint32 version = 2;
|
||||
// Height of this block since the genesis block (height 0)
|
||||
uint64 height = 3;
|
||||
// Hash of the block previous to this in the chain.
|
||||
bytes prev_hash = 4;
|
||||
// Timestamp at which the block was built.
|
||||
uint64 timestamp = 5;
|
||||
// This is the UTXO merkle root of the outputs in the blockchain
|
||||
bytes output_mr = 6;
|
||||
// This is the merkle root of all outputs in this block
|
||||
bytes block_output_mr = 7;
|
||||
// This is the MMR root of the kernels
|
||||
bytes kernel_mr = 8;
|
||||
// This is the Merkle root of the inputs in this block
|
||||
bytes input_mr = 9;
|
||||
// Total accumulated sum of kernel offsets since genesis block. We can derive the kernel offset sum for *this*
|
||||
// block from the total kernel offset of the previous block header.
|
||||
bytes total_kernel_offset = 10;
|
||||
// Nonce increment used to mine this block.
|
||||
uint64 nonce = 11;
|
||||
// Proof of work metadata
|
||||
ProofOfWork pow = 12;
|
||||
// Kernel MMR size
|
||||
uint64 kernel_mmr_size = 13;
|
||||
// Output MMR size
|
||||
uint64 output_mmr_size = 14;
|
||||
// Sum of script offsets for all kernels in this block.
|
||||
bytes total_script_offset = 15;
|
||||
// Merkle root of validator nodes
|
||||
bytes validator_node_mr = 16;
|
||||
// Validator size
|
||||
uint64 validator_node_size = 17;
|
||||
}
|
||||
|
||||
// The proof of work data structure that is included in the block header.
|
||||
message ProofOfWork {
|
||||
// The algorithm used to mine this block
|
||||
// 0 = Monero RandomX
|
||||
// 1 = Sha3X
|
||||
// 2 = Tari RandomX
|
||||
// 3 = Cuckaroo
|
||||
uint64 pow_algo = 1;
|
||||
// Supplemental proof of work data. For example for Sha3x, this would be empty (only the block header is
|
||||
// required), but for Monero merge mining we need the Monero block header and RandomX seed hash.
|
||||
bytes pow_data = 4;
|
||||
}
|
||||
|
||||
//This is used to request the which pow algo should be used with the block template
|
||||
message PowAlgo {
|
||||
// The permitted pow algorithms
|
||||
enum PowAlgos {
|
||||
POW_ALGOS_RANDOMXM = 0; // Accessible as `grpc::pow_algo::PowAlgos::RandomxM`
|
||||
POW_ALGOS_SHA3X = 1; // Accessible as `grpc::pow_algo::PowAlgos::Sha3x`
|
||||
POW_ALGOS_RANDOMXT = 2; // Accessible as `grpc::pow_algo::PowAlgos::RandomxT`
|
||||
POW_ALGOS_CUCKAROO = 3; // Accessible as `grpc::pow_algo::PowAlgos::Cuckaroo`
|
||||
}
|
||||
// The pow algo to use
|
||||
PowAlgos pow_algo = 1;
|
||||
}
|
||||
|
||||
|
||||
// A Minotari block. Blocks are linked together into a blockchain.
|
||||
message Block {
|
||||
// The BlockHeader contains all the metadata for the block, including proof of work, a link to the previous block
|
||||
// and the transaction kernels.
|
||||
BlockHeader header = 1;
|
||||
// The components of the block or transaction. The same struct can be used for either, since in Mimblewimble,
|
||||
// blocks consist of inputs, outputs and kernels, rather than transactions.
|
||||
AggregateBody body = 2;
|
||||
}
|
||||
|
||||
// The representation of a historical block in the blockchain. It is essentially identical to a protocol-defined
|
||||
// block but contains some extra metadata that clients such as Block Explorers will find interesting.
|
||||
message HistoricalBlock {
|
||||
// The number of blocks that have been mined since this block, including this one. The current tip will have one
|
||||
// confirmation.
|
||||
uint64 confirmations = 1;
|
||||
// The underlying block
|
||||
Block block = 2;
|
||||
}
|
||||
|
||||
|
||||
// The NewBlockHeaderTemplate is used for the construction of a new mine-able block. It contains all the metadata for the block that the Base Node is able to complete on behalf of a Miner.
|
||||
message NewBlockHeaderTemplate {
|
||||
// Version of the block
|
||||
uint32 version = 1;
|
||||
// Height of this block since the genesis block (height 0)
|
||||
uint64 height = 2;
|
||||
// Hash of the block previous to this in the chain.
|
||||
bytes prev_hash = 3;
|
||||
// Total accumulated sum of kernel offsets since genesis block. We can derive the kernel offset sum for *this*
|
||||
// block from the total kernel offset of the previous block header.
|
||||
bytes total_kernel_offset = 4;
|
||||
// Proof of work metadata
|
||||
ProofOfWork pow = 5;
|
||||
// Sum of script offsets for all kernels in this block.
|
||||
bytes total_script_offset = 7;
|
||||
}
|
||||
|
||||
// The new block template is used constructing a new partial block, allowing a miner to added the coinbase utxo and as a final step the Base node to add the MMR roots to the header.
|
||||
message NewBlockTemplate {
|
||||
// The NewBlockHeaderTemplate is used for the construction of a new mineable block. It contains all the metadata for
|
||||
// the block that the Base Node is able to complete on behalf of a Miner.
|
||||
NewBlockHeaderTemplate header = 1;
|
||||
// This flag indicates if the inputs, outputs and kernels have been sorted internally, that is, the sort() method
|
||||
// has been called. This may be false even if all components are sorted.
|
||||
AggregateBody body = 2;
|
||||
// Sometimes the mempool has not synced to the latest tip, this flag indicates if the mempool is out of sync.
|
||||
// In most cases the next call to get_new_block_template will return a block with the mempool in sync.
|
||||
bool is_mempool_in_sync = 3;
|
||||
}
|
||||
|
||||
+29
@@ -0,0 +1,29 @@
|
||||
// Generated by the gRPC C++ plugin.
|
||||
// If you make any local change, they will be lost.
|
||||
// source: network.proto
|
||||
|
||||
#include "network.pb.h"
|
||||
#include "network.grpc.pb.h"
|
||||
|
||||
#include <functional>
|
||||
#include <grpcpp/support/async_stream.h>
|
||||
#include <grpcpp/support/async_unary_call.h>
|
||||
#include <grpcpp/impl/channel_interface.h>
|
||||
#include <grpcpp/impl/client_unary_call.h>
|
||||
#include <grpcpp/support/client_callback.h>
|
||||
#include <grpcpp/support/message_allocator.h>
|
||||
#include <grpcpp/support/method_handler.h>
|
||||
#include <grpcpp/impl/rpc_service_method.h>
|
||||
#include <grpcpp/support/server_callback.h>
|
||||
#include <grpcpp/impl/server_callback_handlers.h>
|
||||
#include <grpcpp/server_context.h>
|
||||
#include <grpcpp/impl/service_type.h>
|
||||
#include <grpcpp/support/sync_stream.h>
|
||||
#include <grpcpp/ports_def.inc>
|
||||
namespace tari {
|
||||
namespace rpc {
|
||||
|
||||
} // namespace tari
|
||||
} // namespace rpc
|
||||
#include <grpcpp/ports_undef.inc>
|
||||
|
||||
+59
@@ -0,0 +1,59 @@
|
||||
// Generated by the gRPC C++ plugin.
|
||||
// If you make any local change, they will be lost.
|
||||
// source: network.proto
|
||||
// Original file comments:
|
||||
// Copyright 2020. The Tari Project
|
||||
//
|
||||
// Redistribution and use in source and binary forms, with or without modification, are permitted provided that the
|
||||
// following conditions are met:
|
||||
//
|
||||
// 1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following
|
||||
// disclaimer.
|
||||
//
|
||||
// 2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the
|
||||
// following disclaimer in the documentation and/or other materials provided with the distribution.
|
||||
//
|
||||
// 3. Neither the name of the copyright holder nor the names of its contributors may be used to endorse or promote
|
||||
// products derived from this software without specific prior written permission.
|
||||
//
|
||||
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES,
|
||||
// INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
||||
// DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
|
||||
// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
|
||||
// SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
|
||||
// WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE
|
||||
// USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
#ifndef GRPC_network_2eproto__INCLUDED
|
||||
#define GRPC_network_2eproto__INCLUDED
|
||||
|
||||
#include "network.pb.h"
|
||||
|
||||
#include <functional>
|
||||
#include <grpcpp/generic/async_generic_service.h>
|
||||
#include <grpcpp/support/async_stream.h>
|
||||
#include <grpcpp/support/async_unary_call.h>
|
||||
#include <grpcpp/support/client_callback.h>
|
||||
#include <grpcpp/client_context.h>
|
||||
#include <grpcpp/completion_queue.h>
|
||||
#include <grpcpp/support/message_allocator.h>
|
||||
#include <grpcpp/support/method_handler.h>
|
||||
#include <grpcpp/impl/proto_utils.h>
|
||||
#include <grpcpp/impl/rpc_method.h>
|
||||
#include <grpcpp/support/server_callback.h>
|
||||
#include <grpcpp/impl/server_callback_handlers.h>
|
||||
#include <grpcpp/server_context.h>
|
||||
#include <grpcpp/impl/service_type.h>
|
||||
#include <grpcpp/support/status.h>
|
||||
#include <grpcpp/support/stub_options.h>
|
||||
#include <grpcpp/support/sync_stream.h>
|
||||
#include <grpcpp/ports_def.inc>
|
||||
|
||||
namespace tari {
|
||||
namespace rpc {
|
||||
|
||||
} // namespace rpc
|
||||
} // namespace tari
|
||||
|
||||
|
||||
#include <grpcpp/ports_undef.inc>
|
||||
#endif // GRPC_network_2eproto__INCLUDED
|
||||
+3463
File diff suppressed because it is too large
Load Diff
+3777
File diff suppressed because it is too large
Load Diff
+97
@@ -0,0 +1,97 @@
|
||||
// Copyright 2020. The Tari Project
|
||||
//
|
||||
// Redistribution and use in source and binary forms, with or without modification, are permitted provided that the
|
||||
// following conditions are met:
|
||||
//
|
||||
// 1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following
|
||||
// disclaimer.
|
||||
//
|
||||
// 2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the
|
||||
// following disclaimer in the documentation and/or other materials provided with the distribution.
|
||||
//
|
||||
// 3. Neither the name of the copyright holder nor the names of its contributors may be used to endorse or promote
|
||||
// products derived from this software without specific prior written permission.
|
||||
//
|
||||
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES,
|
||||
// INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
||||
// DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
|
||||
// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
|
||||
// SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
|
||||
// WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE
|
||||
// USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
syntax = "proto3";
|
||||
|
||||
package tari.rpc;
|
||||
|
||||
import "google/protobuf/timestamp.proto";
|
||||
|
||||
message NodeIdentity {
|
||||
bytes public_key = 1;
|
||||
repeated string public_addresses = 2;
|
||||
bytes node_id = 3;
|
||||
}
|
||||
|
||||
message Peer {
|
||||
/// Public key of the peer
|
||||
bytes public_key =1;
|
||||
/// NodeId of the peer
|
||||
bytes node_id =2;
|
||||
/// Peer's addresses
|
||||
repeated Address addresses = 3;
|
||||
/// Last connection attempt to peer
|
||||
uint64 last_connection = 4;
|
||||
/// Flags for the peer.
|
||||
uint32 flags = 5;
|
||||
uint64 banned_until= 6;
|
||||
string banned_reason= 7;
|
||||
uint64 offline_at = 8;
|
||||
/// Features supported by the peer
|
||||
uint32 features = 9;
|
||||
/// used as information for more efficient protocol negotiation.
|
||||
repeated bytes supported_protocols = 11;
|
||||
/// User agent advertised by the peer
|
||||
string user_agent = 12;
|
||||
}
|
||||
|
||||
enum ConnectivityStatus {
|
||||
Initializing = 0;
|
||||
Online = 1;
|
||||
Degraded = 2;
|
||||
Offline = 3;
|
||||
}
|
||||
|
||||
message NetworkStatusResponse {
|
||||
ConnectivityStatus status = 1;
|
||||
uint32 avg_latency_ms = 2;
|
||||
uint32 num_node_connections = 3;
|
||||
}
|
||||
|
||||
message Address {
|
||||
bytes address =1;
|
||||
string last_seen = 2;
|
||||
uint32 connection_attempts = 3;
|
||||
AverageLatency avg_latency = 5;
|
||||
}
|
||||
|
||||
message AverageLatency {
|
||||
uint64 latency = 1;
|
||||
}
|
||||
|
||||
message ListConnectedPeersResponse {
|
||||
repeated Peer connected_peers = 1;
|
||||
}
|
||||
|
||||
message SoftwareUpdate {
|
||||
bool has_update = 1;
|
||||
string version = 2;
|
||||
string sha = 3;
|
||||
string download_url = 4;
|
||||
}
|
||||
|
||||
message GetIdentityRequest { }
|
||||
|
||||
message GetIdentityResponse {
|
||||
bytes public_key = 1;
|
||||
string public_address = 2;
|
||||
bytes node_id = 3;
|
||||
}
|
||||
@@ -0,0 +1,29 @@
|
||||
// Generated by the gRPC C++ plugin.
|
||||
// If you make any local change, they will be lost.
|
||||
// source: sidechain_types.proto
|
||||
|
||||
#include "sidechain_types.pb.h"
|
||||
#include "sidechain_types.grpc.pb.h"
|
||||
|
||||
#include <functional>
|
||||
#include <grpcpp/support/async_stream.h>
|
||||
#include <grpcpp/support/async_unary_call.h>
|
||||
#include <grpcpp/impl/channel_interface.h>
|
||||
#include <grpcpp/impl/client_unary_call.h>
|
||||
#include <grpcpp/support/client_callback.h>
|
||||
#include <grpcpp/support/message_allocator.h>
|
||||
#include <grpcpp/support/method_handler.h>
|
||||
#include <grpcpp/impl/rpc_service_method.h>
|
||||
#include <grpcpp/support/server_callback.h>
|
||||
#include <grpcpp/impl/server_callback_handlers.h>
|
||||
#include <grpcpp/server_context.h>
|
||||
#include <grpcpp/impl/service_type.h>
|
||||
#include <grpcpp/support/sync_stream.h>
|
||||
#include <grpcpp/ports_def.inc>
|
||||
namespace tari {
|
||||
namespace rpc {
|
||||
|
||||
} // namespace tari
|
||||
} // namespace rpc
|
||||
#include <grpcpp/ports_undef.inc>
|
||||
|
||||
@@ -0,0 +1,59 @@
|
||||
// Generated by the gRPC C++ plugin.
|
||||
// If you make any local change, they will be lost.
|
||||
// source: sidechain_types.proto
|
||||
// Original file comments:
|
||||
// Copyright 2020. The Tari Project
|
||||
//
|
||||
// Redistribution and use in source and binary forms, with or without modification, are permitted provided that the
|
||||
// following conditions are met:
|
||||
//
|
||||
// 1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following
|
||||
// disclaimer.
|
||||
//
|
||||
// 2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the
|
||||
// following disclaimer in the documentation and/or other materials provided with the distribution.
|
||||
//
|
||||
// 3. Neither the name of the copyright holder nor the names of its contributors may be used to endorse or promote
|
||||
// products derived from this software without specific prior written permission.
|
||||
//
|
||||
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES,
|
||||
// INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
||||
// DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
|
||||
// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
|
||||
// SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
|
||||
// WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE
|
||||
// USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
#ifndef GRPC_sidechain_5ftypes_2eproto__INCLUDED
|
||||
#define GRPC_sidechain_5ftypes_2eproto__INCLUDED
|
||||
|
||||
#include "sidechain_types.pb.h"
|
||||
|
||||
#include <functional>
|
||||
#include <grpcpp/generic/async_generic_service.h>
|
||||
#include <grpcpp/support/async_stream.h>
|
||||
#include <grpcpp/support/async_unary_call.h>
|
||||
#include <grpcpp/support/client_callback.h>
|
||||
#include <grpcpp/client_context.h>
|
||||
#include <grpcpp/completion_queue.h>
|
||||
#include <grpcpp/support/message_allocator.h>
|
||||
#include <grpcpp/support/method_handler.h>
|
||||
#include <grpcpp/impl/proto_utils.h>
|
||||
#include <grpcpp/impl/rpc_method.h>
|
||||
#include <grpcpp/support/server_callback.h>
|
||||
#include <grpcpp/impl/server_callback_handlers.h>
|
||||
#include <grpcpp/server_context.h>
|
||||
#include <grpcpp/impl/service_type.h>
|
||||
#include <grpcpp/support/status.h>
|
||||
#include <grpcpp/support/stub_options.h>
|
||||
#include <grpcpp/support/sync_stream.h>
|
||||
#include <grpcpp/ports_def.inc>
|
||||
|
||||
namespace tari {
|
||||
namespace rpc {
|
||||
|
||||
} // namespace rpc
|
||||
} // namespace tari
|
||||
|
||||
|
||||
#include <grpcpp/ports_undef.inc>
|
||||
#endif // GRPC_sidechain_5ftypes_2eproto__INCLUDED
|
||||
+8556
File diff suppressed because it is too large
Load Diff
+9694
File diff suppressed because it is too large
Load Diff
+172
@@ -0,0 +1,172 @@
|
||||
// Copyright 2020. The Tari Project
|
||||
//
|
||||
// Redistribution and use in source and binary forms, with or without modification, are permitted provided that the
|
||||
// following conditions are met:
|
||||
//
|
||||
// 1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following
|
||||
// disclaimer.
|
||||
//
|
||||
// 2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the
|
||||
// following disclaimer in the documentation and/or other materials provided with the distribution.
|
||||
//
|
||||
// 3. Neither the name of the copyright holder nor the names of its contributors may be used to endorse or promote
|
||||
// products derived from this software without specific prior written permission.
|
||||
//
|
||||
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES,
|
||||
// INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
||||
// DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
|
||||
// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
|
||||
// SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
|
||||
// WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE
|
||||
// USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
syntax = "proto3";
|
||||
|
||||
package tari.rpc;
|
||||
|
||||
import "types.proto";
|
||||
|
||||
message SideChainFeature {
|
||||
oneof feature {
|
||||
ValidatorNodeRegistration validator_node_registration = 1;
|
||||
TemplateRegistration template_registration = 2;
|
||||
ConfidentialOutputData confidential_output = 3;
|
||||
EvictionProof eviction_proof = 4;
|
||||
ValidatorNodeExit validator_node_exit = 5;
|
||||
}
|
||||
SideChainId sidechain_id = 6;
|
||||
}
|
||||
|
||||
message SideChainId {
|
||||
bytes public_key = 1;
|
||||
Signature knowledge_proof = 2;
|
||||
}
|
||||
|
||||
message ValidatorNodeRegistration {
|
||||
bytes public_key = 1;
|
||||
Signature signature = 2;
|
||||
bytes claim_public_key = 3;
|
||||
uint64 max_epoch = 4;
|
||||
}
|
||||
|
||||
message ValidatorNodeExit {
|
||||
bytes public_key = 1;
|
||||
Signature signature = 2;
|
||||
uint64 max_epoch = 3;
|
||||
}
|
||||
|
||||
message TemplateRegistration {
|
||||
bytes author_public_key = 1;
|
||||
Signature author_signature = 2;
|
||||
string template_name = 3;
|
||||
uint32 template_version = 4;
|
||||
TemplateType template_type = 5;
|
||||
BuildInfo build_info = 6;
|
||||
bytes binary_sha = 7;
|
||||
string binary_url = 8;
|
||||
}
|
||||
|
||||
message ConfidentialOutputData {
|
||||
bytes claim_public_key = 1;
|
||||
}
|
||||
|
||||
message TemplateType {
|
||||
oneof template_type {
|
||||
WasmInfo wasm = 1;
|
||||
FlowInfo flow = 2;
|
||||
ManifestInfo manifest = 3;
|
||||
}
|
||||
}
|
||||
|
||||
message WasmInfo {
|
||||
uint32 abi_version = 1;
|
||||
}
|
||||
|
||||
message FlowInfo {
|
||||
}
|
||||
|
||||
message ManifestInfo {
|
||||
}
|
||||
|
||||
message BuildInfo {
|
||||
string repo_url = 1;
|
||||
bytes commit_hash = 2;
|
||||
}
|
||||
|
||||
|
||||
message EvictionProof {
|
||||
CommitProof proof = 1;
|
||||
}
|
||||
|
||||
message CommitProof {
|
||||
oneof version {
|
||||
CommitProofV1 v1 = 1;
|
||||
}
|
||||
}
|
||||
|
||||
message CommitProofV1 {
|
||||
bytes command = 1;
|
||||
SidechainBlockCommitProof commit_proof = 2;
|
||||
bytes encoded_inclusion_proof = 3;
|
||||
}
|
||||
|
||||
message SidechainBlockCommitProof {
|
||||
SidechainBlockHeader header = 1;
|
||||
repeated CommitProofElement proof_elements = 2;
|
||||
}
|
||||
|
||||
message CommitProofElement {
|
||||
oneof proof_element {
|
||||
QuorumCertificate quorum_certificate = 1;
|
||||
DummyChain dummy_chain = 2;
|
||||
}
|
||||
}
|
||||
|
||||
message DummyChain {
|
||||
repeated ChainLink chain_links = 1;
|
||||
}
|
||||
|
||||
message ChainLink {
|
||||
bytes header_hash = 1;
|
||||
bytes parent_id = 2;
|
||||
}
|
||||
|
||||
message SidechainBlockHeader {
|
||||
uint32 network = 1;
|
||||
bytes parent_id = 2;
|
||||
bytes justify_id = 3;
|
||||
uint64 height = 4;
|
||||
uint64 epoch = 5;
|
||||
ShardGroup shard_group = 6;
|
||||
bytes proposed_by = 7;
|
||||
bytes state_merkle_root = 8;
|
||||
bytes command_merkle_root = 9;
|
||||
Signature signature = 11;
|
||||
bytes metadata_hash = 10;
|
||||
}
|
||||
|
||||
message ShardGroup {
|
||||
uint32 start = 1;
|
||||
uint32 end_inclusive = 2;
|
||||
}
|
||||
|
||||
message EvictAtom {
|
||||
bytes public_key = 1;
|
||||
}
|
||||
|
||||
message QuorumCertificate {
|
||||
bytes header_hash = 1;
|
||||
bytes parent_id = 2;
|
||||
repeated ValidatorSignature signatures = 3;
|
||||
QuorumDecision decision = 4;
|
||||
}
|
||||
|
||||
enum QuorumDecision {
|
||||
Accept = 0;
|
||||
Reject = 1;
|
||||
}
|
||||
|
||||
message ValidatorSignature {
|
||||
bytes public_key = 1;
|
||||
Signature signature = 2;
|
||||
}
|
||||
|
||||
@@ -0,0 +1,29 @@
|
||||
// Generated by the gRPC C++ plugin.
|
||||
// If you make any local change, they will be lost.
|
||||
// source: transaction.proto
|
||||
|
||||
#include "transaction.pb.h"
|
||||
#include "transaction.grpc.pb.h"
|
||||
|
||||
#include <functional>
|
||||
#include <grpcpp/support/async_stream.h>
|
||||
#include <grpcpp/support/async_unary_call.h>
|
||||
#include <grpcpp/impl/channel_interface.h>
|
||||
#include <grpcpp/impl/client_unary_call.h>
|
||||
#include <grpcpp/support/client_callback.h>
|
||||
#include <grpcpp/support/message_allocator.h>
|
||||
#include <grpcpp/support/method_handler.h>
|
||||
#include <grpcpp/impl/rpc_service_method.h>
|
||||
#include <grpcpp/support/server_callback.h>
|
||||
#include <grpcpp/impl/server_callback_handlers.h>
|
||||
#include <grpcpp/server_context.h>
|
||||
#include <grpcpp/impl/service_type.h>
|
||||
#include <grpcpp/support/sync_stream.h>
|
||||
#include <grpcpp/ports_def.inc>
|
||||
namespace tari {
|
||||
namespace rpc {
|
||||
|
||||
} // namespace tari
|
||||
} // namespace rpc
|
||||
#include <grpcpp/ports_undef.inc>
|
||||
|
||||
@@ -0,0 +1,59 @@
|
||||
// Generated by the gRPC C++ plugin.
|
||||
// If you make any local change, they will be lost.
|
||||
// source: transaction.proto
|
||||
// Original file comments:
|
||||
// Copyright 2020. The Tari Project
|
||||
//
|
||||
// Redistribution and use in source and binary forms, with or without modification, are permitted provided that the
|
||||
// following conditions are met:
|
||||
//
|
||||
// 1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following
|
||||
// disclaimer.
|
||||
//
|
||||
// 2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the
|
||||
// following disclaimer in the documentation and/or other materials provided with the distribution.
|
||||
//
|
||||
// 3. Neither the name of the copyright holder nor the names of its contributors may be used to endorse or promote
|
||||
// products derived from this software without specific prior written permission.
|
||||
//
|
||||
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES,
|
||||
// INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
||||
// DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
|
||||
// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
|
||||
// SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
|
||||
// WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE
|
||||
// USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
#ifndef GRPC_transaction_2eproto__INCLUDED
|
||||
#define GRPC_transaction_2eproto__INCLUDED
|
||||
|
||||
#include "transaction.pb.h"
|
||||
|
||||
#include <functional>
|
||||
#include <grpcpp/generic/async_generic_service.h>
|
||||
#include <grpcpp/support/async_stream.h>
|
||||
#include <grpcpp/support/async_unary_call.h>
|
||||
#include <grpcpp/support/client_callback.h>
|
||||
#include <grpcpp/client_context.h>
|
||||
#include <grpcpp/completion_queue.h>
|
||||
#include <grpcpp/support/message_allocator.h>
|
||||
#include <grpcpp/support/method_handler.h>
|
||||
#include <grpcpp/impl/proto_utils.h>
|
||||
#include <grpcpp/impl/rpc_method.h>
|
||||
#include <grpcpp/support/server_callback.h>
|
||||
#include <grpcpp/impl/server_callback_handlers.h>
|
||||
#include <grpcpp/server_context.h>
|
||||
#include <grpcpp/impl/service_type.h>
|
||||
#include <grpcpp/support/status.h>
|
||||
#include <grpcpp/support/stub_options.h>
|
||||
#include <grpcpp/support/sync_stream.h>
|
||||
#include <grpcpp/ports_def.inc>
|
||||
|
||||
namespace tari {
|
||||
namespace rpc {
|
||||
|
||||
} // namespace rpc
|
||||
} // namespace tari
|
||||
|
||||
|
||||
#include <grpcpp/ports_undef.inc>
|
||||
#endif // GRPC_transaction_2eproto__INCLUDED
|
||||
+4359
File diff suppressed because it is too large
Load Diff
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user