Skip to content

Commit

Permalink
Merge branch 'develop'
Browse files Browse the repository at this point in the history
  • Loading branch information
bezalel committed Apr 8, 2019
2 parents cf1ac85 + 2943d7d commit 53dee36
Show file tree
Hide file tree
Showing 54 changed files with 1,752 additions and 626 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -90,3 +90,4 @@ yosemite_bios/reset_yosemite_testnet_on_local.sh
yosemite_bios/reset_std_token_yosemite_testnet_on_local.sh
yosemite_bios/stop_yosemite_testnet_node_local.sh
yosemite_bios/start_yosemite_testnet_node_local.sh
yosemite_bios/clean_data_yosemite_testnet_on_local.sh
9 changes: 6 additions & 3 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/CMakeModules")
if (UNIX)
if (APPLE)
if (LLVM_DIR STREQUAL "" OR NOT LLVM_DIR)
set(LLVM_DIR "/usr/local/opt/llvm@4/lib/cmake/llvm")
set(LLVM_DIR "/usr/local/opt/llvm@4/lib/cmake/llvm/")
endif()
endif()
endif()
Expand All @@ -37,7 +37,7 @@ set( CXX_STANDARD_REQUIRED ON)

set(VERSION_MAJOR 1)
set(VERSION_MINOR 6)
set(VERSION_PATCH 0)
set(VERSION_PATCH 3)

if(VERSION_SUFFIX)
set(VERSION_FULL "${VERSION_MAJOR}.${VERSION_MINOR}.${VERSION_PATCH}-${VERSION_SUFFIX}")
Expand Down Expand Up @@ -130,6 +130,9 @@ FIND_PACKAGE(Boost 1.67 REQUIRED COMPONENTS
locale
iostreams)

# Some new stdlibc++s will #error on <experimental/string_view>
add_definitions(-DBOOST_ASIO_DISABLE_STD_EXPERIMENTAL_STRING_VIEW)

if( WIN32 )

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


if ("${EOSIO_ROOT_KEY}" STREQUAL "")
set(EOSIO_ROOT_KEY "EOS6MRyAjQq8ud7hVNYcfnVPJqcVpscN5So8BhtHuGYqET5GDW5CV")
set(EOSIO_ROOT_KEY "EOS6MRyAjQq8ud7hVNYcfnVPJqcVpscN5So8BhtHuGYqET5GDW5CV")
endif()

message( STATUS "Using '${EOSIO_ROOT_KEY}' as public key for 'yosemite' account" )
Expand Down
9 changes: 4 additions & 5 deletions Docker/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,11 +1,10 @@
FROM eosio/builder as builder
ARG repository_name=yosemite-public-blockchain
ARG branch=master
ARG native_token_symbol=DUSD
ARG native_token_precision=4

RUN git clone -b $branch https://github.com/YosemiteLabs/$repository_name.git --recursive \
&& cd $repository_name && echo "$branch:$(git rev-parse HEAD)" > /etc/yosemite-version \
RUN git clone -b $branch https://github.com/YosemiteLabs/yosemite-public-blockchain.git --recursive \
&& cd yosemite-public-blockchain && echo "$branch:$(git rev-parse HEAD)" > /etc/yosemite-version \
&& cmake -H. -B"/tmp/build" -GNinja -DCMAKE_BUILD_TYPE=Release -DWASM_ROOT=/opt/wasm -DCMAKE_CXX_COMPILER=clang++ \
-DCMAKE_C_COMPILER=clang -DCMAKE_INSTALL_PREFIX=/tmp/build -DBUILD_MONGO_DB_PLUGIN=true \
-DYOSEMITE_NATIVE_TOKEN_SYMBOL_NAME=$native_token_symbol -DYOSEMITE_NATIVE_TOKEN_PRECISION=$native_token_precision \
Expand All @@ -17,9 +16,9 @@ RUN apt-get update && DEBIAN_FRONTEND=noninteractive apt-get -y install openssl
COPY --from=builder /usr/local/lib/* /usr/local/lib/
COPY --from=builder /tmp/build/bin /opt/yosemite/bin
COPY --from=builder /tmp/build/contracts /contracts
COPY --from=builder /$repository_name/Docker/config.ini /
COPY --from=builder /yosemite-public-blockchain/Docker/config.ini /
COPY --from=builder /etc/yosemite-version /etc
COPY --from=builder /$repository_name/Docker/yosemited.sh /opt/yosemite/bin/yosemited.sh
COPY --from=builder /yosemite-public-blockchain/Docker/yosemited.sh /opt/yosemite/bin/yosemited.sh
ENV EOSIO_ROOT=/opt/yosemite
ENV YOSEMITE_ROOT=/opt/yosemite
RUN chmod +x /opt/yosemite/bin/yosemited.sh
Expand Down
4 changes: 2 additions & 2 deletions Docker/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,10 @@ cd yosemite-public-blockchain/Docker
docker build . -t yosemitex/yosemite
```

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:
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:

```bash
docker build -t yosemitex/yosemite:1.6.0 --build-arg branch=1.6.0 .
docker build -t yosemitex/yosemite:v1.6.3 --build-arg branch=v1.6.3 .
```

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.
Expand Down
4 changes: 2 additions & 2 deletions LICENSE
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,9 @@ met:
3. All advertising materials mentioning features or use of this
software must display the following acknowledgement:
"Powered by YOSEMITE" or
"This product includes software developed by the Yosemite X Inc."
"This product includes software developed by Yosemite X Inc."

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

Expand Down
10 changes: 3 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -85,13 +85,9 @@ even if it had been advised of the possibility of damage.


## Supported Operating Systems
1. Amazon 2017.09 and higher
2. Centos 7
3. Fedora 25 and higher (Fedora 27 recommended)
4. Mint 18
5. Ubuntu 16.04 (Ubuntu 16.10 recommended)
6. Ubuntu 18.04
7. MacOS Darwin 10.12 and higher (MacOS 10.13.x recommended)
1. Centos 7
2. Ubuntu 18.04
3. MacOS 10.13 and higher (MacOS 10.14.x recommended)



Expand Down
34 changes: 0 additions & 34 deletions contracts/yosemitelib/system_depository.hpp

This file was deleted.

41 changes: 41 additions & 0 deletions contracts/yosemitelib/transaction_vote.h
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ extern "C" {


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

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


/**
* Get Top Transaction Vote Receivers
* @brief Retrieve top transaction vote receiver list from blockchain core.
* Transaction votes are processed and accrued for each vote target account on blockchain core by YOSEMITE Proof-of-Transaction/Transaction-as-a-Vote protocol
* Smart contract code including system contract can retrieve the top transaction vote receiver list
* sorted by the accumulated time-decaying weighted transaction vote amount for each tx vote receiver account.
* The whole list of transaction vote receivers can be arbitrarily long,
* so the sorted list can be retrieved by multiple function call with different offset_rank and limit parameter values.
*
* @param buffer - a buffer to write the top sorted transaction vote receiver list data to,
* returned buffer memory contains array of 'yosemite_tx_vote_stat_for_account' struct
* @param size - the size of the buffer, 0 to return required size
* @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.
* e.g. if offset_rank = 0, the first item in the returned list is the top 1 vote receiver.
* @param limit - max limit of the returned item count
*
* @return the size of the sorted transaction vote receiver list data written to the buffer (array of 'yosemite_tx_vote_stat_for_account' struct),
* or number of bytes that can be copied if size==0 passed
* @pre `buffer` is a valid pointer to a range of memory at least `size` bytes long
* @post `buffer` is filled with packed transaction vote receiver list data
*/
size_t get_top_transaction_vote_receivers( char *buffer, size_t size, uint32_t offset_rank, uint32_t limit );

/**
* Get Total Weighted Transaction Votes
* @brief Retrieve the total weighted (time-decaying) transaction vote amount accumulated for all blockchain transactions in the blockchain history
*
* @return total weighted transaction vote amount
*/
double get_total_weighted_transaction_votes();


///@ } trxvoteapi
}

struct yosemite_transaction_vote {
uint64_t to; // account name
uint32_t amount;
};

struct yosemite_tx_vote_stat_for_account {
uint64_t account;
double tx_votes_weighted;
uint64_t tx_votes;
};
10 changes: 5 additions & 5 deletions contracts/yx.ntoken/yx.ntoken.cpp
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#include <yosemitelib/native_token.hpp>
#include <yosemitelib/system_accounts.hpp>
#include <yosemitelib/transaction_fee.hpp>
#include <yosemitelib/system_depository.hpp>
//#include <yosemitelib/system_depository.hpp>
#include <yosemitelib/transaction_vote.h>

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

require_auth(token.issuer);
eosio_assert(static_cast<uint32_t>(is_authorized_sys_depository(token.issuer)),
"issuer account is not system depository");
//eosio_assert(static_cast<uint32_t>(is_authorized_sys_depository(token.issuer)),
// "issuer account is not system depository");

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

require_auth(token.issuer);
eosio_assert(static_cast<uint32_t>(is_authorized_sys_depository(token.issuer)),
"issuer account is not system depository");
//eosio_assert(static_cast<uint32_t>(is_authorized_sys_depository(token.issuer)),
// "issuer account is not system depository");

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

0 comments on commit 53dee36

Please sign in to comment.