Giter Site home page Giter Site logo

scrtlabs / enigma-core-deprecated Goto Github PK

View Code? Open in Web Editor NEW
31.0 19.0 12.0 3.47 MB

The code has been moved to a new repository:

Home Page: https://github.com/enigmampc/enigma-core

License: GNU Affero General Public License v3.0

Makefile 3.71% Rust 95.82% Python 0.30% Dockerfile 0.16%

enigma-core-deprecated's Introduction

The code has been moved to a new repository: https://github.com/enigmampc/enigma-core

Enigma Core library

Service Master Develop
CI Badge

Pure Rust Enclave && Untrusted in Rust. Core is part of the Enigma node software stack. The Core component as it's name suggests is responsible for the core operations. The core includes Remote Attestation (SGX SDK), Cryptography and the Ethereum EVM.

Getting Started (With the Enigma Docker)

Prerequisites

Build and Compile

  • build the enigma docker image
 cd /some/path/enigma-core/dockerfile
 docker build -t enigma_core .

The output should look like that:

Sending build context to Docker daemon  2.048kB
Step 1/7 : FROM baiduxlab/sgx-rust:1.0.0
 ---> 44a7928943e4
Step 2/7 : MAINTAINER enigmampc
 ---> Using cache
 ---> 2a1b994a20f4
Step 3/7 : WORKDIR /root
 ---> Using cache
 ---> 33fc66f979b8
Step 4/7 : RUN rm -rf /root/sgx
 ---> Using cache
 ---> da313d0a4471
Step 5/7 : RUN git clone https://github.com/baidu/rust-sgx-sdk.git sgx -b v1.0.0
 ---> Using cache
 ---> 704631bc2d68
Step 6/7 : RUN apt-get install -y libzmq3-dev
 ---> Using cache
 ---> 141b17bb1564
Step 7/7 : RUN echo '/opt/intel/sgxpsw/aesm/aesm_service &' >> /root/.bashrc
 ---> Using cache
 ---> cd6787969fd1
Successfully built cd6787969fd1
  • run docker:
docker run -v /some/path/enigma-core/:/root/enigma-core -ti --net="host" --device /dev/isgx enigma_core
  • build the project
cd enigma-core/enigma-core
make 

If the following error ocures then this is an open issuen that will be solved.

error[E0463]: can't find crate for `std`
  --> /root/.cargo/git/checkouts/rust-sgx-sdk-fc8771c5c45bde9a/378a4f0/xargo/sgx_tunittest/../../sgx_tunittest/src/lib.rs:88:1
   |
88 | extern crate sgx_tstd as std;
   | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ can't find crate

error: aborting due to previous error

For more information about this error, try `rustc --explain E0463`.
error: Could not compile `sgx_tunittest`.

check out Troubleshooting and then make clean && make

Run the tests (inside Docker)

  • Build the project
make
cd app/

Run the tests (no std)

cargo test

Run the test (with std)

cargo test -- --nocapture

Run the project

cd root/enigma-core/enigma-core/bin
./enigma-core-app

Simulation Mode

If you want to run this in a computer that doesn't support SGX you can run both enigma-core and surface in simulation mode.
To do this, run surface with --simulation, then fire up the docker and run:

$ cd enigma-core
$ make full-clean
$ export SGX_MODE=SW
$ make # Here you can add JOBS=N to pass on to cargo the number of jobs to run simultaneously.

Principal Node

Principal Node README.

TBD

Installing

TBD

Deployment

Built With

TBD

Contributing

The master branch always contain the latest release, develop branch is used for continuous developing
Tags will be used to signify releases.

Pull Request

Every new feature or a bug fix will be presented in a pull request while it's a work in progress under the correct label.
When finished change the label to 3 - Ready for reviewing, every pull request is required to pass a code review from at least 1 member before merging.

Issues

Please use the templates accordingly.

Versioning

TBD

Troubleshooting

  • Error while building with make
error[E0463]: can't find crate for `std`
  --> /root/.cargo/git/checkouts/rust-sgx-sdk-fc8771c5c45bde9a/378a4f0/xargo/sgx_tunittest/../../sgx_tunittest/src/lib.rs:88:1
  • Temp Solution:
rm -rf /root/.cargo/git/checkouts/rust-sgx-sdk-fc8771c5c45bde9a/378a4f0/xargo/

Authors

License

The Enigma Core is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.

This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License for more details.

You should have received a copy of the GNU Affero General Public License along with this program. If not, see https://www.gnu.org/licenses/.

Acknowledgements

Thanks to Baidu X-Lab for their great work on Rust SGX SDK.

enigma-core-deprecated's People

Contributors

elichai avatar isan-rivkin avatar lacabra avatar moriaab avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

enigma-core-deprecated's Issues

Cannot build Core on the distributed_dev branch of enigma-docker-network

If I run "docker-compose up --scale core=1 core" on the enigma-docker-network repository(distributed_dev branch), I get this error:

Note that the container fetches the "develop" branch of Core while building.

error[E0432]: unresolved import `core::hint`
core_1      |   --> /root/.cargo/registry/src/github.com-1ecc6299db9ec823/spin-0.4.9/src/once.rs:38:11
core_1      |    |
core_1      | 38 | use core::hint::unreachable_unchecked as unreachable;
core_1      |    |           ^^^^ Could not find `hint` in `core`
core_1      | 
core_1      |    Compiling unicode-xid v0.0.4
core_1      |    Compiling sgx_unwind v0.0.0 (https://github.com/baidu/rust-sgx-sdk.git?rev=v1.0.0#378a4f0d)
core_1      | error: aborting due to previous error
core_1      | 
core_1      | For more information about this error, try `rustc --explain E0432`.
core_1      | error: Could not compile `spin`.
core_1      | warning: build failed, waiting for other jobs to finish...
core_1      | error: build failed
core_1      | Makefile:16: recipe for target 'libenclave.a' failed
core_1      | make[1]: *** [libenclave.a] Error 101
core_1      | make[1]: Leaving directory '/root/enigma-core/enigma-core/enclave'
core_1      | Makefile:137: recipe for target 'enclave' failed
core_1      | make: *** [enclave] Error 2
core_1      | [+] Home dir is /root
core_1      | [+] Home dir is /root
core_1      | [+] Created new .enigma folder => "/root/.enigma"
core_1      | [-] Open token file /root/.enigma/enclave.token error! Will create one.
core_1      | [-] Init Enclave Failed SGX_ERROR_ENCLAVE_FILE_ACCESS!
enigma_core_1 exited with code 0

cannot build core container from enigma-docker-network due to method named 'trim_end_matches'

I'm trying to build containers for enigma network on my local SGX-enabled pc with the HARDWARE option, but found this error. Only x-term for surface appeared but not the others.

core_1_d86d4a746552 |     Finished release [optimized] target(s) in 0.0 secs
core_1_d86d4a746552 | Cargo  =>  bin/app
core_1_d86d4a746552 | mkdir -p ./bin
core_1_d86d4a746552 | cp ./app/target/release/enigma-core-app ./bin/enigma-core-app
core_1_d86d4a746552 | make -C ./enclave/
core_1_d86d4a746552 | make[1]: Entering directory '/root/enigma-core/enigma-core/enclave'
core_1_d86d4a746552 | cargo build --release  
core_1_d86d4a746552 |    Compiling cc v1.0.27
core_1_d86d4a746552 |    Compiling sgx_tstd v1.0.0 (https://github.com/baidu/rust-sgx-sdk.git?rev=v1.0.0#378a4f0d)
core_1_d86d4a746552 |    Compiling tiny-keccak v1.4.2
core_1_d86d4a746552 |    Compiling synstructure v0.6.1
core_1_d86d4a746552 |    Compiling serde_derive_internals v0.16.0 (https://github.com/baidu/rust-sgx-sdk.git?rev=v1.0.0#378a4f0d)
core_1_d86d4a746552 |    Compiling crossbeam-epoch v0.3.1
core_1_d86d4a746552 |    Compiling block-buffer v0.2.0
core_1_d86d4a746552 |    Compiling crypto-mac v0.4.0
core_1_d86d4a746552 | error[E0599]: no method named `trim_end_matches` found for type `&std::string::String` in the current scope
core_1_d86d4a746552 |     --> /root/.cargo/registry/src/github.com-1ecc6299db9ec823/cc-1.0.27/src/lib.rs:1722:67
core_1_d86d4a746552 |      |
core_1_d86d4a746552 | 1722 |                     let cross_compile = cc_env.as_ref().map(|s| s.trim_end_matches('-'));
core_1_d86d4a746552 |      |                                                                   ^^^^^^^^^^^^^^^^
core_1_d86d4a746552 |      |
core_1_d86d4a746552 |      = help: did you mean `trim_left_matches`?
core_1_d86d4a746552 | 
core_1_d86d4a746552 | error: aborting due to previous error
core_1_d86d4a746552 | 
core_1_d86d4a746552 | For more information about this error, try `rustc --explain E0599`.
core_1_d86d4a746552 | error: Could not compile `cc`.
core_1_d86d4a746552 | warning: build failed, waiting for other jobs to finish...
Compiling ./contracts/Billionare.sol...
Compiling ./contracts/CoinMixer.sol...
Compiling ./contracts/Enigma.sol...
Compiling ./contracts/EnigmaToken.sol...
Compiling ./contracts/Migrations.sol...
Compiling ./contracts/utils/GetCode2.sol...
Compiling openzeppelin-solidity/contracts/ECRecovery.sol...
Compiling openzeppelin-solidity/contracts/math/SafeMath.sol...
Compiling openzeppelin-solidity/contracts/token/ERC20/BasicToken.sol...
Compiling openzeppelin-solidity/contracts/token/ERC20/ERC20.sol...
Compiling openzeppelin-solidity/contracts/token/ERC20/ERC20Basic.sol...
Compiling openzeppelin-solidity/contracts/token/ERC20/StandardToken.sol...
core_1_d86d4a746552 | error: build failed

I've googled it about it seems nothing similar to this one.
I'm pretty sure i m following the getting started documentation of enigma.co.

Can you help me with this?

License issue

Greetings!

Author of rust-sgx-sdk here. Good to see that you guys are doing fantastic jobs using our SDK and hope you guys are doing well!

Of course you guys are free to use the SDK and do whatever you want. Would you please add something regards to the License we use? and some acknowledgement in your Readme would be pretty much awesome!

Of course, if you guys have recommendations or any ideas about this SDK, please feel free to contact me at [email protected]. Thanks!

Best,
Yu

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.