Skip to content

Commit

Permalink
snapshot 2018/04/01
Browse files Browse the repository at this point in the history
  • Loading branch information
ryscheng committed Apr 1, 2018
0 parents commit dce901f
Show file tree
Hide file tree
Showing 253 changed files with 15,006 additions and 0 deletions.
82 changes: 82 additions & 0 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,82 @@
version: 2
jobs:
build:
docker:
- image: ekiden/testing
steps:
# Set up
- run: echo 'PS1='"'"'\$ '"'"'; . /root/.bashrc' >> $BASH_ENV
- run: echo 'export SGX_MODE=SIM' >> $BASH_ENV
- run: echo 'export INTEL_SGX_SDK=/opt/sgxsdk' >> $BASH_ENV
- checkout

# Build
- run: cargo make build-flow

# Rustfmt
- run: cargo make checkstyle

# Cargo tests. Some tests are excluded as they currently don't compile.
- run: |
cargo test --all \
--exclude ekiden-untrusted \
--exclude ekiden-enclave-untrusted \
--exclude ekiden-rpc-untrusted \
--exclude ekiden-db-untrusted \
--exclude ekiden-consensus \
-- --test-threads 1
# Cargo benchmarks. We first fetch the latest benchmark results from master and then
# compare against them.
- run: |
set +e
set +o pipefail
wget -q -O - "https://circleci.com/api/v1.1/project/github/sunblaze-ucb/ekiden/latest/artifacts/?branch=master&circle-token=${CIRCLE_TOKEN}" | grep -o 'https://[^"]*' | xargs -P4 -I % wget -q -O /tmp/benchmarks-master.json %?circle-token=${CIRCLE_TOKEN}
- run: |
./scripts/benchmark.py \
ekiden-rpc-trusted \
ekiden-db-trusted \
--output /tmp/benchmarks.json \
--compare-to /tmp/benchmarks-master.json
- store_artifacts:
path: /tmp/benchmarks.json
destination: benchmarks

# Create enclave output directory.
- run: mkdir -p target/enclave
# Install ekiden-tools.
- run: cargo install --force --path tools ekiden-tools
# Build key manager contract.
- run: cargo ekiden build-contract ekiden-key-manager --path contracts/key-manager --output target/enclave
# Build token contract.
- run: cargo ekiden build-contract token --path contracts/token --output-identity --output target/enclave
# Start the consensus node.
- run:
command: ./target/debug/ekiden-consensus
background: true
# Start tendermint node.
- run: tendermint init
- run:
command: tendermint node --consensus.create_empty_blocks=false --rpc.laddr tcp://0.0.0.0:46666 --rpc.grpc_laddr tcp://0.0.0.0:46657
background: true
# Start key manager compute node.
- run:
command: ./target/debug/ekiden-compute target/enclave/ekiden-key-manager.so -p 9003 --disable-key-manager --identity-file identity-km.pb
background: true
# Start token compute node.
- run:
command: ./target/debug/ekiden-compute target/enclave/token.so --identity-file identity-token.pb
background: true
# Start token client.
- run: ./target/debug/token-client --mr-enclave $(cat target/enclave/token.mrenclave)

workflows:
version: 2
build:
jobs:
- build
experimental:
notify:
branches:
only:
- master
1 change: 1 addition & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
target
22 changes: 22 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
# Build.
/target/
**/*.rs.bk
*.a
*.o
*.so
**/generated
Cargo.lock
Xargo.toml

# Enclave compilation
Enclave_t.c
Enclave_t.h

# IDE.
.idea/*

# Temporary files.
*.swp

# Saved enclave identity.
/identity*.pb
Empty file added .gitmodules
Empty file.
54 changes: 54 additions & 0 deletions .rustfmt.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
required_version = "0.3.6"
unstable_features = false
max_width = 100
hard_tabs = false
tab_spaces = 4
newline_style = "Unix"
indent_style = "Block"
use_small_heuristics = true
format_strings = false
wrap_comments = false
comment_width = 80
normalize_comments = false
empty_item_single_line = true
struct_lit_single_line = true
fn_single_line = false
where_single_line = false
imports_indent = "Visual"
imports_layout = "Mixed"
reorder_extern_crates = true
reorder_extern_crates_in_group = true
reorder_imports = true
reorder_imports_in_group = true
reorder_imported_names = true
binop_separator = "Front"
type_punctuation_density = "Wide"
space_before_colon = false
space_after_colon = true
spaces_around_ranges = false
spaces_within_parens_and_brackets = false
combine_control_expr = true
struct_field_align_threshold = 0
remove_blank_lines_at_start_or_end_of_block = true
match_arm_blocks = true
force_multiline_blocks = false
fn_args_density = "Tall"
brace_style = "SameLineWhere"
control_brace_style = "AlwaysSameLine"
trailing_comma = "Vertical"
trailing_semicolon = true
match_block_trailing_comma = false
blank_lines_upper_bound = 1
blank_lines_lower_bound = 0
merge_derives = true
use_try_shorthand = true
condense_wildcard_suffixes = false
force_explicit_abi = true
write_mode = "Overwrite"
color = "Auto"
disable_all_formatting = false
skip_children = false
error_on_line_overflow = true
error_on_unformatted = false
report_todo = "Never"
report_fixme = "Never"
41 changes: 41 additions & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
[workspace]
members = [
"tools",

# Common.
"common",

# Enclave loader.
"enclave/common",
"enclave/untrusted",
"enclave/trusted",

# RPC (+ attestation).
"rpc/common",
"rpc/client",
"rpc/untrusted",
"rpc/trusted",
"rpc/edl",

# Database.
"db/untrusted",
"db/trusted",
"db/edl",

# Core.
"core/common",
"core/untrusted",
"core/trusted",
"core/edl",

# Compute node.
"compute/api",
"compute",

# Consensus node.
"consensus/api",
"consensus",

# Clients.
"clients/token",
]
Loading

0 comments on commit dce901f

Please sign in to comment.