mirror of
https://github.com/fluencelabs/trust-graph
synced 2025-07-04 17:11:41 +00:00
Compare commits
15 Commits
trust-grap
...
trust-grap
Author | SHA1 | Date | |
---|---|---|---|
106bff637e | |||
120bedfafb | |||
48351d5562 | |||
0b66f4e053 | |||
ed5bd2c0ec | |||
2f336f73cf | |||
d378fe2509 | |||
80bf4aa4ff | |||
80757e6352 | |||
f2c3b2a13c | |||
4f657f9dae | |||
725d3f8f48 | |||
1fb02e4827 | |||
a37bda37a2 | |||
ee330a715a |
10
.github/release-please/manifest.json
vendored
10
.github/release-please/manifest.json
vendored
@ -1,7 +1,7 @@
|
|||||||
{
|
{
|
||||||
"trust-graph": "0.4.6",
|
"trust-graph": "0.4.8",
|
||||||
"aqua": "0.4.6",
|
"aqua": "0.4.8",
|
||||||
"service": "0.4.6",
|
"service": "0.4.8",
|
||||||
"keypair": "0.10.2",
|
"keypair": "0.10.4",
|
||||||
"distro": "0.4.6"
|
"distro": "0.4.8"
|
||||||
}
|
}
|
||||||
|
39
.github/workflows/release.yml
vendored
39
.github/workflows/release.yml
vendored
@ -105,45 +105,6 @@ jobs:
|
|||||||
run: npm publish --access public
|
run: npm publish --access public
|
||||||
working-directory: aqua
|
working-directory: aqua
|
||||||
|
|
||||||
- name: Install ipfs
|
|
||||||
uses: nahsi/setup-ipfs@v1
|
|
||||||
|
|
||||||
- name: Create builtin distribution package
|
|
||||||
if: needs.release-please.outputs.trust-graph-release-created
|
|
||||||
run: ./builtin-package/package.sh
|
|
||||||
|
|
||||||
- name: Calculate SHA256
|
|
||||||
if: needs.release-please.outputs.trust-graph-release-created
|
|
||||||
id: sha
|
|
||||||
run: |
|
|
||||||
# Calculate sha256
|
|
||||||
du -hs trust-graph.tar.gz
|
|
||||||
sha256sum trust-graph.tar.gz
|
|
||||||
sha=($(sha256sum trust-graph.tar.gz))
|
|
||||||
echo "sha256=${sha}" >> $GITHUB_OUTPUT
|
|
||||||
|
|
||||||
- name: Upload trust-graph package
|
|
||||||
if: needs.release-please.outputs.trust-graph-release-created
|
|
||||||
uses: softprops/action-gh-release@v1
|
|
||||||
with:
|
|
||||||
files: trust-graph.tar.gz
|
|
||||||
tag_name: ${{ needs.release-please.outputs.trust-graph-tag-name }}
|
|
||||||
|
|
||||||
- name: Update version in node-distro repo
|
|
||||||
if: needs.release-please.outputs.trust-graph-release-created
|
|
||||||
uses: benc-uk/workflow-dispatch@v1
|
|
||||||
with:
|
|
||||||
workflow: update_service
|
|
||||||
repo: fluencelabs/node-distro
|
|
||||||
ref: "main"
|
|
||||||
token: ${{ secrets.PERSONAL_TOKEN }}
|
|
||||||
inputs: '{
|
|
||||||
"name": "trust-graph",
|
|
||||||
"version": "${{ needs.release-please.outputs.trust-graph-version }}",
|
|
||||||
"url": "https://github.com/fluencelabs/trust-graph/releases/download/${{ needs.release-please.outputs.trust-graph-tag-name }}/trust-graph.tar.gz",
|
|
||||||
"sha256": "${{ steps.sha.outputs.sha256 }}"
|
|
||||||
}'
|
|
||||||
|
|
||||||
slack:
|
slack:
|
||||||
if: always()
|
if: always()
|
||||||
name: "Notify"
|
name: "Notify"
|
||||||
|
21
.github/workflows/tests.yml
vendored
21
.github/workflows/tests.yml
vendored
@ -21,6 +21,8 @@ jobs:
|
|||||||
|
|
||||||
- name: Setup marine
|
- name: Setup marine
|
||||||
uses: fluencelabs/setup-marine@v1
|
uses: fluencelabs/setup-marine@v1
|
||||||
|
with:
|
||||||
|
artifact-name: marine
|
||||||
|
|
||||||
- name: Build
|
- name: Build
|
||||||
run: ./build.sh
|
run: ./build.sh
|
||||||
@ -31,11 +33,8 @@ jobs:
|
|||||||
command: clippy
|
command: clippy
|
||||||
args: -Z unstable-options --all
|
args: -Z unstable-options --all
|
||||||
|
|
||||||
- name: Install cargo-nextest
|
- name: Setup nextest
|
||||||
uses: baptiste0928/cargo-install@v1.3.0
|
uses: taiki-e/install-action@nextest
|
||||||
with:
|
|
||||||
crate: cargo-nextest
|
|
||||||
version: 0.9.22
|
|
||||||
|
|
||||||
- name: Run cargo nextest
|
- name: Run cargo nextest
|
||||||
env:
|
env:
|
||||||
@ -57,15 +56,3 @@ jobs:
|
|||||||
|
|
||||||
- run: npm run build
|
- run: npm run build
|
||||||
working-directory: aqua
|
working-directory: aqua
|
||||||
|
|
||||||
- name: Install ipfs
|
|
||||||
uses: nahsi/setup-ipfs@v1
|
|
||||||
|
|
||||||
- name: Create distribution package
|
|
||||||
run: ./builtin-package/package.sh
|
|
||||||
|
|
||||||
- name: Upload trust-graph
|
|
||||||
uses: actions/upload-artifact@v3
|
|
||||||
with:
|
|
||||||
name: trust-graph
|
|
||||||
path: trust-graph.tar.gz
|
|
||||||
|
1551
Cargo.lock
generated
1551
Cargo.lock
generated
File diff suppressed because it is too large
Load Diff
172
admin/package-lock.json
generated
172
admin/package-lock.json
generated
@ -9,12 +9,12 @@
|
|||||||
"version": "1.0.0",
|
"version": "1.0.0",
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@fluencelabs/aqua": "^0.9.1-374",
|
"@fluencelabs/aqua": "^0.10.0",
|
||||||
"@fluencelabs/aqua-lib": "^0.6.0",
|
"@fluencelabs/aqua-lib": "^0.6.0",
|
||||||
"@fluencelabs/fluence": "^0.27.5",
|
"@fluencelabs/fluence": "^0.27.5",
|
||||||
"@fluencelabs/fluence-network-environment": "^1.0.13",
|
"@fluencelabs/fluence-network-environment": "^1.0.13",
|
||||||
"@fluencelabs/trust-graph": "file:../aqua",
|
"@fluencelabs/trust-graph": "file:../aqua",
|
||||||
"bs58": "^4.0.1"
|
"bs58": "^5.0.0"
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"typescript": "^4.4.3"
|
"typescript": "^4.4.3"
|
||||||
@ -22,13 +22,13 @@
|
|||||||
},
|
},
|
||||||
"../aqua": {
|
"../aqua": {
|
||||||
"name": "@fluencelabs/trust-graph",
|
"name": "@fluencelabs/trust-graph",
|
||||||
"version": "0.2.2",
|
"version": "0.4.7",
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@fluencelabs/aqua-lib": "^0.5.2"
|
"@fluencelabs/aqua-lib": "^0.7.0"
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@fluencelabs/aqua": "^0.7.4-322"
|
"@fluencelabs/aqua": "^0.10.3"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"../aqua/node_modules/@fluencelabs/aqua": {
|
"../aqua/node_modules/@fluencelabs/aqua": {
|
||||||
@ -687,13 +687,13 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/@fluencelabs/aqua": {
|
"node_modules/@fluencelabs/aqua": {
|
||||||
"version": "0.9.1-374",
|
"version": "0.10.3",
|
||||||
"resolved": "https://registry.npmjs.org/@fluencelabs/aqua/-/aqua-0.9.1-374.tgz",
|
"resolved": "https://registry.npmjs.org/@fluencelabs/aqua/-/aqua-0.10.3.tgz",
|
||||||
"integrity": "sha512-jF6oVE4h7bP/dQArKEfsy4UxbQbzACfVIBY/TFUL5D3np4ssjxrh15Y3gl1PwSWjlaPcDeFvAuStmcqfYQmLqQ==",
|
"integrity": "sha512-v7Jy+KzZkUm7NuUgrp7UQ8gxuhykxuTU3JigCdxiZMcG3/zD+OtHzsSggVLxVjDP7CKuTcjEKZSCxObwHp/Tpw==",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@fluencelabs/aqua-ipfs": "0.5.8",
|
"@fluencelabs/aqua-ipfs": "0.5.9",
|
||||||
"@fluencelabs/aqua-lib": "0.6.0",
|
"@fluencelabs/aqua-lib": "0.6.0",
|
||||||
"@fluencelabs/fluence": "0.27.5",
|
"@fluencelabs/fluence": "0.28.0",
|
||||||
"@fluencelabs/fluence-network-environment": "1.0.13",
|
"@fluencelabs/fluence-network-environment": "1.0.13",
|
||||||
"ipfs-http-client": "50.1.2"
|
"ipfs-http-client": "50.1.2"
|
||||||
},
|
},
|
||||||
@ -703,9 +703,9 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/@fluencelabs/aqua-ipfs": {
|
"node_modules/@fluencelabs/aqua-ipfs": {
|
||||||
"version": "0.5.8",
|
"version": "0.5.9",
|
||||||
"resolved": "https://registry.npmjs.org/@fluencelabs/aqua-ipfs/-/aqua-ipfs-0.5.8.tgz",
|
"resolved": "https://registry.npmjs.org/@fluencelabs/aqua-ipfs/-/aqua-ipfs-0.5.9.tgz",
|
||||||
"integrity": "sha512-jKlyGBm8oJAIQ3Ags58oJ8QVTlCYSvZQVTnX2SnugGXWVwt4+9qtqtvNT5MvWKK3M9lCFDbJJy/qVTjzPJlaiw==",
|
"integrity": "sha512-Vg7pYv4gEreOKfvzKEL5FchGqSKwat7JyKpqJO6h+FC5S1bl76UkI507+ExhijmUbQGznop8G33XFxyUi6q5SQ==",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@fluencelabs/aqua-lib": "^0.5.2"
|
"@fluencelabs/aqua-lib": "^0.5.2"
|
||||||
}
|
}
|
||||||
@ -720,6 +720,44 @@
|
|||||||
"resolved": "https://registry.npmjs.org/@fluencelabs/aqua-lib/-/aqua-lib-0.6.0.tgz",
|
"resolved": "https://registry.npmjs.org/@fluencelabs/aqua-lib/-/aqua-lib-0.6.0.tgz",
|
||||||
"integrity": "sha512-ifjtCM93KO3LhzPkMxqmXhwLmrg/scjOiyTihEVg7ns5N+BVzaK1eWzdOdqGdl9ZVoah43pdlQUepEo7VdRmsw=="
|
"integrity": "sha512-ifjtCM93KO3LhzPkMxqmXhwLmrg/scjOiyTihEVg7ns5N+BVzaK1eWzdOdqGdl9ZVoah43pdlQUepEo7VdRmsw=="
|
||||||
},
|
},
|
||||||
|
"node_modules/@fluencelabs/aqua/node_modules/@fluencelabs/avm": {
|
||||||
|
"version": "0.35.3",
|
||||||
|
"resolved": "https://registry.npmjs.org/@fluencelabs/avm/-/avm-0.35.3.tgz",
|
||||||
|
"integrity": "sha512-Y5mPPCmAUUKc5CDO12IL8mGEreWa7maVdX0MWCAH4+GvfLPFN1FxOMSKRYEtvkyVEL88pc9pd8cm5IRCBkFthg=="
|
||||||
|
},
|
||||||
|
"node_modules/@fluencelabs/aqua/node_modules/@fluencelabs/fluence": {
|
||||||
|
"version": "0.28.0",
|
||||||
|
"resolved": "https://registry.npmjs.org/@fluencelabs/fluence/-/fluence-0.28.0.tgz",
|
||||||
|
"integrity": "sha512-SXb2vjTj8m/nw4jEILV0tu9VIFprGo8mNb2nOB5btxdsOI8GzQZkpGzTLrSd/+UagIo2GdxAu0GhBP8dxZXaqg==",
|
||||||
|
"deprecated": "fluencelabs/fluence is deprecated in favor of a thinner CDN-distributed .js bundle, please see the following link for installation instructions https://github.com/fluencelabs/js-client#installation",
|
||||||
|
"dependencies": {
|
||||||
|
"@fluencelabs/avm": "0.35.3",
|
||||||
|
"@fluencelabs/connection": "0.2.0",
|
||||||
|
"@fluencelabs/interfaces": "0.1.0",
|
||||||
|
"@fluencelabs/keypair": "0.2.0",
|
||||||
|
"@fluencelabs/marine-js": "0.3.37",
|
||||||
|
"async": "3.2.4",
|
||||||
|
"base64-js": "^1.5.1",
|
||||||
|
"browser-or-node": "2.0.0",
|
||||||
|
"bs58": "5.0.0",
|
||||||
|
"buffer": "^6.0.3",
|
||||||
|
"cids": "1.1.9",
|
||||||
|
"loglevel": "1.8.1",
|
||||||
|
"multiformats": "9.9.0",
|
||||||
|
"peer-id": "0.16.0",
|
||||||
|
"platform": "^1.3.6",
|
||||||
|
"rxjs": "^7.5.5",
|
||||||
|
"ts-pattern": "3.3.3",
|
||||||
|
"uuid": "8.3.2"
|
||||||
|
},
|
||||||
|
"bin": {
|
||||||
|
"copy-marine": "dist/tools/copyMarine.js"
|
||||||
|
},
|
||||||
|
"engines": {
|
||||||
|
"node": ">=10",
|
||||||
|
"pnpm": ">=3"
|
||||||
|
}
|
||||||
|
},
|
||||||
"node_modules/@fluencelabs/avm": {
|
"node_modules/@fluencelabs/avm": {
|
||||||
"version": "0.31.10",
|
"version": "0.31.10",
|
||||||
"resolved": "https://registry.npmjs.org/@fluencelabs/avm/-/avm-0.31.10.tgz",
|
"resolved": "https://registry.npmjs.org/@fluencelabs/avm/-/avm-0.31.10.tgz",
|
||||||
@ -798,19 +836,6 @@
|
|||||||
"resolved": "https://registry.npmjs.org/@fluencelabs/fluence-network-environment/-/fluence-network-environment-1.0.13.tgz",
|
"resolved": "https://registry.npmjs.org/@fluencelabs/fluence-network-environment/-/fluence-network-environment-1.0.13.tgz",
|
||||||
"integrity": "sha512-2pci3T0sUHE08jwEs1r/vHKVT4XUh/A3j/QJ0eIhddsxyIjEksjdn05X7DF6STD14CF8GgBVOJEPgav8qaUMpA=="
|
"integrity": "sha512-2pci3T0sUHE08jwEs1r/vHKVT4XUh/A3j/QJ0eIhddsxyIjEksjdn05X7DF6STD14CF8GgBVOJEPgav8qaUMpA=="
|
||||||
},
|
},
|
||||||
"node_modules/@fluencelabs/fluence/node_modules/base-x": {
|
|
||||||
"version": "4.0.0",
|
|
||||||
"resolved": "https://registry.npmjs.org/base-x/-/base-x-4.0.0.tgz",
|
|
||||||
"integrity": "sha512-FuwxlW4H5kh37X/oW59pwTzzTKRzfrrQwhmyspRM7swOEZcHtDZSCt45U6oKgtuFE+WYPblePMVIPR4RZrh/hw=="
|
|
||||||
},
|
|
||||||
"node_modules/@fluencelabs/fluence/node_modules/bs58": {
|
|
||||||
"version": "5.0.0",
|
|
||||||
"resolved": "https://registry.npmjs.org/bs58/-/bs58-5.0.0.tgz",
|
|
||||||
"integrity": "sha512-r+ihvQJvahgYT50JD05dyJNKlmmSlMoOGwn1lCcEzanPglg7TxYjioQUYehQ9mAR/+hOSd2jRc/Z2y5UxBymvQ==",
|
|
||||||
"dependencies": {
|
|
||||||
"base-x": "^4.0.0"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"node_modules/@fluencelabs/interfaces": {
|
"node_modules/@fluencelabs/interfaces": {
|
||||||
"version": "0.1.0",
|
"version": "0.1.0",
|
||||||
"resolved": "https://registry.npmjs.org/@fluencelabs/interfaces/-/interfaces-0.1.0.tgz",
|
"resolved": "https://registry.npmjs.org/@fluencelabs/interfaces/-/interfaces-0.1.0.tgz",
|
||||||
@ -1896,11 +1921,9 @@
|
|||||||
"integrity": "sha512-3oSeUO0TMV67hN1AmbXsK4yaqU7tjiHlbxRDZOpH0KW9+CeX4bRAaX0Anxt0tx2MrpRpWwQaPwIlISEJhYU5Pw=="
|
"integrity": "sha512-3oSeUO0TMV67hN1AmbXsK4yaqU7tjiHlbxRDZOpH0KW9+CeX4bRAaX0Anxt0tx2MrpRpWwQaPwIlISEJhYU5Pw=="
|
||||||
},
|
},
|
||||||
"node_modules/base-x": {
|
"node_modules/base-x": {
|
||||||
"version": "3.0.8",
|
"version": "4.0.0",
|
||||||
"license": "MIT",
|
"resolved": "https://registry.npmjs.org/base-x/-/base-x-4.0.0.tgz",
|
||||||
"dependencies": {
|
"integrity": "sha512-FuwxlW4H5kh37X/oW59pwTzzTKRzfrrQwhmyspRM7swOEZcHtDZSCt45U6oKgtuFE+WYPblePMVIPR4RZrh/hw=="
|
||||||
"safe-buffer": "^5.0.1"
|
|
||||||
}
|
|
||||||
},
|
},
|
||||||
"node_modules/base64-js": {
|
"node_modules/base64-js": {
|
||||||
"version": "1.5.1",
|
"version": "1.5.1",
|
||||||
@ -2077,10 +2100,11 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/bs58": {
|
"node_modules/bs58": {
|
||||||
"version": "4.0.1",
|
"version": "5.0.0",
|
||||||
"license": "MIT",
|
"resolved": "https://registry.npmjs.org/bs58/-/bs58-5.0.0.tgz",
|
||||||
|
"integrity": "sha512-r+ihvQJvahgYT50JD05dyJNKlmmSlMoOGwn1lCcEzanPglg7TxYjioQUYehQ9mAR/+hOSd2jRc/Z2y5UxBymvQ==",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"base-x": "^3.0.2"
|
"base-x": "^4.0.0"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/bser": {
|
"node_modules/bser": {
|
||||||
@ -7936,21 +7960,53 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
"@fluencelabs/aqua": {
|
"@fluencelabs/aqua": {
|
||||||
"version": "0.9.1-374",
|
"version": "0.10.3",
|
||||||
"resolved": "https://registry.npmjs.org/@fluencelabs/aqua/-/aqua-0.9.1-374.tgz",
|
"resolved": "https://registry.npmjs.org/@fluencelabs/aqua/-/aqua-0.10.3.tgz",
|
||||||
"integrity": "sha512-jF6oVE4h7bP/dQArKEfsy4UxbQbzACfVIBY/TFUL5D3np4ssjxrh15Y3gl1PwSWjlaPcDeFvAuStmcqfYQmLqQ==",
|
"integrity": "sha512-v7Jy+KzZkUm7NuUgrp7UQ8gxuhykxuTU3JigCdxiZMcG3/zD+OtHzsSggVLxVjDP7CKuTcjEKZSCxObwHp/Tpw==",
|
||||||
"requires": {
|
"requires": {
|
||||||
"@fluencelabs/aqua-ipfs": "0.5.8",
|
"@fluencelabs/aqua-ipfs": "0.5.9",
|
||||||
"@fluencelabs/aqua-lib": "0.6.0",
|
"@fluencelabs/aqua-lib": "0.6.0",
|
||||||
"@fluencelabs/fluence": "0.27.5",
|
"@fluencelabs/fluence": "0.28.0",
|
||||||
"@fluencelabs/fluence-network-environment": "1.0.13",
|
"@fluencelabs/fluence-network-environment": "1.0.13",
|
||||||
"ipfs-http-client": "50.1.2"
|
"ipfs-http-client": "50.1.2"
|
||||||
|
},
|
||||||
|
"dependencies": {
|
||||||
|
"@fluencelabs/avm": {
|
||||||
|
"version": "0.35.3",
|
||||||
|
"resolved": "https://registry.npmjs.org/@fluencelabs/avm/-/avm-0.35.3.tgz",
|
||||||
|
"integrity": "sha512-Y5mPPCmAUUKc5CDO12IL8mGEreWa7maVdX0MWCAH4+GvfLPFN1FxOMSKRYEtvkyVEL88pc9pd8cm5IRCBkFthg=="
|
||||||
|
},
|
||||||
|
"@fluencelabs/fluence": {
|
||||||
|
"version": "0.28.0",
|
||||||
|
"resolved": "https://registry.npmjs.org/@fluencelabs/fluence/-/fluence-0.28.0.tgz",
|
||||||
|
"integrity": "sha512-SXb2vjTj8m/nw4jEILV0tu9VIFprGo8mNb2nOB5btxdsOI8GzQZkpGzTLrSd/+UagIo2GdxAu0GhBP8dxZXaqg==",
|
||||||
|
"requires": {
|
||||||
|
"@fluencelabs/avm": "0.35.3",
|
||||||
|
"@fluencelabs/connection": "0.2.0",
|
||||||
|
"@fluencelabs/interfaces": "0.1.0",
|
||||||
|
"@fluencelabs/keypair": "0.2.0",
|
||||||
|
"@fluencelabs/marine-js": "0.3.37",
|
||||||
|
"async": "3.2.4",
|
||||||
|
"base64-js": "^1.5.1",
|
||||||
|
"browser-or-node": "2.0.0",
|
||||||
|
"bs58": "5.0.0",
|
||||||
|
"buffer": "^6.0.3",
|
||||||
|
"cids": "1.1.9",
|
||||||
|
"loglevel": "1.8.1",
|
||||||
|
"multiformats": "9.9.0",
|
||||||
|
"peer-id": "0.16.0",
|
||||||
|
"platform": "^1.3.6",
|
||||||
|
"rxjs": "^7.5.5",
|
||||||
|
"ts-pattern": "3.3.3",
|
||||||
|
"uuid": "8.3.2"
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"@fluencelabs/aqua-ipfs": {
|
"@fluencelabs/aqua-ipfs": {
|
||||||
"version": "0.5.8",
|
"version": "0.5.9",
|
||||||
"resolved": "https://registry.npmjs.org/@fluencelabs/aqua-ipfs/-/aqua-ipfs-0.5.8.tgz",
|
"resolved": "https://registry.npmjs.org/@fluencelabs/aqua-ipfs/-/aqua-ipfs-0.5.9.tgz",
|
||||||
"integrity": "sha512-jKlyGBm8oJAIQ3Ags58oJ8QVTlCYSvZQVTnX2SnugGXWVwt4+9qtqtvNT5MvWKK3M9lCFDbJJy/qVTjzPJlaiw==",
|
"integrity": "sha512-Vg7pYv4gEreOKfvzKEL5FchGqSKwat7JyKpqJO6h+FC5S1bl76UkI507+ExhijmUbQGznop8G33XFxyUi6q5SQ==",
|
||||||
"requires": {
|
"requires": {
|
||||||
"@fluencelabs/aqua-lib": "^0.5.2"
|
"@fluencelabs/aqua-lib": "^0.5.2"
|
||||||
},
|
},
|
||||||
@ -8022,21 +8078,6 @@
|
|||||||
"rxjs": "^7.5.5",
|
"rxjs": "^7.5.5",
|
||||||
"ts-pattern": "3.3.3",
|
"ts-pattern": "3.3.3",
|
||||||
"uuid": "8.3.2"
|
"uuid": "8.3.2"
|
||||||
},
|
|
||||||
"dependencies": {
|
|
||||||
"base-x": {
|
|
||||||
"version": "4.0.0",
|
|
||||||
"resolved": "https://registry.npmjs.org/base-x/-/base-x-4.0.0.tgz",
|
|
||||||
"integrity": "sha512-FuwxlW4H5kh37X/oW59pwTzzTKRzfrrQwhmyspRM7swOEZcHtDZSCt45U6oKgtuFE+WYPblePMVIPR4RZrh/hw=="
|
|
||||||
},
|
|
||||||
"bs58": {
|
|
||||||
"version": "5.0.0",
|
|
||||||
"resolved": "https://registry.npmjs.org/bs58/-/bs58-5.0.0.tgz",
|
|
||||||
"integrity": "sha512-r+ihvQJvahgYT50JD05dyJNKlmmSlMoOGwn1lCcEzanPglg7TxYjioQUYehQ9mAR/+hOSd2jRc/Z2y5UxBymvQ==",
|
|
||||||
"requires": {
|
|
||||||
"base-x": "^4.0.0"
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"@fluencelabs/fluence-network-environment": {
|
"@fluencelabs/fluence-network-environment": {
|
||||||
@ -8100,8 +8141,8 @@
|
|||||||
"@fluencelabs/trust-graph": {
|
"@fluencelabs/trust-graph": {
|
||||||
"version": "file:../aqua",
|
"version": "file:../aqua",
|
||||||
"requires": {
|
"requires": {
|
||||||
"@fluencelabs/aqua": "^0.7.4-322",
|
"@fluencelabs/aqua": "^0.10.3",
|
||||||
"@fluencelabs/aqua-lib": "^0.5.2"
|
"@fluencelabs/aqua-lib": "^0.7.0"
|
||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@fluencelabs/aqua": {
|
"@fluencelabs/aqua": {
|
||||||
@ -8979,10 +9020,9 @@
|
|||||||
"integrity": "sha512-3oSeUO0TMV67hN1AmbXsK4yaqU7tjiHlbxRDZOpH0KW9+CeX4bRAaX0Anxt0tx2MrpRpWwQaPwIlISEJhYU5Pw=="
|
"integrity": "sha512-3oSeUO0TMV67hN1AmbXsK4yaqU7tjiHlbxRDZOpH0KW9+CeX4bRAaX0Anxt0tx2MrpRpWwQaPwIlISEJhYU5Pw=="
|
||||||
},
|
},
|
||||||
"base-x": {
|
"base-x": {
|
||||||
"version": "3.0.8",
|
"version": "4.0.0",
|
||||||
"requires": {
|
"resolved": "https://registry.npmjs.org/base-x/-/base-x-4.0.0.tgz",
|
||||||
"safe-buffer": "^5.0.1"
|
"integrity": "sha512-FuwxlW4H5kh37X/oW59pwTzzTKRzfrrQwhmyspRM7swOEZcHtDZSCt45U6oKgtuFE+WYPblePMVIPR4RZrh/hw=="
|
||||||
}
|
|
||||||
},
|
},
|
||||||
"base64-js": {
|
"base64-js": {
|
||||||
"version": "1.5.1",
|
"version": "1.5.1",
|
||||||
@ -9111,9 +9151,11 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
"bs58": {
|
"bs58": {
|
||||||
"version": "4.0.1",
|
"version": "5.0.0",
|
||||||
|
"resolved": "https://registry.npmjs.org/bs58/-/bs58-5.0.0.tgz",
|
||||||
|
"integrity": "sha512-r+ihvQJvahgYT50JD05dyJNKlmmSlMoOGwn1lCcEzanPglg7TxYjioQUYehQ9mAR/+hOSd2jRc/Z2y5UxBymvQ==",
|
||||||
"requires": {
|
"requires": {
|
||||||
"base-x": "^3.0.2"
|
"base-x": "^4.0.0"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"bser": {
|
"bser": {
|
||||||
|
@ -13,12 +13,12 @@
|
|||||||
"author": "Fluence Labs",
|
"author": "Fluence Labs",
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@fluencelabs/aqua": "^0.9.1-374",
|
"@fluencelabs/aqua": "^0.10.0",
|
||||||
"@fluencelabs/aqua-lib": "^0.6.0",
|
"@fluencelabs/aqua-lib": "^0.6.0",
|
||||||
"@fluencelabs/fluence": "^0.27.5",
|
"@fluencelabs/fluence": "^0.27.5",
|
||||||
"@fluencelabs/fluence-network-environment": "^1.0.13",
|
"@fluencelabs/fluence-network-environment": "^1.0.13",
|
||||||
"@fluencelabs/trust-graph": "file:../aqua",
|
"@fluencelabs/trust-graph": "file:../aqua",
|
||||||
"bs58": "^4.0.1"
|
"bs58": "^5.0.0"
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"typescript": "^4.4.3"
|
"typescript": "^4.4.3"
|
||||||
|
@ -1,5 +1,19 @@
|
|||||||
# Changelog
|
# Changelog
|
||||||
|
|
||||||
|
## [0.4.8](https://github.com/fluencelabs/trust-graph/compare/trust-graph-api-v0.4.7...trust-graph-api-v0.4.8) (2023-12-20)
|
||||||
|
|
||||||
|
|
||||||
|
### Miscellaneous Chores
|
||||||
|
|
||||||
|
* **trust-graph-api:** Synchronize trust-graph, wasm and api versions
|
||||||
|
|
||||||
|
## [0.4.7](https://github.com/fluencelabs/trust-graph/compare/trust-graph-api-v0.4.6...trust-graph-api-v0.4.7) (2023-07-04)
|
||||||
|
|
||||||
|
|
||||||
|
### Miscellaneous Chores
|
||||||
|
|
||||||
|
* **trust-graph-api:** Synchronize trust-graph, wasm and api versions
|
||||||
|
|
||||||
## [0.4.6](https://github.com/fluencelabs/trust-graph/compare/trust-graph-api-v0.4.5...trust-graph-api-v0.4.6) (2023-06-30)
|
## [0.4.6](https://github.com/fluencelabs/trust-graph/compare/trust-graph-api-v0.4.5...trust-graph-api-v0.4.6) (2023-06-30)
|
||||||
|
|
||||||
|
|
||||||
|
4
aqua/package-lock.json
generated
4
aqua/package-lock.json
generated
@ -1,12 +1,12 @@
|
|||||||
{
|
{
|
||||||
"name": "@fluencelabs/trust-graph",
|
"name": "@fluencelabs/trust-graph",
|
||||||
"version": "0.4.6",
|
"version": "0.4.8",
|
||||||
"lockfileVersion": 2,
|
"lockfileVersion": 2,
|
||||||
"requires": true,
|
"requires": true,
|
||||||
"packages": {
|
"packages": {
|
||||||
"": {
|
"": {
|
||||||
"name": "@fluencelabs/trust-graph",
|
"name": "@fluencelabs/trust-graph",
|
||||||
"version": "0.4.6",
|
"version": "0.4.8",
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@fluencelabs/aqua-lib": "^0.7.0"
|
"@fluencelabs/aqua-lib": "^0.7.0"
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "@fluencelabs/trust-graph",
|
"name": "@fluencelabs/trust-graph",
|
||||||
"version": "0.4.6",
|
"version": "0.4.8",
|
||||||
"description": "Aqua Trust Graph API library",
|
"description": "Aqua Trust Graph API library",
|
||||||
"files": [
|
"files": [
|
||||||
"*.aqua"
|
"*.aqua"
|
||||||
|
@ -1,5 +1,19 @@
|
|||||||
# Changelog
|
# Changelog
|
||||||
|
|
||||||
|
## [0.4.8](https://github.com/fluencelabs/trust-graph/compare/distro-v0.4.7...distro-v0.4.8) (2023-12-20)
|
||||||
|
|
||||||
|
|
||||||
|
### Features
|
||||||
|
|
||||||
|
* update marine sdk's, configs and sqlite connector ([#129](https://github.com/fluencelabs/trust-graph/issues/129)) ([0b66f4e](https://github.com/fluencelabs/trust-graph/commit/0b66f4e0536633879de46f69ac8391c72ece7e77))
|
||||||
|
|
||||||
|
## [0.4.7](https://github.com/fluencelabs/trust-graph/compare/distro-v0.4.6...distro-v0.4.7) (2023-07-04)
|
||||||
|
|
||||||
|
|
||||||
|
### Miscellaneous Chores
|
||||||
|
|
||||||
|
* **distro:** Synchronize trust-graph, wasm and api versions
|
||||||
|
|
||||||
## [0.4.6](https://github.com/fluencelabs/trust-graph/compare/distro-v0.4.5...distro-v0.4.6) (2023-06-30)
|
## [0.4.6](https://github.com/fluencelabs/trust-graph/compare/distro-v0.4.5...distro-v0.4.6) (2023-06-30)
|
||||||
|
|
||||||
|
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
[package]
|
[package]
|
||||||
name = "trust-graph-distro"
|
name = "trust-graph-distro"
|
||||||
version = "0.4.6"
|
version = "0.4.8"
|
||||||
edition = "2021"
|
edition = "2021"
|
||||||
build = "build.rs"
|
build = "build.rs"
|
||||||
license = "Apache-2.0"
|
license = "Apache-2.0"
|
||||||
@ -15,4 +15,4 @@ serde_json = "1.0.96"
|
|||||||
lazy_static = "1.4.0"
|
lazy_static = "1.4.0"
|
||||||
|
|
||||||
[build-dependencies]
|
[build-dependencies]
|
||||||
built = "0.5.2"
|
built = "0.6.0"
|
||||||
|
@ -1,4 +1,5 @@
|
|||||||
modules_dir = "."
|
modules_dir = "."
|
||||||
|
total_memory_limit = "Infinity"
|
||||||
|
|
||||||
[[module]]
|
[[module]]
|
||||||
name = "sqlite3"
|
name = "sqlite3"
|
||||||
|
1529
example/package-lock.json
generated
1529
example/package-lock.json
generated
File diff suppressed because it is too large
Load Diff
@ -13,14 +13,14 @@
|
|||||||
"author": "Fluence Labs",
|
"author": "Fluence Labs",
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@fluencelabs/aqua-lib": "^0.5.2",
|
"@fluencelabs/aqua-lib": "^0.6.0",
|
||||||
"@fluencelabs/fluence": "^0.23.0",
|
"@fluencelabs/fluence": "^0.23.0",
|
||||||
"@fluencelabs/fluence-network-environment": "^1.0.10",
|
"@fluencelabs/fluence-network-environment": "^1.0.10",
|
||||||
"@fluencelabs/trust-graph": "3.0.2",
|
"@fluencelabs/trust-graph": "3.1.2",
|
||||||
"bs58": "^4.0.1"
|
"bs58": "^5.0.0"
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"typescript": "^4.5.2",
|
"typescript": "^4.5.2",
|
||||||
"@fluencelabs/aqua": "^0.7.4-325"
|
"@fluencelabs/aqua": "^0.10.0"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -4,6 +4,21 @@ All notable changes to this project will be documented in this file.
|
|||||||
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
|
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
|
||||||
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
|
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
|
||||||
|
|
||||||
|
## [0.10.4](https://github.com/fluencelabs/trust-graph/compare/keypair-v0.10.3...keypair-v0.10.4) (2023-12-20)
|
||||||
|
|
||||||
|
|
||||||
|
### Features
|
||||||
|
|
||||||
|
* **fluence-keypair:** bump ed25519-dalek to 0.2.0 ([#127](https://github.com/fluencelabs/trust-graph/issues/127)) ([ed5bd2c](https://github.com/fluencelabs/trust-graph/commit/ed5bd2c0ec50bef5ac7a12deacb73da491666912))
|
||||||
|
* update marine sdk's, configs and sqlite connector ([#129](https://github.com/fluencelabs/trust-graph/issues/129)) ([0b66f4e](https://github.com/fluencelabs/trust-graph/commit/0b66f4e0536633879de46f69ac8391c72ece7e77))
|
||||||
|
|
||||||
|
## [0.10.3](https://github.com/fluencelabs/trust-graph/compare/keypair-v0.10.2...keypair-v0.10.3) (2023-07-04)
|
||||||
|
|
||||||
|
|
||||||
|
### Bug Fixes
|
||||||
|
|
||||||
|
* **keypair:** deserialize libp2p keypair from secret key ([#116](https://github.com/fluencelabs/trust-graph/issues/116)) ([ee330a7](https://github.com/fluencelabs/trust-graph/commit/ee330a715a902e48fc9b61d662ffcd950a26379c))
|
||||||
|
|
||||||
## [0.10.2](https://github.com/fluencelabs/trust-graph/compare/keypair-v0.10.1...keypair-v0.10.2) (2023-06-30)
|
## [0.10.2](https://github.com/fluencelabs/trust-graph/compare/keypair-v0.10.1...keypair-v0.10.2) (2023-06-30)
|
||||||
|
|
||||||
|
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
[package]
|
[package]
|
||||||
name = "fluence-keypair"
|
name = "fluence-keypair"
|
||||||
version = "0.10.2"
|
version = "0.10.4"
|
||||||
authors = ["Fluence Labs"]
|
authors = ["Fluence Labs"]
|
||||||
edition = "2021"
|
edition = "2021"
|
||||||
description = "unified keypair API based on libp2p-identity"
|
description = "unified keypair API based on libp2p-identity"
|
||||||
@ -10,10 +10,10 @@ repository = "https://github.com/fluencelabs/trust-graph"
|
|||||||
[dependencies]
|
[dependencies]
|
||||||
serde = { version = "1.0.118", features = ["derive"] }
|
serde = { version = "1.0.118", features = ["derive"] }
|
||||||
bs58 = "0.5.0"
|
bs58 = "0.5.0"
|
||||||
ed25519-dalek = { version = "1.0.1", features = ["serde", "std"] }
|
ed25519-dalek = { version = "2.0.0", features = ["serde", "std", "rand_core"] }
|
||||||
rand = "0.8.5"
|
rand = "0.8.5"
|
||||||
thiserror = "1.0.23"
|
thiserror = "1.0.23"
|
||||||
lazy_static = "1.2"
|
lazy_static = "1.4"
|
||||||
libsecp256k1 = "0.7.1"
|
libsecp256k1 = "0.7.1"
|
||||||
asn1_der = "0.6.1"
|
asn1_der = "0.6.1"
|
||||||
sha2 = "0.10.6"
|
sha2 = "0.10.6"
|
||||||
|
@ -1,3 +1,3 @@
|
|||||||
[toolchain]
|
[toolchain]
|
||||||
channel = "nightly-2022-08-30"
|
channel = "nightly-2023-12-06"
|
||||||
targets = [ "x86_64-apple-darwin", "x86_64-unknown-linux-gnu" ]
|
targets = [ "x86_64-apple-darwin", "x86_64-unknown-linux-gnu" ]
|
||||||
|
@ -19,16 +19,16 @@
|
|||||||
// DEALINGS IN THE SOFTWARE.
|
// DEALINGS IN THE SOFTWARE.
|
||||||
|
|
||||||
//! Ed25519 keys.
|
//! Ed25519 keys.
|
||||||
use crate::error::{DecodingError, SigningError, VerificationError};
|
use crate::error::{DecodingError, DecodingError::InvalidLength, SigningError, VerificationError};
|
||||||
use core::fmt;
|
use core::fmt;
|
||||||
use ed25519_dalek::{self as ed25519, Signer as _, Verifier as _};
|
use ed25519_dalek::{self as ed25519, Signer as _, Verifier as _};
|
||||||
use rand::RngCore;
|
|
||||||
use serde::{Deserialize, Serialize};
|
use serde::{Deserialize, Serialize};
|
||||||
use std::convert::TryFrom;
|
use std::convert::TryFrom;
|
||||||
use zeroize::Zeroize;
|
use zeroize::Zeroize;
|
||||||
|
|
||||||
/// An Ed25519 keypair.
|
/// An Ed25519 keypair
|
||||||
pub struct Keypair(ed25519::Keypair);
|
#[derive(Clone)]
|
||||||
|
pub struct Keypair(ed25519::SigningKey);
|
||||||
|
|
||||||
impl Keypair {
|
impl Keypair {
|
||||||
/// Generate a new Ed25519 keypair.
|
/// Generate a new Ed25519 keypair.
|
||||||
@ -40,13 +40,15 @@ impl Keypair {
|
|||||||
/// of the secret scalar and the compressed public point,
|
/// of the secret scalar and the compressed public point,
|
||||||
/// an informal standard for encoding Ed25519 keypairs.
|
/// an informal standard for encoding Ed25519 keypairs.
|
||||||
pub fn encode(&self) -> [u8; 64] {
|
pub fn encode(&self) -> [u8; 64] {
|
||||||
self.0.to_bytes()
|
self.0.to_keypair_bytes()
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Decode a keypair from the format produced by `encode`,
|
/// Decode a keypair from the format produced by `encode`,
|
||||||
/// zeroing the input on success.
|
/// zeroing the input on success.
|
||||||
pub fn decode(kp: &mut [u8]) -> Result<Self, DecodingError> {
|
pub fn decode(kp: &mut [u8]) -> Result<Self, DecodingError> {
|
||||||
ed25519::Keypair::from_bytes(kp)
|
let bytes = <[u8; 64]>::try_from(&*kp).map_err(InvalidLength)?;
|
||||||
|
|
||||||
|
ed25519::SigningKey::from_keypair_bytes(&bytes)
|
||||||
.map(|k| {
|
.map(|k| {
|
||||||
kp.zeroize();
|
kp.zeroize();
|
||||||
Keypair(k)
|
Keypair(k)
|
||||||
@ -61,12 +63,12 @@ impl Keypair {
|
|||||||
|
|
||||||
/// Get the public key of this keypair.
|
/// Get the public key of this keypair.
|
||||||
pub fn public(&self) -> PublicKey {
|
pub fn public(&self) -> PublicKey {
|
||||||
PublicKey(self.0.public)
|
PublicKey(self.0.verifying_key())
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Get the secret key of this keypair.
|
/// Get the secret key of this keypair.
|
||||||
pub fn secret(&self) -> SecretKey {
|
pub fn secret(&self) -> SecretKey {
|
||||||
SecretKey::from_bytes(&mut self.0.secret.to_bytes())
|
SecretKey::from_bytes(&mut self.0.to_bytes())
|
||||||
.expect("ed25519::SecretKey::from_bytes(to_bytes(k)) != k")
|
.expect("ed25519::SecretKey::from_bytes(to_bytes(k)) != k")
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -74,26 +76,14 @@ impl Keypair {
|
|||||||
impl fmt::Debug for Keypair {
|
impl fmt::Debug for Keypair {
|
||||||
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
|
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
|
||||||
f.debug_struct("Keypair")
|
f.debug_struct("Keypair")
|
||||||
.field("public", &self.0.public)
|
.field("public", &self.0.verifying_key())
|
||||||
.finish()
|
.finish()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
impl Clone for Keypair {
|
|
||||||
fn clone(&self) -> Self {
|
|
||||||
let mut sk_bytes = self.0.secret.to_bytes();
|
|
||||||
let secret = SecretKey::from_bytes(&mut sk_bytes)
|
|
||||||
.expect("ed25519::SecretKey::from_bytes(to_bytes(k)) != k")
|
|
||||||
.0;
|
|
||||||
let public = ed25519::PublicKey::from_bytes(&self.0.public.to_bytes())
|
|
||||||
.expect("ed25519::PublicKey::from_bytes(to_bytes(k)) != k");
|
|
||||||
Keypair(ed25519::Keypair { secret, public })
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/// Build keypair from existing ed25519 keypair
|
/// Build keypair from existing ed25519 keypair
|
||||||
impl From<ed25519::Keypair> for Keypair {
|
impl From<ed25519::SigningKey> for Keypair {
|
||||||
fn from(kp: ed25519::Keypair) -> Self {
|
fn from(kp: ed25519::SigningKey) -> Self {
|
||||||
Keypair(kp)
|
Keypair(kp)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -101,25 +91,21 @@ impl From<ed25519::Keypair> for Keypair {
|
|||||||
/// Demote an Ed25519 keypair to a secret key.
|
/// Demote an Ed25519 keypair to a secret key.
|
||||||
impl From<Keypair> for SecretKey {
|
impl From<Keypair> for SecretKey {
|
||||||
fn from(kp: Keypair) -> Self {
|
fn from(kp: Keypair) -> Self {
|
||||||
SecretKey(kp.0.secret)
|
SecretKey(kp.0.to_bytes())
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Promote an Ed25519 secret key into a keypair.
|
/// Promote an Ed25519 secret key into a keypair.
|
||||||
impl From<SecretKey> for Keypair {
|
impl From<SecretKey> for Keypair {
|
||||||
fn from(sk: SecretKey) -> Self {
|
fn from(sk: SecretKey) -> Self {
|
||||||
let secret: ed25519::ExpandedSecretKey = (&sk.0).into();
|
let signing = ed25519::SigningKey::from_bytes(&sk.0);
|
||||||
let public = ed25519::PublicKey::from(&secret);
|
Keypair(signing)
|
||||||
Keypair(ed25519::Keypair {
|
|
||||||
secret: sk.0,
|
|
||||||
public,
|
|
||||||
})
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/// An Ed25519 public key.
|
/// An Ed25519 public key.
|
||||||
#[derive(PartialEq, Eq, Debug, Clone, Deserialize, Serialize)]
|
#[derive(PartialEq, Eq, Debug, Clone, Deserialize, Serialize)]
|
||||||
pub struct PublicKey(ed25519::PublicKey);
|
pub struct PublicKey(ed25519::VerifyingKey);
|
||||||
|
|
||||||
impl PublicKey {
|
impl PublicKey {
|
||||||
/// Verify the Ed25519 signature on a message using the public key.
|
/// Verify the Ed25519 signature on a message using the public key.
|
||||||
@ -143,26 +129,21 @@ impl PublicKey {
|
|||||||
|
|
||||||
/// Decode a public key from a byte array as produced by `encode`.
|
/// Decode a public key from a byte array as produced by `encode`.
|
||||||
pub fn decode(bytes: &[u8]) -> Result<Self, DecodingError> {
|
pub fn decode(bytes: &[u8]) -> Result<Self, DecodingError> {
|
||||||
ed25519::PublicKey::from_bytes(bytes)
|
let bytes = <[u8; 32]>::try_from(bytes).map_err(InvalidLength)?;
|
||||||
|
ed25519::VerifyingKey::from_bytes(&bytes)
|
||||||
.map_err(DecodingError::Ed25519)
|
.map_err(DecodingError::Ed25519)
|
||||||
.map(PublicKey)
|
.map(PublicKey)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/// An Ed25519 secret key.
|
/// An Ed25519 secret key.
|
||||||
|
#[derive(Clone)]
|
||||||
pub struct SecretKey(pub ed25519::SecretKey);
|
pub struct SecretKey(pub ed25519::SecretKey);
|
||||||
|
|
||||||
/// View the bytes of the secret key.
|
/// View the bytes of the secret key.
|
||||||
impl AsRef<[u8]> for SecretKey {
|
impl AsRef<[u8]> for SecretKey {
|
||||||
fn as_ref(&self) -> &[u8] {
|
fn as_ref(&self) -> &[u8] {
|
||||||
self.0.as_bytes()
|
&self.0[..]
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
impl Clone for SecretKey {
|
|
||||||
fn clone(&self) -> Self {
|
|
||||||
let mut sk_bytes = self.0.to_bytes();
|
|
||||||
Self::from_bytes(&mut sk_bytes).expect("ed25519::SecretKey::from_bytes(to_bytes(k)) != k")
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -175,13 +156,8 @@ impl fmt::Debug for SecretKey {
|
|||||||
impl SecretKey {
|
impl SecretKey {
|
||||||
/// Generate a new Ed25519 secret key.
|
/// Generate a new Ed25519 secret key.
|
||||||
pub fn generate() -> Self {
|
pub fn generate() -> Self {
|
||||||
let mut bytes = [0u8; 32];
|
let signing = ed25519::SigningKey::generate(&mut rand::rngs::OsRng);
|
||||||
rand::thread_rng().fill_bytes(&mut bytes);
|
SecretKey(signing.to_bytes())
|
||||||
SecretKey(
|
|
||||||
ed25519::SecretKey::from_bytes(&bytes).expect(
|
|
||||||
"this returns `Err` only if the length is wrong; the length is correct; qed",
|
|
||||||
),
|
|
||||||
)
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Create an Ed25519 secret key from a byte slice, zeroing the input on success.
|
/// Create an Ed25519 secret key from a byte slice, zeroing the input on success.
|
||||||
@ -189,7 +165,7 @@ impl SecretKey {
|
|||||||
/// returned.
|
/// returned.
|
||||||
pub fn from_bytes(mut sk_bytes: impl AsMut<[u8]>) -> Result<Self, DecodingError> {
|
pub fn from_bytes(mut sk_bytes: impl AsMut<[u8]>) -> Result<Self, DecodingError> {
|
||||||
let sk_bytes = sk_bytes.as_mut();
|
let sk_bytes = sk_bytes.as_mut();
|
||||||
let secret = ed25519::SecretKey::from_bytes(&*sk_bytes).map_err(DecodingError::Ed25519)?;
|
let secret = <[u8; 32]>::try_from(&*sk_bytes).map_err(InvalidLength)?;
|
||||||
sk_bytes.zeroize();
|
sk_bytes.zeroize();
|
||||||
Ok(SecretKey(secret))
|
Ok(SecretKey(secret))
|
||||||
}
|
}
|
||||||
@ -201,10 +177,11 @@ pub struct Signature(pub Vec<u8>);
|
|||||||
#[cfg(test)]
|
#[cfg(test)]
|
||||||
mod tests {
|
mod tests {
|
||||||
use super::*;
|
use super::*;
|
||||||
|
use crate::KeyPair;
|
||||||
use quickcheck::*;
|
use quickcheck::*;
|
||||||
|
|
||||||
fn eq_keypairs(kp1: &Keypair, kp2: &Keypair) -> bool {
|
fn eq_keypairs(kp1: &Keypair, kp2: &Keypair) -> bool {
|
||||||
kp1.public() == kp2.public() && kp1.0.secret.as_bytes() == kp2.0.secret.as_bytes()
|
kp1.public() == kp2.public() && kp1.0.to_bytes() == kp2.0.to_bytes()
|
||||||
}
|
}
|
||||||
|
|
||||||
#[test]
|
#[test]
|
||||||
@ -218,11 +195,22 @@ mod tests {
|
|||||||
QuickCheck::new().tests(10).quickcheck(prop as fn() -> _);
|
QuickCheck::new().tests(10).quickcheck(prop as fn() -> _);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[test]
|
||||||
|
fn ed25519_keypair_convert() {
|
||||||
|
fn prop() -> bool {
|
||||||
|
let kp1 = KeyPair::generate_ed25519();
|
||||||
|
let libp2p_kp: libp2p_identity::Keypair = kp1.clone().into();
|
||||||
|
let kp2: KeyPair = libp2p_kp.into();
|
||||||
|
kp1.public() == kp2.public() && kp1.secret().unwrap() == kp2.secret().unwrap()
|
||||||
|
}
|
||||||
|
QuickCheck::new().tests(10).quickcheck(prop as fn() -> _);
|
||||||
|
}
|
||||||
|
|
||||||
#[test]
|
#[test]
|
||||||
fn ed25519_keypair_from_secret() {
|
fn ed25519_keypair_from_secret() {
|
||||||
fn prop() -> bool {
|
fn prop() -> bool {
|
||||||
let kp1 = Keypair::generate();
|
let kp1 = Keypair::generate();
|
||||||
let mut sk = kp1.0.secret.to_bytes();
|
let mut sk = kp1.0.to_bytes();
|
||||||
let kp2 = Keypair::from(SecretKey::from_bytes(&mut sk).unwrap());
|
let kp2 = Keypair::from(SecretKey::from_bytes(&mut sk).unwrap());
|
||||||
eq_keypairs(&kp1, &kp2) && sk == [0u8; 32]
|
eq_keypairs(&kp1, &kp2) && sk == [0u8; 32]
|
||||||
}
|
}
|
||||||
|
@ -31,6 +31,8 @@ pub enum Error {
|
|||||||
/// An error during decoding of key material.
|
/// An error during decoding of key material.
|
||||||
#[derive(ThisError, Debug)]
|
#[derive(ThisError, Debug)]
|
||||||
pub enum DecodingError {
|
pub enum DecodingError {
|
||||||
|
#[error("Failed to decode, invalid length: {0}")]
|
||||||
|
InvalidLength(#[from] std::array::TryFromSliceError),
|
||||||
#[error("Failed to decode with ed25519: {0}")]
|
#[error("Failed to decode with ed25519: {0}")]
|
||||||
Ed25519(
|
Ed25519(
|
||||||
#[from]
|
#[from]
|
||||||
|
@ -195,7 +195,7 @@ impl KeyPair {
|
|||||||
pub fn secret(&self) -> eyre::Result<Vec<u8>> {
|
pub fn secret(&self) -> eyre::Result<Vec<u8>> {
|
||||||
use KeyPair::*;
|
use KeyPair::*;
|
||||||
match self {
|
match self {
|
||||||
Ed25519(pair) => Ok(pair.secret().0.to_bytes().to_vec()),
|
Ed25519(pair) => Ok(pair.secret().0.to_vec()),
|
||||||
#[cfg(not(target_arch = "wasm32"))]
|
#[cfg(not(target_arch = "wasm32"))]
|
||||||
Rsa(_) => Err(eyre::eyre!("secret key is not available for RSA")),
|
Rsa(_) => Err(eyre::eyre!("secret key is not available for RSA")),
|
||||||
Secp256k1(pair) => Ok(pair.secret().to_bytes().to_vec()),
|
Secp256k1(pair) => Ok(pair.secret().to_bytes().to_vec()),
|
||||||
@ -283,7 +283,9 @@ impl From<KeyPair> for libp2p_identity::Keypair {
|
|||||||
fn convert_keypair(key: KeyPair) -> eyre::Result<libp2p_identity::Keypair> {
|
fn convert_keypair(key: KeyPair) -> eyre::Result<libp2p_identity::Keypair> {
|
||||||
match key {
|
match key {
|
||||||
KeyPair::Ed25519(kp) => {
|
KeyPair::Ed25519(kp) => {
|
||||||
let kp = Keypair::ed25519_from_bytes(kp.encode().to_vec().as_mut_slice())?;
|
// for some reason, libp2p takes SecretKey's 32 bytes here instead of Keypair's 64 bytes
|
||||||
|
let secret_bytes = kp.secret().0;
|
||||||
|
let kp = libp2p_identity::Keypair::ed25519_from_bytes(secret_bytes)?;
|
||||||
Ok(kp)
|
Ok(kp)
|
||||||
}
|
}
|
||||||
#[cfg(not(target_arch = "wasm32"))]
|
#[cfg(not(target_arch = "wasm32"))]
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
[toolchain]
|
[toolchain]
|
||||||
channel = "nightly-2022-12-06"
|
channel = "nightly-2023-12-06"
|
||||||
targets = [ "x86_64-apple-darwin", "wasm32-wasi", "wasm32-unknown-unknown", "x86_64-unknown-linux-gnu" ]
|
targets = [ "x86_64-apple-darwin", "wasm32-wasi", "wasm32-unknown-unknown", "x86_64-unknown-linux-gnu" ]
|
||||||
components = [ "rustfmt", "clippy" ]
|
components = [ "rustfmt", "clippy" ]
|
||||||
|
@ -9,6 +9,36 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
|||||||
* trust-graph bumped from 0.4.1 to 0.4.2
|
* trust-graph bumped from 0.4.1 to 0.4.2
|
||||||
* fluence-keypair bumped from 0.10.0 to 0.10.1
|
* fluence-keypair bumped from 0.10.0 to 0.10.1
|
||||||
|
|
||||||
|
## [0.4.8](https://github.com/fluencelabs/trust-graph/compare/trust-graph-wasm-v0.4.7...trust-graph-wasm-v0.4.8) (2023-12-20)
|
||||||
|
|
||||||
|
|
||||||
|
### Features
|
||||||
|
|
||||||
|
* update marine sdk's, configs and sqlite connector ([#129](https://github.com/fluencelabs/trust-graph/issues/129)) ([0b66f4e](https://github.com/fluencelabs/trust-graph/commit/0b66f4e0536633879de46f69ac8391c72ece7e77))
|
||||||
|
|
||||||
|
|
||||||
|
### Dependencies
|
||||||
|
|
||||||
|
* The following workspace dependencies were updated
|
||||||
|
* dependencies
|
||||||
|
* trust-graph bumped from 0.4.7 to 0.4.8
|
||||||
|
* fluence-keypair bumped from 0.10.3 to 0.10.4
|
||||||
|
|
||||||
|
## [0.4.7](https://github.com/fluencelabs/trust-graph/compare/trust-graph-wasm-v0.4.6...trust-graph-wasm-v0.4.7) (2023-07-04)
|
||||||
|
|
||||||
|
|
||||||
|
### Bug Fixes
|
||||||
|
|
||||||
|
* **deps:** update rust crate marine-rs-sdk-test to 0.10.0 ([#106](https://github.com/fluencelabs/trust-graph/issues/106)) ([725d3f8](https://github.com/fluencelabs/trust-graph/commit/725d3f8f48b3bf1ed8605e9ba2da5c966a145f0d))
|
||||||
|
|
||||||
|
|
||||||
|
### Dependencies
|
||||||
|
|
||||||
|
* The following workspace dependencies were updated
|
||||||
|
* dependencies
|
||||||
|
* trust-graph bumped from 0.4.6 to 0.4.7
|
||||||
|
* fluence-keypair bumped from 0.10.2 to 0.10.3
|
||||||
|
|
||||||
## [0.4.6](https://github.com/fluencelabs/trust-graph/compare/trust-graph-wasm-v0.4.5...trust-graph-wasm-v0.4.6) (2023-06-30)
|
## [0.4.6](https://github.com/fluencelabs/trust-graph/compare/trust-graph-wasm-v0.4.5...trust-graph-wasm-v0.4.6) (2023-06-30)
|
||||||
|
|
||||||
|
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
[package]
|
[package]
|
||||||
name = "trust-graph-wasm"
|
name = "trust-graph-wasm"
|
||||||
version = "0.4.6"
|
version = "0.4.8"
|
||||||
authors = ["Fluence Labs"]
|
authors = ["Fluence Labs"]
|
||||||
edition = "2021"
|
edition = "2021"
|
||||||
description = "trust graph wasm"
|
description = "trust graph wasm"
|
||||||
@ -12,16 +12,16 @@ name = "trust-graph"
|
|||||||
path = "src/main.rs"
|
path = "src/main.rs"
|
||||||
|
|
||||||
[dependencies]
|
[dependencies]
|
||||||
trust-graph = { version = "0.4.6", path = "../trust-graph" }
|
trust-graph = { version = "0.4.8", path = "../trust-graph" }
|
||||||
fluence-keypair = { version = "0.10.2", path = "../keypair" }
|
fluence-keypair = { version = "0.10.4", path = "../keypair" }
|
||||||
marine-rs-sdk = { version = "0.7.1", features = ["logger"] }
|
marine-rs-sdk = { version = "0.10.2", features = ["logger"] }
|
||||||
marine-sqlite-connector = "0.8.0"
|
marine-sqlite-connector = "0.9.2"
|
||||||
|
|
||||||
libp2p-identity = { workspace = true }
|
libp2p-identity = { workspace = true }
|
||||||
|
|
||||||
log = "0.4.8"
|
log = "0.4.8"
|
||||||
anyhow = "1.0.31"
|
anyhow = "1.0.31"
|
||||||
once_cell = "1.4.1"
|
once_cell = "1.18.0"
|
||||||
serde_json = "1.0"
|
serde_json = "1.0"
|
||||||
bs58 = "0.4.0"
|
bs58 = "0.4.0"
|
||||||
rmp-serde = "1.1.1"
|
rmp-serde = "1.1.1"
|
||||||
@ -29,8 +29,8 @@ bincode = "1.3.1"
|
|||||||
thiserror = "1.0.23"
|
thiserror = "1.0.23"
|
||||||
|
|
||||||
[dev-dependencies]
|
[dev-dependencies]
|
||||||
marine-rs-sdk-test = "0.9.1"
|
marine-rs-sdk-test = "0.12.1"
|
||||||
rusqlite = "0.28.0"
|
rusqlite = "0.28.0"
|
||||||
|
|
||||||
[build-dependencies]
|
[build-dependencies]
|
||||||
marine-rs-sdk-test = "0.9.1"
|
marine-rs-sdk-test = "0.12.1"
|
||||||
|
@ -1,4 +1,5 @@
|
|||||||
modules_dir = "artifacts/"
|
modules_dir = "artifacts/"
|
||||||
|
total_memory_limit = "Infinity"
|
||||||
|
|
||||||
[[module]]
|
[[module]]
|
||||||
name = "sqlite3"
|
name = "sqlite3"
|
||||||
|
@ -1,3 +1,3 @@
|
|||||||
[toolchain]
|
[toolchain]
|
||||||
channel = "nightly-2022-12-06"
|
channel = "nightly-2023-12-06"
|
||||||
targets = [ "x86_64-apple-darwin", "wasm32-wasi", "wasm32-unknown-unknown", "x86_64-unknown-linux-gnu" ]
|
targets = [ "x86_64-apple-darwin", "wasm32-wasi", "wasm32-unknown-unknown", "x86_64-unknown-linux-gnu" ]
|
||||||
|
@ -37,7 +37,7 @@ pub(crate) fn check_timestamp_tetraplets(
|
|||||||
.get(arg_number)
|
.get(arg_number)
|
||||||
.ok_or_else(|| InvalidTimestampTetraplet(format!("{:?}", call_parameters.tetraplets)))?;
|
.ok_or_else(|| InvalidTimestampTetraplet(format!("{:?}", call_parameters.tetraplets)))?;
|
||||||
let tetraplet = tetraplets
|
let tetraplet = tetraplets
|
||||||
.get(0)
|
.first()
|
||||||
.ok_or_else(|| InvalidTimestampTetraplet(format!("{:?}", call_parameters.tetraplets)))?;
|
.ok_or_else(|| InvalidTimestampTetraplet(format!("{:?}", call_parameters.tetraplets)))?;
|
||||||
(TRUSTED_TIMESTAMP.eq(&(&tetraplet.service_id, &tetraplet.function_name))
|
(TRUSTED_TIMESTAMP.eq(&(&tetraplet.service_id, &tetraplet.function_name))
|
||||||
&& tetraplet.peer_pk == call_parameters.host_id)
|
&& tetraplet.peer_pk == call_parameters.host_id)
|
||||||
|
@ -4,6 +4,34 @@
|
|||||||
* dependencies
|
* dependencies
|
||||||
* fluence-keypair bumped from 0.10.0 to 0.10.1
|
* fluence-keypair bumped from 0.10.0 to 0.10.1
|
||||||
|
|
||||||
|
## [0.4.8](https://github.com/fluencelabs/trust-graph/compare/trust-graph-v0.4.7...trust-graph-v0.4.8) (2023-12-20)
|
||||||
|
|
||||||
|
|
||||||
|
### Features
|
||||||
|
|
||||||
|
* update marine sdk's, configs and sqlite connector ([#129](https://github.com/fluencelabs/trust-graph/issues/129)) ([0b66f4e](https://github.com/fluencelabs/trust-graph/commit/0b66f4e0536633879de46f69ac8391c72ece7e77))
|
||||||
|
|
||||||
|
|
||||||
|
### Dependencies
|
||||||
|
|
||||||
|
* The following workspace dependencies were updated
|
||||||
|
* dependencies
|
||||||
|
* fluence-keypair bumped from 0.10.3 to 0.10.4
|
||||||
|
|
||||||
|
## [0.4.7](https://github.com/fluencelabs/trust-graph/compare/trust-graph-v0.4.6...trust-graph-v0.4.7) (2023-07-04)
|
||||||
|
|
||||||
|
|
||||||
|
### Miscellaneous Chores
|
||||||
|
|
||||||
|
* **trust-graph:** Synchronize trust-graph, wasm and api versions
|
||||||
|
|
||||||
|
|
||||||
|
### Dependencies
|
||||||
|
|
||||||
|
* The following workspace dependencies were updated
|
||||||
|
* dependencies
|
||||||
|
* fluence-keypair bumped from 0.10.2 to 0.10.3
|
||||||
|
|
||||||
## [0.4.6](https://github.com/fluencelabs/trust-graph/compare/trust-graph-v0.4.5...trust-graph-v0.4.6) (2023-06-30)
|
## [0.4.6](https://github.com/fluencelabs/trust-graph/compare/trust-graph-v0.4.5...trust-graph-v0.4.6) (2023-06-30)
|
||||||
|
|
||||||
|
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
[package]
|
[package]
|
||||||
name = "trust-graph"
|
name = "trust-graph"
|
||||||
version = "0.4.6"
|
version = "0.4.8"
|
||||||
authors = ["Fluence Labs"]
|
authors = ["Fluence Labs"]
|
||||||
edition = "2021"
|
edition = "2021"
|
||||||
description = "trust graph"
|
description = "trust graph"
|
||||||
@ -10,7 +10,7 @@ repository = "https://github.com/fluencelabs/trust-graph"
|
|||||||
[dependencies]
|
[dependencies]
|
||||||
serde = { version = "1.0.118", features = ["derive"] }
|
serde = { version = "1.0.118", features = ["derive"] }
|
||||||
|
|
||||||
fluence-keypair = { path = "../keypair", version = "0.10.2" }
|
fluence-keypair = { path = "../keypair", version = "0.10.4" }
|
||||||
bs58 = "0.4.0"
|
bs58 = "0.4.0"
|
||||||
failure = "0.1.6"
|
failure = "0.1.6"
|
||||||
log = "0.4.11"
|
log = "0.4.11"
|
||||||
|
@ -29,7 +29,7 @@ use std::{
|
|||||||
#[repr(transparent)]
|
#[repr(transparent)]
|
||||||
pub struct PublicKeyHashable(PublicKey);
|
pub struct PublicKeyHashable(PublicKey);
|
||||||
|
|
||||||
#[allow(clippy::derive_hash_xor_eq)]
|
#[allow(clippy::derived_hash_with_manual_eq)]
|
||||||
impl Hash for PublicKeyHashable {
|
impl Hash for PublicKeyHashable {
|
||||||
fn hash<H: Hasher>(&self, state: &mut H) {
|
fn hash<H: Hasher>(&self, state: &mut H) {
|
||||||
state.write(&self.0.encode());
|
state.write(&self.0.encode());
|
||||||
|
@ -154,7 +154,7 @@ where
|
|||||||
C: Borrow<Certificate>,
|
C: Borrow<Certificate>,
|
||||||
{
|
{
|
||||||
let chain = &cert.borrow().chain;
|
let chain = &cert.borrow().chain;
|
||||||
let mut issued_by = chain.get(0).ok_or(EmptyChain)?.issued_for.clone();
|
let mut issued_by = chain.first().ok_or(EmptyChain)?.issued_for.clone();
|
||||||
|
|
||||||
// TODO: optimize to check only root weight
|
// TODO: optimize to check only root weight
|
||||||
for trust in chain {
|
for trust in chain {
|
||||||
|
Reference in New Issue
Block a user