• This repository has been archived on 27/Jul/2022
  • Stars
    star
    157
  • Rank 232,134 (Top 5 %)
  • Language
    Rust
  • License
    Other
  • Created over 5 years ago
  • Updated almost 2 years ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

Thaler Experimental Network; For Crypto.org Chain: github.com/crypto-org-chain/chain-main

DEVELOPMENT MOVED TO: https://github.com/crypto-org-chain/chain-main

Table of Contents

  1. Description
  2. Contributing
  3. License
  4. Documentation
  5. Build
    1. Docker image
    2. Makefile
    3. Linux native (Ubuntu 18.04)
    4. Build mock mode on non-sgx platform (e.g. mac)
  6. Start a Local Full Node
  7. Send your First Transaction
  8. Testing
  9. Useful Links

1. Description

This repository contains the Thaler Experimental Network code (pre-pivoted Crypto.com Chain). The current repository consists of the following Rust sub-crates:

  • chain-abci: the Tendermint ABCI application that currently does the transaction validation etc.
  • chain-core: the library that contains the main type definitions and any utility code (such as serialization), so that it can be used in chain-abci and other applications.
  • chain-storage: storage related logic used by chain-abci.
  • chain-tx-filtering: Library that captures the fuctionality related to block-level public view key-based transaction filtering.
  • chain-tx-validation: Library with functions that verify, given current chain state's data, if a transaction is valid.
  • test-common: Common code shared by unit tests.
  • dev-utils: currently a minimal development tool for generating genesis.json
  • client-[common|network|core|cli|rpc]: Client backend implementation for transaction creation and wallet management. Follow these links for more details:
  • chain-tx-enclave/: enclaves and enclave wrapper apps.
  • enclave-protocol: Requests and responses exchanges over ZMQ between chain-abci app.
  • cro-clib: c API library.

2. Contributing

Please abide by the Code of Conduct in all interactions, and the contributing guidelines when submitting code.

3. License

Apache 2.0

4. Documentation

Technical documentation can be found in this Github repository (you can read it in this hosted version.

5. Build full node

1. Docker image

$ docker build -t crypto-chain:latest .

Docker build arguments:

  • SGX_MODE:
    • HW: SGX hardware mode, default.
    • SW: SGX software simulation mode.
  • NETWORK_ID: Network HEX Id of Tendermint, default: AB.
  • BUILD_PROFILE:
    • debug: debug mode.
    • release: release mode, default.
  • BUILD_MODE:
    • sgx: default.
    • mock: A simulation mode only for development on non-sgx platform, don't use in production.

2. Makefile

$ make build

It builds in docker container, the result binaries reside in local directory, it runs something like:

$ docker run --rm -v `pwd`:/chain cryptocom/chain:latest run_build_scripts

The result binary is built for the docker container environment, may not runnable locally.

The makefile supports other commands too:

$ make help
...
SUBCOMMAND:
	prepare                prepare the environment
	image                  build the docker image
	build                  just build the chain and enclave binaery in docker
	run-sgx                docker run sgx-validation and a sgx-query container
	run-chain              docker run chain-abci, tendermint and client-rpc container
	stop-all               docker stop all the container
	start-all              docker start all the container
	restart-all            docker restart all the container
	rm-all                 remove all the docker container
	clean                  clean all the temporary files while compiling
	clean-data             remove all the data in data_path

3. Linux native (Ubuntu 18.04)

Prerequisite:

  • intel sgx sdk (Set environment variable SGX_SDK to the sdk directory)
  • rust toolchain nightly-2019-11-25 (you can install with rustup)
$ apt-get install -y \
    cmake \
    libgflags-dev \
    libzmq3-dev \
    pkg-config \
    clang
$ ./docker/build.sh

All the executables and signed enclave libraries will reside in ./target/debug.

Environment variables mentioned in the docker image building section also apply here.

4. Develop with mock mode on non-sgx platform (e.g. mac)

TODO

6. Start a Local Full Node

Please follow the instruction to deploy a local full node.

7. Send Your First Transaction

Kindly refer to this instruction to perform transactions between addresses.

8. Testing

You can run the unit tests and integration tests with drone-cli on sgx platform:

$ cat > .drone.secret << EOF
SPID=<SPID>
IAS_API_KEY=<IAS_API_KEY>
EOF
$ drone exec --trusted \
    --include build \
    --include unit-tests \
    --include integration-tests \
    --include multinode-tests

Kindly refer to Prepare SPID & KEY to obtain the values of SPID and IAS_API_KEY.


More Repositories

1

chain-desktop-wallet

Crypto.com DeFi Desktop Wallet
TypeScript
358
star
2

defi-wallet-core-rs

Cross-platform, cross-blockchain wallet library in Rust for DeFi Wallet and other applications.
Rust
45
star
3

chain-indexing

Go
35
star
4

swap-token-list

JavaScript
30
star
5

swap-contracts-core

Core smart contracts of DeFi Swap
TypeScript
19
star
6

pystarport

pystarport setup and run local devnet for cosmos like blockchains
Python
18
star
7

cosmos-sdk-codeql

A query suite for common bug patterns in Cosmos SDK-based applications
CodeQL
17
star
8

swap-contracts-periphery

Peripheral smart contracts for interacting with DeFi Swap
Solidity
15
star
9

thaler-nodelib

Crypto.com Chain library for Node.js
TypeScript
13
star
10

deficonnect-monorepo

DeFi Wallet Web SDK
TypeScript
12
star
11

cro-staking

JavaScript
12
star
12

crypto-exchange

11
star
13

crypto-pay-prestashop

Crypto.com Pay Checkout for PrestaShop
PHP
10
star
14

thaler-sample-wallet

Sample Crypto.com Chain Wallet implementation using Angular
TypeScript
10
star
15

thaler-docs

Crypto.com Chain documentation and specs: https://thaler-testnet.crypto.com/docs/
Shell
9
star
16

defi-swap-swap-subgraph

Subgraph for Defi swap-info
TypeScript
5
star
17

aws-ne-sys

Extracted from https://github.com/aws/aws-nitro-enclaves-acm
Rust
4
star
18

chain-tx-enclave

MOVED TO https://github.com/crypto-com/chain/tree/master/chain-tx-enclave
C
3
star
19

thaler-indexing

Crypto.com Chain data indexing service
Go
3
star
20

thaler-multisig-demo

Demonstrate Multi-signature functionality in Crypto.com chain
Rust
2
star
21

ledger-crypto

DEVELOPMENT MOVED TO: https://github.com/LedgerHQ/app-cryptocom
C
2
star
22

sgx-vendor

temporary `cargo vendor` with updated sgx-forked crates
Rust
1
star
23

crypto-com.github.io

Staging hosted Crypto.com Chain documentation and specs
HTML
1
star
24

swap-subgraphs

DEPRECATED
TypeScript
1
star
25

sample-thaler-ios-example

Sample code to demonstrate how Thaler Experimental Network C bindings can be used in an iOS project
C
1
star
26

thaler-ilp-settlement

Interledger CRO settlement engine (Proof of Concept)
TypeScript
1
star