提交 c4768c29 编写于 作者: D Daniel Larimer

Merge branch 'master' of github.com:EOSIO/eos

FROM base/archlinux:latest
MAINTAINER Nathan Hourt <nat.hourt@gmail.com>
RUN pacman --noconfirm --needed -Syu clang ninja cmake git autoconf automake make m4 binutils pkg-config libtool fakeroot boost llvm
RUN mkdir /work
WORKDIR /work
COPY * /work/
RUN bash ./bootstrap.sh
FROM ubuntu:xenial-20170619
MAINTAINER xiaobo (peterwillcn@gmail.com)
RUN echo 'APT::Install-Recommends 0;' >> /etc/apt/apt.conf.d/01norecommends \
&& echo 'APT::Install-Suggests 0;' >> /etc/apt/apt.conf.d/01norecommends \
&& apt-get update \
&& DEBIAN_FRONTEND=noninteractive apt-get install -y vim sudo wget htop iftop net-tools ca-certificates unzip
RUN echo "deb http://apt.llvm.org/xenial/ llvm-toolchain-xenial-4.0 main" >> /etc/apt/sources.list.d/llvm.list \
&& echo "deb-src http://apt.llvm.org/xenial/ llvm-toolchain-xenial-4.0 main" >> /etc/apt/sources.list.d/llvm.list \
&& wget -O - http://apt.llvm.org/llvm-snapshot.gpg.key|sudo apt-key add - \
&& apt-get update \
&& DEBIAN_FRONTEND=noninteractive apt-get install -y git-core automake autoconf libtool make cmake build-essential automake pkg-config libtool \
mpi-default-dev libicu-dev python-dev python3-dev libbz2-dev zlib1g-dev clang libssl-dev \
clang-4.0 lldb-4.0 lld-4.0 \
&& rm -rf /var/lib/apt/lists/*
RUN cd /tmp && wget https://dl.bintray.com/boostorg/release/1.64.0/source/boost_1_64_0.tar.gz \
&& tar zxf boost_1_64_0.tar.gz \
&& cd boost_1_64_0 \
&& ./bootstrap.sh --with-toolset=clang \
&& ./b2 -a -j$(nproc) stage release -sHAVE_ICU=1 --sICU_PATH=/usr \
&& ./b2 install --prefix=/usr \
&& rm -rf /tmp/boost_1_64_0*
RUN update-alternatives --install /usr/bin/clang clang /usr/lib/llvm-4.0/bin/clang 400 \
&& update-alternatives --install /usr/bin/clang++ clang++ /usr/lib/llvm-4.0/bin/clang++ 400
RUN cd /tmp && git clone https://github.com/cryptonomex/secp256k1-zkp.git \
&& tar zcf secp256k1-zkp.tgz secp256k1-zkp && cd secp256k1-zkp \
&& ./autogen.sh && ./configure && make && make install \
&& ldconfig && rm -rf /tmp/secp256k1-zkp*
RUN cd /tmp && git clone https://github.com/EOSIO/eos.git --recursive \
&& cd eos && mkdir build && cd build \
&& cmake -DCMAKE_CXX_COMPILER=clang++ -DCMAKE_C_COMPILER=clang -DCMAKE_CXX_STANDARD=14 -DCMAKE_INSTALL_PREFIX=/opt/eos ../ \
&& make -j$(nproc) && make install \
&& rm -rf /tmp/eos*
RUN mkdir -p /opt/eos/bin/data-dir
COPY config.ini genesis.json /
COPY entrypoint.sh /sbin
RUN cd /opt/eos/bin && chmod +x /sbin/entrypoint.sh
VOLUME /opt/eos/bin/data-dir
EXPOSE 9876 8888
ENTRYPOINT ["/sbin/entrypoint.sh"]
# Maintainer: Nathan Hourt <nat.hourt@gmail.com>
pkgname=libsecp256k1-zkp-cnx
pkgver=20150529
pkgrel=1
pkgdesc="Optimized C library for EC operations on curve secp256k1 (Cryptonomex fork)"
arch=('i686' 'x86_64')
url="https://github.com/cryptonomex/secp256k1-zkp"
makedepends=('autoconf' 'automake' 'libtool' 'git' 'm4' 'make' 'pkg-config')
license=('MIT')
source=(${pkgname%-git}::git+https://github.com/cryptonomex/secp256k1-zkp)
sha256sums=('SKIP')
provides=('libsecp256k1' 'secp256k1')
conflicts=('libsecp256k1' 'secp256k1')
pkgver() {
cd ${pkgname%-git}
git log -1 --format="%cd" --date=short | sed "s|-||g"
}
build() {
cd ${pkgname%-git}
msg2 'Building...'
./autogen.sh
./configure \
--prefix=/usr \
--sbindir=/usr/bin \
--libexecdir=/usr/lib/libsecp256k1 \
--sysconfdir=/etc \
--sharedstatedir=/usr/share/libsecp256k1 \
--localstatedir=/var/lib/libsecp256k1 \
--disable-tests \
--with-gnu-ld
make
}
package() {
cd ${pkgname%-git}
msg2 'Installing license...'
install -Dm 644 COPYING -t "$pkgdir/usr/share/licenses/libsecp256k1"
msg2 'Installing documentation'
install -Dm 644 README.md -t "$pkgdir/usr/share/doc/libsecp256k1"
msg2 'Installing...'
make DESTDIR="$pkgdir" install
msg2 'Cleaning up pkgdir...'
find "$pkgdir" -type d -name .git -exec rm -r '{}' +
find "$pkgdir" -type f -name .gitignore -exec rm -r '{}' +
}
## Example Dockerfile
### Run in docker
This is an example Dockerfile, which demonstrates how to build Eos successfully. At present, it is not intended for any other purposes than documentation.
So simple and fast operation EOS:
- [Docker](https://docs.docker.com)
- [Docker-compose](https://github.com/docker/compose)
- [Docker-volumes](https://github.com/cpuguy83/docker-volumes)
Build eos images
```
cd eos/Docker
cp ../genesis.json .
docker build -t eosio/eos .
```
Start docker
```
sudo mkdir -p /data/store/eos
docker-compose -f docker-compose.yml up
```
Done
mkdir -m 777 secp
mv PKGBUILD secp
cd secp
su -s /bin/bash -c makepkg nobody
pacman --noconfirm -U libsecp256k1-zkp-cnx-20150529-1-x86_64.pkg.tar.xz
cd ..
rm -rf secp Dockerfile README.md bootstrap.sh
git clone https://github.com/eosio/eos --recursive
cd eos
cmake -G Ninja -DCMAKE_CXX_COMPILER=clang++ -DCMAKE_C_COMPILER=clang .
ninja
# File to read Genesis State from
# genesis-json =
genesis-json = "/opt/eos/bin/data-dir/genesis.json"
# the location of the block log (absolute path or relative to application data dir)
block-log-dir = "blocks"
# Pairs of [BLOCK_NUM,BLOCK_ID] that should be enforced as checkpoints.
# checkpoint =
# open the database in read only mode
readonly = 0
# the location of the chain shared memory files (absolute path or relative to application data dir)
shared-file-dir = "blockchain"
# Minimum size MB of database shared memory file
shared-file-size = 8192
# The local IP and port to listen for incoming http connections.
http-server-endpoint = 127.0.0.1:8888
# The local IP address and port to listen for incoming connections.
listen-endpoint = 127.0.0.1:9876
# The IP address and port of a remote peer to sync with.
# remote-endpoint =
# The public IP address and port that should be advertized to peers.
public-endpoint = 0.0.0.0:9876
# Enable block production, even if the chain is stale.
enable-stale-production = true
# Percent of producers (0-99) that must be participating in order to produce blocks
required-participation = false
# ID of producer controlled by this node (e.g. "init0", quotes are required, may specify multiple times)
# producer-name =
producer-name = init0
producer-name = init1
producer-name = init2
producer-name = init3
producer-name = init4
producer-name = init5
producer-name = init6
producer-name = init7
producer-name = init8
producer-name = init9
producer-name = init10
producer-name = init11
producer-name = init12
producer-name = init13
producer-name = init14
producer-name = init15
producer-name = init16
producer-name = init17
producer-name = init18
producer-name = init19
producer-name = init20
# Tuple of [PublicKey, WIF private key] (may specify multiple times)
private-key = ["EOS6MRyAjQq8ud7hVNYcfnVPJqcVpscN5So8BhtHuGYqET5GDW5CV","5KQwrPbwdL6PhXujxW37FSSQZ1JiwsST4cqQzDeyXtP79zkvFD3"]
# Plugin(s) to enable, may be specified multiple times
# plugin =
plugin = eos::producer_plugin
version: "2"
services:
eos:
image: eosio/eos
ports:
- "8888:8888"
- "9876:9876"
volumes:
- /data/store/eos:/opt/eos/bin/data-dir
#!/bin/sh
cd /opt/eos/bin
if [ -f '/opt/eos/bin/data-dir/config.ini' ]
then
echo
else
cp /config.ini /opt/eos/bin/data-dir
fi
if [ -f '/opt/eos/bin/data-dir/genesis.json' ]
then
echo
else
cp /genesis.json /opt/eos/bin/data-dir
fi
exec /opt/eos/bin/eosd
......@@ -78,3 +78,28 @@ plugin = eos::producer_plugin
```
Now it should be possible to run `eosd` and see it begin producing blocks. At present, the P2P code is not implemented, so only single-node configurations are possible. When the P2P networking is implemented, this instructions will be updated to show how to create an example multi-node testnet.
### Run in docker
So simple and fast operation EOS:
- [Docker](https://docs.docker.com)
- [Docker-compose](https://github.com/docker/compose)
- [Docker-volumes](https://github.com/cpuguy83/docker-volumes)
Build eos images
```
cd eos/Docker
cp ../genesis.json .
docker build -t eosio/eos .
```
Start docker
```
sudo mkdir -p /data/store/eos
docker-compose -f docker-compose.yml up
```
Done
......@@ -822,7 +822,7 @@ void chain_controller::initialize_chain(chain_initializer_interface& starter)
_db.create<block_summary_object>([&](block_summary_object&) {});
auto messages = starter.prepare_database(*this, _db);
std::for_each(messages.begin(), messages.end(), [this](const auto& m) { process_message(m); });
std::for_each(messages.begin(), messages.end(), [this](const Message& m) { process_message(m); });
});
}
} FC_CAPTURE_AND_RETHROW() }
......
......@@ -430,13 +430,67 @@ namespace IR
visitOp(SIMDOP(108),i16x8_ge_s,"i16x8.ge_s",NoImm,BINARY(v128,v128)) \
visitOp(SIMDOP(109),i16x8_ge_u,"i16x8.ge_u",NoImm,BINARY(v128,v128)) \
visitOp(SIMDOP(110),i32x4_ge_s,"i32x4.ge_s",NoImm,BINARY(v128,v128)) \
visitOp(SIMDOP(111),i32x4_ge_u,"i32x4.ge_u",NoImm,BINARY(v128,v128)) \
\
visitOp(SIMDOP(136),i32x4_trunc_s_f32x4_sat,"i32x4.trunc_s/f32x4:sat",NoImm,UNARY(v128,v128)) \
visitOp(SIMDOP(137),i32x4_trunc_u_f32x4_sat,"i32x4.trunc_u/f32x4:sat",NoImm,UNARY(v128,v128)) \
visitOp(SIMDOP(138),i64x2_trunc_s_f64x2_sat,"i64x2.trunc_s/f64x2:sat",NoImm,UNARY(v128,v128)) \
visitOp(SIMDOP(139),i64x2_trunc_u_f64x2_sat,"i64x2.trunc_u/f64x2:sat",NoImm,UNARY(v128,v128))
visitOp(SIMDOP(111),i32x4_ge_u,"i32x4.ge_u",NoImm,BINARY(v128,v128))
#define ENUM_FLOAT_SIMD_OPERATORS(visitOp) \
visitOp(SIMDOP(7),f32x4_splat,"f32x4.splat",NoImm,UNARY(f32,v128)) \
visitOp(SIMDOP(8),f64x2_splat,"f64x2.splat",NoImm,UNARY(f64,v128)) \
\
visitOp(SIMDOP(15),f32x4_extract_lane,"f32x4.extract_lane",LaneIndexImm<4>,UNARY(v128,f32)) \
visitOp(SIMDOP(16),f64x2_extract_lane,"f64x2.extract_lane",LaneIndexImm<2>,UNARY(v128,f64)) \
\
visitOp(SIMDOP(21),f32x4_replace_lane,"f32x4.replace_lane",LaneIndexImm<4>,REPLACELANE(f32,v128)) \
visitOp(SIMDOP(22),f64x2_replace_lane,"f64x2.replace_lane",LaneIndexImm<2>,REPLACELANE(f64,v128)) \
\
visitOp(SIMDOP(75),f32x4_eq,"f32x4.eq",NoImm,BINARY(v128,v128)) \
visitOp(SIMDOP(76),f64x2_eq,"f64x2.eq",NoImm,BINARY(v128,v128)) \
\
visitOp(SIMDOP(80),f32x4_ne,"f32x4.ne",NoImm,BINARY(v128,v128)) \
visitOp(SIMDOP(81),f64x2_ne,"f64x2.ne",NoImm,BINARY(v128,v128)) \
\
visitOp(SIMDOP(88),f32x4_lt,"f32x4.lt",NoImm,BINARY(v128,v128)) \
visitOp(SIMDOP(89),f64x2_lt,"f64x2.lt",NoImm,BINARY(v128,v128)) \
\
visitOp(SIMDOP(96),f32x4_le,"f32x4.le",NoImm,BINARY(v128,v128)) \
visitOp(SIMDOP(97),f64x2_le,"f64x2.le",NoImm,BINARY(v128,v128)) \
\
visitOp(SIMDOP(104),f32x4_gt,"f32x4.gt",NoImm,BINARY(v128,v128)) \
visitOp(SIMDOP(105),f64x2_gt,"f64x2.gt",NoImm,BINARY(v128,v128)) \
\
visitOp(SIMDOP(112),f32x4_ge,"f32x4.ge",NoImm,BINARY(v128,v128)) \
visitOp(SIMDOP(113),f64x2_ge,"f64x2.ge",NoImm,BINARY(v128,v128)) \
\
visitOp(SIMDOP(114),f32x4_neg,"f32x4.neg",NoImm,UNARY(v128,v128)) \
visitOp(SIMDOP(115),f64x2_neg,"f64x2.neg",NoImm,UNARY(v128,v128)) \
\
visitOp(SIMDOP(116),f32x4_abs,"f32x4.abs",NoImm,UNARY(v128,v128)) \
visitOp(SIMDOP(117),f64x2_abs,"f64x2.abs",NoImm,UNARY(v128,v128)) \
\
visitOp(SIMDOP(118),f32x4_min,"f32x4.min",NoImm,BINARY(v128,v128)) \
visitOp(SIMDOP(119),f64x2_min,"f64x2.min",NoImm,BINARY(v128,v128)) \
\
visitOp(SIMDOP(120),f32x4_max,"f32x4.max",NoImm,BINARY(v128,v128)) \
visitOp(SIMDOP(121),f64x2_max,"f64x2.max",NoImm,BINARY(v128,v128)) \
\
visitOp(SIMDOP(122),f32x4_add,"f32x4.add",NoImm,BINARY(v128,v128)) \
visitOp(SIMDOP(123),f64x2_add,"f64x2.add",NoImm,BINARY(v128,v128)) \
\
visitOp(SIMDOP(124),f32x4_sub,"f32x4.sub",NoImm,BINARY(v128,v128)) \
visitOp(SIMDOP(125),f64x2_sub,"f64x2.sub",NoImm,BINARY(v128,v128)) \
\
visitOp(SIMDOP(126),f32x4_div,"f32x4.div",NoImm,BINARY(v128,v128)) \
visitOp(SIMDOP(127),f64x2_div,"f64x2.div",NoImm,BINARY(v128,v128)) \
\
visitOp(SIMDOP(128),f32x4_mul,"f32x4.mul",NoImm,BINARY(v128,v128)) \
visitOp(SIMDOP(129),f64x2_mul,"f64x2.mul",NoImm,BINARY(v128,v128)) \
\
visitOp(SIMDOP(130),f32x4_sqrt,"f32x4.sqrt",NoImm,UNARY(v128,v128)) \
visitOp(SIMDOP(131),f64x2_sqrt,"f64x2.sqrt",NoImm,UNARY(v128,v128)) \
\
visitOp(SIMDOP(132),f32x4_convert_s_i32x4,"f32x4.convert_s/i32x4",NoImm,UNARY(v128,v128)) \
visitOp(SIMDOP(133),f32x4_convert_u_i32x4,"f32x4.convert_u/i32x4",NoImm,UNARY(v128,v128)) \
visitOp(SIMDOP(134),f64x2_convert_s_i64x2,"f64x2.convert_s/i64x2",NoImm,UNARY(v128,v128)) \
visitOp(SIMDOP(135),f64x2_convert_u_i64x2,"f64x2.convert_u/i64x2",NoImm,UNARY(v128,v128)) \
\
visitOp(SIMDOP(136),i32x4_trunc_s_f32x4_sat,"i32x4.trunc_s/f32x4:sat",NoImm,UNARY(v128,v128)) \
visitOp(SIMDOP(137),i32x4_trunc_u_f32x4_sat,"i32x4.trunc_u/f32x4:sat",NoImm,UNARY(v128,v128)) \
visitOp(SIMDOP(138),i64x2_trunc_s_f64x2_sat,"i64x2.trunc_s/f64x2:sat",NoImm,UNARY(v128,v128)) \
......
......@@ -38,8 +38,6 @@
using std::string;
using std::vector;
namespace bpo = boost::program_options;
namespace eos {
class producer_plugin_impl {
......@@ -98,11 +96,11 @@ void producer_plugin::set_program_options(
eos::utilities::key_to_wif(default_priv_key));
command_line_options.add_options()
("enable-stale-production", bpo::bool_switch()->notifier([this](bool e){my->_production_enabled = e;}), "Enable block production, even if the chain is stale.")
("required-participation", bpo::bool_switch()->notifier([this](int e){my->_required_producer_participation = uint32_t(e*config::Percent1);}), "Percent of producers (0-99) that must be participating in order to produce blocks")
("producer-name,p", bpo::value<vector<string>>()->composing()->multitoken(),
("enable-stale-production", boost::program_options::bool_switch()->notifier([this](bool e){my->_production_enabled = e;}), "Enable block production, even if the chain is stale.")
("required-participation", boost::program_options::bool_switch()->notifier([this](int e){my->_required_producer_participation = uint32_t(e*config::Percent1);}), "Percent of producers (0-99) that must be participating in order to produce blocks")
("producer-name,p", boost::program_options::value<vector<string>>()->composing()->multitoken(),
("ID of producer controlled by this node (e.g. " + producer_id_example + ", quotes are required, may specify multiple times)").c_str())
("private-key", bpo::value<vector<string>>()->composing()->multitoken()->default_value({fc::json::to_string(private_key_default)},
("private-key", boost::program_options::value<vector<string>>()->composing()->multitoken()->default_value({fc::json::to_string(private_key_default)},
fc::json::to_string(private_key_default)),
"Tuple of [PublicKey, WIF private key] (may specify multiple times)")
;
......
......@@ -30,14 +30,14 @@ BOOST_AUTO_TEST_CASE(median_properties_test)
votes.emplace_back(BlockchainConfiguration{1, 1, 1, 1, 1, 1, 1});
votes.emplace_back(BlockchainConfiguration{1, 1, 1, 1, 1, 1, 1});
medians = {1024, 100, 1000, Asset(3333).amount, Asset(50).amount, Asset(50).amount, 100};
medians = BlockchainConfiguration {1024, 100, 1000, Asset(3333).amount, Asset(50).amount, Asset(50).amount, 100};
BOOST_CHECK_EQUAL(BlockchainConfiguration::get_median_values(votes), medians);
BOOST_CHECK_EQUAL(BlockchainConfiguration::get_median_values({medians}), medians);
votes.erase(votes.begin() + 2);
votes.erase(votes.end() - 1);
medians = {1024, 100, 1024, Asset(3333).amount, Asset(50).amount, Asset(100).amount, 100};
medians = BlockchainConfiguration {1024, 100, 1024, Asset(3333).amount, Asset(50).amount, Asset(100).amount, 100};
BOOST_CHECK_EQUAL(BlockchainConfiguration::get_median_values(votes), medians);
} FC_LOG_AND_RETHROW() }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册