Skip to content

Commit

Permalink
Merge pull request EOSIO#179 from enumivo/v1
Browse files Browse the repository at this point in the history
V1
  • Loading branch information
Enumivo authored Jun 2, 2018
2 parents 4c3d0f8 + aad0fb3 commit 20a3cf5
Show file tree
Hide file tree
Showing 29 changed files with 170,255 additions and 114 deletions.
14 changes: 6 additions & 8 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
cmake_minimum_required( VERSION 3.5 )

# Defines Enumivo library target.
project( Enumivo )

enable_testing()
Expand Down Expand Up @@ -29,20 +28,19 @@ set( INSTALLER_APP_ID "68ad7005-8eee-49c9-95ce-9eed97e5b347" )

# http://stackoverflow.com/a/18369825
if("${CMAKE_CXX_COMPILER_ID}" STREQUAL "GNU")
if (CMAKE_CXX_COMPILER_VERSION VERSION_LESS 4.8)
message(FATAL_ERROR "GCC version must be at least 4.8!")
if (CMAKE_CXX_COMPILER_VERSION VERSION_LESS 6.0)
message(FATAL_ERROR "GCC version must be at least 6.0!")
endif()
elseif ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "Clang")
if (CMAKE_CXX_COMPILER_VERSION VERSION_LESS 3.3)
message(FATAL_ERROR "Clang version must be at least 3.3!")
if (CMAKE_CXX_COMPILER_VERSION VERSION_LESS 4.0)
message(FATAL_ERROR "Clang version must be at least 4.0!")
endif()
endif()


set(CMAKE_EXPORT_COMPILE_COMMANDS "ON")
set(BUILD_DOXYGEN FALSE CACHE BOOL "Build doxygen documentation on every make")
set(BUILD_MONGO_DB_PLUGIN FALSE CACHE BOOL "Build mongo database plugin")
set(ENU_EGENESIS_JSON "${CMAKE_CURRENT_SOURCE_DIR}/genesis.json" )

#set (USE_PCH 1)

Expand Down Expand Up @@ -187,7 +185,7 @@ string(TOUPPER ${CORE_SYMBOL_NAME} CORE_SYMBOL_NAME)

string(LENGTH ${CORE_SYMBOL_NAME} CORE_SYMBOL_NAME_LENGTH)
if (CORE_SYMBOL_NAME_LENGTH GREATER 7)
message(FATAL_ERROR "CORE_SYMBOL_NAME lenght must be a between 1 and 7 characters")
message(FATAL_ERROR "CORE_SYMBOL_NAME length must be between 1 and 7 characters")
endif()

message( STATUS "Using '${CORE_SYMBOL_NAME}' as CORE symbol name" )
Expand All @@ -196,7 +194,7 @@ if ("${ENUMIVO_ROOT_KEY}" STREQUAL "")
set(ENUMIVO_ROOT_KEY "ENU6MRyAjQq8ud7hVNYcfnVPJqcVpscN5So8BhtHuGYqET5GDW5CV")
endif()

message( STATUS "Using '${ENUMIVO_ROOT_KEY}' as public key for enumivo account" )
message( STATUS "Using '${ENUMIVO_ROOT_KEY}' as public key for 'enumivo' account" )

include(wasm)

Expand Down
2 changes: 1 addition & 1 deletion CMakeModules/doxygen.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ include(FindDoxygen)
if(NOT DOXYGEN_FOUND)
message(STATUS "Doxygen not found. Contract documentation will not be generated.")
else()
set(DOXY_ENU_VERSION "${VERSION_MAJOR}.${VERSION_MINOR}" CACHE INTERNAL "Version string used in PROJECT_NUMBER.")
set(DOXY_ENU_VERSION "${VERSION_MAJOR}.${VERSION_MINOR}.${VERSION_PATCH}" CACHE INTERNAL "Version string used in PROJECT_NUMBER.")
# CMake strips trailing path separators off of variables it knows are paths,
# so the trailing '/' Doxygen expects is embedded in the doxyfile.
set(DOXY_DOC_DEST_DIR "${CMAKE_BINARY_DIR}/docs" CACHE PATH "Path to the doxygen output")
Expand Down
23 changes: 11 additions & 12 deletions Docker/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,10 @@ cd enumivo/Docker
docker build . -t enumivo/enumivo
```

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 dawn-v4.0.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 v1.0.0 tag, you could do the following:

```bash
docker build -t enumivo/enumivo:dawn-v4.0.0 --build-arg branch=dawn-v4.0.0 .
docker build -t enumivo/enumivo:v1.0.0 --build-arg branch=v1.0.0 .
```

By default, the symbol in enumivo.system is set to ENU. You can override this using the symbol argument while building the docker image.
Expand All @@ -35,7 +35,7 @@ docker build -t enumivo/enumivo --build-arg symbol=<symbol> .
## Start enunode docker container only

```bash
docker run --name enunode -p 8888:8888 -p 9876:9876 -t enumivo/enumivo enunoded.sh arg1 arg2
docker run --name enunode -p 8888:8888 -p 9876:9876 -t enumivo/enumivo enunoded.sh -e arg1 arg2
```

By default, all data is persisted in a docker volume. It can be deleted if the data is outdated or corrupted:
Expand All @@ -49,7 +49,7 @@ $ docker volume rm fdc265730a4f697346fa8b078c176e315b959e79365fc9cbd11f090ea0cb5
Alternately, you can directly mount host directory into the container

```bash
docker run --name enunode -v /path-to-data-dir:/opt/enumivo/bin/data-dir -p 8888:8888 -p 9876:9876 -t enumivo/enumivo enunoded.sh arg1 arg2
docker run --name enumivo -v /path-to-data-dir:/opt/enumivo/bin/data-dir -p 8888:8888 -p 9876:9876 -t enumivo/enumivo enunoded.sh -e arg1 arg2
```

## Get chain info
Expand Down Expand Up @@ -142,7 +142,7 @@ version: "3"
services:
enunoded:
image: enumivo/enumivo:latest
command: /opt/enumivo/bin/enunoded.sh
command: /opt/enumivo/bin/enunoded.sh -e
hostname: enunoded
ports:
- 8888:8888
Expand Down Expand Up @@ -173,28 +173,27 @@ run `docker pull enumivo/enumivo:latest`

run `docker-compose up`

### Dawn 4.2 Testnet
### Enumivo 1.0 Testnet

We can easily set up a Dawn 4.2 local testnet using docker images. Just run the following commands:
We can easily set up a Enumivo 1.0 local testnet using docker images. Just run the following commands:

Note: if you want to use the mongo db plugin, you have to enable it in your `data-dir/config.ini` first.

```
# pull images
docker pull enumivo/enumivo:20180528
docker pull mongo:latest
docker pull enumivo/enumivo:v1.0.0
# create volume
docker volume create --name=enunode-data-volume
docker volume create --name=enuwallet-data-volume
docker volume create --name=mongo-data-volume
# start containers
docker-compose -f docker-compose-dawn4.2.yaml up -d
docker-compose -f docker-compose-enumivo1.0.yaml up -d
# get chain info
curl http://127.0.0.1:8888/v1/chain/get_info
# get logs
docker-compose logs -f enunoded
# stop containers
docker-compose -f docker-compose-dawn4.2.yaml down
docker-compose -f docker-compose-enumivo1.0.yaml down
```

The `blocks` data are stored under `--data-dir` by default, and the wallet files are stored under `--wallet-dir` by default, of course you can change these as you want.
Expand Down
171 changes: 121 additions & 50 deletions Docker/config.ini
Original file line number Diff line number Diff line change
@@ -1,95 +1,166 @@
# Track only transactions whose scopes involve the listed accounts. Default is to track all transactions.
# filter_on_accounts =
# the endpoint upon which to listen for incoming connections (enumivo::bnet_plugin)
bnet-endpoint = 0.0.0.0:4321

# Limits the maximum time (in milliseconds) processing a single get_transactions call.
get-transactions-time-limit = 3
# the number of threads to use to process network messages (enumivo::bnet_plugin)
# bnet-threads =

# File to read Genesis State from
genesis-json = /opt/enumivo/bin/data-dir/genesis.json
# remote endpoint of other node to connect to; Use multiple bnet-connect options as needed to compose a network (enumivo::bnet_plugin)
# bnet-connect =

# override the initial timestamp in the Genesis State file
# genesis-timestamp =
# this peer will request no pending transactions from other nodes (enumivo::bnet_plugin)
bnet-no-trx = false

# the location of the block log (absolute path or relative to application data dir)
block-log-dir = "blocks"
# the location of the blocks directory (absolute path or relative to application data dir) (enumivo::chain_plugin)
blocks-dir = "blocks"

# Pairs of [BLOCK_NUM,BLOCK_ID] that should be enforced as checkpoints.
# Pairs of [BLOCK_NUM,BLOCK_ID] that should be enforced as checkpoints. (enumivo::chain_plugin)
# checkpoint =

# the location of the chain shared memory files (absolute path or relative to application data dir)
shared-file-dir = "blockchain"
# Override default WASM runtime (enumivo::chain_plugin)
# wasm-runtime =

# Minimum size MB of database shared memory file
shared-file-size = 8192
# Maximum size (in MB) of the chain state database (enumivo::chain_plugin)
chain-state-db-size-mb = 8192

# The local IP and port to listen for incoming http connections.
http-server-address = 0.0.0.0:8888
# Maximum size (in MB) of the reversible blocks database (enumivo::chain_plugin)
reversible-blocks-db-size-mb = 340

# Specify the Access-Control-Allow-Origin to be returned on each request.
# print contract's output to console (enumivo::chain_plugin)
contracts-console = false

# Account added to actor whitelist (may specify multiple times) (enumivo::chain_plugin)
# actor-whitelist =

# Account added to actor blacklist (may specify multiple times) (enumivo::chain_plugin)
# actor-blacklist =

# Contract account added to contract whitelist (may specify multiple times) (enumivo::chain_plugin)
# contract-whitelist =

# Contract account added to contract blacklist (may specify multiple times) (enumivo::chain_plugin)
# contract-blacklist =

# Track actions which match receiver:action:actor. Actor may be blank to include all. Receiver and Action may not be blank. (enumivo::history_plugin)
# filter-on =

# PEM encoded trusted root certificate (or path to file containing one) used to validate any TLS connections made. (may specify multiple times)
# (enumivo::http_client_plugin)
# https-client-root-cert =

# true: validate that the peer certificates are valid and trusted, false: ignore cert errors (enumivo::http_client_plugin)
https-client-validate-peers = 1

# The local IP and port to listen for incoming http connections; set blank to disable. (enumivo::http_plugin)
http-server-address = 127.0.0.1:8888

# The local IP and port to listen for incoming https connections; leave blank to disable. (enumivo::http_plugin)
# https-server-address =

# Filename with the certificate chain to present on https connections. PEM format. Required for https. (enumivo::http_plugin)
# https-certificate-chain-file =

# Filename with https private key in PEM format. Required for https (enumivo::http_plugin)
# https-private-key-file =

# Specify the Access-Control-Allow-Origin to be returned on each request. (enumivo::http_plugin)
# access-control-allow-origin =

# Specify the Access-Control-Allow-Headers to be returned on each request.
# Specify the Access-Control-Allow-Headers to be returned on each request. (enumivo::http_plugin)
# access-control-allow-headers =

# Specify if Access-Control-Allow-Credentials: true should be returned on each request.
# Specify the Access-Control-Max-Age to be returned on each request. (enumivo::http_plugin)
# access-control-max-age =

# Specify if Access-Control-Allow-Credentials: true should be returned on each request. (enumivo::http_plugin)
access-control-allow-credentials = false

# The actual host:port used to listen for incoming p2p connections.
# The actual host:port used to listen for incoming p2p connections. (enumivo::net_plugin)
p2p-listen-endpoint = 0.0.0.0:9876

# An externally accessible host:port for identifying this node. Defaults to p2p-listen-endpoint.
# An externally accessible host:port for identifying this node. Defaults to p2p-listen-endpoint. (enumivo::net_plugin)
# p2p-server-address =

# The public endpoint of a peer node to connect to. Use multiple p2p-peer-address options as needed to compose a network.
# The public endpoint of a peer node to connect to. Use multiple p2p-peer-address options as needed to compose a network. (enumivo::net_plugin)
# p2p-peer-address =

# The name supplied to identify this node amongst the peers.
agent-name = "Enumivo Test Agent"
# Maximum number of client0nodes from any single IP address (enumivo::net_plugin)
p2p-max-nodes-per-host = 1

# True to always send full blocks, false to send block summaries
send-whole-blocks = 1
# The name supplied to identify this node amongst the peers. (enumivo::net_plugin)
agent-name = "Enumivo Test Agent"

# Can be 'any' or 'producers' or 'specified' or 'none'. If 'specified', peer-key must be specified at least once. If only 'producers', peer-key is not required. 'producers' and 'specified' may be combined.
# Can be 'any' or 'producers' or 'specified' or 'none'. If 'specified', peer-key must be specified at least once. If only 'producers', peer-key is not required. 'producers' and 'specified' may be combined. (enumivo::net_plugin)
allowed-connection = any

# Optional public key of peer allowed to connect. May be used multiple times.
# Optional public key of peer allowed to connect. May be used multiple times. (enumivo::net_plugin)
# peer-key =

# Tuple of [PublicKey, WIF private key] (may specify multiple times)
# Tuple of [PublicKey, WIF private key] (may specify multiple times) (enumivo::net_plugin)
# peer-private-key =
# Log level: one of 'all', 'debug', 'info', 'warn', 'error', or 'off'
log-level-net-plugin = info

# Maximum number of clients from which connections are accepted, use 0 for no limit
# Maximum number of clients from which connections are accepted, use 0 for no limit (enumivo::net_plugin)
max-clients = 25

# number of seconds to wait before cleaning up dead connections
# number of seconds to wait before cleaning up dead connections (enumivo::net_plugin)
connection-cleanup-period = 30

# True to require exact match of peer network version.
# True to require exact match of peer network version. (enumivo::net_plugin)
network-version-match = 0

# Enable block production, even if the chain is stale.
enable-stale-production = true
# number of blocks to retrieve in a chunk from any individual peer during synchronization (enumivo::net_plugin)
sync-fetch-span = 100

# Percent of producers (0-100) that must be participating in order to produce blocks
required-participation = 33
# maximum sizes of transaction or block messages that are sent without first sending a notice (enumivo::net_plugin)
max-implicit-request = 1500

# ID of producer controlled by this node (e.g. inita; may specify multiple times)
# Enable block production, even if the chain is stale. (enumivo::producer_plugin)
enable-stale-production = false

# Start this node in a state where production is paused (enumivo::producer_plugin)
pause-on-startup = false

# Limits the maximum time (in milliseconds) that is allowed a pushed transaction's code to execute before being considered invalid (enumivo::producer_plugin)
max-transaction-time = 30

# Limits the maximum age (in seconds) of the DPOS Irreversible Block for a chain this node will produce blocks on (use negative value to indicate unlimited) (enumivo::producer_plugin)
max-irreversible-block-age = -1

# ID of producer controlled by this node (e.g. inita; may specify multiple times) (enumivo::producer_plugin)
# producer-name =
producer-name = enumivo

# (DEPRECATED - Use signature-provider instead) Tuple of [public key, WIF private key] (may specify multiple times) (enumivo::producer_plugin)
# private-key =

# Key=Value pairs in the form <public-key>=<provider-spec>
# Where:
# <public-key> is a string form of a vaild Enumivo public key
#
# <provider-spec> is a string in the form <provider-type>:<data>
#
# <provider-type> is KEY, or ENUWALLET
#
# KEY:<data> is a string form of a valid Enumivo private key which maps to the provided public key
#
# ENUWALLET:<data> is the URL where enuwallet is available and the approptiate wallet(s) are unlocked (enumivo::producer_plugin)
signature-provider = ENU6MRyAjQq8ud7hVNYcfnVPJqcVpscN5So8BhtHuGYqET5GDW5CV=KEY:5KQwrPbwdL6PhXujxW37FSSQZ1JiwsST4cqQzDeyXtP79zkvFD3

# Tuple of [public key, WIF private key] (may specify multiple times)
private-key = ["ENU6MRyAjQq8ud7hVNYcfnVPJqcVpscN5So8BhtHuGYqET5GDW5CV","5KQwrPbwdL6PhXujxW37FSSQZ1JiwsST4cqQzDeyXtP79zkvFD3"]
# Limits the maximum time (in milliseconds) that is allowd for sending blocks to a enuwallet provider for signing (enumivo::producer_plugin)
enuwallet-provider-timeout = 5

# Lag in number of blocks from the head block when selecting the reference block for transactions (-1 means Last Irreversible Block) (enumivo::txn_test_gen_plugin)
txn-reference-block-lag = 0

# The path of the wallet files (absolute path or relative to application data dir) (enumivo::wallet_plugin)
wallet-dir = "."

# Timeout for unlocked wallet in seconds (default 900 (15 minutes)). Wallets will automatically lock after specified number of seconds of inactivity. Activity is defined as any wallet command e.g. list-wallets. (enumivo::wallet_plugin)
unlock-timeout = 900

# enumivo key that will be imported automatically when a wallet is created. (enumivo::wallet_plugin)
# enumivo-key =

# Plugin(s) to enable, may be specified multiple times
# plugin =
# Plugin(s) to enable, may be specified multiple times
plugin = enumivo::producer_plugin
plugin = enumivo::chain_api_plugin
plugin = enumivo::wallet_api_plugin
plugin = enumivo::history_api_plugin
plugin = enumivo::http_plugin
# plugin = enumivo::mongo_db_plugin

# Enable block production with the testnet producers
producer-name = enumivo
Original file line number Diff line number Diff line change
@@ -1,20 +1,10 @@
version: "3"

services:
mongo:
image: mongo:latest
hostname: mongo
ports:
- 27017:27017
volumes:
- mongo-data-volume:/data/db

enunoded:
image: enumivo/enumivo:20180528
command: /opt/enumivo/bin/enunoded.sh --data-dir /opt/enumivo/bin/data-dir --delete-all-blocks #--mongodb-uri mongodb://mongo:27017/ENU
image: enumivo/enumivo:v1.0.0
command: /opt/enumivo/bin/enunoded.sh --data-dir /opt/enumivo/bin/data-dir -e
hostname: enunoded
links:
- mongo
ports:
- 8888:8888
- 9876:9876
Expand All @@ -24,7 +14,7 @@ services:
- enunode-data-volume:/opt/enumivo/bin/data-dir

enuwallet:
image: enumivo/enumivo:20180528
image: enumivo/enumivo:v1.0.0
command: /opt/enumivo/bin/enuwallet --wallet-dir /opt/enumivo/bin/data-dir --http-server-address=127.0.0.1:8900
hostname: enuwallet
links:
Expand All @@ -33,8 +23,6 @@ services:
- enuwallet-data-volume:/opt/enumivo/bin/data-dir

volumes:
mongo-data-volume:
external: true
enunode-data-volume:
external: true
enuwallet-data-volume:
Expand Down
Loading

0 comments on commit 20a3cf5

Please sign in to comment.