Browse Source

Merge pull request #10 from ethereum-mining/build-config

Build config
cl-refactor
Paweł Bylica 8 years ago
committed by GitHub
parent
commit
5a6acad5c5
  1. 2
      .travis.yml
  2. 5
      CMakeLists.txt
  3. 5
      libethcore/BlockInfo.cpp
  4. 31
      libethcore/BlockInfo.h
  5. 1
      libethcore/Ethash.h
  6. 3
      libethcore/Miner.h

2
.travis.yml

@ -13,6 +13,6 @@ cache:
directories:
- $HOME/.hunter
script:
- cmake -DETHASHCUDA=Off -DETHSTRATUM=On -DETHASHCL=On -H. -Bbuild
- cmake -DHUNTER_JOBS_NUMBER=4 -DETHASHCUDA=Off -DETHSTRATUM=On -DETHASHCL=On -H. -Bbuild
- cmake --build build
- build/ethminer/ethminer --list-devices -G

5
CMakeLists.txt

@ -8,10 +8,11 @@ if (NOT DEFINED CMAKE_TOOLCHAIN_FILE)
set(CMAKE_TOOLCHAIN_FILE ${CMAKE_SOURCE_DIR}/cmake/toolchain.cmake)
endif()
set(HUNTER_CONFIGURATION_TYPES Release)
include(HunterGate)
HunterGate(
URL "https://github.com/ruslo/hunter/archive/v0.18.44.tar.gz"
SHA1 "a78f0b377b8e53c038f12fc18b0c02564c4534c8"
URL "https://github.com/ruslo/hunter/archive/v0.18.46.tar.gz"
SHA1 "e368cbf2a98cf8b8fa7a379fde74eca8ded425e3"
)

5
libethcore/BlockInfo.cpp

@ -88,11 +88,6 @@ void BlockInfo::streamRLPFields(RLPStream& _s) const
<< m_difficulty << m_number << m_gasLimit << m_gasUsed << m_timestamp << m_extraData;
}
h256 BlockInfo::headerHashFromBlock(bytesConstRef _block)
{
return sha3(RLP(_block)[0].data());
}
RLP BlockInfo::extractHeader(bytesConstRef _block)
{
RLP root(_block);

31
libethcore/BlockInfo.h

@ -79,7 +79,6 @@ DEV_SIMPLE_EXCEPTION(GenesisBlockCannotBeCalculated);
*/
class BlockInfo
{
friend class BlockChain;
public:
static const unsigned BasicFields = 13;
@ -87,8 +86,6 @@ public:
explicit BlockInfo(bytesConstRef _data, Strictness _s = CheckEverything, h256 const& _hashWith = h256(), BlockDataType _bdt = BlockData);
explicit BlockInfo(bytes const& _data, Strictness _s = CheckEverything, h256 const& _hashWith = h256(), BlockDataType _bdt = BlockData): BlockInfo(&_data, _s, _hashWith, _bdt) {}
static h256 headerHashFromBlock(bytes const& _block) { return headerHashFromBlock(&_block); }
static h256 headerHashFromBlock(bytesConstRef _block);
static RLP extractHeader(bytesConstRef _block);
explicit operator bool() const { return m_timestamp != Invalid256; }
@ -116,16 +113,7 @@ public:
h256 const& parentHash() const { return m_parentHash; }
h256 const& sha3Uncles() const { return m_sha3Uncles; }
void setParentHash(h256 const& _v) { m_parentHash = _v; noteDirty(); }
void setSha3Uncles(h256 const& _v) { m_sha3Uncles = _v; noteDirty(); }
void setTimestamp(u256 const& _v) { m_timestamp = _v; noteDirty(); }
void setCoinbaseAddress(Address const& _v) { m_coinbaseAddress = _v; noteDirty(); }
void setRoots(h256 const& _t, h256 const& _r, h256 const& _u, h256 const& _s) { m_transactionsRoot = _t; m_receiptsRoot = _r; m_stateRoot = _s; m_sha3Uncles = _u; noteDirty(); }
void setGasUsed(u256 const& _v) { m_gasUsed = _v; noteDirty(); }
void setNumber(u256 const& _v) { m_number = _v; noteDirty(); }
void setGasLimit(u256 const& _v) { m_gasLimit = _v; noteDirty(); }
void setExtraData(bytes const& _v) { m_extraData = _v; noteDirty(); }
void setLogBloom(LogBloom const& _v) { m_logBloom = _v; noteDirty(); }
void setDifficulty(u256 const& _v) { m_difficulty = _v; noteDirty(); }
Address const& beneficiary() const { return m_coinbaseAddress; }
@ -174,14 +162,6 @@ private:
mutable h256 m_boundary; ///< 2^256 / difficulty
};
inline std::ostream& operator<<(std::ostream& _out, BlockInfo const& _bi)
{
_out << _bi.hashWithout() << " " << _bi.parentHash() << " " << _bi.sha3Uncles() << " " << _bi.beneficiary() << " " << _bi.stateRoot() << " " << _bi.transactionsRoot() << " " <<
_bi.receiptsRoot() << " " << _bi.logBloom() << " " << _bi.difficulty() << " " << _bi.number() << " " << _bi.gasLimit() << " " <<
_bi.gasUsed() << " " << _bi.timestamp();
return _out;
}
template <class BlockInfoSub>
class BlockHeaderPolished: public BlockInfoSub
{
@ -191,10 +171,6 @@ public:
explicit BlockHeaderPolished(bytes const& _data, Strictness _s = IgnoreSeal, h256 const& _h = h256(), BlockDataType _bdt = BlockData) { populate(&_data, _s, _h, _bdt); }
explicit BlockHeaderPolished(bytesConstRef _data, Strictness _s = IgnoreSeal, h256 const& _h = h256(), BlockDataType _bdt = BlockData) { populate(_data, _s, _h, _bdt); }
// deprecated - just use constructor instead.
static BlockHeaderPolished fromHeader(bytes const& _data, Strictness _s = IgnoreSeal, h256 const& _h = h256()) { return BlockHeaderPolished(_data, _s, _h, HeaderData); }
static BlockHeaderPolished fromHeader(bytesConstRef _data, Strictness _s = IgnoreSeal, h256 const& _h = h256()) { return BlockHeaderPolished(_data, _s, _h, HeaderData); }
// deprecated for public API - use constructor.
// TODO: make private.
void populate(bytesConstRef _data, Strictness _s, h256 const& _h = h256(), BlockDataType _bdt = BlockData)
@ -243,13 +219,6 @@ public:
if (_i == WithProof)
BlockInfoSub::streamRLPFields(_s);
}
bytes sealFieldsRLP() const
{
RLPStream s;
BlockInfoSub::streamRLPFields(s);
return s.out();
}
};
}

1
libethcore/Ethash.h

@ -58,7 +58,6 @@ public:
public:
h256 const& seedHash() const;
Nonce const& nonce() const { return m_nonce; }
h256 const& mixHash() const { return m_mixHash; }
protected:
BlockHeaderRaw() = default;

3
libethcore/Miner.h

@ -231,9 +231,6 @@ private:
WorkPackage m_work;
mutable Mutex x_work;
bool m_dagLoaded = false;
};
}

Loading…
Cancel
Save