Skip to content

Commit

Permalink
Reorganize crates (#1059)
Browse files Browse the repository at this point in the history
* Reorganize crates

Signed-off-by: Patrik Stas <[email protected]>
  • Loading branch information
Patrik-Stas authored Nov 16, 2023
1 parent db69f3c commit 61b7cd1
Show file tree
Hide file tree
Showing 364 changed files with 151 additions and 158 deletions.
8 changes: 4 additions & 4 deletions .github/actions/build-napi/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ runs:
with:
node-version: ${{ inputs.node-version }}
cache: npm
cache-dependency-path: ${{ github.workspace }}/wrappers/vcx-napi-rs/package-lock.json
cache-dependency-path: ${{ github.workspace }}/aries/wrappers/vcx-napi-rs/package-lock.json
- name: Install
uses: actions-rs/toolchain@v1
if: ${{ !inputs.docker }}
Expand All @@ -43,7 +43,7 @@ runs:
key: ${{ inputs.target }}-cargo-registry
- name: Install dependencies
run: npm install
working-directory: ${{ github.workspace }}/wrappers/vcx-napi-rs
working-directory: ${{ github.workspace }}/aries/wrappers/vcx-napi-rs
shell: bash
- name: Build in docker
uses: addnab/docker-run-action@v3
Expand All @@ -55,11 +55,11 @@ runs:
- name: Build
run: ${{ inputs.build }}
if: ${{ !inputs.docker }}
working-directory: ${{ github.workspace }}/wrappers/vcx-napi-rs
working-directory: ${{ github.workspace }}/aries/wrappers/vcx-napi-rs
shell: bash
- name: Upload artifact
uses: actions/upload-artifact@v3
with:
name: bindings-${{ inputs.target }}
path: ${{ github.workspace }}/wrappers/vcx-napi-rs/*.node
path: ${{ github.workspace }}/aries/wrappers/vcx-napi-rs/*.node
if-no-files-found: error
10 changes: 5 additions & 5 deletions .github/actions/publish-napi/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,21 +18,21 @@ runs:
with:
node-version: ${{ inputs.node-version }}
cache: npm
cache-dependency-path: ${{ github.workspace }}/wrappers/vcx-napi-rs/package-lock.json
cache-dependency-path: ${{ github.workspace }}/aries/wrappers/vcx-napi-rs/package-lock.json
- name: Install dependencies
run: npm install
working-directory: ${{ github.workspace }}/wrappers/vcx-napi-rs
working-directory: ${{ github.workspace }}/aries/wrappers/vcx-napi-rs
shell: bash
- name: Download napi artifacts
uses: actions/download-artifact@v3
with:
path: ${{ github.workspace }}/wrappers/vcx-napi-rs/artifacts
path: ${{ github.workspace }}/aries/wrappers/vcx-napi-rs/artifacts
- name: Move artifacts
run: |
find . -type d -not -path \*\*/artifacts/bindings-\* -path \*\*/artifacts/\*\* -mindepth 2 -maxdepth 2 -exec rm -rf {} \+
ls -R artifacts
npm run artifacts
working-directory: ${{ github.workspace }}/wrappers/vcx-napi-rs
working-directory: ${{ github.workspace }}/aries/wrappers/vcx-napi-rs
shell: bash
- name: Publish
run: |
Expand All @@ -45,7 +45,7 @@ runs:
else
echo "New version was not defined, skipping release."
fi
working-directory: ${{ github.workspace }}/wrappers/vcx-napi-rs
working-directory: ${{ github.workspace }}/aries/wrappers/vcx-napi-rs
shell: bash
env:
NPMJS_TOKEN: ${{ inputs.npmjs-token }}
Expand Down
8 changes: 4 additions & 4 deletions .github/actions/setup-testing-nodejs/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -43,12 +43,12 @@ runs:
docker-compose -f ./.github/ci/agency/docker-compose.yml up -d
- name: "Build binding module"
shell: bash
run: (cd wrappers/vcx-napi-rs && npm install && npm run build:napi:debug)
run: (cd aries/wrappers/vcx-napi-rs && npm install && npm run build:napi:debug)
- name: "Transpile TS wrapper"
shell: bash
run: (cd wrappers/node && npm install && npm run compile)
run: (cd aries/wrappers/node && npm install && npm run compile)
- name: "Check wrappers"
shell: bash
run: |
ls -lah wrappers/vcx-napi-rs
ls -lah wrappers/node
ls -lah aries/wrappers/vcx-napi-rs
ls -lah aries/wrappers/node
8 changes: 4 additions & 4 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -339,7 +339,7 @@ jobs:
rust-toolchain-version: ${{ env.RUST_TOOLCHAIN_VERSON }}
- name: "Run libvcx_core integration tests"
run: |
RUST_TEST_THREADS=1 cargo test --manifest-path="libvcx_core/Cargo.toml" -- --include-ignored;
RUST_TEST_THREADS=1 cargo test --manifest-path="aries/legacy/libvcx_core/Cargo.toml" -- --include-ignored;
test-integration-did-crate:
needs: workflow-setup
Expand Down Expand Up @@ -372,7 +372,7 @@ jobs:
rust-toolchain-version: ${{ env.RUST_TOOLCHAIN_VERSON }}
node-version: ${{ matrix.node-version }}
- name: "Run wrapper integration tests"
run: (cd wrappers/node && npm run test:integration)
run: (cd aries/wrappers/node && npm run test:integration)
- name: "Install vcxagent-core dependencies"
run: (cd aries/agents/node/vcxagent-core && npm install)
- name: "Run demo"
Expand Down Expand Up @@ -406,7 +406,7 @@ jobs:
run: |
if [[ "$PUBLISH_VERSION" ]]
then
NPMJS_TOKEN=${{ secrets.NPMJS_TOKEN }} PUBLISH_VERSION=${{ env.PUBLISH_VERSION }} ./wrappers/node/publish.sh
NPMJS_TOKEN=${{ secrets.NPMJS_TOKEN }} PUBLISH_VERSION=${{ env.PUBLISH_VERSION }} ./aries/wrappers/node/publish.sh
else
echo "New version was not defined, skipping release."
fi
Expand Down Expand Up @@ -460,7 +460,7 @@ jobs:
env
unset CC
unset CXX
cd wrappers/vcx-napi-rs
cd aries/wrappers/vcx-napi-rs
npm run build:napi
strip *.node
- host: macos-latest
Expand Down
20 changes: 10 additions & 10 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

16 changes: 8 additions & 8 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -3,17 +3,17 @@ resolver = "2"

members = [
"aries_vcx",
"libvcx_core",
"agency_client",
"libvdrtools",
"aries/legacy/libvcx_core",
"aries/legacy/agency_client",
"aries/legacy/libvdrtools",
"messages_macros",
"messages",
"shared_vcx",
"diddoc_legacy",
"aries/shared",
"aries/legacy/diddoc_legacy",
"aries/agents/rust/mediator",
"aries/agents/rust/mediator/client-tui",
"agents/rust/aries-vcx-agent",
"wrappers/vcx-napi-rs",
"aries/agents/rust/aries-vcx-agent",
"aries/wrappers/vcx-napi-rs",
"aries_vcx_core",
"uniffi_aries_vcx/core",
"did_doc",
Expand All @@ -27,7 +27,7 @@ members = [
"did_resolver_web",
"public_key",
"indy_ledger_response_parser",
"wallet_migrator",
"tools/wallet_migrator",
"tools/simple_message_relay",
"tools/test_utils",
"tools/libvcx_logger",
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ The repository contains a set of crates to build [Aries](https://github.com/hype
- [`aries_vcx`](aries_vcx) - Library implementing DIDComm protocols, with focus on verifiable credential issuance and verification.
- [`messages`](messages) - Library for building and parsing Aries messages.
- `aries_vcx_core` - Interfaces for interaction with ledgers, wallets and credentials.
- [`agents`](agents/rust) - Aries agents built on top of `aries_vcx`.
- [`agents`](aries/agents/rust) - Aries agents built on top of `aries_vcx`.

## General components
- `did_parser` - Building and parsing [DIDs](https://w3c.github.io/did-core/).
Expand Down
5 changes: 0 additions & 5 deletions agents/rust/README.md

This file was deleted.

2 changes: 1 addition & 1 deletion aries/agents/node/.gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,6 @@ typings/
# End of https://www.gitignore.io/api/node


**/storage-*/
vcxagent-core/storage-proofs/

**/test/tmp
4 changes: 2 additions & 2 deletions aries/agents/node/vcxagent-core/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@
"test:integration:connection": "jest --forceExit --env=node --runInBand test/connection.spec.js"
},
"dependencies": {
"@hyperledger/node-vcx-wrapper": "file:../../../../wrappers/node",
"@hyperledger/node-vcx-wrapper": "file:../../../wrappers/node",
"axios": "^1.6.0",
"ffi-napi": "^4.0.3",
"fs-extra": "^4.0.3",
Expand All @@ -68,4 +68,4 @@
"standard": "^16.0.4",
"winston": "^3.3.3"
}
}
}
2 changes: 1 addition & 1 deletion aries/agents/node/vcxagent-core/readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ VCX Agent Core is implementation of simple agent with persistent file storage. I

# Try it
1. First step is to compile and `aries-vcx` and make it available on your system. Follow [instructions](../../../libvcx).
2. You need to have mediator agent compatible with `aries-vcx`. See more [info](../../../README.md).
2. You need to have mediator agent compatible with `aries-vcx`. See more [info](../../../../README.md).
3. Run `npm run demo`. This will run sample scenario where Alice and Faber
- establish connection,
- Faber issues a credential to Alice
Expand Down
6 changes: 6 additions & 0 deletions aries/agents/rust/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
# Rust agents

This directory contains some of Rust agents built on top of the `aries_vcx` crate:

- [`aries-vcx-agent`](./aries-vcx-agent) - aries agent library providing used to build our cross-framework testing [backchannel](https://github.com/hyperledger/aries-agent-test-harness/tree/main/aries-backchannels/aries-vcx)
- [`mediator`](./mediator) - didcomm mediator service
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,12 @@ edition.workspace = true

[dependencies]
serde = "1.0.145"
aries_vcx = { path = "../../../aries_vcx" }
aries_vcx_core = { path = "../../../aries_vcx_core", features = [
aries_vcx = { path = "../../../../aries_vcx" }
aries_vcx_core = { path = "../../../../aries_vcx_core", features = [
"credx",
"vdrtools_wallet",
] }
shared_vcx = { path = "../../../shared_vcx" }
shared = { path = "../../../shared" }
async-trait = "0.1.64"
derive_builder = "0.12.0"
serde_json = "1.0.85"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ pub struct VcxHttpClient;
#[async_trait]
impl Transport for VcxHttpClient {
async fn send_message(&self, msg: Vec<u8>, service_endpoint: Url) -> VcxResult<()> {
shared_vcx::http_client::post_message(msg, service_endpoint).await?;
shared::http_client::post_message(msg, service_endpoint).await?;
Ok(())
}
}
File renamed without changes.
2 changes: 1 addition & 1 deletion aries/agents/rust/mediator/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ aries_vcx_core = { path = "../../../../aries_vcx_core", features = [
async-trait = "0.1.73"
axum = "0.6"
axum-macros = "0.3.8"
diddoc_legacy = { path = "../../../../diddoc_legacy" }
diddoc_legacy = { path = "../../../../aries/legacy/diddoc_legacy" }
dotenvy = "0.15"
env_logger = "0.10.0"
fast_qr = { version = "0.10.2", features = ["svg"] }
Expand Down
3 changes: 1 addition & 2 deletions aries/agents/rust/mediator/src/aries_agent/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -114,8 +114,7 @@ impl<T: BaseWallet + 'static, P: MediatorPersistence> Agent<T, P> {
if let Some(service) = &self.service {
let invitation = OutOfBandSender::create()
.append_service(&OobService::AriesService(service.clone()))
.oob
.clone();
.oob;
Ok(invitation)
} else {
Err("No service to create invite for".to_owned())
Expand Down
4 changes: 1 addition & 3 deletions aries/agents/rust/mediator/src/http_routes/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -58,9 +58,7 @@ pub async fn handle_didcomm(
State(agent): State<ArcAgent<impl BaseWallet + 'static, impl MediatorPersistence>>,
didcomm_msg: Bytes,
) -> Result<Json<Value>, String> {
didcomm_handlers::handle_aries(State(agent), didcomm_msg)
.await
.map_err(|e| e.to_string())
didcomm_handlers::handle_aries(State(agent), didcomm_msg).await
}

pub async fn readme() -> Html<String> {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,4 +20,4 @@ url = { version = "2.3", features = ["serde"] }
uuid = { version = "0.8", default-features = false, features = ["v4"]}
thiserror = "1.0.37"
async-trait = "0.1.73"
shared_vcx = { path = "../shared_vcx" }
shared = { path = "../../shared" }
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
use std::sync::Arc;

use shared_vcx::validation::{did::validate_did, verkey::validate_verkey};
use shared::validation::{did::validate_did, verkey::validate_verkey};
use url::Url;

use crate::{
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
use shared_vcx::errors::validation::{ValidationError, ValidationErrorKind};
use shared::errors::validation::{ValidationError, ValidationErrorKind};

use crate::errors::error::{AgencyClientError, AgencyClientErrorKind};

Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
use core::u8;

use serde_json::Value;
use shared_vcx::http_client::post_message;
use shared::http_client::post_message;

use crate::{
agency_client::AgencyClient,
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
use shared_vcx::validation::{did::validate_did, verkey::validate_verkey};
use shared::validation::{did::validate_did, verkey::validate_verkey};

use crate::{
errors::error::AgencyClientResult,
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ serde_json = "1.0.40"
serde_derive = "1.0.97"
url = { version = "2.3", features = ["serde"] }
thiserror = "1.0.37"
shared_vcx = { path = "../shared_vcx" }
shared = { path = "../../shared" }

[dev-dependencies]
serde_json = "1.0.91"
Loading

0 comments on commit 61b7cd1

Please sign in to comment.