Skip to content

Commit

Permalink
Merge pull request #12 from boschresearch/feature/support-startup-arg…
Browse files Browse the repository at this point in the history
…uments

Add argument parsing and logging
  • Loading branch information
domwoe authored Mar 8, 2022
2 parents ce652f8 + 4f64d54 commit ceeb330
Show file tree
Hide file tree
Showing 16 changed files with 143 additions and 205 deletions.
4 changes: 4 additions & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
target
.git
.github
github
45 changes: 45 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,3 +5,48 @@ The code depends on [indy-vdr](https://github.com/hyperledger/indy-vdr) and coul

This software could be used as a driver for the [Universal Resolver](https://github.com/decentralized-identity/universal-resolver).

# Usage

The project can be built using standard rust tooling: `cargo build` or exectued via `cargo run`

Logging can be enabled using the environment variable`RUST_LOG`, e.g. `RUST_LOG=debug ./indy-did-driver`

### Default configuration
- default port is 8080
- default network registry is https://github.com/IDunion/indy-did-networks

The driver can be reached via HTTP, e.g. curl http://localhost:8080/1.0/identifiers/<did>

### CLI options
```
-f, --genesis-filename <GENESIS_FILENAME>
Pool transaction genesis filename [default: pool_transactions_genesis.json]
-h, --help
Print help information
-n, --github-network <GITHUB_NETWORKS>
github repository for registered networks [default: https://github.com/IDunion/indy-did-
networks]
-p, --port <PORT>
Port to expose [default: 8080]
-s, --source <SOURCE>
source to use, allowed values are path or github [default: ]
-V, --version
Print version information
```
### Local development

The resolver can also be configured to resolve local/custom indy networks for development purposes, e.g. [von-network](https://github.com/bcgov/von-network).
Create a folder structure like the following:

```
networks/
└──local/
└──pool_transactions_genesis.json
```
Start the indy-did-driver with the option `-s <path/to/networks>` and resolve via `did:indy:local:<DID>`
2 changes: 1 addition & 1 deletion docker/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -25,11 +25,11 @@ USER root
RUN apt-get update && apt-get install ca-certificates -y && rm -rf /var/lib/apt/lists/*

COPY --from=builder /app/target/release/indy-did-driver /app/
COPY --from=builder /app/indy-did-driver/genesis-files /app/genesis-files

COPY --from=builder /app/licenses.html /app/

RUN groupadd runner && useradd -r -g runner runner
RUN chown -R runner:runner /app
USER runner

EXPOSE 8080
Expand Down
1 change: 1 addition & 0 deletions indy-did-driver/.gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,4 @@ Cargo.lock
target/
.idea/
.vscode/
github
10 changes: 8 additions & 2 deletions indy-did-driver/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "indy-did-driver"
version = "0.1.0"
version = "0.1.1"
authors = ["Paul Bastian <[email protected]>"]
edition = "2018"
license = "Apache-2.0"
Expand All @@ -16,4 +16,10 @@ indy-vdr = "0.3.4"
serde = "1.0"
serde_json = "1.0"
rouille = "3.5.0"
regex = "1.5.4"
regex = "1.5.4"
clap = { version = "3.1.3", features = ["derive"] }
log = "0.4.0"
env_logger = "0.9.0"

[features]
derive = []
5 changes: 0 additions & 5 deletions indy-did-driver/networks/eesdi/pool_transactions_genesis.json

This file was deleted.

This file was deleted.

This file was deleted.

Loading

0 comments on commit ceeb330

Please sign in to comment.