Skip to content

Commit

Permalink
Merge pull request #326 from cam-parra/master
Browse files Browse the repository at this point in the history
0.9.5 release
  • Loading branch information
mac-arrap authored Oct 24, 2018
2 parents ea993b1 + aa1c45f commit 7a16d3b
Show file tree
Hide file tree
Showing 9 changed files with 108 additions and 101 deletions.
136 changes: 81 additions & 55 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,87 +1,113 @@
![sovrinlogo](https://github.com/sovrin-foundation/sovrin/blob/master/banner.png "insert humor here")
![img](https://github.com/sovrin-foundation/sovrin/blob/master/banner.png)

# Table of Contents

1. [LibSovToken](#orged7f66f)
1. [Requirements](#requirements)
1. [Installing Indy-SDK](#installing-indy-sdk)
2. [Running Indy Pool](#running-indy-pool)
1. [Build the pool](#build-the-pool)
2. [run the poool](#run-the-poool)
3. [Compiling libsovtoken and running tests](#compiling-libsovtoken-and-running-tests)
3. [How To Contribute](#how-to-contribute)

<a href="https://www.apache.org/licenses/LICENSE-2.0.txt" target="_blank">![Hex.pm](https://img.shields.io/hexpm/l/plug.svg?style=plastic)</a>
<a href="https://badge.fury.io/gh/sovrin-foundation%2Flibsovtoken">[![GitHub version](https://badge.fury.io/gh/sovrin-foundation%2Flibsovtoken.svg)](https://badge.fury.io/gh/sovrin-foundation%2Flibsovtoken)</a>

<a id="orged7f66f"></a>

# LibSovToken

Adds Sovrin's token functionality to HyperLedger's Indy-SDK.

This is a payment handler library to work with libindy. It may one day be merged into libindy.

<a id="requirements"></a>

## Requirements

* Rust Lang (Stable)
* LibIndy (Stable)
* Indy Pool (Provided)
- Rust Lang (Stable)
- LibIndy (Stable)
- Indy Pool (Provided)


<a id="installing-indy-sdk"></a>

### Installing Indy-SDK

##### Ubuntu
1. Ubuntu

sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys 68DB5E88
sudo add-apt-repository "deb https://repo.sovrin.org/sdk/deb xenial stable"
sudo apt-get update
sudo apt-get install -y libindy>=1.6.0

``` shell
sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys 68DB5E88
sudo add-apt-repository "deb https://repo.sovrin.org/sdk/deb xenial stable"
sudo apt-get update
sudo apt-get install -y libindy>=1.6.0
```
2. macOS

git clone https://github.com/hyperledger/indy-sdk.git
cd indy-sdk
git checkout stable
cd libindy
cargo clean
cargo update
cargo build

Libsovtoken build needs to know how to find Indy-SDK. This is done
through the environment variable LIBINDY_DIR.

Create an environment variable LIBINDY_DIR. Have it point the directory
containing indy-sdk binaries.

Use `pwd` to get path to current directory

Add this to your bash profile:

# EXAMPLE
export LIBINDY_DIR='/my/path/to/indy-sdk/libindy/target/debug/'

*Note* anytime you get latest for indy-sdk, you must rebuild the
libraries before building libsovtoken, as the libsovtoken build does not
compile indy-sdk.

##### macOS

```shell
git clone https://github.com/hyperledger/indy-sdk.git
cd indy-sdk
git checkout stable
cd libindy
cargo clean
cargo update
cargo build
```
Libsovtoken build needs to know how to find Indy-SDK. This is done through the environment variable LIBINDY_DIR.
<a id="running-indy-pool"></a>

Create an environment variable LIBINDY_DIR. Have it point the directory containing indy-sdk binaries.
## Running Indy Pool

Use `pwd` to get path to current directory

Add this to your bash profile:
<a id="build-the-pool"></a>

```shell
# EXAMPLE
export LIBINDY_DIR='/my/path/to/indy-sdk/libindy/target/debug/'
```
### Build the pool

*Note* anytime you get latest for indy-sdk, you must rebuild the libraries before building libsovtoken, as the libsovtoken build does not compile indy-sdk.
cd devops/indy-pool/ && docker build -t indy_pool .

## Running Indy Pool

### Build the pool
```shell
cd devops/indy-pool/ && docker build -t indy_pool .
```
<a id="run-the-poool"></a>

### run the poool
``` shell
docker run -itd -p 9701-9708:9701-9708 indy_pool
```

docker run -itd -p 9701-9708:9701-9708 indy_pool


<a id="compiling-libsovtoken-and-running-tests"></a>

### Compiling libsovtoken and running tests
1) Make sure you meet the requirements above, including building the projects, if you elect to use source code.
2) Get latest for libsovtoken from master at https://github.com/evernym/libsovtoken.git
3) The source code is in a sub-directory called libsovtoken
4) Run the following commands from the libsovtoken subdirectory
1) cargo update
2) cargo build
5) Run the tests to ensure everything is in good order.
1) cargo test

***Please keep in mind*** (at the time this document was written) some of the cargo crates are github repositories.
If you update libsovtoken code from github you need to re-build libsovtoken as follows:
1) cargo clean
2) cargo update
3) cargo build

The cargo update command is necessary to make sure you get latest from the cargo crates in github

1. Make sure you meet the requirements above, including building the
projects, if you elect to use source code.
2. Get latest for libsovtoken at
<https://github.com/sovrin-foundation/libsovtoken.git>
3. The source code is in a sub-directory called libsovtoken
4. Run the following commands from the libsovtoken subdirectory
1. cargo update
2. cargo build

5. Run the tests to ensure everything is in good order.
1. cargo test


<a id="how-to-contribute"></a>

## How To Contribute

Please follow the guide [here](./doc/pull-request.md).

2 changes: 1 addition & 1 deletion devops/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ FPM_P_VENDOR := Evernym
FPM_P_DESCRIPTION := libsovtoken writen in Rust
FPM_P_NAME = $(PACKAGE_NAME)
FPM_P_VERSION ?= $(SRC_VERSION)
FPM_P_DEPENDS = libindy(=1.6.6)
FPM_P_DEPENDS = libindy(=1.6.7)
FPM_P_OUTPUT_DIR = $(LIB_TARGET_DIR)
FPM_ARGS = $(LIB_DYNAMIC)=/usr/lib/

Expand Down
8 changes: 4 additions & 4 deletions devops/aws-codebuild/Jenkinsfile.ci
Original file line number Diff line number Diff line change
Expand Up @@ -54,13 +54,13 @@ pipelineWrapper({
// not accurate (it concatenates them):
// debian package version: <src_version>+<release_version>
// debian package name: <src_version><release_version>
def sovtoken_deb_version = "0.9.3+12.58"
def sovtokenfees_deb_version = "0.9.3+13.58"
def sovtoken_deb_version = "0.9.5"
def sovtokenfees_deb_version = "0.9.5"

sh """
cd ./devops/docker/ci/xenial/
wget --no-check-certificate https://repo.sovrin.org/deb/pool/xenial/rc/s/sovtoken/sovtoken_${sovtoken_deb_version}_amd64.deb
wget --no-check-certificate https://repo.sovrin.org/deb/pool/xenial/rc/s/sovtokenfees/sovtokenfees_${sovtokenfees_deb_version}_amd64.deb
wget --no-check-certificate https://repo.sovrin.org/deb/pool/xenial/stable/s/sovtoken/sovtoken_${sovtoken_deb_version}_amd64.deb
wget --no-check-certificate https://repo.sovrin.org/deb/pool/xenial/stable/s/sovtokenfees/sovtokenfees_${sovtokenfees_deb_version}_amd64.deb
"""
}
}
Expand Down
4 changes: 2 additions & 2 deletions devops/docker/base/xenial/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ RUN cd /tmp \
# need for libsodium to be reachable via pkg-config (sodiumoxide uses it)
ENV PKG_CONFIG_PATH /usr/local/lib/pkgconfig:$PKG_CONFIG_PATH # TODO ??? is it really needed

ENV LIBINDY_VERSION=1.6.6
ENV LIBINDY_VERSION=1.6.7
RUN apt-key adv --keyserver keyserver.ubuntu.com --recv-keys 68DB5E88 \
&& echo "deb https://repo.sovrin.org/sdk/deb xenial stable" >> /etc/apt/sources.list \
&& apt-get update && apt-get install -y --no-install-recommends \
Expand All @@ -46,4 +46,4 @@ RUN cd /tmp/libsovtoken \

# TODO CMD ENTRYPOINT ...

ENV LIBSOVTOKEN_BASE_ENV_VERSION=0.9.0
ENV LIBSOVTOKEN_BASE_ENV_VERSION=0.12.0
41 changes: 11 additions & 30 deletions devops/docker/ci/xenial/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM evernym/libsovtoken:base-xenial-0.9.0
FROM evernym/libsovtoken:base-xenial-0.12.0
# TODO LABEL maintainer="Name <email-address>"

ARG LIBINDY_CRYPTO_VERSION
Expand Down Expand Up @@ -34,11 +34,12 @@ RUN apt-get update && apt-get install -y --no-install-recommends \
# - have explicitly defined versions in packages depends list
# - are likely to be updated (e.g. packaged 3rd parties like python3-pyzmq
# or python3-rocksdb are not specified here)
ENV LIBINDY_CRYPTO_VERSION ${LIBINDY_CRYPTO_VERSION:-0.4.3}
ENV PYTHON3_INDY_CRYPTO_VERSION ${PYTHON3_INDY_CRYPTO_VERSION:-0.4.3}
ENV INDY_PLENUM_VERSION ${INDY_PLENUM_VERSION:-1.6.51}
ENV LIBINDY_CRYPTO_VERSION ${LIBINDY_CRYPTO_VERSION:-0.4.5}
ENV PYTHON3_INDY_CRYPTO_VERSION ${PYTHON3_INDY_CRYPTO_VERSION:-0.4.5}
ENV INDY_PLENUM_VERSION ${INDY_PLENUM_VERSION:-1.6.53}
ENV INDY_ANONCREDS_VERSION ${INDY_ANONCREDS_VERSION:-1.0.11}
ENV INDY_NODE_VERSION ${INDY_NODE_VERSION:-1.6.73}
ENV INDY_NODE_VERSION ${INDY_NODE_VERSION:-1.6.78}
ENV TOKEN_VER ${TOKEN_VER:-0.9.5}
RUN echo "deb https://repo.sovrin.org/sdk/deb xenial stable" >> /etc/apt/sources.list
RUN echo "deb https://repo.sovrin.org/deb xenial stable" >> /etc/apt/sources.list \
&& apt-get update && apt-get install -y --no-install-recommends \
Expand All @@ -47,6 +48,8 @@ RUN echo "deb https://repo.sovrin.org/deb xenial stable" >> /etc/apt/sources.lis
indy-plenum=${INDY_PLENUM_VERSION} \
indy-anoncreds=${INDY_ANONCREDS_VERSION} \
indy-node=${INDY_NODE_VERSION} \
sovtoken=${TOKEN_VER} \
sovtokenfees=${TOKEN_VER} \
&& rm -rf /var/lib/apt/lists/*
COPY supervisord.conf /etc/supervisord.conf

Expand All @@ -60,34 +63,12 @@ RUN awk '{if (index($1, "NETWORK_NAME") != 0) {print("NETWORK_NAME = \"sandbox\"

USER root

# sovtoken and sovtokenfees
# bump this env var if you need to avoid caching for apt-based installation
ENV SOVTOKEN_PLUGINS_APT_UPDATE 1
ENV EVERNYM_REPO_IP ${EVERNYM_REPO_IP:-10.2.3.179}
# TODO workaround to copy optional files *.deb
# fix that once that issue is resovled
# https://github.com/moby/moby/issues/26332
COPY sovtoken*.deb supervisord.conf /tmp/sovtoken-debs/
RUN if [ -f /tmp/sovtoken-debs/sovtoken_*.deb ] && [ -f /tmp/sovtoken-debs/sovtokenfees_*.deb ]; then \
apt-get update \
&& dpkg -i /tmp/sovtoken-debs/*.deb \
&& apt-get install -f -y --no-install-recommends; \
else \
echo "${EVERNYM_REPO_IP} repo.corp.evernym.com" >> /etc/hosts \
&& mkdir -p /usr/local/share/ca-certificates \
&& curl -k https://repo.corp.evernym.com/ca.crt | tee /usr/local/share/ca-certificates/Evernym_Root_CA.crt \
&& update-ca-certificates \
&& curl https://repo.corp.evernym.com/repo.corp.evenym.com-sig.key | apt-key add - \
&& echo 'deb https://repo.corp.evernym.com/deb evernym-agency-dev-ubuntu main' | tee /etc/apt/sources.list.d/agency-dev_repo.corp.evernym.com.list \
&& apt-get update && apt-get install -y --no-install-recommends \
sovtoken \
sovtokenfees \
&& rm -rf /var/lib/apt/lists/*; \
fi
ENV SOVTOKEN_PLUGINS_APT_UPDATE 2



COPY libsovtoken-ci-entrypoint.sh /usr/local/bin/
RUN chmod +x /usr/local/bin/libsovtoken-ci-entrypoint.sh
ENTRYPOINT ["libsovtoken-ci-entrypoint.sh"]

ENV LIBSOVTOKEN_CI_ENV_VERSION=0.45.0
ENV LIBSOVTOKEN_CI_ENV_VERSION=0.49.0
12 changes: 6 additions & 6 deletions devops/indy-pool/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -21,13 +21,13 @@ ARG uid=1000

ARG indy_stream=stable

ARG indy_plenum_ver=1.6.51
ARG indy_node_ver=1.6.73
ARG indy_plenum_ver=1.6.53
ARG indy_node_ver=1.6.78
ARG indy_anoncreds_ver=1.0.11
ARG python3_indy_crypto_ver=0.4.3
ARG indy_crypto_ver=0.4.3
ARG token_ver=0.9.3+12.58
ARG fees_ver=0.9.3+13.58
ARG python3_indy_crypto_ver=0.4.5
ARG indy_crypto_ver=0.4.5
ARG token_ver=0.9.5
ARG fees_ver=0.9.5

# Install environment
RUN apt-get update -y && apt-get install -y \
Expand Down
2 changes: 1 addition & 1 deletion libsovtoken/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "libsovtoken"
version = "0.9.3"
version = "0.9.5"
authors = [
"Matt Raffel <matt.raffel@evernym.com",
"Stephen Felt <stephen.felt@evernym.com",
Expand Down
Original file line number Diff line number Diff line change
@@ -1 +1 @@
libindy=1.6.6=stable
libindy=1.6.7=stable
2 changes: 1 addition & 1 deletion libsovtoken/build_scripts/ios/mac/shared.functions.sh
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#!/bin/sh

export LIBINDY_IOS_BUILD_URL="https://repo.sovrin.org/ios/libindy/stable/libindy-core/1.6.6/libindy.tar.gz"
export LIBINDY_IOS_BUILD_URL="https://repo.sovrin.org/ios/libindy/stable/libindy-core/1.6.7/libindy.tar.gz"
export LIBINDY_FILE=$(basename ${LIBINDY_IOS_BUILD_URL})
export LIBINDY_VERSION=$(basename $(dirname ${LIBINDY_IOS_BUILD_URL}))
export BUILD_CACHE=~/.build_libvxc/ioscache
Expand Down

0 comments on commit 7a16d3b

Please sign in to comment.