添加对 Tari Solo 的支持
All checks were successful
Build and Release / build-and-test (amd64, alpine) (push) Successful in 23s
Build and Release / build-and-test (amd64, ubuntu) (push) Successful in 30s
Build and Release / build-and-test (arm64, ubuntu) (push) Successful in 59s
Build and Release / build-and-test (arm64, alpine) (push) Successful in 1m5s
Build and Release / release (push) Has been skipped
All checks were successful
Build and Release / build-and-test (amd64, alpine) (push) Successful in 23s
Build and Release / build-and-test (amd64, ubuntu) (push) Successful in 30s
Build and Release / build-and-test (arm64, ubuntu) (push) Successful in 59s
Build and Release / build-and-test (arm64, alpine) (push) Successful in 1m5s
Build and Release / release (push) Has been skipped
This commit is contained in:
40
init.sh
40
init.sh
@@ -18,42 +18,4 @@ sed -i 's/XMRigCC/XXXigCC/' src/version.h
|
||||
sed -i 's/\(#define APP_DESC .*\)"/\1 (with Tari Solo Mining Support)"/' src/version.h
|
||||
|
||||
# Modify the config.json to set verbose to true
|
||||
sed -i 's/"verbose": false/"verbose": true/' src/config.json
|
||||
|
||||
# Modify BlockTemplate.cpp to support Tari 76-byte solo mining format
|
||||
echo "Adding Tari Solo Mining support to BlockTemplate.cpp..."
|
||||
|
||||
# Add Tari format detection at the beginning of parse(bool hashes) function
|
||||
# Find the line "bool xmrig::BlockTemplate::parse(bool hashes)" and add Tari detection after the opening brace
|
||||
sed -i '/^bool xmrig::BlockTemplate::parse(bool hashes)/,/^{/a\
|
||||
\/\/ Detect Tari solo mining format (76 bytes)\
|
||||
\/\/ Format: 3 bytes header + 32 bytes mining_hash + 8 bytes nonce + 33 bytes pow\
|
||||
if (m_blob.size() == 76) {\
|
||||
\/\/ Tari solo mining format - use fixed-size parsing (no varint)\
|
||||
BlobReader<false> ar(m_blob.data(), m_blob.size());\
|
||||
\
|
||||
\/\/ Skip 3-byte header (major_version, minor_version, timestamp - all 0 for Tari)\
|
||||
ar.skip(3);\
|
||||
\
|
||||
\/\/ Skip 32-byte mining_hash\
|
||||
ar.skip(32);\
|
||||
\
|
||||
\/\/ Nonce is at offset 35 (3 + 32)\
|
||||
setOffset(NONCE_OFFSET, 35);\
|
||||
ar.skip(8); \/\/ Skip nonce (8 bytes, big-endian)\
|
||||
\
|
||||
\/\/ Skip 33-byte PoW data\
|
||||
ar.skip(33);\
|
||||
\
|
||||
\/\/ For Tari, we do not need to parse miner tx or other Monero-specific fields\
|
||||
\/\/ Just accept the template and let XMRig modify the nonce\
|
||||
return true;\
|
||||
}\
|
||||
\
|
||||
\/\/ Original Monero varint parsing for non-Tari formats
|
||||
' src/base/tools/cryptonote/BlockTemplate.cpp
|
||||
|
||||
# Change the original BlobReader to BlobReader<true> to explicitly use varint parsing
|
||||
sed -i 's/BlobReader ar(m_blob\.data(), m_blob\.size());/BlobReader<true> ar(m_blob.data(), m_blob.size());/' src/base/tools/cryptonote/BlockTemplate.cpp
|
||||
|
||||
echo "✅ Tari Solo Mining support added to BlockTemplate.cpp"
|
||||
sed -i 's/"verbose": false/"verbose": true/' src/config.json
|
||||
Reference in New Issue
Block a user