Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Changed the Linux Compilation #379

Open
wants to merge 71 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
71 commits
Select commit Hold shift + click to select a range
5271c4c
initial commit
HashHound Jul 9, 2024
7880fe2
Update CMakeLists.txt
HashHound Jul 9, 2024
d6c6bc7
Update CryptoNoteConfig.h
HashHound Jul 9, 2024
a0db2b2
devfee update
HashHound Jul 9, 2024
d2c083d
Update Currency.cpp
HashHound Jul 9, 2024
333e1bc
FishHash files
HashHound Jul 9, 2024
684875d
Revert "FishHash files"
HashHound Jul 9, 2024
7a9f4c9
Update README.md
HashHound Jul 9, 2024
c32f38c
Update CMakeLists.txt
HashHound Jul 9, 2024
e495ca7
Update CMakeLists.txt
HashHound Jul 9, 2024
8b92728
Revert "Update CMakeLists.txt"
HashHound Jul 9, 2024
99ccb68
ubuntu 22 test
HashHound Jul 9, 2024
935c422
Revert "ubuntu 22 test"
HashHound Jul 9, 2024
e20d331
static update
HashHound Jul 9, 2024
4a52999
still tests
HashHound Jul 9, 2024
6f7828d
Update CMakeLists.txt
HashHound Jul 9, 2024
770b912
Revert "Update CMakeLists.txt"
HashHound Jul 9, 2024
731a0d1
Revert "still tests"
HashHound Jul 9, 2024
faf97cc
Update CMakeLists.txt
HashHound Jul 9, 2024
2a99360
Revert "Update CMakeLists.txt"
HashHound Jul 9, 2024
bfa564c
Update CMakeLists.txt
HashHound Jul 9, 2024
f4ac1c8
Update CMakeLists.txt
HashHound Jul 9, 2024
02582ce
Windows fix
HashHound Jul 9, 2024
0573a58
Update CMakeLists.txt
HashHound Jul 9, 2024
07f3460
Update CMakeLists.txt
HashHound Jul 9, 2024
84c15d7
Update CMakeLists.txt
HashHound Jul 9, 2024
a5c15f6
Update CMakeLists.txt
HashHound Jul 10, 2024
500e911
update to seednodes and dev fee
HashHound Jul 10, 2024
031d563
Update CryptoNoteConfig.h
HashHound Jul 10, 2024
468129d
Update Currency.cpp
HashHound Jul 10, 2024
e6e83dc
Update Currency.cpp
HashHound Jul 10, 2024
4179b77
Update Currency.cpp
HashHound Jul 10, 2024
f9854be
Revert "Update Currency.cpp"
HashHound Jul 10, 2024
f3578e7
Update CryptoNoteConfig.h
HashHound Jul 10, 2024
d925aa5
Update Currency.cpp
HashHound Jul 10, 2024
efe8a0e
testing devfee
HashHound Jul 10, 2024
897d1e4
Revert "testing devfee"
HashHound Jul 10, 2024
1bf32ec
Revert "Update Currency.cpp"
HashHound Jul 10, 2024
7f7885a
Revert "Update CryptoNoteConfig.h"
HashHound Jul 10, 2024
2daddd7
Update Currency.cpp
HashHound Jul 10, 2024
13f2125
Update CryptoNoteConfig.h
HashHound Jul 11, 2024
45d7e0a
Genesis Blockreward test
HashHound Jul 11, 2024
54f969a
Update CryptoNoteConfig.h
HashHound Jul 11, 2024
2fac8db
Update CryptoNoteConfig.h
HashHound Jul 11, 2024
18fe89e
Update Currency.cpp
HashHound Jul 11, 2024
b8aa167
Update Currency.h
HashHound Jul 11, 2024
7da3b57
Update Currency.cpp
HashHound Jul 11, 2024
f6bba02
Update Currency.cpp
HashHound Jul 11, 2024
80dbe50
Update Currency.cpp
HashHound Jul 11, 2024
55d41a2
Update Currency.cpp
HashHound Jul 11, 2024
e8a0ef5
Update Currency.cpp
HashHound Jul 11, 2024
8e5aa46
genesis block reward test
HashHound Jul 11, 2024
4904ca9
Revert "genesis block reward test"
HashHound Jul 12, 2024
883b1b3
Revert "Update Currency.cpp"
HashHound Jul 12, 2024
0fb1867
Revert "Update Currency.cpp"
HashHound Jul 12, 2024
c727681
Revert "Update Currency.cpp"
HashHound Jul 12, 2024
f4cf674
Revert "Update Currency.cpp"
HashHound Jul 12, 2024
9ca3eab
Revert "Update Currency.cpp"
HashHound Jul 12, 2024
7273e3a
Revert "Update Currency.h"
HashHound Jul 12, 2024
7b9d9ec
Revert "Update Currency.cpp"
HashHound Jul 12, 2024
cc8df9f
Revert "Update CryptoNoteConfig.h"
HashHound Jul 12, 2024
aa7ff24
Revert "Update CryptoNoteConfig.h"
HashHound Jul 12, 2024
2c43044
Revert "Genesis Blockreward test"
HashHound Jul 12, 2024
2c8390e
new fee logic
HashHound Jul 12, 2024
22638d3
Update CryptoNoteConfig.h
HashHound Jul 12, 2024
4ebf776
Update Currency.cpp
HashHound Jul 13, 2024
03080c6
Update Currency.cpp
HashHound Jul 13, 2024
5385942
Wallet Recovery update
HashHound Jul 13, 2024
1b61625
wallet mnemonic update
HashHound Jul 14, 2024
1e1d5db
Revert "wallet mnemonic update"
HashHound Jul 14, 2024
c9ea99a
Revert "Wallet Recovery update"
HashHound Jul 14, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ if(MSVC)
include_directories(SYSTEM src/platform/msc)
else()
if (${CMAKE_SYSTEM_NAME} STREQUAL "Linux")
# This option has no effect in glibc version less than 2.20.
# This option has no effect in glibc version less than 2.20.
# Since glibc 2.20 _BSD_SOURCE is deprecated, this macro is recomended instead
add_definitions("-D_DEFAULT_SOURCE -D_GNU_SOURCE")
endif()
Expand Down Expand Up @@ -85,7 +85,7 @@ else()
set(RELEASE_FLAGS "-Ofast -DNDEBUG -Wno-unused-variable")
if(NOT APPLE)
# There is a clang bug that does not allow to compile code that uses AES-NI intrinsics if -flto is enabled
if (CMAKE_C_COMPILER_ID STREQUAL "GNU" AND CMAKE_SYSTEM_NAME STREQUAL "Linux"
if (CMAKE_C_COMPILER_ID STREQUAL "GNU" AND CMAKE_SYSTEM_NAME STREQUAL "Linux"
AND CMAKE_BUILD_TYPE STREQUAL "Release" AND ((CMAKE_C_COMPILER_VERSION VERSION_GREATER 4.9) OR (CMAKE_C_COMPILER_VERSION VERSION_EQUAL 4.9)))
# On linux, to build in lto mode, check that ld.gold linker is used: 'update-alternatives --install /usr/bin/ld ld /usr/bin/ld.gold HIGHEST_PRIORITY'
set(CMAKE_AR gcc-ar)
Expand Down
213 changes: 13 additions & 200 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,207 +1,20 @@
This is the reference code for [CryptoNote](https://cryptonote.org) cryptocurrency protocol.
## **Dogemone: The Future of Privacy Coins**

* Launch your own CryptoNote currency: [CryptoNote Starter](https://cryptonotestarter.org/)
* CryptoNote reference implementation: [CryptoNoteCoin](https://cryptonote-coin.org)
* Discussion board and support: [CryptoNote Forum](https://forum.cryptonote.org)
Dogemone is a cutting-edge privacy coin built on the robust Cryptonote protocol, ensuring unparalleled transaction confidentiality and security. With a maximum supply of 300 million, Dogemone follows a meticulously designed emission curve, providing a predictable and fair distribution over time. The coin leverages the Cryptonight algorithm, known for its ASIC resistance and efficiency in CPU and GPU mining, promoting decentralization. Dogemone is committed to protecting your financial privacy while maintaining a secure and decentralized network, making it a standout choice in the realm of cryptocurrency. Join us in shaping a future where privacy and security are paramount.

## CryptoNote forking how-to
### **Key Features:**
- **Privacy-Focused**: Utilizes Cryptonote protocol for untraceable and unlinkable transactions.
- **Controlled Supply**: Capped at 300 million coins with a fair emission curve.
- **Efficient Mining**: Cryptonight algorithm ensures equitable mining opportunities.
- **No Premine**: 100% fair launch with no premine.
- **Developer Fee**: 10% of the block reward is allocated to development, taken slowly over time.
- **Difficulty Adjustment**: Adaptive difficulty adjustment every 120 seconds for network stability.
- **Decentralized Network**: Promotes decentralization and security.

### Preparation
Embrace the future of privacy with Dogemone.

1. Create an account on [GitHub.com](github.com)
2. Fork [CryptoNote repository](https://github.com/cryptonotefoundation/cryptonote)
3. Buy one or two Ubuntu-based dedicated servers (at least 2Gb of RAM) for seed nodes.



### First step. Give a name to your coin

**Good name must be unique.** Check uniqueness with [google](http://google.com) and [Map of Coins](mapofcoins.com) or any other similar service.

Name must be specified twice:

**1. in file src/CryptoNoteConfig.h** - `CRYPTONOTE_NAME` constant

Example:
```
const char CRYPTONOTE_NAME[] = "furiouscoin";
```

**2. in src/CMakeList.txt file** - set_property(TARGET daemon PROPERTY OUTPUT_NAME "YOURCOINNAME**d**")

Example:
```
set_property(TARGET daemon PROPERTY OUTPUT_NAME "furiouscoind")
```

**Note:** You should also change a repository name.


### Second step. Emission logic

**1. Total money supply** (src/CryptoNoteConfig.h)

Total amount of coins to be emitted. Most of CryptoNote based coins use `(uint64_t)(-1)` (equals to 18446744073709551616). You can define number explicitly (for example `UINT64_C(858986905600000000)`).

Example:
```
const uint64_t MONEY_SUPPLY = (uint64_t)(-1);
```

**2. Emission curve** (src/CryptoNoteConfig.h)

Be default CryptoNote provides emission formula with slight decrease of block reward with each block. This is different from Bitcoin where block reward halves every 4 years.

`EMISSION_SPEED_FACTOR` constant defines emission curve slope. This parameter is required to calulate block reward.

Example:
```
const unsigned EMISSION_SPEED_FACTOR = 18;
```

**3. Difficulty target** (src/CryptoNoteConfig.h)

Difficulty target is an ideal time period between blocks. In case an average time between blocks becomes less than difficulty target, the difficulty increases. Difficulty target is measured in seconds.

Difficulty target directly influences several aspects of coin's behavior:

- transaction confirmation speed: the longer the time between the blocks is, the slower transaction confirmation is
- emission speed: the longer the time between the blocks is the slower the emission process is
- orphan rate: chains with very fast blocks have greater orphan rate

For most coins difficulty target is 60 or 120 seconds.

Example:
```
const uint64_t DIFFICULTY_TARGET = 120;
```

**4. Block reward formula**

In case you are not satisfied with CryptoNote default implementation of block reward logic you can also change it. The implementation is in `src/CryptoNoteCore/Currency.cpp`:
```
bool Currency::getBlockReward(size_t medianSize, size_t currentBlockSize, uint64_t alreadyGeneratedCoins, uint64_t fee, uint64_t& reward, int64_t& emissionChange) const
```

This function has two parts:

- basic block reward calculation: `uint64_t baseReward = (m_moneySupply - alreadyGeneratedCoins) >> m_emissionSpeedFactor;`
- big block penalty calculation: this is the way CryptoNote protects the block chain from transaction flooding attacks and preserves opportunities for organic network growth at the same time.

Only the first part of this function is directly related to the emission logic. You can change it the way you want. See MonetaVerde and DuckNote as the examples where this function is modified.


### Third step. Networking

**1. Default ports for P2P and RPC networking** (src/CryptoNoteConfig.h)

P2P port is used by daemons to talk to each other through P2P protocol.
RPC port is used by wallet and other programs to talk to daemon.

It's better to choose ports that aren't used by other software or coins. See known TCP ports lists:

* http://www.speedguide.net/ports.php
* http://www.networksorcery.com/enp/protocol/ip/ports00000.htm
* http://keir.net/portlist.html

Example:
```
const int P2P_DEFAULT_PORT = 17236;
const int RPC_DEFAULT_PORT = 18236;
```


**2. Network identifier** (src/P2p/P2pNetworks.h)

This identifier is used in network packages in order not to mix two different cryptocoin networks. Change all the bytes to random values for your network:
```
const static boost::uuids::uuid CRYPTONOTE_NETWORK = { { 0xA1, 0x1A, 0xA1, 0x1A, 0xA1, 0x0A, 0xA1, 0x0A, 0xA0, 0x1A, 0xA0, 0x1A, 0xA0, 0x1A, 0xA1, 0x1A } };
```


**3. Seed nodes** (src/CryptoNoteConfig.h)

Add IP addresses of your seed nodes.

Example:
```
const std::initializer_list<const char*> SEED_NODES = {
"111.11.11.11:17236",
"222.22.22.22:17236",
};
```


### Fourth step. Transaction fee and related parameters

**1. Minimum transaction fee** (src/CryptoNoteConfig.h)

Zero minimum fee can lead to transaction flooding. Transactions cheaper than the minimum transaction fee wouldn't be accepted by daemons. 100000 value for `MINIMUM_FEE` is usually enough.

Example:
```
const uint64_t MINIMUM_FEE = 100000;
```


**2. Penalty free block size** (src/CryptoNoteConfig.h)

CryptoNote protects chain from tx flooding by reducing block reward for blocks larger than the median block size. However, this rule applies for blocks larger than `CRYPTONOTE_BLOCK_GRANTED_FULL_REWARD_ZONE` bytes.

Example:
```
const size_t CRYPTONOTE_BLOCK_GRANTED_FULL_REWARD_ZONE = 20000;
```


### Fifth step. Address prefix

You may choose a letter (in some cases several letters) all the coin's public addresses will start with. It is defined by `CRYPTONOTE_PUBLIC_ADDRESS_BASE58_PREFIX` constant. Since the rules for address prefixes are nontrivial you may use the [prefix generator tool](https://cryptonotestarter.org/tools.html).

Example:
```
const uint64_t CRYPTONOTE_PUBLIC_ADDRESS_BASE58_PREFIX = 0xe9; // addresses start with "f"
```


### Sixth step. Genesis block

**1. Build the binaries with blank genesis tx hex** (src/CryptoNoteConfig.h)

You should leave `const char GENESIS_COINBASE_TX_HEX[]` blank and compile the binaries without it.

Example:
```
const char GENESIS_COINBASE_TX_HEX[] = "";
```


**2. Start the daemon to print out the genesis block**

Run your daemon with `--print-genesis-tx` argument. It will print out the genesis block coinbase transaction hash.

Example:
```
furiouscoind --print-genesis-tx
```


**3. Copy the printed transaction hash** (src/CryptoNoteConfig.h)

Copy the tx hash that has been printed by the daemon to `GENESIS_COINBASE_TX_HEX` in `src/CryptoNoteConfig.h`

Example:
```
const char GENESIS_COINBASE_TX_HEX[] = "013c01ff0001ffff...785a33d9ebdba68b0";
```


**4. Recompile the binaries**

Recompile everything again. Your coin code is ready now. Make an announcement for the potential users and enjoy!


## Building CryptoNote
## Building Dogemone

### On *nix

Expand Down Expand Up @@ -238,4 +51,4 @@ cmake -G "Visual Studio 12 Win64" ..
```

And then do Build.
Good luck!
We would recommend using the prebuild binaries from the release section, Good luck!
4 changes: 2 additions & 2 deletions src/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ if (MSVC)
target_link_libraries(System ws2_32)
endif ()

target_link_libraries(ConnectivityTool CryptoNoteCore Common Logging Crypto P2P Rpc Http Serialization System ${Boost_LIBRARIES})
target_link_libraries(ConnectivityTool CryptoNoteCore Logging Crypto P2P Rpc Http Serialization Common System ${Boost_LIBRARIES})
target_link_libraries(Daemon CryptoNoteCore P2P Rpc Serialization System Http Logging Common Crypto upnpc-static BlockchainExplorer ${Boost_LIBRARIES})
target_link_libraries(SimpleWallet Wallet NodeRpcProxy Transfers Rpc Http Serialization CryptoNoteCore System Logging Common Crypto ${Boost_LIBRARIES})
target_link_libraries(PaymentGateService PaymentGate JsonRpcServer Wallet NodeRpcProxy Transfers CryptoNoteCore Crypto P2P Rpc Http Serialization System Logging Common InProcessNode upnpc-static BlockchainExplorer ${Boost_LIBRARIES})
Expand All @@ -80,4 +80,4 @@ set_property(TARGET SimpleWallet PROPERTY OUTPUT_NAME "simplewallet")
set_property(TARGET PaymentGateService PROPERTY OUTPUT_NAME "walletd")
set_property(TARGET Miner PROPERTY OUTPUT_NAME "miner")
#TODO Specify the name of daemon for your currency
set_property(TARGET Daemon PROPERTY OUTPUT_NAME "cryptonoted")
set_property(TARGET Daemon PROPERTY OUTPUT_NAME "dogemoned")
Loading