Skip to content

Commit

Permalink
Merge pull request #1045 from iotaledger/dev
Browse files Browse the repository at this point in the history
  • Loading branch information
eike-hass committed Sep 26, 2022
2 parents c7ba28e + bcde7c0 commit c5f0073
Show file tree
Hide file tree
Showing 533 changed files with 29,963 additions and 18,459 deletions.
4 changes: 2 additions & 2 deletions .github/ISSUE_TEMPLATE/config.yml
@@ -1,5 +1,5 @@
blank_issues_enabled: false
contact_links:
- name: Official Discord
- name: Official IOTA Discord
url: https://discord.iota.org/
about: Contact the maintainers by joining the official Discord. Look for the channel #identity-discussion.
about: "Contact the maintainers by joining the #identity channel on the IOTA Discord."
4 changes: 2 additions & 2 deletions .github/ISSUE_TEMPLATE/task.md
Expand Up @@ -14,10 +14,10 @@ Describe the task, this may be scoped beyond a single PR.
Describe the motivation for the feature to be developed.

## Resources
Link to any resources relevant for the task such as Issues, PRs, reference implementations, or specifications.
Link to any resources relevant for the task such as issues, PRs, reference implementations, or specifications.

## To-do list
Create a task-specific to-do list . Please link PRs that match the To-do list item behind the item after it has been submitted.
Create a task-specific to-do list. Please link PRs that match the TODO list item behind the item after it has been submitted.

- [ ] Item one
- [ ] Item two
Expand Down
44 changes: 44 additions & 0 deletions .github/actions/private-tangle/setup/action.yml
@@ -0,0 +1,44 @@
name: 'private-tangle-setup'
description: 'Setup a private tangle'
runs:
using: "composite"
steps:
- name: Setup private tangle
shell: bash
run: |
# TODO: use next lines when a working hornet release is published
# # Download the private_tangle setup from the hornet repo.
# mkdir private_tangle
# cd private_tangle
# # Use the output of https://api.github.com/repos/iotaledger/hornet/releases/latest once there's a 2.0 Hornet release.
# DOWNLOAD_URL=$(curl "https://api.github.com/repos/iotaledger/hornet/releases" | jq -r '.[0].assets[] | select(.name | contains("private_tangle")) | .browser_download_url')
# echo "Downloading private tangle from $DOWNLOAD_URL"
# curl -L -o private_tangle.tar.gz $DOWNLOAD_URL
# tar -xf private_tangle.tar.gz
# TODO: remove next lines when a working hornet release is published
git clone https://github.com/iotaledger/hornet.git
cd hornet/private_tangle
# Set minPoWScore = 1 since the default (0) doesn't work with wasm_miner.rs in iota.rs currently.
jq '.minPoWScore = $val' --argjson val 1 protocol_parameters.json > tmp.json && mv tmp.json protocol_parameters.json
jq --color-output . protocol_parameters.json
# Manipulate and print config
jq '.restAPI.pow.enabled = $newVal' --argjson newVal true config_private_tangle.json > tmp.$$.json && mv tmp.$$.json config_private_tangle.json
jq --color-output . config_private_tangle.json
# Start Tangle
sudo ./cleanup.sh
sudo ./bootstrap.sh
sudo ./run.sh -d
- name: Wait for tangle to start
shell: bash
run: wget -qO- https://raw.githubusercontent.com/eficode/wait-for/$WAIT_FOR_VERSION/wait-for | sh -s -- -t 60 http://localhost:14265/health -- echo "Tangle is up"
env:
WAIT_FOR_VERSION: 4df3f9262d84cab0039c07bf861045fbb3c20ab7 # v2.2.3
- name: Wait for faucet to start
shell: bash
run: wget -qO- https://raw.githubusercontent.com/eficode/wait-for/$WAIT_FOR_VERSION/wait-for | sh -s -- -t 60 http://localhost:8091/api/info -- echo "Faucet is up"
env:
WAIT_FOR_VERSION: 4df3f9262d84cab0039c07bf861045fbb3c20ab7 # v2.2.3
16 changes: 16 additions & 0 deletions .github/actions/private-tangle/tear-down/action.yml
@@ -0,0 +1,16 @@
name: 'private-tangle-tear-down'
description: 'tear-down a private tangle'
runs:
using: "composite"
steps:
- name: Tear down private tangle
shell: bash
run: |
# TODO: use next line when a working hornet release is published
#cd private_tangle
# TODO: remove next line when a working hornet release is published
cd hornet/private_tangle
docker-compose down
cd ..
sudo rm -rf private_tangle
2 changes: 1 addition & 1 deletion .github/actions/publish/publish-rust/action.yml
Expand Up @@ -31,4 +31,4 @@ runs:
run: |
echo "dry-run: '${{ inputs.dry-run }}'"
echo "version: '${{ inputs.version }}'"
cargo release --workspace --token ${{ inputs.crates-token }} --isolated --no-dev-version --no-push --no-tag --verbose $(if [ "${{ inputs.dry-run }}" = "false" ]; then echo --execute --no-confirm; fi) ${{ inputs.version }}
cargo release --workspace --token ${{ inputs.crates-token }} --isolated --no-dev-version --no-push --no-tag --dependent-version error --verbose $(if [ "${{ inputs.dry-run }}" = "false" ]; then echo --execute --no-confirm; fi) ${{ inputs.version }}
73 changes: 63 additions & 10 deletions .github/actions/release/bump-versions/action.yml
Expand Up @@ -31,27 +31,63 @@ runs:
command: install
args: -f --no-default-features --features "add set-version" --version ^0.8 cargo-edit

- name: Replace identity_iota version in Wasm bindings
- name: Bump Rust crate versions
shell: bash
if: ${{inputs.release-target == 'rust'}}
working-directory: bindings/wasm
run: |
cargo add identity_iota@=${{ inputs.version }} --path=../../identity_iota
cargo workspaces version --force "*" --no-git-commit --exact custom ${{ inputs.version }} -y
- name: Replace identity versions in stronghold nodejs bindings
# cargo workspaces ignores examples/ but cargo release still tries to version it during publishing.
- name: Bump Rust examples version
shell: bash
if: ${{inputs.release-target == 'rust'}}
working-directory: bindings/stronghold-nodejs
working-directory: examples
run: |
cargo add identity_core@=${{ inputs.version }} --path=../../identity_core
cargo add identity_iota_core@=${{ inputs.version }} --path=../../identity_iota_core
cargo add identity_account_storage@=${{ inputs.version }} --path=../../identity_account_storage
cargo set-version ${{ inputs.version }}
- name: Bump Rust crate versions
# cargo workspaces ignores examples_legacy/ but cargo release still tries to version it during publishing.
- name: Bump Rust examples_legacy version
shell: bash
if: ${{inputs.release-target == 'rust'}}
working-directory: examples_legacy
run: |
cargo workspaces version --force "*" --no-git-commit --exact custom ${{ inputs.version }} -y
cargo set-version ${{ inputs.version }}
# cargo workspaces ignores the legacy crates because they are excluded from the workspace.
# Bump versions for consistency.
- name: Bump Rust legacy crates' version
shell: bash
if: ${{inputs.release-target == 'rust'}}
run: |
cargo set-version --manifest-path identity_account_storage/Cargo.toml ${{ inputs.version }}
cargo set-version --manifest-path identity_iota_client_legacy/Cargo.toml ${{ inputs.version }}
cargo set-version --manifest-path identity_iota_core_legacy/Cargo.toml ${{ inputs.version }}
cargo set-version --manifest-path identity_account/Cargo.toml ${{ inputs.version }}
cargo add --manifest-path identity_account_storage/Cargo.toml --path identity_core
cargo add --manifest-path identity_account_storage/Cargo.toml --path identity_did
cargo add --manifest-path identity_account_storage/Cargo.toml --path identity_iota_core_legacy
cargo add --manifest-path identity_account/Cargo.toml --path identity_account_storage
cargo add --manifest-path identity_account/Cargo.toml --path identity_core
cargo add --manifest-path identity_account/Cargo.toml --path identity_credential
cargo add --manifest-path identity_account/Cargo.toml --path identity_did
cargo add --manifest-path identity_account/Cargo.toml --path identity_iota_client_legacy
cargo add --manifest-path identity_account/Cargo.toml --path identity_iota_core_legacy
cargo add --manifest-path identity_iota_core_legacy/Cargo.toml --path identity_core
cargo add --manifest-path identity_iota_core_legacy/Cargo.toml --path identity_did
cargo add --manifest-path identity_iota_client_legacy/Cargo.toml --path identity_core
cargo add --manifest-path identity_iota_client_legacy/Cargo.toml --path identity_credential
cargo add --manifest-path identity_iota_client_legacy/Cargo.toml --path identity_did
cargo add --manifest-path identity_iota_client_legacy/Cargo.toml --path identity_iota_core_legacy
# cargo workspaces ignores identity_agent because it is excluded from the workspace.
# Bump versions for consistency.
- name: Bump Rust agent version
shell: bash
if: ${{inputs.release-target == 'rust'}}
working-directory: identity_agent
run: |
cargo set-version ${{ inputs.version }}
cargo add --path ../identity_core
- name: Bump Wasm bindings crate version
shell: bash
Expand All @@ -67,6 +103,23 @@ runs:
run: |
cargo set-version ${{ inputs.version }}
- name: Replace identity_iota version in Wasm bindings
shell: bash
if: ${{inputs.release-target == 'rust'}}
working-directory: bindings/wasm
run: |
cargo add identity_iota --path=../../identity_iota
- name: Replace identity versions in stronghold nodejs bindings
shell: bash
if: ${{inputs.release-target == 'rust'}}
working-directory: bindings/stronghold-nodejs
run: |
cargo add identity_core --path=../../identity_core
cargo add identity_did --path=../../identity_did
cargo add identity_iota_core_legacy --path=../../identity_iota_core_legacy
cargo add identity_account_storage --path=../../identity_account_storage
- name: Set up Node.js
uses: actions/setup-node@v2
if: ${{inputs.release-target == 'wasm'}}
Expand Down
6 changes: 6 additions & 0 deletions .github/releases/v0.7.0-alpha.1.md
@@ -0,0 +1,6 @@
This version introduces a new DID method targeting the IOTA UTXO ledger. This method works fundamentally differently from the previous method and introduces new capabilities to interact with Layer 1 entities like native tokens, NFTs and smart contracts.
\n\n
This is an early alpha release, so there may be breaking changes in upcoming versions that invalidate DIDs created with this version. The method at this point is only intended for experimentation.
\n\n
Note: Identities created with the earlier versions cannot be resolved with this version of the library.
\n\n
6 changes: 6 additions & 0 deletions .github/releases/wasm-v0.7.0-alpha.1.md
@@ -0,0 +1,6 @@
This version introduces a new DID method targeting the IOTA UTXO ledger. This method works fundamentally differently from the previous method and introduces new capabilities to interact with Layer 1 entities like native tokens, NFTs and smart contracts.
\n\n
This is an early alpha release, so there may be breaking changes in upcoming versions that invalidate DIDs created with this version. The method at this point is only intended for experimentation.
\n\n
Note: Identities created with the earlier versions cannot be resolved with this version of the library.
\n\n
74 changes: 56 additions & 18 deletions .github/workflows/build-and-test.yml
Expand Up @@ -6,7 +6,7 @@ on:
- main
- dev
pull_request:
types: [opened, synchronize, reopened, ready_for_review]
types: [ opened, synchronize, reopened, ready_for_review ]
branches:
- main
- dev
Expand Down Expand Up @@ -63,7 +63,7 @@ jobs:
build-and-test:
runs-on: ${{ matrix.os }}
needs: [check-for-run-condition, check-for-modification]
needs: [ check-for-run-condition, check-for-modification ]
if: ${{ needs.check-for-run-condition.outputs.should-run == 'true' && needs.check-for-modification.outputs.core-modified == 'true' }}
strategy:
fail-fast: false
Expand Down Expand Up @@ -97,27 +97,58 @@ jobs:
with:
os: ${{matrix.os}}

- name: Build
- name: Check --no-default-features
if: matrix.os == 'ubuntu-latest'
run: |
cargo metadata --format-version 1 | \
jq -r '.workspace_members[] | select(contains("examples") | not)' | \
awk '{print $1}' | \
xargs -I {} cargo check -p {} --no-default-features
- name: Check default features
if: matrix.os == 'ubuntu-latest'
run: |
cargo metadata --format-version 1 | \
jq -r '.workspace_members[] | select(contains("examples") | not)' | \
awk '{print $1}' | \
xargs -I {} cargo check -p {}
# Clean debug target to avoid bloating the GitHub Actions cache.
# The previous builds cannot be re-used at all for the full --all-features --release build anyway.
- name: Clean target
if: matrix.os == 'ubuntu-latest'
run: cargo clean

- name: Build all features
uses: actions-rs/cargo@v1
with:
# Build the library, tests, and examples without running them to avoid recompilation in the run tests step
command: build
args: --workspace --tests --examples --release
args: --workspace --tests --examples --all-features --release

- name: Start private tangle
if: matrix.os == 'ubuntu-latest'
uses: './.github/actions/private-tangle/setup'

- name: Run tests
uses: actions-rs/cargo@v1
with:
command: test
args: --all --all-features --release
args: --workspace --all-features --release

- name: Run Rust examples
# run examples only on ubuntu for now
if: matrix.os == 'ubuntu-latest'
run: |
cargo read-manifest --manifest-path ./examples/Cargo.toml | \
jq -r '.targets[].name' | \
parallel -k -j 4 --retries 3 cargo run --example {} --release
cargo metadata --format-version 1 --manifest-path ./examples/Cargo.toml | \
jq -r '.packages[] | select(.name == "examples") | .targets[].name' | \
awk '$1 ~ /[0-9].*/' | \
parallel -k -j 4 --retries 3 ./target/release/examples/{}
- name: Tear down private tangle
if: matrix.os == 'ubuntu-latest' && always()
uses: './.github/actions/private-tangle/tear-down'

- name: Stop sccache
uses: './.github/actions/rust/sccache/stop-sccache'
with:
Expand Down Expand Up @@ -192,16 +223,23 @@ jobs:
name: identity-wasm-bindings-build
path: bindings/wasm

- name: Start private tangle
uses: './.github/actions/private-tangle/setup'

- name: Run Wasm examples
run: npm run test:examples
working-directory: bindings/wasm

build-and-test-stronghold-nodejs:
needs:
- check-for-run-condition
- build-wasm
if: ${{ needs.check-for-run-condition.outputs.should-run == 'true' }}
# owner/repository of workflow has to be static, see https://github.community/t/env-variables-in-uses/17466
uses: iotaledger/identity.rs/.github/workflows/shared-build-and-test-stronghold-nodejs.yml@dev
with:
input-artifact-name: identity-wasm-bindings-build
- name: Tear down private tangle
if: always()
uses: './.github/actions/private-tangle/tear-down'

# build-and-test-stronghold-nodejs:
# needs:
# - check-for-run-condition
# - build-wasm
# if: ${{ needs.check-for-run-condition.outputs.should-run == 'true' }}
# # owner/repository of workflow has to be static, see https://github.community/t/env-variables-in-uses/17466
# uses: iotaledger/identity.rs/.github/workflows/shared-build-and-test-stronghold-nodejs.yml@dev
# with:
# input-artifact-name: identity-wasm-bindings-build
2 changes: 1 addition & 1 deletion .github/workflows/clippy.yml
Expand Up @@ -43,7 +43,7 @@ jobs:
args: --all-targets --all-features -- -D warnings
name: core

- name: wasm clippy check
- name: Wasm clippy check
uses: actions-rs/clippy-check@v1
with:
token: ${{ secrets.GITHUB_TOKEN }}
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/coverage.yml
Expand Up @@ -26,7 +26,7 @@ jobs:
- uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: nightly-2022-04-08
toolchain: nightly-2022-06-30
override: true
components: llvm-tools-preview

Expand Down
11 changes: 10 additions & 1 deletion .github/workflows/format.yml
Expand Up @@ -27,10 +27,16 @@ jobs:
uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: nightly-2022-03-11
toolchain: nightly-2022-06-30
override: true
components: rustfmt

- name: Install cargo-license-template
uses: actions-rs/cargo@v1
with:
command: install
args: cargo-license-template

- name: Install dprint
run: npm install -g dprint
#run: cargo install dprint # installing from source is slow, ~5 minutes
Expand Down Expand Up @@ -64,3 +70,6 @@ jobs:
- name: Cargo.toml fmt check
run:
dprint check

- name: cargo-license-template check
run: cargo license-template --template .license_template --ignore .license_template_ignore --verbose
4 changes: 2 additions & 2 deletions .github/workflows/rust-automatic-release-and-publish.yml
Expand Up @@ -14,8 +14,8 @@ jobs:
uses: iotaledger/identity.rs/.github/workflows/shared-release.yml@dev
with:
changelog-config-path: ./.github/.github_changelog_generator
dev-tag-regex: ^v[0-9]+\.[0-9]+\.[0-9]+-(dev)\.\d*$
main-tag-regex: ^v[0-9]+\.[0-9]+\.[0-9]+$
pre-release-tag-regex: ^v[0-9]+\.[0-9]+\.[0-9]+-(?<pre_release>\w+)\.\d+$
main-release-tag-regex: ^v[0-9]+\.[0-9]+\.[0-9]+$
create-github-release: true
secrets:
GPG_PRIVATE_KEY: ${{ secrets.GPG_PRIVATE_KEY }}
Expand Down

0 comments on commit c5f0073

Please sign in to comment.