Git Product home page Git Product logo

hyperledger / indy-sdk Goto Github PK

View Code? Open in Web Editor NEW
669.0 69.0 741.0 273.8 MB

indy-sdk

Home Page: https://wiki.hyperledger.org/display/indy

License: Apache License 2.0

Shell 2.22% Rust 52.96% C++ 1.01% C 3.15% Ruby 0.60% Objective-C 4.64% Objective-C++ 5.10% Python 6.43% Java 6.80% C# 5.82% Makefile 0.01% Swift 0.01% Groovy 0.57% HTML 6.06% CSS 0.93% JavaScript 1.47% Dockerfile 0.21% TypeScript 1.97% Perl 0.06%
hyperledger-indy aries ssi zkp hacktoberfest

indy-sdk's Introduction

Indy SDK - Deprecated

logo

⚠️ Deprecation Notice ⚠️

The Indy SDK has been deprecated in favor of the Indy and Aries shared libraries. Please use the following libraries and projects to replace your use of the Indy SDK.

A module for interacting with the Indy Node ledger.

A secure (encrypted at rest) storage and a key management service suitable for use with Hyperledger Aries agents and possibly other digital trust agents. Askar is a replacement implementation (with lessons learned!) of the indy-wallet part of the Hyperledger Indy SDK. Askar has been demonstrated to be more performant and stable than the Indy SDK when under comparable load.

Rust library and reference implementation of the Anoncreds V1.0 specification. Supporting ledger agnostic anoncreds.

The a feature parity replacement for the indy-cli from the indy-sdk.

About the Indy SDK

This is the official SDK for Hyperledger Indy, which provides a distributed-ledger-based foundation for self-sovereign identity. Indy provides a software ecosystem for private, secure, and powerful identity, and the Indy SDK enables clients for it. The major artifact of the SDK is a C-callable library; there are also convenience wrappers for various programming languages and Indy CLI tool.

All bugs, stories, and backlog for this project are managed through Hyperledger's Jira in project IS (note that regular Indy tickets are in the INDY project instead...). Also, make sure to join us on Hyperledger's Rocket.Chat at #indy-sdk to discuss. You will need a Linux Foundation login to get access to these channels

Understanding Hyperledger Indy

If you have just started learning about self-sovereign identity, here are some resources to increase your understanding:

  • This extended tutorial introduces Indy, explains how the whole ecosystem works, and how the functions in the SDK can be used to construct rich clients: Indy-SDK Getting-Started Guide

    • Please take note that this tutorial doesn't cover how sides set up a connection and exchange messages. How this communication channel can be built you can find at Aries project which describes it in great details.
  • Hyperledger Indy Working Group calls happen every Thursday at 8amPT, 9amMT, 11amET, 4pmBST. Add to your calendar and join from any device: https://zoom.us/j/232861185

  • A recent webinar explaining self-sovereign identity using Hyperledger Indy and Sovrin: SSI Meetup Webinar

  • Visit the main resource for all things "Indy" to get acquainted with the code base, helpful resources, and up-to-date information: Hyperledger Wiki-Indy.

  • You may also want to look at the older guide that explored the ecosystem via command line. That material is being rewritten but still contains some useful ideas.

Items included in this SDK

libindy

The major artifact of the SDK is a C-callable library that provides the basic building blocks for the creation of applications on the top of Hyperledger Indy. It is available for most popular desktop, mobile and server platforms.

Libindy wrappers

A set of libindy wrappers for developing Indy-based applications in your favorite programming language. Indy SDK provides libindy wrappers for the following programming languages and platforms:

Indy CLI

Indy CLI is the official command line interface that helps Indy developers and administrators.

Libnullpay

Libnullpay is a libindy plugin that can be used for development of applications that use the Payments API of Indy SDK.

Libvcx

Libvcx is a c-callable library built on top of libindy that provides a high-level credential exchange protocol. It simplifies creation of agent applications and provides better agent-2-agent interoperability for Hyperledger Indy infrastructure.

This library is currently in an experimental state and is not part of official releases.

Libvcx wrappers

A set of libvcx wrappers for developing vcx-based applications in your favorite programming language.

Indy SDK provides libvcx wrappers for the following programming languages and platforms:

These wrappers are currently in experimental state and it is not part of official releases.

Example use

LibVCX Agency

LibVCX can be used with mediator agency which enables asynchronous communication between 2 parties.

  • Dummy Cloud Agent is simple implementation of VCX compatible Cloud Agent. The main purpose of this implementation is VCX testing, demos and documentation of VCX protocol.
  • NodeVCXAgency is alternative implementation in NodeJS.

How-To Tutorials

Short, simple tutorials that demonstrate how to accomplish common tasks are also available. See the docs/how-tos folder.

  1. Write a DID and Query Its Verkey
  2. Rotate a Key
  3. Save a Schema and Cred Def
  4. Issue a Credential
  5. Negotiate a Proof
  6. Send a Secure Message

Installing the SDK

Release channels

The Indy SDK release process defines the following release channels:

  • master - development builds for each push to master branch.
  • rc - release candidates.
  • stable - stable releases.

Please refer to our release workflow for more details.

Ubuntu based distributions (Ubuntu 16.04 and 18.04)

It is recommended to install the SDK packages with APT:

sudo apt-get install ca-certificates -y
sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys CE7709D068DB5E88
sudo add-apt-repository "deb https://repo.sovrin.org/sdk/deb (xenial|bionic) {release channel}"
sudo apt-get update
sudo apt-get install -y {library}
  • {library} must be replaced with libindy, libnullpay, libvcx or indy-cli.
  • (xenial|bionic) xenial for 16.04 Ubuntu and bionic for 18.04 Ubuntu.
  • {release channel} must be replaced with master, rc or stable to define corresponded release channel. Please See the section "Release channels" above for more details.

Windows

  1. Go to https://repo.sovrin.org/windows/{library}/{release-channel}.
  2. Download last version of library.
  3. Unzip archives to the directory where you want to save working library.
  4. After unzip you will get next structure of files:
  • Your working directory for libindy
    • include
      • ...
    • lib
      • indy.dll
      • libeay32md.dll
      • libsodium.dll
      • libzmq.dll
      • ssleay32md.dll

include contains c-header files which contains all necessary declarations that may be need for your applications.

lib contains all necessary binaries which contains libindy and all it's dependencies. You must add to PATH environment variable path to lib. It's necessary for dynamic linkage your application with libindy.

{release channel} must be replaced with master, rc or stable to define corresponded release channel. See section "Release channels" for more details.

{library} must be replaced with libindy, libnullpay, libvcx or indy-cli.

iOS

See wrapper iOS install documentation.

Android

  1. Go to https://repo.sovrin.org/android/{library}/{release-channel}.
  2. 3 architecture are supported as of now arm,arm64 and x86.
  3. Download latest version of library.
  4. Unzip archives to the directory where you want to save the .so files.
  5. After unzip you will get next structure of files:
  • Your working directory for libindy
    • include
      • ...
    • lib
      • libindy.so
      • libindy_shared.so
      • libindy.a

include contains c-header files which contains all necessary declarations that may be need for your applications.

lib contains three types of binaries.

  • libindy.so - This is a shared library which is statically linked with all the depenedencies. You dont need to sidelaod other dependencies like zmq, sodium and openssl to android app if you use this.

  • libindy_shared.so - This is pure shared library. It is not dynamically linked to its dependencies. You need to sideload the binaries with its dependencies. You can download the needed pre-built dependencies from here

    • Rename this library to libindy.so before loading it into the app. This will help you in having the compatibility with existing wrappers.
  • libindy.a - This is a static library, which is compiled with NDK.

{library} must be replaced with libindy, libnullpay or libvcx.

How to use instructions.

{release channel} must be replaced with rc or stable to define corresponded release channel. See section "Release channels" for more details.

Note :

  • [WARNING] This library should be considered as experimental as currently unit tests are not executed in the CI phase.

Centos

  1. Go to https://repo.sovrin.org/rpm/{library}/{release-channel}.
  2. Download and unzip the last version of library.
  3. Install with rpm -i library-version.rpm.

{library} must be replaced with libindy, libnullpay, libvcx, indy-cli to define corresponded library.

{release channel} must be replaced with master, rc or stable to define corresponded release channel. See section "Release channels" for more details.

MacOS

  1. Go to https://repo.sovrin.org/macos/{library}/{release-channel}.
  2. Download the latest version of library.
  3. Unzip archives to the directory where you want to save working library.
  4. After unzip you will get next structure of files:
  • Your working directory
    • include - contains c-header files which contains all necessary declarations that may be need for your applications.
      • ...
    • lib - contains library binaries (static and dynamic).
      • library.a
      • library.dylib
  1. Install dependent libraries: libsodium, zeromq, openssl. The dependent libraries should match the version with what you can find from otool -L libindy.dylib.

You need add the path to lib folder to LIBRARY_PATH environment variable.

{library} must be replaced with libindy, libnullpay, libvcx or indy-cli to define corresponded library.

{release channel} must be replaced with master, rc or stable to define corresponded release channel.

How to build Indy SDK from source

Note: By default cargo build produce debug artifacts with a large amount of run-time checks. It's good for development, but this build can be in 100+ times slower for some math calculation. If you would like to analyse CPU performance of libindy for your use case, you have to use release artifacts (cargo build --release).

How to start local nodes pool with docker

To test the SDK codebase with a virtual Indy node network, you can start a pool of local nodes using docker:

Note: If you are getting a PoolLedgerTimeout error it's because the IP addresses in cli/docker_pool_transactions_genesis and the pool configuration don't match. Use method 3 to configure the IPs of the docker containers to match the pool.

1) Starting the test pool on localhost

Start the pool of local nodes on 127.0.0.1:9701-9708 with Docker by running:

docker build -f ci/indy-pool.dockerfile -t indy_pool .
docker run -itd -p 9701-9708:9701-9708 indy_pool

2) Starting the test pool on a specific IP address

Dockerfile ci/indy-pool.dockerfile supports an optional pool_ip param that allows changing ip of pool nodes in generated pool configuration.

You can start the pool with e.g. with the IP address of your development machine's WIFI interface so that mobile apps in the same network can reach the pool.

# replace 192.168.179.90 with your wifi IP address
docker build --build-arg pool_ip=192.168.179.90 -f ci/indy-pool.dockerfile -t indy_pool .
docker run -itd -p 192.168.179.90:9701-9708:9701-9708 indy_pool

To connect to the pool the IP addresses in /var/lib/indy/sandbox/pool_transactions_genesis (in docker) and the pool configuration you use in your mobile app must match.

3) Starting the test pool on a docker network

The following commands allow to start local nodes pool in custom docker network and access this pool by custom ip in docker network:

docker network create --subnet 10.0.0.0/8 indy_pool_network
docker build --build-arg pool_ip=10.0.0.2 -f ci/indy-pool.dockerfile -t indy_pool .
docker run -d --ip="10.0.0.2" --net=indy_pool_network indy_pool

Note that for Windows and MacOS this approach has some issues. Docker for these OS run in their virtual environment. First command creates network for container and host can't get access to that network because container placed on virtual machine. You must appropriate set up networking on your virtual environment. See the instructions for MacOS below.

Docker port mapping on MacOS

If you use some Docker distribution based on Virtual Box you can use Virtual Box's port forwarding future to map 9701-9709 container ports to local 9701-9709 ports.

If you use VMWare Fusion to run Docker locally, follow the instructions from this article and add the following lines to /Library/Preferences/VMware Fusion/vmnet8/nat.conf:

# Use these with care - anyone can enter into your VM through these...
# The format and example are as follows:
#<external port number> = <VM's IP address>:<VM's port number>
#8080 = 172.16.3.128:80
9701 = <your_docker_ip>:9701
9702 = <your_docker_ip>:9702
9703 = <your_docker_ip>:9703
9704 = <your_docker_ip>:9704
9705 = <your_docker_ip>:9705
9706 = <your_docker_ip>:9706
9707 = <your_docker_ip>:9707
9708 = <your_docker_ip>:9708
9709 = <your_docker_ip>:9709

where <your_docker_ip> is your Docker host IP.

Docker machine needs to be rebooted after these changes.

Wrappers documentation

The following wrappers are tested and complete.

There is also active work on a wrapper for Go; visit #indy-sdk on Rocket.Chat for details.

Indy CLI documentation

  • An explanation of how to install the official command line interface for that provides commands to manage wallets and interactions with the ledger: Indy CLI

How to migrate

The documents that provide necessary information for Libindy migrations.

How to Contribute

  • We'd love your help; see these HL Indy Wiki and slides on how to contribute.
  • If you need to add a new call, read this instruction.
  • You may also want to read this info about maintainers and our process.
  • We use developer certificate of origin (DCO) in all hyperledger repositories, so to get your pull requests accepted, you must certify your commits by signing off on each commit. More information can be found in Signing Commits article.

Notes

  • Libindy implements multithreading approach based on mpsc channels. If your application needs to use Libindy from multiple processes you should keep in mind the following restrictions:
    • Fork - duplicates only the main thread. So, child threads will not be duplicated. If any out-of-process requirements are possible, the caller must fork first before any calls to Libindy (otherwise the command from a child thread will hang). Fork is only available on Unix.
    • Popen - spawns a new OS level process which will create its own child threads. Popen is cross-platform.

indy-sdk's People

Contributors

adenishchenko avatar anastasia-tarasova avatar andkononykhin avatar artemkaaas avatar ashcherbakov avatar axelnennker avatar cybermag avatar dhh1128 avatar dkulic avatar faisal00813 avatar farskipper avatar hadleym avatar ianco avatar jovfer avatar kdenhartog avatar keichiri avatar khagesh avatar kithat avatar mattraffel avatar michaeldboyd avatar mikelodder7 avatar mirgee avatar mrjcrunch avatar patrik-stas avatar peacekeeper avatar rytmarsh avatar sergeypalamarchuk avatar srottem avatar tmarkovski avatar toktar 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  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  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  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  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  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

indy-sdk's Issues

[Feature request] Filesystem paths need to be configurable

Currently the paths where configurations and wallets are searched for and saved to are fixed in EnvironmentUtils::indy_home_path and similar functions.

It would be better to have the following system to set the indy home path:

  1. An API (e.g. indy_set_home_path(const char*)); if this API has not been called yet when the path is needed, then
  2. An environment variable (e.g. INDY_HOME_PATH); if this variable is not set then
  3. A default system-specific path (as implemented now).

It would be even better to have the above system available at finer granularity, so that EnvironmentUtils::<whatever>_home_path (where <whatever> is currently either wallet or pool) can be controlled in the following ways:

  1. An API (e.g. indy_set_<whatever>_path(const char*)); if this API has not been called yet when the path is needed, then
  2. An environment variable (e.g. INDY_<WHATEVER>_PATH); if this variable is not set then
  3. The current default <EnvironmentUtils::indy_home_path>/<whatever>, where EnvironmentUtils::indy_home_path can be controlled as explained above.

If this is to be implemented, the ability to set the temporary directory in the same way as explained above for the home directory would make the feature more complete, but is arguably less useful in practical scenarios.

nonce in node getting started

This line has a constant nonce
https://github.com/hyperledger/indy-sdk/blob/master/samples/nodejs/gettingStarted.js#L246

Two questions:

  1. What are the requirements on nonce? Is there a minimum length or an exact length requirement? Some Rust code suggests that some nonces have an exact length.
    https://github.com/hyperledger/indy-sdk/blob/master/libindy/src/utils/crypto/chacha20poly1305_ietf/sodium.rs#L10

  2. In the Rust code there is a method gen_nonce. Would it make sense to expose that to the API and wrappers? If not, would you consider providing random nonce generation examples in all the getting_started guides to help developers generate them and not copying the static ones to production code.

var crypto = require('crypto'),
    biguint = require('biguint-format');
biguint.format(crypto.randomBytes(16), 'dec');

There is zero information about what nonce is in https://www.npmjs.com/package/indy-sdk.

Not able to get nodes started on Mac possibly due to missing indy_config.py

I've successfully ran pip3 install indy-node-dev on Mac but am running into an error when trying to start nodes

which -a generate_indy_pool_transactions
/usr/local/bin/generate_indy_pool_transactions
bc-computer:~ momi$ /usr/local/bin/generate_indy_pool_transactions --nodes 4 --clients 5 --nodeNum 1 2 3 4
Traceback (most recent call last):
  File "/usr/local/bin/generate_indy_pool_transactions", line 16, in <module>
    getTxnOrderedFields(), ConfigHelper, NodeConfigHelper)
  File "/usr/local/lib/python3.6/site-packages/plenum/common/test_network_setup.py", line 207, in bootstrapTestNodes
    for line in fileinput.input(['/etc/indy/indy_config.py'], inplace=True):
  File "/usr/local/Cellar/python3/3.6.3/Frameworks/Python.framework/Versions/3.6/lib/python3.6/fileinput.py", line 250, in __next__
    line = self._readline()
  File "/usr/local/Cellar/python3/3.6.3/Frameworks/Python.framework/Versions/3.6/lib/python3.6/fileinput.py", line 337, in _readline
    os.rename(self._filename, self._backupfilename)
PermissionError: [Errno 13] Permission denied: '/etc/indy/indy_config.py' -> '/etc/indy/indy_config.py.bak'

The original error I got was that the file wasn't found:

FileNotFoundError: [Errno 2] No such file or directory: '/etc/indy/indy_config.py' -> '/etc/indy/indy_config.py.bak'

So I touched the file which resulted in the permission denied error.

 touch /etc/indy/indy_config.py
touch: /etc/indy/indy_config.py: Permission denied
bc-computer:~ momi$ sudo touch /etc/indy/indy_config.py

I also tried to run the generate_indy_pool_transactions command as sudo

bc-computer:~ momi$ sudo touch /etc/indy/indy_config.py

but got this error, probably because I didn't have the indy_config.py file to begin with:

sudo generate_indy_pool_transactions --nodes 4 --clients 5 --nodeNum 1 2 3 4
Traceback (most recent call last):
  File "/usr/local/bin/generate_indy_pool_transactions", line 16, in <module>
    getTxnOrderedFields(), ConfigHelper, NodeConfigHelper)
  File "/usr/local/lib/python3.6/site-packages/plenum/common/test_network_setup.py", line 216, in bootstrapTestNodes
    config_helper_class, node_config_helper_class)
  File "/usr/local/lib/python3.6/site-packages/plenum/common/test_network_setup.py", line 84, in bootstrapTestNodesCore
    os.makedirs(config_helper.genesis_dir, exist_ok=True)
  File "/usr/local/lib/python3.6/site-packages/indy_common/config_helper.py", line 16, in genesis_dir
    os.path.join(self.config.GENESIS_DIR, self.config.NETWORK_NAME))
AttributeError: module 'indy_config.py' has no attribute 'GENESIS_DIR'

I think this is an attempt to resolve the problem of missing files.

Should I run any of the scripts from that commit? Will they run on MacOS (High Sierra)?

My environment is:
uname -msra
Darwin bc-computer.local 17.2.0 Darwin Kernel Version 17.2.0: Fri Sep 29 18:27:05 PDT 2017; root:xnu-4570.20.62~3/RELEASE_X86_64 x86_64

Please advise on any next steps I should take to get problem resolved and to start nodes.

Thanks

E: Unable to locate package indy-cli

Following the instructions here:

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 indy-cli

yeilds:

Reading package lists... Done
Building dependency tree
Reading state information... Done
E: Unable to locate package indy-cli

Can somone please advise?

RUST_TEST_THREADS=1 cargo test command fails on Ubuntu 16.04 LTS

Hi - similar scenario to issue 447 but different problem.
Running the Setup Indy SDK build environment instructions,
All OK (including cargo build) until step 'Run tests' RUST_TEST_THREADS=1 cargo test.
Then error: error: linking with 'cc' failed: exit code: 1

I thought this might be similar to issue 295 as my libsodium version was 1.0.8-5. Upgraded libsodium8 and libsodium-dev to 1.0.13.1 but this made no difference.

Environment detail:

  • uname -a : Linux hidalgo 4.4.0-104-generic #127-Ubuntu SMP Mon Dec 11 12:16:42 UTC 2017 x86_64 x86_64 x86_64 GNU/Linux
  • rustc --version : rustc 1.22.1 (05e2e1c41 2017-11-22)

What further info would help diagnose the issue?
Thanks!

CLI: many commands missing compared to indy-node CLI

According to the indy-node readme, the indy-sdk cli should replace the indy-node cli.

But, looking at the source of the former, the source of the latter and the design document of the latter, it appears that the indy-sdk cli is still missing many functions.

I found a jira issue about the overall switch between the two clis, but I didn't manage to understand whether the missing commands will be implemented and, if so, whether they will be available soon or require some more time.

Cargo build of libindy failing in MacOS

I followed the build instructions in mac-build.md. I get the following error:

Compiling sodiumoxide v0.0.16
error: failed to run custom build command for `zmq-sys v0.8.2`
process didn't exit successfully: `/Users/harold/Documents/workspace/indy-sdk/libindy/target/debug/build/zmq-sys-874f4247528cfe3b/build-script-build` (exit code: 101)
--- stderr
thread 'main' panicked at 'Unable to locate libzmq:
`"pkg-config" "--libs" "--cflags" "libzmq >= 3.2"` did not exit successfully: exit code: 1
--- stderr
Package libzmq was not found in the pkg-config search path.
Perhaps you should add the directory containing `libzmq.pc'
to the PKG_CONFIG_PATH environment variable
No package 'libzmq' found
', /Users/harold/.cargo/registry/src/github.com-1ecc6299db9ec823/zmq-sys-0.8.2/build.rs:31:17
note: Run with `RUST_BACKTRACE=1` for a backtrace.

warning: build failed, waiting for other jobs to finish...
error: build failed

My environment variables are:
export PKG_CONFIG_ALLOW_CROSS=1
export CARGO_INCREMENTAL=1
export RUST_LOG=indy=trace
export RUST_TEST_THREADS=1
export OPENSSL_DIR=/usr/local/Cellar/openssl/1.0.2o_2

Docker getting_started unable to access keyserver

When, I was trying to run the docker-compose in indy-sdk/doc/getting-started I wasn't able to get a key from ubuntu's key server.

Step 5/22 : RUN apt-key adv --keyserver keyserver.ubuntu.com --recv-keys 68DB5E88
---> Running in 5bb694c6f621
Executing: /tmp/tmp.sAbcDRiKqb/gpg.1.sh --keyserver
keyserver.ubuntu.com
--recv-keys
68DB5E88
gpg: requesting key 68DB5E88 from hkp server keyserver.ubuntu.com
gpg: keyserver timed out
gpg: keyserver receive failed: keyserver error

I was able to fix it by:

  1. replacing keyserver.ubuntu.com with hkp://keyserver.ubuntu.com:80 in /indy-sdk/doc/getting-started/getting_started.dockerfile and indy-sdk/ci/indy-pool.dockerfile
  2. rebuild with docker-compose build --no-cache
  3. Run with docker-compose up

I think the keyserver addresses should be updated, or at the least, the documentation updated to address this.

Thanks.

Can not run the source code of tutorials "Write a DID and Query Its Verkey"

I do this tutorial. I run "mvn clean install" It show "Build Success" on terminal. I already have libindy.so file in ./lib/

But, When I click button "Run App" on Eclipse IDE, It show this error.

And this is my pom.xml file:

<modelVersion>4.0.0</modelVersion>
<groupId>org.hyperledger.indy-sdk-java</groupId>
<artifactId>indy-sdk-java-sample</artifactId>
<packaging>jar</packaging>
<version>0.0.1</version>
<name>indy-sdk-java</name>
<description>This is the sample of usage java wrapper for Hyperledger Indy SDK.
</description>
<licenses>
	<license>
		<name>MIT/Apache-2.0</name>
		<url>http://www.apache.org/licenses/LICENSE-2.0.txt</url>
		<distribution>repo</distribution>
	</license>
</licenses>

<scm>
	<url>https://github.com/hyperledger/indy-sdk</url>
	<connection>scm:git:git://github.com/hyperledger/indy-sdk.git</connection>
	<developerConnection>scm:git:[email protected]:hyperledger/indy-sdk.git</developerConnection>
</scm>

<properties>
	<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
	<github.global.server>github</github.global.server>
</properties>

<repositories>
	<repository>
		<id>evernym</id>
		<url>https://repo.evernym.com/artifactory/libindy-maven-local</url>
	</repository>
</repositories>

<build>
	<plugins>
		<plugin>
			<groupId>org.apache.maven.plugins</groupId>
			<artifactId>maven-compiler-plugin</artifactId>
			<version>3.3</version>
			<configuration>
				<source>1.8</source>
				<target>1.8</target>
			</configuration>
		</plugin>
		<plugin>
			<groupId>org.apache.maven.plugins</groupId>
			<artifactId>maven-source-plugin</artifactId>
			<version>2.4</version>
			<executions>
				<execution>
					<goals>
						<goal>jar</goal>
					</goals>
				</execution>
			</executions>
		</plugin>
		<plugin>
			<groupId>org.apache.maven.plugins</groupId>
			<artifactId>maven-surefire-plugin</artifactId>
			<version>2.18.1</version>
		</plugin>
		<plugin>
			<groupId>org.apache.maven.plugins</groupId>
			<artifactId>maven-dependency-plugin</artifactId>
			<version>2.10</version>
			<executions>
				<execution>
					<id>execution</id>
					<phase>package</phase>
					<goals>
						<goal>copy-dependencies</goal>
					</goals>
				</execution>
			</executions>
			<configuration>
				<includeScope>runtime</includeScope>
			</configuration>
		</plugin>

	</plugins>
</build>

<dependencies>
	<dependency>
		<groupId>junit</groupId>
		<artifactId>junit</artifactId>
		<version>4.12</version>
	</dependency>
	<dependency>
		<groupId>org.apache.commons</groupId>
		<artifactId>commons-lang3</artifactId>
		<version>3.5</version>
		<scope>compile</scope>
	</dependency>
	<dependency>
		<groupId>commons-io</groupId>
		<artifactId>commons-io</artifactId>
		<version>2.5</version>
	</dependency>
	<dependency>
		<groupId>org.json</groupId>
		<artifactId>json</artifactId>
		<version>20160810</version>
	</dependency>
	<dependency>
		<groupId>org.hyperledger</groupId>
		<artifactId>indy</artifactId>
		<version>1.4.0</version>
	</dependency>
</dependencies>

Help me, I run on Ubuntu 16.04, this is the first time I work with maven.

Thank you.

RUST_TEST_THREADS=1 cargo test command fails on ubuntu

I am getting the errors below when executing this command:

RUST_TEST_THREADS=1 cargo test

from these instructions with this environment:

uname -msra
Linux proliant 4.10.0-28-generic #32~16.04.2-Ubuntu SMP Thu Jul 20 10:19:48 UTC 2017 x86_64 x86_64 x86_64 GNU/Linux

Everything up to that point worked successfully.

error: associated constants are experimental (see issue #29646)
  --> /root/.cargo/registry/src/github.com-1ecc6299db9ec823/indy-crypto-0.2.0/src/pair/amcl.rs:49:5
   |
49 |     const BYTES_REPR_SIZE: usize = MODBYTES * 4;
   |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

error: associated constants are experimental (see issue #29646)
   --> /root/.cargo/registry/src/github.com-1ecc6299db9ec823/indy-crypto-0.2.0/src/pair/amcl.rs:198:5
    |
198 |     const BYTES_REPR_SIZE: usize = MODBYTES * 4;
    |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

error: associated constants are experimental (see issue #29646)
   --> /root/.cargo/registry/src/github.com-1ecc6299db9ec823/indy-crypto-0.2.0/src/pair/amcl.rs:326:5
    |
326 |     const BYTES_REPR_SIZE: usize = MODBYTES;
    |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

error: associated constants are experimental (see issue #29646)
   --> /root/.cargo/registry/src/github.com-1ecc6299db9ec823/indy-crypto-0.2.0/src/pair/amcl.rs:490:5
    |
490 |     const BYTES_REPR_SIZE: usize = MODBYTES * 16;
    |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

error: aborting due to 4 previous errors

error: Could not compile `indy-crypto`.
Build failed, waiting for other jobs to finish...
error: build failed

Any suggestions? I am stuck at this point.

Thanks

Error: Ledger merkle tree doesn't acceptable for current tree

Hi,

I'm trying to use the Python wrapper against the master of hyperledger/indy-node and it fails consistently when running open_pool_ledger. Initially I though there's something wrong with my Python code, but then I tried running the code from samples and got the same error: Ledger merkle tree doesn't acceptable for current tree:

cd samples/python
python3 src/main.py

Error:

...
 INFO|indy::services::pool          |           src/services/pool/mod.rs:544 | RemoteNode::send_str Node1 {"op":"LEDGER_STATUS","txnSeqNo":4,"merkleRoot":"EBEbqTXvTpgJ6z6W9YGme41TdcnWW6AQjqXt7duTnbRP","ledgerId":0,"ppSeqNo":null,"viewNo":null}
TRACE|indy::services::pool          |           src/services/pool/mod.rs:246 | zmq poll loop <<
TRACE|indy::services::pool          |           src/services/pool/mod.rs:240 | zmq poll loop >>
TRACE|indy::services::pool          |           src/services/pool/mod.rs:348 | get_zmq_poll_timeout first_event Tm { tm_sec: 21, tm_min: 59, tm_hour: 16, tm_mday: 15, tm_mon: 1, tm_year: 118, tm_wday: 4, tm_yday: 45, tm_isdst: 0, tm_utcoff: 0, tm_nsec: 454409000 }
TRACE|indy::services::pool          |           src/services/pool/mod.rs:349 | get_zmq_poll_timeout now_utc Tm { tm_sec: 31, tm_min: 58, tm_hour: 16, tm_mday: 15, tm_mon: 1, tm_year: 118, tm_wday: 4, tm_yday: 45, tm_isdst: 0, tm_utcoff: 0, tm_nsec: 534605000 }
TRACE|indy::services::pool          |           src/services/pool/mod.rs:351 | get_zmq_poll_timeout diff Duration Duration { secs: 49, nanos: 919804000 }
TRACE|indy::services::pool          |           src/services/pool/mod.rs:353 | get_zmq_poll_timeout diff ms 49919
TRACE|indy::services::pool          |           src/services/pool/mod.rs:293 | zmq poll 2
 INFO|indy::services::pool          |           src/services/pool/mod.rs:538 | RemoteNode::recv_msg Node4 {"viewNo":null,"op":"LEDGER_STATUS","ledgerId":0,"merkleRoot":"FTH83QNd84mnaXFD8vQdRHbRmmkZqz22pbHFjzy9mYt1","ppSeqNo":null,"txnSeqNo":4}
 INFO|indy::services::pool          |           src/services/pool/mod.rs:538 | RemoteNode::recv_msg Node3 {"merkleRoot":"FTH83QNd84mnaXFD8vQdRHbRmmkZqz22pbHFjzy9mYt1","ledgerId":0,"viewNo":null,"ppSeqNo":null,"op":"LEDGER_STATUS","txnSeqNo":4}
TRACE|indy::services::pool          |           src/services/pool/mod.rs:244 | process_actions - Invalid library state: Ledger merkle tree doesn't acceptable for current tree.
ERROR|indy::services::pool          |           src/services/pool/mod.rs:426 | Pool worker thread finished with error CommonError(InvalidState("Ledger merkle tree doesn\'t acceptable for current tree."))
 INFO|indy::commands                |                src/commands/mod.rs:99  | PoolCommand command received
 INFO|indy::commands::pool          |               src/commands/pool.rs:68  | OpenAck handle 4, pool_id 5, result Err(CommonError(InvalidState("Ledger merkle tree doesn\'t acceptable for current tree.")))
ERROR|indy::errors::indy            |                 src/errors/indy.rs:68  | Casting error to ErrorCode: Invalid library state: Ledger merkle tree doesn't acceptable for current tree.
WARNING:indy.libindy:_indy_loop_callback: Function returned error 112
Traceback (most recent call last):
  File "src/main.py", line 15, in <module>
    loop.run_until_complete(main())
  File "/usr/local/Cellar/python3/3.6.4_2/Frameworks/Python.framework/Versions/3.6/lib/python3.6/asyncio/base_events.py", line 467, in run_until_complete
    return future.result()
  File "src/main.py", line 10, in main
    await ledger.demo()
  File "/Users/me/Projects/hyperledger/indy-sdk/samples/python/src/ledger.py", line 24, in demo
    pool_handle = await pool.open_pool_ledger(pool_name, None)
  File "/Users/me/Projects/hyperledger/indy-sdk/wrappers/python/indy/pool.py", line 82, in open_pool_ledger
    open_pool_ledger.cb)
indy.error.IndyError: ErrorCode.CommonInvalidState

Background

I tried many different ways of connecting to Indy using the Python wrapper but it always fails with CommonInvalidState.

I found this issue report: https://jira.hyperledger.org/browse/IS-355?page=com.atlassian.streams.streams-jira-plugin%3Aactivity-stream-issue-tab

My suspicion is that the version of indy-crypto may be inconsistent between indy-sdk and indy-node, but I can't see the way to roll it back for indy-sdk without losing the whole lot of recent changes.

Any guidance how to fix it would be highly appreciated.

Stan

Error: `No reqId in request` in `SubmitAck` command after submitting GET_NYM request

Test pool started from indy-sdk Dockerfile, master branch (yesterday).
Client using custom Android build of indy-sdk, master branch (three days ago).

Code follows step by step the ledger tutorial, but in Typescript.

From code:

const get_nym_req = await indy.build_get_nym_request(trustee_did, did);
const get_nym_res = await indy.submit_request(pool, get_nym_req) as any;

From Android log:

indy::api::ledger:          indy_submit_request:
                                >>> pool_handle: 2, request_json: 0x660219f0
indy::api::ledger:          indy_submit_request: entities
                                >>> pool_handle: 2, request_json: "\"{\\\"reqId\\\":1527667759626699721,\\\"identifier\\\":\\\"V4SGRU86Z58d6TV7PBUe6f\\\",\\\"operation\\\":{\\\"type\\\":\\\"105\\\",\\\"dest\\\":\\\"J4qUvZPtsMQMv4KJ6FBes6\\\"},\\\"protocolVersion\\\":1}\""
indy::commands:             LedgerCommand command received
indy::commands::ledger:     SubmitRequest command received
indy::commands::ledger:     submit_request
                                >>> handle: 2, request_json: "\"{\\\"reqId\\\":1527667759626699721,\\\"identifier\\\":\\\"V4SGRU86Z58d6TV7PBUe6f\\\",\\\"operation\\\":{\\\"type\\\":\\\"105\\\",\\\"dest\\\":\\\"J4qUvZPtsMQMv4KJ6FBes6\\\"},\\\"protocolVersion\\\":1}\""
indy::services::pool:       zmq poll 1
indy::services::pool:       cmd [[34, 123, 92, 34, 114, 101, 113, 73, 100, 92, 34, 58, 49, 53, 50, 55, 54, 54, 55, 55, 53, 57, 54, 50, 54, 54, 57, 57, 55, 50, 49, 44, 92, 34, 105, 100, 101, 110, 116, 105, 102, 105, 101, 114, 92, 34, 58, 92, 34, 86, 52, 83, 71, 82, 85, 56, 54, 90, 53, 56, 100, 54, 84, 86, 55, 80, 66, 85, 101, 54, 102, 92, 34, 44, 92, 34, 111, 112, 101, 114, 97, 116, 105, 111, 110, 92, 34, 58, 123, 92, 34, 116, 121, 112, 101, 92, 34, 58, 92, 34, 49, 48, 53, 92, 34, 44, 92, 34, 100, 101, 115, 116, 92, 34, 58, 92, 34, 74, 52, 113, 85, 118, 90, 80, 116, 115, 77, 81, 77, 118, 52, 75, 74, 54, 70, 66, 101, 115, 54, 92, 34, 125, 44, 92, 34, 112, 114, 111, 116, 111, 99, 111, 108, 86, 101, 114, 115, 105, 111, 110, 92, 34, 58, 49, 125, 34], [5, 0, 0, 0]]
indy::services::pool:..:    cmd "\"{\\\"reqId\\\":1527667759626699721,\\\"identifier\\\":\\\"V4SGRU86Z58d6TV7PBUe6f\\\",\\\"operation\\\":{\\\"type\\\":\\\"105\\\",\\\"dest\\\":\\\"J4qUvZPtsMQMv4KJ6FBes6\\\"},\\\"protocolVersion\\\":1}\""
indy::api::ledger:          indy_submit_request:
                                <<< res: Success
indy::services::pool:       zmq poll loop <<
indy::commands:             LedgerCommand command received
indy::commands::ledger:     SubmitAck command received
indy::errors::indy:         Casting error to ErrorCode: Invalid structure: No reqId in request
indy::services::pool:       zmq poll loop >>
indy::api::ledger:          indy_submit_request: request_result_json: ""

GDPR compliance

Dear indy team, even though this not an issue, I want to ask if you have investigated your mechanisms according to GDPR. It wood be very helpful for any application with users in the EU considering to integrate indy.

Thanks!

Build is failing for Mac OS

Cargo build is failing for MacOS

error: linking with cc failed: exit code: 1

note: Undefined symbols for architecture x86_64:
"_je_malloc_usable_size", referenced from:
heapsize::heap_size_of_impl::hd63dce4a1e7de8ce in libheapsize-81e9311798c7d6fb.rlib(heapsize-81e9311798c7d6fb.0.o)
ld: symbol(s) not found for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)

Providing more info with Exceptions (Java SDK wrapper)

Current Java SDK wrapper only returning general information when exception occurs, for example "org.hyperledger.indy.sdk.InvalidStructureException: A value being processed is not valid." when passing a JSON to Indy node which is not helpful to dig into it. Hope it can provide more information when such errors happened.

Creating a pool handle with genesis file results in Unexpected token

indy_sdk: 1.5.0
npm indy_sdk 2.5.0
Platform: OSX

Running a docker container detailed

docker build -f ci/indy-pool.dockerfile -t indy_pool .
docker run -itd -p 9701-9708:9701-9708 indy_pool

using the genesis file found in:

indy-sdk/cli/docker_pool_transactions_genesis
result:

docker_pool_transactions_genesis:1
(function (exports, require, module, __filename, __dirname) { {"reqSignature":{},"txn":{"data":{"data":{"alias":"Node1","blskey":"4N8aUNHSgjQVgkpm8nhNEfDf6txHznoYREg9kirmJrkivgL4oSEimFF6nsQ6M41QvhM2Z33nves5vfSn9n1UwNFJBYtWVnHYMATn76vLuL3zU88KyeAYcHfsih3He6UHcXDxcaecHVz6jhCYz1P2UZn2bDVruL5wXpehgBfBaLKm3Ba","client_ip":"10.0.0.2","client_port":9702,"node_ip":"10.0.0.2","node_port":9701,"services":["VALIDATOR"]},"dest":"Gw6pDLhcBcoQesN72qfotTgFa7cbuqZpkX3Xo6pLhPhv"},"metadata":{"from":"Th7MpTaRZVRYnPiabds81Y"},"type":"0"},"txnMetadata":{"seqNo":1,"txnId":"fea82e10e894419fe2bea7d96296a6d46f50f93f9eeda954ec461b2ed2950b62"},"ver":"1"}
                                                                             ^

SyntaxError: Unexpected token :
    at new Script (vm.js:74:7)
    at createScript (vm.js:246:10)
    at Object.runInThisContext (vm.js:298:10)
    at Module._compile (internal/modules/cjs/loader.js:646:28)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:689:10)
    at Module.load (internal/modules/cjs/loader.js:589:32)
    at tryModuleLoad (internal/modules/cjs/loader.js:528:12)
    at Function.Module._load (internal/modules/cjs/loader.js:520:3)
    at Module.require (internal/modules/cjs/loader.js:626:17)
    at require (internal/modules/cjs/helpers.js:20:18)

cargo test failure problem

When I tried to issue: cargo test. I got this error:

"Unexpected SQLite error: disk I/O error"

I have installed libsqlite-dev.
Is there any package I missed? Or something else?

setProtocolVersion is not a function

OS: MAC OS X
Running getting started node.js sample:

TypeError: indy.setProtocolVersion is not a function

If I do not set the protocol function:

Pool worker thread finished with error PoolIncompatibleProtocolVersion("Libindy PROTOCOL_VERSION is 1 but Pool Genesis Transactions are of version 1.4.Call indy_set_protocol_version(2) to set correct PROTOCOL_VERSION")

higher level API

Developers have to go through some repetitive code when using libindy.

The pattern is build request, send request, sometimes parse response.
Like here: https://github.com/hyperledger/indy-sdk/blob/master/samples/nodejs/gettingStarted.js#L715

These are only small snippets but why repeat them in all applications using libindy?

I heard this several time from different developers adn suggest to move these methods up and expose them in the API (maybe even deprecating the low-level methods?)

Indy CLI doesn't work for file input.

According to the documentation I can use the Indy CLI in batch mode with:

indy-cli <path-to-text-file>

I'm running it like:

indy /usr/myapp/setup.indy

And I get:

Loading module /usr/local/lib/python3.5/dist-packages/config/config-crypto-example1.py
Module loaded.

Indy-CLI (c) 2017 Evernym, Inc.
Type 'help' for more information.
Running Indy 1.2.270


Running command: '/usr/myapp/setup.indy'...

Invalid command: '/usr/myapp/setup.indy'

A note about my setup - I'm essentially following the docker build instructions here

which uses the following dependencies:


# Config apt
RUN add-apt-repository "deb http://us.archive.ubuntu.com/ubuntu xenial main universe"
RUN apt-key adv --keyserver keyserver.ubuntu.com --recv-keys 68DB5E88
RUN add-apt-repository "deb https://repo.sovrin.org/deb xenial master"
RUN add-apt-repository "deb https://repo.sovrin.org/sdk/deb xenial stable"

# Update apt
RUN apt-get update

# Install packages
RUN apt-get install -y libsodium18
RUN apt-get install -y python3-charm-crypto
RUN apt-get install -y libindy 
RUN apt-get install -y libindy-crypto

####################
##  Indy
####################

# Config apt

# Update apt
RUN apt-get update

# Install packages
RUN apt-get install -y indy-node

Getting Started - Create wallet error

Hi,

I tried the getting started code with the docker-compose provided and I encounter an error when trying to create the Steward wallet:

`IndyError Traceback (most recent call last)
in run()
25 await wallet.create_wallet(pool_name, steward_wallet_name, None, None,
---> 26 None)
27 except IndyError as ex:

/usr/local/lib/python3.5/dist-packages/indy/wallet.py in create_wallet(pool_name, name, xtype, config, credentials)
51 c_credentials,
---> 52 create_wallet.cb)
53

/usr/lib/python3.5/asyncio/futures.py in iter(self)
362 assert self.done(), "yield from wasn't used with future"
--> 363 return self.result() # May raise too.
364

/usr/lib/python3.5/asyncio/futures.py in result(self)
273 if self._exception is not None:
--> 274 raise self._exception
275 return self._result

IndyError: ErrorCode.CommonInvalidParam6`

Do you have any idea of what is causing this ?

Running indy-pool.dockerfile fails in Plenum Python package

I have been creating Docker containers of the indy-pool with the provided indy-pool.dockerfile for over 2 months now. This morning it simply stopped working with the following error message:

Step 21/23 : RUN generate_indy_pool_transactions --nodes 4 --clients 5 --nodeNum 1 2 3 4 --ips="$pool_ip,$pool_ip,$pool_ip,$pool_ip"
 ---> Running in 77a61ead17ea
Traceback (most recent call last):
  File "/usr/local/bin/generate_indy_pool_transactions", line 19, in <module>
    getTxnOrderedFields(), ConfigHelper, NodeConfigHelper)
  File "/usr/local/lib/python3.5/dist-packages/plenum/common/test_network_setup.py", line 207, in bootstrapTestNodes
    steward_defs, node_defs = cls.gen_defs(args.ips, args.nodes, startingPort)
  File "/usr/local/lib/python3.5/dist-packages/plenum/common/test_network_setup.py", line 291, in gen_defs
    d.verkey = s_signer.verkey
  File "/usr/local/lib/python3.5/dist-packages/plenum/common/signer_did.py", line 54, in verkey
    return self.abbr_prfx + self._verkey
TypeError: Can't convert 'bytes' object to str implicitly
ERROR: Service 'pool' failed to build: The command '/bin/sh -c generate_indy_pool_transactions --nodes 4 --clients 5 --nodeNum 1 2 3 4 --ips="$pool_ip,$pool_ip,$pool_ip,$pool_ip"' returned a non-zero code: 1

This seems rather unusual to me since all indy-package versions are specified within the dockerfile (e.g. ARG indy_plenum_ver=1.2.237). Any thoughts on why the provided dockerfile is failing on me out of a sudden?

ci/indy-pool.dockerfile doesn't run on Raspberry Pi

The dependencies installed in ci/indy-pool.dockerfile don't work on raspberry pi. Is there a version of this file that pulls and compiles directly from the repositories rather than using apt-get to install them?

Libindy VM returns 'CommonInvalidState' when running test cases to connecting to the pool

Setting up the Vagrant VM environment (or Docker) and running the Python Test programs from the Libindy01 VM produces the following error.

Note: Both the 'Stable' branch and the 'Master' branch of Indy-Node have been tested and both return this error.

INFO|indy::commands | src/commands/mod.rs:108 | PoolCommand command received INFO|indy::services::pool | src/services/pool/mod.rs:549 | RemoteNode::send_str Node1 pi INFO|indy::services::pool | src/services/pool/mod.rs:549 | RemoteNode::send_str Node3 pi INFO|indy::services::pool | src/services/pool/mod.rs:549 | RemoteNode::send_str Node2 pi INFO|indy::services::pool | src/services/pool/mod.rs:549 | RemoteNode::send_str Node4 pi INFO|indy::services::pool | src/services/pool/mod.rs:543 | RemoteNode::recv_msg Node2 po INFO|indy::services::pool | src/services/pool/mod.rs:549 | RemoteNode::send_str Node2 {"op":"LEDGER_STATUS","txnSeqNo":4,"merkleRoot":"HPjXYNQy1UMjoD3XkBnZZaoL8B8a4N4foZdKCpyQDBC6","ledgerId":0,"ppSeqNo":null,"viewNo":null} INFO|indy::services::pool | src/services/pool/mod.rs:543 | RemoteNode::recv_msg Node1 po INFO|indy::services::pool | src/services/pool/mod.rs:549 | RemoteNode::send_str Node1 {"op":"LEDGER_STATUS","txnSeqNo":4,"merkleRoot":"HPjXYNQy1UMjoD3XkBnZZaoL8B8a4N4foZdKCpyQDBC6","ledgerId":0,"ppSeqNo":null,"viewNo":null} INFO|indy::services::pool | src/services/pool/mod.rs:543 | RemoteNode::recv_msg Node4 po INFO|indy::services::pool | src/services/pool/mod.rs:549 | RemoteNode::send_str Node4 {"op":"LEDGER_STATUS","txnSeqNo":4,"merkleRoot":"HPjXYNQy1UMjoD3XkBnZZaoL8B8a4N4foZdKCpyQDBC6","ledgerId":0,"ppSeqNo":null,"viewNo":null} INFO|indy::services::pool | src/services/pool/mod.rs:543 | RemoteNode::recv_msg Node3 po INFO|indy::services::pool | src/services/pool/mod.rs:549 | RemoteNode::send_str Node3 {"op":"LEDGER_STATUS","txnSeqNo":4,"merkleRoot":"HPjXYNQy1UMjoD3XkBnZZaoL8B8a4N4foZdKCpyQDBC6","ledgerId":0,"ppSeqNo":null,"viewNo":null} INFO|indy::services::pool | src/services/pool/mod.rs:543 | RemoteNode::recv_msg Node4 {"ledgerId":0,"viewNo":null,"txnSeqNo":4,"ppSeqNo":null,"op":"LEDGER_STATUS","merkleRoot":"DKTaqoxsaDxNwVBhGyqH5W6HRMmQ8viSSeypSKekfuQw"} INFO|indy::services::pool | src/services/pool/mod.rs:543 | RemoteNode::recv_msg Node2 {"ledgerId":0,"viewNo":null,"txnSeqNo":4,"op":"LEDGER_STATUS","merkleRoot":"DKTaqoxsaDxNwVBhGyqH5W6HRMmQ8viSSeypSKekfuQw","ppSeqNo":null} INFO|indy::services::pool | src/services/pool/mod.rs:543 | RemoteNode::recv_msg Node3 {"viewNo":null,"ppSeqNo":null,"ledgerId":0,"txnSeqNo":4,"op":"LEDGER_STATUS","merkleRoot":"DKTaqoxsaDxNwVBhGyqH5W6HRMmQ8viSSeypSKekfuQw"} INFO|indy::commands | src/commands/mod.rs:108 | PoolCommand command received INFO|indy::commands::pool | src/commands/pool.rs:67 | OpenAck handle 1, pool_id 2, result Err(CommonError(InvalidState("Ledger merkle tree doesn\'t acceptable for current tree."))) ERROR|indy::errors::indy | src/errors/indy.rs:68 | Casting error to ErrorCode: Invalid library state: Ledger merkle tree doesn't acceptable for current tree. DEBUG:indy.libindy:_indy_callback: >>> command_handle: 1, err 112, args: (0,) DEBUG:indy.libindy:_indy_callback: <<< DEBUG:indy.libindy:_indy_loop_callback: >>> command_handle: 1, err 112, args: (0,) WARNING:indy.libindy:_indy_loop_callback: Function returned error 112 DEBUG:indy.libindy:_indy_loop_callback <<< ERROR|indy::services::pool | src/services/pool/mod.rs:428 | Pool worker thread finished with error CommonError(InvalidState("Ledger merkle tree doesn\'t acceptable for current tree.")) Traceback (most recent call last): File "ServiceOntario.py", line 168, in <module> loop.run_until_complete(main()) File "/usr/lib/python3.5/asyncio/base_events.py", line 387, in run_until_complete return future.result() File "/usr/lib/python3.5/asyncio/futures.py", line 274, in result raise self._exception File "/usr/lib/python3.5/asyncio/tasks.py", line 241, in _step result = coro.throw(exc) File "ServiceOntario.py", line 122, in main pool_handle = await open_pool() File "ServiceOntario.py", line 97, in open_pool pool_handle = await pool.open_pool_ledger(pool_name, None) File "/usr/local/lib/python3.5/dist-packages/indy/pool.py", line 82, in open_pool_ledger open_pool_ledger.cb) File "/usr/lib/python3.5/asyncio/futures.py", line 361, in __iter__ yield self # This tells Task to wait for completion. File "/usr/lib/python3.5/asyncio/tasks.py", line 296, in _wakeup future.result() File "/usr/lib/python3.5/asyncio/futures.py", line 274, in result raise self._exception indy.error.IndyError: ErrorCode.CommonInvalidState

How to get started with Indy?

Super excited to see Sovrin joining Hyperledger project. However, I'm completely lost (1) how to deploy an Indy blockchain locally ? (2) where are the smart contract details - will chaincode run on Indy? (3) where are the source codes for the plenum blockchain? (4) Is there a doc anywhere with these details?

Migrate with how-tos

Current how-tos seem based on 1.3.0 which are not working with 1.4.0, hope can provide more examples with 1.4.0. Or at least give some example JSONs in Libindy migration Guide.

Provide the way to configure logging on C API level

Currently, libsovrin uses popular https://github.com/rust-lang-nursery/log facade. It allows linking with logger implementation in runtime.

We use env_logger that allows logging configuration by environment variables for our tests, but there is no logger initialization provided on C API level. I suggest the following:

  1. Call env_logger init method during initialization of CommandExecutor singleton
  2. Provide API that will allow registering custom callbacks for the logger. It will allow re-using same logging infrastructure as the main application that uses libsovrin.

Point 2 can be postponed.

sovrin_sign and sovrin_verify_signature should support arbitrary byte array

Right now, sovrin_sign and sovrin_verify_signature can create/verify signatures for the JSON messages that are sent to the ledger. In these methods, a JSON message is serialized to a byte array using a custom algorithm that is not used outside of Indy/Sovrin ledger communication. Also, the signature is automatically inserted into the JSON message.

I think it would be very useful if those methods could be used more generically, to create/verify signatures on any arbitrary byte array supplied by the library user.

indy_create_and_store_credential_def: `support_revocation` is documented as optional but is actually mandatory

From the documentation in api/anoncreds.rs:

/// config_json: type-specific configuration of credential definition as json:
/// - 'CL':
///   - support_revocation: whether to request non-revocation credential (optional, default false)

But if config_json is left empty, as the documentation suggests, the following error pops up:

Invalid structure: Cannot deserialize CredentialDefinitionConfig: InvalidStructure("missing field `support_revocation` at line 1 column 2")

This is due to the fact that in domain/anoncreds/credential_definition.rs CredentialDefinitionConfig::support_revocation has type bool instead of Option<bool>.

docker setup experience

when walking through the getting started guide using docker, the setup is somewhat difficult. I've had to make changes to the docker-compose.yaml (IP-pools) as well as I can't identify why there's about 20 docker images, and what each one does. Is there a way that we could build a docker image and commit it to the docker repository, helping to streamline the getting started process. Additional steps should be added to the instruction guides to indicate that cargo build should be run in indy-sdk and indy-crypto to get tests passing.

sovrin_store_their_did call has excess pk attribute in identity json

sovrin_store_their_did call has excess pk attribute in identity json, but keys for encryption/decription are always can be computed from signkey/verkey.

Looks like it can confuse library user. I suggest removing of this param.

sovrin_encrypt and sovrin_decrypt method also looks excess as we plan to use encryption/decryption on transport protocol layer (CurveCP). It is hard to use these methods directly as NaCL encryption requires nonce and corresponded handshake procedure for safe nonce generation on both sides.

I suggest removing these methods from API.

Getting Started Client install - indy-node

Following the instructions here, experiencing issues executing the following command:

pip3 install -U --no-cache-dir sovrin-client

which yields

x86_64-linux-gnu-gcc -pthread -DNDEBUG -g -fwrapv -O2 -Wall -Wstrict-prototypes -g -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -fPIC -DBENCHMARK_ENABLED=1 -Icharm/core/utilities/ -Icharm/core/benchmark/ -I/usr/include/python3.5m -c charm/core/math/pairing/pairingmodule.c -o build/temp.linux-x86_64-3.5/charm/core/math/pairing/pairingmodule.o
In file included from charm/core/math/pairing/pairingmodule.c:30:0:
charm/core/math/pairing/pairingmodule.h:37:17: fatal error: gmp.h: No such file or directory
compilation terminated.
error: command 'x86_64-linux-gnu-gcc' failed with exit status 1

----------------------------------------
Command "/usr/bin/python3 -u -c "import setuptools, tokenize;file='/tmp/pip-build-t8l864o5/Charm-Crypto/setup.py';exec(compile(getattr(tokenize, 'open', open)(file).read().replace('\r\n', '\n'), file, 'exec'))" install --record /tmp/pip-5oj3fh_2-record/install-record.txt --single-version-externally-managed --compile" failed with error code 1 in /tmp/pip-build-t8l864o5/Charm-Crypto/
root@619ca0be244e:/#

This issue is discussed here BUT I have tried the Xcode approach with the latest version of Mac OS including repairing the crypto.h file for openssl and was unable to fix the issue reported above. My mac os ver is 10.12.6.

I then decided to do a simple docker container for Ubuntu with a docker attach so that I can hit my local sovrin cluster of 4 validator nodes. Unfortunately, I get the same error.

In both cases the issue is with the gmp.h file.

Is there a better crypto package that works and is more dev-ops friendly across platforms?

Any suggestions?

Am I following the wrong getting started instructions?

sovrin_create_and_store_my_did doesn't support creation of seed based CID

If DID isn't provided sovrin_create_and_store_my_did always use first 16 bytes of generated verkey as DID, but identities in pool ledger generated by init scripts use full verkey as DID.

I now that CID is deprecated, but in the current state, it is hard to use libsovrin with private pool. Current integration tests use verkey instead of did as rough workaround and it can confuse potential library users.

I suggest adding support of optional "cid" attribute to did_json param. If it is true full generated verkey will be used as DID if there is no explicit DID.

Cargo build failing on Mac OS X

Cargo build is failing on Mac OS X (El Capitan). Looks like this isn't new, see evernym/sovrin-client-rust#84

Instructions followed https://github.com/hyperledger/indy-sdk/blob/master/doc/mac-build.md

Stack trace

$ cargo build
   Compiling libsodium-sys v0.0.14
   Compiling openssl-sys v0.9.16
   Compiling zmq-pw-sys v0.9.8
   Compiling rusqlite v0.10.1
error: failed to run custom build command for `libsodium-sys v0.0.14`
process didn't exit successfully: `/Volumes/d/java/labs/indy-sdk/libindy/target/debug/build/libsodium-sys-c34349471c02cc69/build-script-build` (exit code: 101)
--- stderr
thread 'main' panicked at 'called `Result::unwrap()` on an `Err` value: "Failed to run `\"pkg-config\" \"--libs\" \"--cflags\" \"libsodium\"`: No such file or directory (os error 2)"', src/libcore/result.rs:860:4
note: Run with `RUST_BACKTRACE=1` for a backtrace.

warning: build failed, waiting for other jobs to finish...
error: build failed**

check parameters

libindy is checking parameters when called through the API.

Additionally there are check at other places like e.g.
https://github.com/hyperledger/indy-sdk/blob/master/libindy/src/commands/non_secrets.rs#L241
The 'from_json' call just checks whether the options string is deserializable but does not use the resulting object. Using the RecordOptions object does not really make sense because in the end the options end up in the wallet_storage API which requires a string anyway.

'fail-fast' is good but this looks like wasted CPU cycles. Not sure what to do about this.

One line above the RecordOptions wasted json deserialization is a call to _check_type which makes it clearer what the purpose is: check_type is checking the type and RecordOptions::from_json is checking the options string.

Should those checks be configured away when a release version of libindy is build?
Should those checks be left to the code that is actually consuming the parameters, so fail-late?

Invalid Syntax in faber.py

I'm following instructions here: https://github.com/hyperledger/indy-node/blob/stable/environment/vagrant/training/vb-multi-vm/TestIndyClusterSetup.md

I'm on MacBook Pro (15-inch, 2017)running OSX High Sierra 10.13.4 (17E202)

Everything has worked so far, but when I try to follow the instructions for starting up the agents, I get a syntax error.

I ran:

cd indy-node/environment/vagrant/training/vb-multi-vm
vagrant ssh agent01
python /usr/local/lib/python3.5/dist-packages/indy_client/test/agent/faber.py --port 5555

That last python command gives me this error:

File "/usr/local/lib/python3.5/dist-packages/indy_client/test/agent/faber.py", line 99 async def bootstrap_faber(agent): ^ SyntaxError: invalid syntax

I'm not hugely up with Python so I haven't tried debugging it myself yet, just wasn't sure what I might be missing - have I somehow gotten the wrong version of python or something for these not to work as described?

I've followed all the instructions on the above page, no errors so far except for this.

Making better getting started guide

I've started to learn indy project by looking through getting started guide thoroughly, and while I did get a lot of understanding of working processes there were some rough edges. I tried to fix some in #556, but there are some more.

One thing is that wallet API is async, and create_wallet takes pool_name as a parameter. While after reading more documentation (and asking people) it became clear that this is done for consistency with other SDK APIs and for ability to handle remote wallets, at first I had impression that wallet had to connect to pool somehow, which was distracting. I think it would be great to have a paragraph somewhere in this guide elaborating on this.

Another one is onboarding function in jupyter notebook. I understand that it was written to reduce amount of code to perform onboarding different trust anchors, but in it's current state it's still quite hard to read and especially correlate with documentation. Maybe it would be better to split it to different functions (according to concerned parties, instead of mixing all of them in big one), possible async ones communicating with each other using asyncio.Queue.

Also, some things (like securely sending initial connection request during onboading) are seemingly out of scope for indy project, and it might be better for getting started guide to state these things explicitly where appropriate.

Overall, from my point of view the main problems in understanding this guide are numerous differences between documentation and notebook code and many intermingled entities in code.

UPD. This issue was moved: https://jira.hyperledger.org/browse/IS-579

indy_register_wallet_type callbacks

the callback function signatures for the arguments to indy_register_wallet_type are not consistent with the rest of libindy.

was this intentional? if so, what is the reasoning behind this decision?

i was expecting to see callback functions with signatures like:

void (*some_callback)(indy_handle_t handle, indy_error_t error, char* another_param);

which would allow for the passing of the error value to a caller.

Error descriptions are not exposed on API level

When errors are raised in the code, they include a description, e.g. in build_nym_request in src/services/ledger/mod.rs:

        let data = match data {
            Some(d) => Some(NymOperationData::from_json(d)
                .map_err(|err| CommonError::InvalidStructure(format!("Invalid data json: {}", err.to_string())))?),
            _ => None
        };

But the callbacks on the API level only return the ErrorCode without description, e.g. in src/api/ledger.rs:

        cb: Option<extern fn(xcommand_handle: i32, err: ErrorCode,
                request_json: *const c_char)>) -> ErrorCode {

Build issue with libindy/include/indy_types.h

Hi all,

I recently started digging into indy, and was trying to compile the code and ran into this issue.

In the recent commit of libindy/include/indy_types.h

4cafeda#diff-6ab3e784eca5e2160eaad8ae4d050b30

These two lines were added

typedef long long     indy_i64_t;
typedef unsigned long long     indy_u64_t;

And their names collide with the existing member variables

typedef int64_t       indy_i64_t;
typedef uint64_t      indy_u64_t;

A little background, I was compiling the code with the nodeJS wrapper
https://github.com/Picolab/indy-sdk/tree/master/wrappers/nodejs

Build Log (sorry that it's long)

root@ubuntudev-vm:~/git/src/github.com/pico2/wrappers/nodejs# npm run rebuild

> [email protected] rebuild /home/ubuntudev/git/src/github.com/pico2/wrappers/nodejs
> node codegen && node-gyp rebuild

make: Entering directory '/home/ubuntudev/git/src/github.com/pico2/wrappers/nodejs/build'
  CXX(target) Release/obj.target/indynodejs/src/indy.o
In file included from ../src/indy_core.h:5:0,
                 from ../src/indy.cc:4:
/home/ubuntudev/git/src/github.com/pico2/wrappers/nodejs/include/indy_types.h:13:23: error: conflicting declaration ‘typedef long long int indy_i64_t’
 typedef long long     indy_i64_t;
                       ^
/home/ubuntudev/git/src/github.com/pico2/wrappers/nodejs/include/indy_types.h:10:23: note: previous declaration as ‘typedef int64_t indy_i64_t’
 typedef int64_t       indy_i64_t;
                       ^
/home/ubuntudev/git/src/github.com/pico2/wrappers/nodejs/include/indy_types.h:14:32: error: conflicting declaration ‘typedef long long unsigned int indy_u64_t’
 typedef unsigned long long     indy_u64_t;
                                ^
/home/ubuntudev/git/src/github.com/pico2/wrappers/nodejs/include/indy_types.h:8:23: note: previous declaration as ‘typedef uint64_t indy_u64_t’
 typedef uint64_t      indy_u64_t;
                       ^
indynodejs.target.mk:97: recipe for target 'Release/obj.target/indynodejs/src/indy.o' failed

I wonder how you guys manage to build it, given the name collision?

Thanks
Stanley

test issue

When I run cargo test: I got this error.
Any clue?

services::wallet::tests::wallet_service_get_pool_name_works stdout ----
thread 'services::wallet::tests::wallet_service_get_pool_name_works' panicked at 'called Result::unwrap() on an Err value: CommonError(IOError(Error { repr: Os { code: 2, message: "No such file or directory" } }))', /checkout/src/libcore/result.rs:916:5

services::wallet::tests::wallet_service_set_get_not_expired_works_for_expired stdout ----
thread 'services::wallet::tests::wallet_service_set_get_not_expired_works_for_expired' panicked at 'called Result::unwrap() on an Err value: CommonError(InvalidState("Unexpected SQLite error: unable to open database file"))', /checkout/src/libcore/result.rs:916:5

getting_started.py fails in indy_prover_store_credential

The nodes are set up with the docket compose .. And I am using the master branch

The line anoncreds.prover_store_credential(alice_wallet, None, transcript_cred_request_json,
transcript_cred_request_metadata_json, authdecrypted_transcript_cred_json,
faber_transcript_cred_def, None)

fails with the following exception

Traceback (most recent call last):
File "/home/srinivasan/ide/pycharm-community-2018.1.1/helpers/pydev/pydevd.py", line 1664, in
main()
File "/home/srinivasan/ide/pycharm-community-2018.1.1/helpers/pydev/pydevd.py", line 1658, in main
globals = debugger.run(setup['file'], None, None, is_module)
File "/home/srinivasan/ide/pycharm-community-2018.1.1/helpers/pydev/pydevd.py", line 1068, in run
pydev_imports.execfile(file, globals, locals) # execute the script
File "/home/srinivasan/ide/pycharm-community-2018.1.1/helpers/pydev/_pydev_imps/_pydev_execfile.py", line 18, in execfile
exec(compile(contents+"\n", file, 'exec'), glob, loc)
File "/home/srinivasan/code/indy-sdk/samples/python/src/main.py", line 16, in
run_coroutine(main)
File "/home/srinivasan/code/indy-sdk/samples/python/src/utils.py", line 45, in run_coroutine
loop.run_until_complete(coroutine())
File "/usr/lib/python3.5/asyncio/base_events.py", line 387, in run_until_complete
return future.result()
File "/usr/lib/python3.5/asyncio/futures.py", line 274, in result
raise self._exception
File "/usr/lib/python3.5/asyncio/tasks.py", line 239, in _step
result = coro.send(None)
File "/home/srinivasan/code/indy-sdk/samples/python/src/main.py", line 8, in main
await getting_started.run()
File "/home/srinivasan/code/indy-sdk/samples/python/src/getting_started.py", line 243, in run
faber_transcript_cred_def, None)
File "/home/srinivasan/code/indy-sdk/samples/python/venv/lib/python3.5/site-packages/indy/anoncreds.py", line 618, in prover_store_credential
prover_store_credential.cb)
File "/usr/lib/python3.5/asyncio/futures.py", line 363, in iter
return self.result() # May raise too.
File "/usr/lib/python3.5/asyncio/futures.py", line 274, in result
raise self._exception
indy.error.IndyError: ErrorCode.CommonInvalidParam8

Cargo build failing in windows

While running the "cargo build" in windows the build fails saying---

error: failed to run custom build command for indy-crypto v0.1.6-dev-30process didn't exit successfully:F:\Hyperledger Indy\git-code\indy-sdk\indy-sdk\libindy\target\debug\build\indy-crypto-7f8e44fb5ad897ae\build-script-build` (exit code: 101)
--- stdout
target=x86_64-pc-windows-msvc

--- stderr
thread 'main' panicked at 'called Result::unwrap() on an Err value: NotPresent', libcore\result.rs:945:5
note: Run with RUST_BACKTRACE=1 for a backtrace.

warning: build failed, waiting for other jobs to finish...
error: build failed`

Cargo install issue on Win 10 ("Unknown flag: --release")

Hi,

Just running through the Windows install of the Indy environment, and all going well as far as the Cargo install.
Running the cargo command as specified, I receive the following error:

Unknown flag: --release

And when I remove this flag, it reports that --target is an unknown flag also.

The cargo --list command returns possible switches yet the --release and --target flags are not listed.

any suggestions?

thanks

n

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.