Skip to content

Commit 53dee36

Browse files
committed
Merge branch 'develop'
2 parents cf1ac85 + 2943d7d commit 53dee36

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

54 files changed

+1752
-626
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -90,3 +90,4 @@ yosemite_bios/reset_yosemite_testnet_on_local.sh
9090
yosemite_bios/reset_std_token_yosemite_testnet_on_local.sh
9191
yosemite_bios/stop_yosemite_testnet_node_local.sh
9292
yosemite_bios/start_yosemite_testnet_node_local.sh
93+
yosemite_bios/clean_data_yosemite_testnet_on_local.sh

CMakeLists.txt

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/CMakeModules")
1919
if (UNIX)
2020
if (APPLE)
2121
if (LLVM_DIR STREQUAL "" OR NOT LLVM_DIR)
22-
set(LLVM_DIR "/usr/local/opt/llvm@4/lib/cmake/llvm")
22+
set(LLVM_DIR "/usr/local/opt/llvm@4/lib/cmake/llvm/")
2323
endif()
2424
endif()
2525
endif()
@@ -37,7 +37,7 @@ set( CXX_STANDARD_REQUIRED ON)
3737

3838
set(VERSION_MAJOR 1)
3939
set(VERSION_MINOR 6)
40-
set(VERSION_PATCH 0)
40+
set(VERSION_PATCH 3)
4141

4242
if(VERSION_SUFFIX)
4343
set(VERSION_FULL "${VERSION_MAJOR}.${VERSION_MINOR}.${VERSION_PATCH}-${VERSION_SUFFIX}")
@@ -130,6 +130,9 @@ FIND_PACKAGE(Boost 1.67 REQUIRED COMPONENTS
130130
locale
131131
iostreams)
132132

133+
# Some new stdlibc++s will #error on <experimental/string_view>
134+
add_definitions(-DBOOST_ASIO_DISABLE_STD_EXPERIMENTAL_STRING_VIEW)
135+
133136
if( WIN32 )
134137

135138
message( STATUS "Configuring EOSIO on WIN32")
@@ -243,7 +246,7 @@ message( STATUS "Using S(${YOSEMITE_NATIVE_TOKEN_PRECISION},${YOSEMITE_NATIVE_TO
243246

244247

245248
if ("${EOSIO_ROOT_KEY}" STREQUAL "")
246-
set(EOSIO_ROOT_KEY "EOS6MRyAjQq8ud7hVNYcfnVPJqcVpscN5So8BhtHuGYqET5GDW5CV")
249+
set(EOSIO_ROOT_KEY "EOS6MRyAjQq8ud7hVNYcfnVPJqcVpscN5So8BhtHuGYqET5GDW5CV")
247250
endif()
248251

249252
message( STATUS "Using '${EOSIO_ROOT_KEY}' as public key for 'yosemite' account" )

Docker/Dockerfile

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,10 @@
11
FROM eosio/builder as builder
2-
ARG repository_name=yosemite-public-blockchain
32
ARG branch=master
43
ARG native_token_symbol=DUSD
54
ARG native_token_precision=4
65

7-
RUN git clone -b $branch https://github.com/YosemiteLabs/$repository_name.git --recursive \
8-
&& cd $repository_name && echo "$branch:$(git rev-parse HEAD)" > /etc/yosemite-version \
6+
RUN git clone -b $branch https://github.com/YosemiteLabs/yosemite-public-blockchain.git --recursive \
7+
&& cd yosemite-public-blockchain && echo "$branch:$(git rev-parse HEAD)" > /etc/yosemite-version \
98
&& cmake -H. -B"/tmp/build" -GNinja -DCMAKE_BUILD_TYPE=Release -DWASM_ROOT=/opt/wasm -DCMAKE_CXX_COMPILER=clang++ \
109
-DCMAKE_C_COMPILER=clang -DCMAKE_INSTALL_PREFIX=/tmp/build -DBUILD_MONGO_DB_PLUGIN=true \
1110
-DYOSEMITE_NATIVE_TOKEN_SYMBOL_NAME=$native_token_symbol -DYOSEMITE_NATIVE_TOKEN_PRECISION=$native_token_precision \
@@ -17,9 +16,9 @@ RUN apt-get update && DEBIAN_FRONTEND=noninteractive apt-get -y install openssl
1716
COPY --from=builder /usr/local/lib/* /usr/local/lib/
1817
COPY --from=builder /tmp/build/bin /opt/yosemite/bin
1918
COPY --from=builder /tmp/build/contracts /contracts
20-
COPY --from=builder /$repository_name/Docker/config.ini /
19+
COPY --from=builder /yosemite-public-blockchain/Docker/config.ini /
2120
COPY --from=builder /etc/yosemite-version /etc
22-
COPY --from=builder /$repository_name/Docker/yosemited.sh /opt/yosemite/bin/yosemited.sh
21+
COPY --from=builder /yosemite-public-blockchain/Docker/yosemited.sh /opt/yosemite/bin/yosemited.sh
2322
ENV EOSIO_ROOT=/opt/yosemite
2423
ENV YOSEMITE_ROOT=/opt/yosemite
2524
RUN chmod +x /opt/yosemite/bin/yosemited.sh

Docker/README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,10 +20,10 @@ cd yosemite-public-blockchain/Docker
2020
docker build . -t yosemitex/yosemite
2121
```
2222

23-
The above will build off the most recent commit to the master branch by default. If you would like to target a specific branch/tag, you may use a build argument. For example, if you wished to generate a docker image based off of the 1.6.0 tag, you could do the following:
23+
The above will build off the most recent commit to the master branch by default. If you would like to target a specific branch/tag, you may use a build argument. For example, if you wished to generate a docker image based off of the 1.6.3 tag, you could do the following:
2424

2525
```bash
26-
docker build -t yosemitex/yosemite:1.6.0 --build-arg branch=1.6.0 .
26+
docker build -t yosemitex/yosemite:v1.6.3 --build-arg branch=v1.6.3 .
2727
```
2828

2929
By default, the native token symbol is set to DUSD with precision 4. You can override this using the symbol argument while building the docker image.

LICENSE

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,9 +17,9 @@ met:
1717
3. All advertising materials mentioning features or use of this
1818
software must display the following acknowledgement:
1919
"Powered by YOSEMITE" or
20-
"This product includes software developed by the Yosemite X Inc."
20+
"This product includes software developed by Yosemite X Inc."
2121

22-
4. Neither the name of the Yosemite X Inc. nor the names of its
22+
4. Neither the name of Yosemite X Inc. nor the names of its
2323
contributors may be used to endorse or promote products derived
2424
from this software without specific prior written permission.
2525

README.md

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -85,13 +85,9 @@ even if it had been advised of the possibility of damage.
8585

8686

8787
## Supported Operating Systems
88-
1. Amazon 2017.09 and higher
89-
2. Centos 7
90-
3. Fedora 25 and higher (Fedora 27 recommended)
91-
4. Mint 18
92-
5. Ubuntu 16.04 (Ubuntu 16.10 recommended)
93-
6. Ubuntu 18.04
94-
7. MacOS Darwin 10.12 and higher (MacOS 10.13.x recommended)
88+
1. Centos 7
89+
2. Ubuntu 18.04
90+
3. MacOS 10.13 and higher (MacOS 10.14.x recommended)
9591

9692

9793

contracts/yosemitelib/system_depository.hpp

Lines changed: 0 additions & 34 deletions
This file was deleted.

contracts/yosemitelib/transaction_vote.h

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ extern "C" {
2323

2424

2525
/**
26+
* [Deprecated]
2627
* Cast Transaction Vote
2728
* @brief Contribute transaction voting from an action in current transaction context.
2829
* The vote amount is accumulated to the vote-to(candidate) account specified in the current transaction context.
@@ -36,6 +37,7 @@ extern "C" {
3637
void cast_transaction_vote( uint32_t vote_amount );
3738

3839
/**
40+
* [Deprecated]
3941
* Get transaction vote data accumulated in the head block (previous block)
4042
* @brief Get transaction votes sum data for each vote-to(candidate) account,
4143
* accumulated from the transactions in the previous block right before current pending block
@@ -49,10 +51,49 @@ extern "C" {
4951
*/
5052
size_t read_head_block_trx_votes_data(char *buffer, size_t size);
5153

54+
55+
/**
56+
* Get Top Transaction Vote Receivers
57+
* @brief Retrieve top transaction vote receiver list from blockchain core.
58+
* Transaction votes are processed and accrued for each vote target account on blockchain core by YOSEMITE Proof-of-Transaction/Transaction-as-a-Vote protocol
59+
* Smart contract code including system contract can retrieve the top transaction vote receiver list
60+
* sorted by the accumulated time-decaying weighted transaction vote amount for each tx vote receiver account.
61+
* The whole list of transaction vote receivers can be arbitrarily long,
62+
* so the sorted list can be retrieved by multiple function call with different offset_rank and limit parameter values.
63+
*
64+
* @param buffer - a buffer to write the top sorted transaction vote receiver list data to,
65+
* returned buffer memory contains array of 'yosemite_tx_vote_stat_for_account' struct
66+
* @param size - the size of the buffer, 0 to return required size
67+
* @param offset_rank - offset-rank of first item in the returned list. offset-rank n means the returned list starts from the rank n+1 tx vote receiver.
68+
* e.g. if offset_rank = 0, the first item in the returned list is the top 1 vote receiver.
69+
* @param limit - max limit of the returned item count
70+
*
71+
* @return the size of the sorted transaction vote receiver list data written to the buffer (array of 'yosemite_tx_vote_stat_for_account' struct),
72+
* or number of bytes that can be copied if size==0 passed
73+
* @pre `buffer` is a valid pointer to a range of memory at least `size` bytes long
74+
* @post `buffer` is filled with packed transaction vote receiver list data
75+
*/
76+
size_t get_top_transaction_vote_receivers( char *buffer, size_t size, uint32_t offset_rank, uint32_t limit );
77+
78+
/**
79+
* Get Total Weighted Transaction Votes
80+
* @brief Retrieve the total weighted (time-decaying) transaction vote amount accumulated for all blockchain transactions in the blockchain history
81+
*
82+
* @return total weighted transaction vote amount
83+
*/
84+
double get_total_weighted_transaction_votes();
85+
86+
5287
///@ } trxvoteapi
5388
}
5489

5590
struct yosemite_transaction_vote {
5691
uint64_t to; // account name
5792
uint32_t amount;
5893
};
94+
95+
struct yosemite_tx_vote_stat_for_account {
96+
uint64_t account;
97+
double tx_votes_weighted;
98+
uint64_t tx_votes;
99+
};

contracts/yx.ntoken/yx.ntoken.cpp

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
#include <yosemitelib/native_token.hpp>
22
#include <yosemitelib/system_accounts.hpp>
33
#include <yosemitelib/transaction_fee.hpp>
4-
#include <yosemitelib/system_depository.hpp>
4+
//#include <yosemitelib/system_depository.hpp>
55
#include <yosemitelib/transaction_vote.h>
66

77
namespace yosemite { namespace native_token {
@@ -37,8 +37,8 @@ namespace yosemite { namespace native_token {
3737
eosio_assert(static_cast<uint32_t>(memo.size() <= 256), "memo has more than 256 bytes");
3838

3939
require_auth(token.issuer);
40-
eosio_assert(static_cast<uint32_t>(is_authorized_sys_depository(token.issuer)),
41-
"issuer account is not system depository");
40+
//eosio_assert(static_cast<uint32_t>(is_authorized_sys_depository(token.issuer)),
41+
// "issuer account is not system depository");
4242

4343
stats_native stats(get_self(), token.issuer);
4444
const auto &tstats = stats.find(NTOKEN_BASIC_STATS_KEY);
@@ -75,8 +75,8 @@ namespace yosemite { namespace native_token {
7575
eosio_assert(static_cast<uint32_t>(memo.size() <= 256), "memo has more than 256 bytes");
7676

7777
require_auth(token.issuer);
78-
eosio_assert(static_cast<uint32_t>(is_authorized_sys_depository(token.issuer)),
79-
"issuer account is not system depository");
78+
//eosio_assert(static_cast<uint32_t>(is_authorized_sys_depository(token.issuer)),
79+
// "issuer account is not system depository");
8080

8181
stats_native stats(get_self(), token.issuer);
8282
const auto &tstats = stats.get(NTOKEN_BASIC_STATS_KEY, "createn for the issuer is not called");

0 commit comments

Comments
 (0)