mirror of
https://github.com/fluencelabs/trust-graph
synced 2025-07-05 01:21:41 +00:00
Compare commits
9 Commits
v3.0.0
...
v0.1.5-hl-
Author | SHA1 | Date | |
---|---|---|---|
a21733b034 | |||
a491cf15e2 | |||
6b6f717c6c | |||
7ee8cacc03 | |||
a207c52ce8 | |||
f27a7e635e | |||
dce846d1c7 | |||
6384d3d67d | |||
bf30873fcb |
@ -16,19 +16,19 @@ jobs:
|
||||
sudo bash .github/download_marine.sh
|
||||
- restore_cache:
|
||||
keys:
|
||||
- trust-graph00-{{ checksum "./Cargo.lock" }}
|
||||
- trust-graph00-{{ checksum "./Cargo.lock" }}-{{ checksum "./keypair/Cargo.lock" }}
|
||||
- run: |
|
||||
rustup target add wasm32-wasi
|
||||
cargo test --no-fail-fast --release --all-features --
|
||||
cd ./service
|
||||
./build.sh
|
||||
mkdir -p data
|
||||
mkdir data
|
||||
cargo test --no-fail-fast --release --all-features -- --test-threads=1
|
||||
- save_cache:
|
||||
paths:
|
||||
- ~/.cargo
|
||||
- ~/.rustup
|
||||
key: trust-graph00-{{ checksum "./Cargo.lock" }}
|
||||
key: trust-graph00-{{ checksum "./Cargo.lock" }-{{ checksum "./service/Cargo.lock" }}}-{{ checksum "./keypair/Cargo.lock" }}
|
||||
|
||||
|
||||
workflows:
|
||||
|
2
.github/workflows/release.yml
vendored
2
.github/workflows/release.yml
vendored
@ -54,7 +54,7 @@ jobs:
|
||||
uses: actions-rs/toolchain@v1
|
||||
with:
|
||||
profile: minimal
|
||||
toolchain: nightly-2022-01-16
|
||||
toolchain: nightly-2021-09-01
|
||||
target: wasm32-wasi
|
||||
override: true
|
||||
|
||||
|
2
.gitignore
vendored
2
.gitignore
vendored
@ -16,5 +16,3 @@ example/src/generated/**
|
||||
example/generated/**
|
||||
admin/src/generated/**
|
||||
admin/generated/**
|
||||
|
||||
target
|
||||
|
498
Cargo.lock
generated
498
Cargo.lock
generated
@ -23,7 +23,7 @@ version = "0.7.6"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "fcb51a0695d8f838b1ee009b3fbf66bda078cd64590202a864a8f3e8c4315c47"
|
||||
dependencies = [
|
||||
"getrandom 0.2.4",
|
||||
"getrandom 0.2.3",
|
||||
"once_cell",
|
||||
"version_check",
|
||||
]
|
||||
@ -39,9 +39,9 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "anyhow"
|
||||
version = "1.0.53"
|
||||
version = "1.0.52"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "94a45b455c14666b85fc40a019e8ab9eb75e3a124e05494f5397122bc9eb06e0"
|
||||
checksum = "84450d0b4a8bd1ba4144ce8ce718fbc5d071358b1e5384bace6536b3d1f2d5b3"
|
||||
|
||||
[[package]]
|
||||
name = "arrayref"
|
||||
@ -64,12 +64,6 @@ dependencies = [
|
||||
"asn1_der_derive",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "asn1_der"
|
||||
version = "0.7.5"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "e22d1f4b888c298a027c99dc9048015fac177587de20fc30232a057dfbe24a21"
|
||||
|
||||
[[package]]
|
||||
name = "asn1_der_derive"
|
||||
version = "0.1.2"
|
||||
@ -88,9 +82,9 @@ checksum = "cdb031dd78e28731d87d56cc8ffef4a8f36ca26c38fe2de700543e627f8a464a"
|
||||
|
||||
[[package]]
|
||||
name = "backtrace"
|
||||
version = "0.3.64"
|
||||
version = "0.3.63"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "5e121dee8023ce33ab248d9ce1493df03c3b38a659b240096fcbd7048ff9c31f"
|
||||
checksum = "321629d8ba6513061f26707241fa9bc89524ff1cd7a915a97ef0c62c666ce1b6"
|
||||
dependencies = [
|
||||
"addr2line",
|
||||
"cc",
|
||||
@ -101,12 +95,6 @@ dependencies = [
|
||||
"rustc-demangle",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "base64"
|
||||
version = "0.13.0"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "904dfeac50f3cdaba28fc6f57fdcddb75f49ed61346676a78c4ffe55877802fd"
|
||||
|
||||
[[package]]
|
||||
name = "bincode"
|
||||
version = "1.3.3"
|
||||
@ -158,15 +146,6 @@ dependencies = [
|
||||
"generic-array 0.14.5",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "block-buffer"
|
||||
version = "0.10.0"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "f1d36a02058e76b040de25a4464ba1c80935655595b661505c8b39b664828b95"
|
||||
dependencies = [
|
||||
"generic-array 0.14.5",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "block-padding"
|
||||
version = "0.1.5"
|
||||
@ -400,15 +379,6 @@ version = "0.2.2"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "7a81dae078cea95a014a339291cec439d2f232ebe854a9d672b796c6afafa9b7"
|
||||
|
||||
[[package]]
|
||||
name = "crypto-common"
|
||||
version = "0.1.1"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "683d6b536309245c849479fba3da410962a43ed8e51c26b729208ec0ac2798d0"
|
||||
dependencies = [
|
||||
"generic-array 0.14.5",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "crypto-mac"
|
||||
version = "0.7.0"
|
||||
@ -447,7 +417,7 @@ checksum = "0b9fdf9972b2bd6af2d913799d9ebc165ea4d2e65878e329d9c6b372c4491b61"
|
||||
dependencies = [
|
||||
"byteorder",
|
||||
"digest 0.9.0",
|
||||
"rand_core 0.5.1",
|
||||
"rand_core",
|
||||
"subtle 2.4.1",
|
||||
"zeroize",
|
||||
]
|
||||
@ -557,17 +527,6 @@ dependencies = [
|
||||
"generic-array 0.14.5",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "digest"
|
||||
version = "0.10.1"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "b697d66081d42af4fba142d56918a3cb21dc8eb63372c6b85d14f44fb9c5979b"
|
||||
dependencies = [
|
||||
"block-buffer 0.10.0",
|
||||
"crypto-common",
|
||||
"generic-array 0.14.5",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "ed25519"
|
||||
version = "1.3.0"
|
||||
@ -586,7 +545,7 @@ checksum = "c762bae6dcaf24c4c84667b8579785430908723d5c889f469d76a41d59cc7a9d"
|
||||
dependencies = [
|
||||
"curve25519-dalek",
|
||||
"ed25519",
|
||||
"rand 0.7.3",
|
||||
"rand",
|
||||
"serde",
|
||||
"serde_bytes",
|
||||
"sha2 0.9.9",
|
||||
@ -611,9 +570,9 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "erased-serde"
|
||||
version = "0.3.18"
|
||||
version = "0.3.17"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "56047058e1ab118075ca22f9ecd737bcc961aa3566a3019cb71388afa280bd8a"
|
||||
checksum = "44a5d80251b806a14cd3e4e1a582e912d5cbf6904ab19fdefbd7a56adca088e1"
|
||||
dependencies = [
|
||||
"serde",
|
||||
]
|
||||
@ -641,9 +600,9 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "eyre"
|
||||
version = "0.6.6"
|
||||
version = "0.6.5"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "bc225d8f637923fe585089fcf03e705c222131232d2c1fb622e84ecf725d0eb8"
|
||||
checksum = "221239d1d5ea86bf5d6f91c9d6bc3646ffe471b08ff9b0f91c44f115ac969d2b"
|
||||
dependencies = [
|
||||
"indenter",
|
||||
"once_cell",
|
||||
@ -691,18 +650,18 @@ checksum = "7360491ce676a36bf9bb3c56c1aa791658183a54d2744120f27285738d90465a"
|
||||
|
||||
[[package]]
|
||||
name = "fastrand"
|
||||
version = "1.7.0"
|
||||
version = "1.6.0"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "c3fcf0cee53519c866c09b5de1f6c56ff9d647101f81c1964fa632e148896cdf"
|
||||
checksum = "779d043b6a0b90cc4c0ed7ee380a6504394cee7efd7db050e3774eee387324b2"
|
||||
dependencies = [
|
||||
"instant",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "fixedbitset"
|
||||
version = "0.4.1"
|
||||
version = "0.2.0"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "279fb028e20b3c4c320317955b77c5e0c9701f05a1d309905d6fc702cdc5053e"
|
||||
checksum = "37ab347416e802de484e4d03c7316c48f1ecb56574dfd4a46a80f173ce1de04d"
|
||||
|
||||
[[package]]
|
||||
name = "fluence-app-service"
|
||||
@ -746,6 +705,73 @@ dependencies = [
|
||||
"wasmer-wasi-fl",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "fluence-fork-libp2p-core"
|
||||
version = "0.27.2"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "77ffef53cfb8b873bf75998669b0aedd5212907d29d8be8e7915c4695967c40d"
|
||||
dependencies = [
|
||||
"asn1_der",
|
||||
"bs58 0.4.0",
|
||||
"ed25519-dalek",
|
||||
"either",
|
||||
"fluence-fork-multistream-select",
|
||||
"fluence-fork-parity-multiaddr",
|
||||
"fnv",
|
||||
"futures",
|
||||
"futures-timer",
|
||||
"lazy_static",
|
||||
"libsecp256k1",
|
||||
"log",
|
||||
"multihash",
|
||||
"parking_lot 0.11.2",
|
||||
"pin-project 1.0.10",
|
||||
"prost",
|
||||
"prost-build",
|
||||
"rand",
|
||||
"ring",
|
||||
"rw-stream-sink",
|
||||
"serde",
|
||||
"sha2 0.9.9",
|
||||
"smallvec",
|
||||
"thiserror",
|
||||
"unsigned-varint 0.7.1",
|
||||
"void",
|
||||
"zeroize",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "fluence-fork-multistream-select"
|
||||
version = "0.10.3"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "34dacd25fddb6fed5c3fa6109fb29e4eea49b731a2548e09f4e54620fa4d6310"
|
||||
dependencies = [
|
||||
"bytes",
|
||||
"futures",
|
||||
"log",
|
||||
"pin-project 1.0.10",
|
||||
"smallvec",
|
||||
"unsigned-varint 0.7.1",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "fluence-fork-parity-multiaddr"
|
||||
version = "0.11.2"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "06228daafbf129ef49806f15779857012c01d49658930d086498e78f12191da7"
|
||||
dependencies = [
|
||||
"arrayref",
|
||||
"bs58 0.4.0",
|
||||
"byteorder",
|
||||
"data-encoding",
|
||||
"multihash",
|
||||
"percent-encoding",
|
||||
"serde",
|
||||
"static_assertions",
|
||||
"unsigned-varint 0.7.1",
|
||||
"url",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "fluence-it-types"
|
||||
version = "0.3.1"
|
||||
@ -761,18 +787,18 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "fluence-keypair"
|
||||
version = "0.6.0"
|
||||
version = "0.5.1"
|
||||
dependencies = [
|
||||
"asn1_der 0.6.3",
|
||||
"asn1_der",
|
||||
"bs58 0.3.1",
|
||||
"ed25519",
|
||||
"ed25519-dalek",
|
||||
"eyre",
|
||||
"fluence-fork-libp2p-core",
|
||||
"lazy_static",
|
||||
"libp2p-core",
|
||||
"libsecp256k1 0.3.5",
|
||||
"libsecp256k1",
|
||||
"quickcheck",
|
||||
"rand 0.7.3",
|
||||
"rand",
|
||||
"ring",
|
||||
"serde",
|
||||
"serde_bytes",
|
||||
@ -938,9 +964,9 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "getrandom"
|
||||
version = "0.2.4"
|
||||
version = "0.2.3"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "418d37c8b1d42553c93648be529cb70f920d3baf8ef469b74b9638df426e0b4c"
|
||||
checksum = "7fcd999463524c52659517fe2cea98493cfe485d10565e7b0fb07dbba7ad2753"
|
||||
dependencies = [
|
||||
"cfg-if 1.0.0",
|
||||
"libc",
|
||||
@ -1026,16 +1052,6 @@ dependencies = [
|
||||
"digest 0.8.1",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "hmac"
|
||||
version = "0.8.1"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "126888268dcc288495a26bf004b38c5fdbb31682f992c84ceb046a1f0fe38840"
|
||||
dependencies = [
|
||||
"crypto-mac 0.8.0",
|
||||
"digest 0.9.0",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "hmac-drbg"
|
||||
version = "0.2.0"
|
||||
@ -1044,18 +1060,7 @@ checksum = "c6e570451493f10f6581b48cdd530413b63ea9e780f544bfd3bdcaa0d89d1a7b"
|
||||
dependencies = [
|
||||
"digest 0.8.1",
|
||||
"generic-array 0.12.4",
|
||||
"hmac 0.7.1",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "hmac-drbg"
|
||||
version = "0.3.0"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "17ea0a1394df5b6574da6e0c1ade9e78868c9fb0a4e5ef4428e32da4676b85b1"
|
||||
dependencies = [
|
||||
"digest 0.9.0",
|
||||
"generic-array 0.14.5",
|
||||
"hmac 0.8.1",
|
||||
"hmac",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
@ -1109,9 +1114,9 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "inventory"
|
||||
version = "0.2.2"
|
||||
version = "0.2.1"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "ce6b5d8c669bfbad811d95ddd7a1c6cf9cfdbf2777e59928b6f3fa8ff54f72a0"
|
||||
checksum = "aa2f6fdbc5fd6457ae78e0313ba2eb5cb509655bbcfe8c577096cdbae8ff621c"
|
||||
dependencies = [
|
||||
"ctor",
|
||||
"ghost",
|
||||
@ -1161,9 +1166,9 @@ checksum = "1aab8fc367588b89dcee83ab0fd66b72b50b72fa1904d7095045ace2b0c81c35"
|
||||
|
||||
[[package]]
|
||||
name = "js-sys"
|
||||
version = "0.3.56"
|
||||
version = "0.3.55"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "a38fc24e30fd564ce974c02bf1d337caddff65be6cc4735a1f7eab22a7440f04"
|
||||
checksum = "7cc9ffccd38c451a86bf13657df244e9c3f37493cce8e5e21e940963777acc84"
|
||||
dependencies = [
|
||||
"wasm-bindgen",
|
||||
]
|
||||
@ -1195,44 +1200,9 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "libc"
|
||||
version = "0.2.116"
|
||||
version = "0.2.112"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "565dbd88872dbe4cc8a46e527f26483c1d1f7afa6b884a3bd6cd893d4f98da74"
|
||||
|
||||
[[package]]
|
||||
name = "libp2p-core"
|
||||
version = "0.31.0"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "a24250cce58fb6ccb32e26647c1c25b48b6f7bd2d6fb3d6dba72001a6694b385"
|
||||
dependencies = [
|
||||
"asn1_der 0.7.5",
|
||||
"bs58 0.4.0",
|
||||
"ed25519-dalek",
|
||||
"either",
|
||||
"fnv",
|
||||
"futures",
|
||||
"futures-timer",
|
||||
"instant",
|
||||
"lazy_static",
|
||||
"libsecp256k1 0.7.0",
|
||||
"log",
|
||||
"multiaddr",
|
||||
"multihash",
|
||||
"multistream-select",
|
||||
"parking_lot 0.11.2",
|
||||
"pin-project 1.0.10",
|
||||
"prost",
|
||||
"prost-build",
|
||||
"rand 0.8.4",
|
||||
"ring",
|
||||
"rw-stream-sink",
|
||||
"sha2 0.10.1",
|
||||
"smallvec",
|
||||
"thiserror",
|
||||
"unsigned-varint",
|
||||
"void",
|
||||
"zeroize",
|
||||
]
|
||||
checksum = "1b03d17f364a3a042d5e5d46b053bbbf82c92c9430c592dd4c064dc6ee997125"
|
||||
|
||||
[[package]]
|
||||
name = "libsecp256k1"
|
||||
@ -1243,61 +1213,13 @@ dependencies = [
|
||||
"arrayref",
|
||||
"crunchy",
|
||||
"digest 0.8.1",
|
||||
"hmac-drbg 0.2.0",
|
||||
"rand 0.7.3",
|
||||
"hmac-drbg",
|
||||
"rand",
|
||||
"sha2 0.8.2",
|
||||
"subtle 2.4.1",
|
||||
"typenum",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "libsecp256k1"
|
||||
version = "0.7.0"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "b0452aac8bab02242429380e9b2f94ea20cea2b37e2c1777a1358799bbe97f37"
|
||||
dependencies = [
|
||||
"arrayref",
|
||||
"base64",
|
||||
"digest 0.9.0",
|
||||
"hmac-drbg 0.3.0",
|
||||
"libsecp256k1-core",
|
||||
"libsecp256k1-gen-ecmult",
|
||||
"libsecp256k1-gen-genmult",
|
||||
"rand 0.8.4",
|
||||
"serde",
|
||||
"sha2 0.9.9",
|
||||
"typenum",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "libsecp256k1-core"
|
||||
version = "0.3.0"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "5be9b9bb642d8522a44d533eab56c16c738301965504753b03ad1de3425d5451"
|
||||
dependencies = [
|
||||
"crunchy",
|
||||
"digest 0.9.0",
|
||||
"subtle 2.4.1",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "libsecp256k1-gen-ecmult"
|
||||
version = "0.3.0"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "3038c808c55c87e8a172643a7d87187fc6c4174468159cb3090659d55bcb4809"
|
||||
dependencies = [
|
||||
"libsecp256k1-core",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "libsecp256k1-gen-genmult"
|
||||
version = "0.3.0"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "3db8d6ba2cec9eacc40e6e8ccc98931840301f1006e95647ceb2dd5c3aa06f7c"
|
||||
dependencies = [
|
||||
"libsecp256k1-core",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "libsqlite3-sys"
|
||||
version = "0.23.2"
|
||||
@ -1319,9 +1241,9 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "lock_api"
|
||||
version = "0.4.6"
|
||||
version = "0.4.5"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "88943dd7ef4a2e5a4bfa2753aaab3013e34ce2533d1996fb18ef591e315e2b3b"
|
||||
checksum = "712a4d093c9976e24e7dbca41db895dabcbac38eb5f4045393d17a95bdfb1109"
|
||||
dependencies = [
|
||||
"scopeguard",
|
||||
]
|
||||
@ -1619,35 +1541,17 @@ dependencies = [
|
||||
"autocfg",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "multiaddr"
|
||||
version = "0.13.0"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "48ee4ea82141951ac6379f964f71b20876d43712bea8faf6dd1a375e08a46499"
|
||||
dependencies = [
|
||||
"arrayref",
|
||||
"bs58 0.4.0",
|
||||
"byteorder",
|
||||
"data-encoding",
|
||||
"multihash",
|
||||
"percent-encoding",
|
||||
"serde",
|
||||
"static_assertions",
|
||||
"unsigned-varint",
|
||||
"url",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "multihash"
|
||||
version = "0.14.0"
|
||||
version = "0.13.2"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "752a61cd890ff691b4411423d23816d5866dd5621e4d1c5687a53b94b5a979d8"
|
||||
checksum = "4dac63698b887d2d929306ea48b63760431ff8a24fac40ddb22f9c7f49fb7cab"
|
||||
dependencies = [
|
||||
"digest 0.9.0",
|
||||
"generic-array 0.14.5",
|
||||
"multihash-derive",
|
||||
"sha2 0.9.9",
|
||||
"unsigned-varint",
|
||||
"unsigned-varint 0.5.1",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
@ -1673,20 +1577,6 @@ dependencies = [
|
||||
"serde",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "multistream-select"
|
||||
version = "0.11.0"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "363a84be6453a70e63513660f4894ef815daf88e3356bffcda9ca27d810ce83b"
|
||||
dependencies = [
|
||||
"bytes",
|
||||
"futures",
|
||||
"log",
|
||||
"pin-project 1.0.10",
|
||||
"smallvec",
|
||||
"unsigned-varint",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "nix"
|
||||
version = "0.15.0"
|
||||
@ -1806,7 +1696,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "7d17b78036a60663b797adeaee46f5c9dfebb86948d1255007a1d6be0271ff99"
|
||||
dependencies = [
|
||||
"instant",
|
||||
"lock_api 0.4.6",
|
||||
"lock_api 0.4.5",
|
||||
"parking_lot_core 0.8.5",
|
||||
]
|
||||
|
||||
@ -1861,9 +1751,9 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "petgraph"
|
||||
version = "0.6.0"
|
||||
version = "0.5.1"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "4a13a2fa9d0b63e5f22328828741e523766fff0ee9e779316902290dff3f824f"
|
||||
checksum = "467d164a6de56270bd7c4d070df81d07beace25012d5103ced4e9ff08d6afdb7"
|
||||
dependencies = [
|
||||
"fixedbitset",
|
||||
"indexmap",
|
||||
@ -1989,9 +1879,9 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "prost"
|
||||
version = "0.9.0"
|
||||
version = "0.7.0"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "444879275cb4fd84958b1a1d5420d15e6fcf7c235fe47f053c9c2a80aceb6001"
|
||||
checksum = "9e6984d2f1a23009bd270b8bb56d0926810a3d483f59c987d77969e9d8e840b2"
|
||||
dependencies = [
|
||||
"bytes",
|
||||
"prost-derive",
|
||||
@ -1999,32 +1889,30 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "prost-build"
|
||||
version = "0.9.0"
|
||||
version = "0.7.0"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "62941722fb675d463659e49c4f3fe1fe792ff24fe5bbaa9c08cd3b98a1c354f5"
|
||||
checksum = "32d3ebd75ac2679c2af3a92246639f9fcc8a442ee420719cc4fe195b98dd5fa3"
|
||||
dependencies = [
|
||||
"bytes",
|
||||
"heck",
|
||||
"itertools 0.10.3",
|
||||
"lazy_static",
|
||||
"itertools 0.9.0",
|
||||
"log",
|
||||
"multimap",
|
||||
"petgraph",
|
||||
"prost",
|
||||
"prost-types",
|
||||
"regex",
|
||||
"tempfile",
|
||||
"which",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "prost-derive"
|
||||
version = "0.9.0"
|
||||
version = "0.7.0"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "f9cc1a3263e07e0bf68e96268f37665207b49560d98739662cdfaae215c720fe"
|
||||
checksum = "169a15f3008ecb5160cba7d37bcd690a7601b6d30cfb87a117d45e59d52af5d4"
|
||||
dependencies = [
|
||||
"anyhow",
|
||||
"itertools 0.10.3",
|
||||
"itertools 0.9.0",
|
||||
"proc-macro2",
|
||||
"quote",
|
||||
"syn",
|
||||
@ -2032,9 +1920,9 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "prost-types"
|
||||
version = "0.9.0"
|
||||
version = "0.7.0"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "534b7a0e836e3c482d2693070f982e39e7611da9695d4d1f5a4b186b51faef0a"
|
||||
checksum = "b518d7cdd93dab1d1122cf07fa9a60771836c668dde9d9e2a139f957f0d9f1bb"
|
||||
dependencies = [
|
||||
"bytes",
|
||||
"prost",
|
||||
@ -2059,15 +1947,15 @@ checksum = "a44883e74aa97ad63db83c4bf8ca490f02b2fc02f92575e720c8551e843c945f"
|
||||
dependencies = [
|
||||
"env_logger",
|
||||
"log",
|
||||
"rand 0.7.3",
|
||||
"rand_core 0.5.1",
|
||||
"rand",
|
||||
"rand_core",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "quote"
|
||||
version = "1.0.15"
|
||||
version = "1.0.14"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "864d3e96a899863136fc6e99f3d7cae289dafe43bf2c5ac19b70df7210c0a145"
|
||||
checksum = "47aa80447ce4daf1717500037052af176af5d38cc3e571d9ec1c7353fc10c87d"
|
||||
dependencies = [
|
||||
"proc-macro2",
|
||||
]
|
||||
@ -2080,21 +1968,9 @@ checksum = "6a6b1679d49b24bbfe0c803429aa1874472f50d9b363131f0e89fc356b544d03"
|
||||
dependencies = [
|
||||
"getrandom 0.1.16",
|
||||
"libc",
|
||||
"rand_chacha 0.2.2",
|
||||
"rand_core 0.5.1",
|
||||
"rand_hc 0.2.0",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "rand"
|
||||
version = "0.8.4"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "2e7573632e6454cf6b99d7aac4ccca54be06da05aca2ef7423d22d27d4d4bcd8"
|
||||
dependencies = [
|
||||
"libc",
|
||||
"rand_chacha 0.3.1",
|
||||
"rand_core 0.6.3",
|
||||
"rand_hc 0.3.1",
|
||||
"rand_chacha",
|
||||
"rand_core",
|
||||
"rand_hc",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
@ -2104,17 +1980,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "f4c8ed856279c9737206bf725bf36935d8666ead7aa69b52be55af369d193402"
|
||||
dependencies = [
|
||||
"ppv-lite86",
|
||||
"rand_core 0.5.1",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "rand_chacha"
|
||||
version = "0.3.1"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "e6c10a63a0fa32252be49d21e7709d4d4baf8d231c2dbce1eaa8141b9b127d88"
|
||||
dependencies = [
|
||||
"ppv-lite86",
|
||||
"rand_core 0.6.3",
|
||||
"rand_core",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
@ -2126,31 +1992,13 @@ dependencies = [
|
||||
"getrandom 0.1.16",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "rand_core"
|
||||
version = "0.6.3"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "d34f1408f55294453790c48b2f1ebbb1c5b4b7563eb1f418bcfcfdbb06ebb4e7"
|
||||
dependencies = [
|
||||
"getrandom 0.2.4",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "rand_hc"
|
||||
version = "0.2.0"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "ca3129af7b92a17112d59ad498c6f81eaf463253766b90396d39ea7a39d6613c"
|
||||
dependencies = [
|
||||
"rand_core 0.5.1",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "rand_hc"
|
||||
version = "0.3.1"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "d51e9f596de227fda2ea6c84607f5558e196eeaf43c986b724ba4fb8fdf497e7"
|
||||
dependencies = [
|
||||
"rand_core 0.6.3",
|
||||
"rand_core",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
@ -2277,9 +2125,9 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "rmp-serde"
|
||||
version = "0.15.5"
|
||||
version = "0.15.1"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "723ecff9ad04f4ad92fe1c8ca6c20d2196d9286e9c60727c4cb5511629260e9d"
|
||||
checksum = "3f74489002493a9984ee753ebd049552a1c82f0740e347ee9fc57c907fb19f83"
|
||||
dependencies = [
|
||||
"byteorder",
|
||||
"rmp",
|
||||
@ -2316,12 +2164,6 @@ dependencies = [
|
||||
"semver 0.9.0",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "rustversion"
|
||||
version = "1.0.6"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "f2cc38e8fa666e2de3c4aba7edeb5ffc5246c1c2ed0e3d17e560aeeba736b23f"
|
||||
|
||||
[[package]]
|
||||
name = "rw-stream-sink"
|
||||
version = "0.2.1"
|
||||
@ -2386,9 +2228,9 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "serde"
|
||||
version = "1.0.136"
|
||||
version = "1.0.118"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "ce31e24b01e1e524df96f1c2fdd054405f8d7376249a5110886fb4b658484789"
|
||||
checksum = "06c64263859d87aa2eb554587e2d23183398d617427327cf2b3d0ed8c69e4800"
|
||||
dependencies = [
|
||||
"serde_derive",
|
||||
]
|
||||
@ -2424,9 +2266,9 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "serde_derive"
|
||||
version = "1.0.136"
|
||||
version = "1.0.118"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "08597e7152fcd306f41838ed3e37be9eaeed2b61c42e2117266a554fab4662f9"
|
||||
checksum = "c84d3526699cd55261af4b941e4e725444df67aa4f9e6a3564f18030d12672df"
|
||||
dependencies = [
|
||||
"proc-macro2",
|
||||
"quote",
|
||||
@ -2435,9 +2277,9 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "serde_json"
|
||||
version = "1.0.78"
|
||||
version = "1.0.74"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "d23c1ba4cf0efd44be32017709280b32d1cea5c3f1275c3b6d9e8bc54f758085"
|
||||
checksum = "ee2bb9cd061c5865d345bb02ca49fcef1391741b672b54a0bf7b679badec3142"
|
||||
dependencies = [
|
||||
"itoa",
|
||||
"ryu",
|
||||
@ -2446,11 +2288,10 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "serde_with"
|
||||
version = "1.11.0"
|
||||
version = "1.6.4"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "ad6056b4cb69b6e43e3a0f055def223380baecc99da683884f205bf347f7c4b3"
|
||||
checksum = "b44be9227e214a0420707c9ca74c2d4991d9955bae9415a8f93f05cebf561be5"
|
||||
dependencies = [
|
||||
"rustversion",
|
||||
"serde",
|
||||
"serde_with_macros",
|
||||
]
|
||||
@ -2492,17 +2333,6 @@ dependencies = [
|
||||
"opaque-debug 0.3.0",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "sha2"
|
||||
version = "0.10.1"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "99c3bd8169c58782adad9290a9af5939994036b76187f7b4f0e6de91dbbfc0ec"
|
||||
dependencies = [
|
||||
"cfg-if 1.0.0",
|
||||
"cpufeatures",
|
||||
"digest 0.10.1",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "signature"
|
||||
version = "1.5.0"
|
||||
@ -2517,9 +2347,9 @@ checksum = "9def91fd1e018fe007022791f865d0ccc9b3a0d5001e01aabb8b40e46000afb5"
|
||||
|
||||
[[package]]
|
||||
name = "smallvec"
|
||||
version = "1.8.0"
|
||||
version = "1.7.0"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "f2dd574626839106c320a323308629dcb1acfc96e32a8cba364ddc61ac23ee83"
|
||||
checksum = "1ecab6c735a6bb4139c0caafd0cc3635748bbb3acf4550e8138122099251f309"
|
||||
|
||||
[[package]]
|
||||
name = "spin"
|
||||
@ -2553,9 +2383,9 @@ checksum = "6bdef32e8150c2a081110b42772ffe7d7c9032b606bc226c8260fd97e0976601"
|
||||
|
||||
[[package]]
|
||||
name = "syn"
|
||||
version = "1.0.86"
|
||||
version = "1.0.85"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "8a65b3f4ffa0092e9887669db0eae07941f023991ab58ea44da8fe8e2d511c6b"
|
||||
checksum = "a684ac3dcd8913827e18cd09a68384ee66c1de24157e3c556c9ab16d85695fb7"
|
||||
dependencies = [
|
||||
"proc-macro2",
|
||||
"quote",
|
||||
@ -2656,11 +2486,11 @@ dependencies = [
|
||||
"bs58 0.3.1",
|
||||
"derivative",
|
||||
"failure",
|
||||
"fluence-fork-libp2p-core",
|
||||
"fluence-keypair",
|
||||
"libp2p-core",
|
||||
"log",
|
||||
"nonempty",
|
||||
"rand 0.7.3",
|
||||
"rand",
|
||||
"ref-cast",
|
||||
"serde",
|
||||
"serde_json",
|
||||
@ -2678,8 +2508,8 @@ dependencies = [
|
||||
"bincode",
|
||||
"boolinator",
|
||||
"bs58 0.3.1",
|
||||
"fluence-fork-libp2p-core",
|
||||
"fluence-keypair",
|
||||
"libp2p-core",
|
||||
"log",
|
||||
"marine-rs-sdk",
|
||||
"marine-rs-sdk-test",
|
||||
@ -2757,6 +2587,12 @@ version = "0.2.2"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "8ccb82d61f80a663efe1f787a51b16b5a51e3314d6ac365b08639f52387b33f3"
|
||||
|
||||
[[package]]
|
||||
name = "unsigned-varint"
|
||||
version = "0.5.1"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "f7fdeedbf205afadfe39ae559b75c3240f24e257d0ca27e85f85cb82aa19ac35"
|
||||
|
||||
[[package]]
|
||||
name = "unsigned-varint"
|
||||
version = "0.7.1"
|
||||
@ -2787,7 +2623,7 @@ version = "0.8.2"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "bc5cf98d8186244414c848017f0e2676b3fcb46807f6668a97dfe67359a3c4b7"
|
||||
dependencies = [
|
||||
"getrandom 0.2.4",
|
||||
"getrandom 0.2.3",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
@ -2858,9 +2694,9 @@ checksum = "1a143597ca7c7793eff794def352d41792a93c481eb1042423ff7ff72ba2c31f"
|
||||
|
||||
[[package]]
|
||||
name = "wasm-bindgen"
|
||||
version = "0.2.79"
|
||||
version = "0.2.78"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "25f1af7423d8588a3d840681122e72e6a24ddbcb3f0ec385cac0d12d24256c06"
|
||||
checksum = "632f73e236b219150ea279196e54e610f5dbafa5d61786303d4da54f84e47fce"
|
||||
dependencies = [
|
||||
"cfg-if 1.0.0",
|
||||
"wasm-bindgen-macro",
|
||||
@ -2868,9 +2704,9 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "wasm-bindgen-backend"
|
||||
version = "0.2.79"
|
||||
version = "0.2.78"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "8b21c0df030f5a177f3cba22e9bc4322695ec43e7257d865302900290bcdedca"
|
||||
checksum = "a317bf8f9fba2476b4b2c85ef4c4af8ff39c3c7f0cdfeed4f82c34a880aa837b"
|
||||
dependencies = [
|
||||
"bumpalo",
|
||||
"lazy_static",
|
||||
@ -2883,9 +2719,9 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "wasm-bindgen-macro"
|
||||
version = "0.2.79"
|
||||
version = "0.2.78"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "2f4203d69e40a52ee523b2529a773d5ffc1dc0071801c87b3d270b471b80ed01"
|
||||
checksum = "d56146e7c495528bf6587663bea13a8eb588d39b36b679d83972e1a2dbbdacf9"
|
||||
dependencies = [
|
||||
"quote",
|
||||
"wasm-bindgen-macro-support",
|
||||
@ -2893,9 +2729,9 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "wasm-bindgen-macro-support"
|
||||
version = "0.2.79"
|
||||
version = "0.2.78"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "bfa8a30d46208db204854cadbb5d4baf5fcf8071ba5bf48190c3e59937962ebc"
|
||||
checksum = "7803e0eea25835f8abdc585cd3021b3deb11543c6fe226dcd30b228857c5c5ab"
|
||||
dependencies = [
|
||||
"proc-macro2",
|
||||
"quote",
|
||||
@ -2906,9 +2742,9 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "wasm-bindgen-shared"
|
||||
version = "0.2.79"
|
||||
version = "0.2.78"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "3d958d035c4438e28c70e4321a2911302f10135ce78a9c7834c0cab4123d06a2"
|
||||
checksum = "0237232789cf037d5480773fe568aac745bfe2afbc11a863e97901780a6b47cc"
|
||||
|
||||
[[package]]
|
||||
name = "wasmer-clif-backend-fl"
|
||||
@ -3109,9 +2945,9 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "web-sys"
|
||||
version = "0.3.56"
|
||||
version = "0.3.55"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "c060b319f29dd25724f09a2ba1418f142f539b2be99fbf4d2d5a8f7330afb8eb"
|
||||
checksum = "38eb105f1c59d9eaa6b5cdc92b859d85b926e82cb2e0945cd0c9259faa6fe9fb"
|
||||
dependencies = [
|
||||
"js-sys",
|
||||
"wasm-bindgen",
|
||||
@ -3119,9 +2955,9 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "which"
|
||||
version = "4.2.4"
|
||||
version = "4.2.2"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "2a5a7e487e921cf220206864a94a89b6c6905bfc19f1057fa26a4cb360e5c1d2"
|
||||
checksum = "ea187a8ef279bc014ec368c27a920da2024d2a711109bfbe3440585d5cf27ad9"
|
||||
dependencies = [
|
||||
"either",
|
||||
"lazy_static",
|
||||
@ -3152,18 +2988,18 @@ checksum = "712e227841d057c1ee1cd2fb22fa7e5a5461ae8e48fa2ca79ec42cfc1931183f"
|
||||
|
||||
[[package]]
|
||||
name = "zeroize"
|
||||
version = "1.5.1"
|
||||
version = "1.4.3"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "4062c749be08d90be727e9c5895371c3a0e49b90ba2b9592dc7afda95cc2b719"
|
||||
checksum = "d68d9dcec5f9b43a30d38c49f91dfedfaac384cb8f085faca366c26207dd1619"
|
||||
dependencies = [
|
||||
"zeroize_derive",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "zeroize_derive"
|
||||
version = "1.3.1"
|
||||
version = "1.2.2"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "81e8f13fef10b63c06356d65d416b070798ddabcadc10d3ece0c5be9b3c7eddb"
|
||||
checksum = "65f1a51723ec88c66d5d1fe80c841f17f63587d6691901d66be9bec6c3b51f73"
|
||||
dependencies = [
|
||||
"proc-macro2",
|
||||
"quote",
|
||||
|
@ -8,10 +8,10 @@ license = "Apache-2.0"
|
||||
repository = "https://github.com/fluencelabs/trust-graph"
|
||||
|
||||
[dependencies]
|
||||
libp2p-core = { version = "0.31", default-features = false, features = [ "secp256k1" ] }
|
||||
serde = { version = "1.0.118", features = ["derive"] }
|
||||
libp2p-core = { package = "fluence-fork-libp2p-core", version = "0.27.2", features = ["secp256k1"] }
|
||||
serde = { version = "=1.0.118", features = ["derive"] }
|
||||
|
||||
fluence-keypair = { path = "./keypair", version = "0.6.0" }
|
||||
fluence-keypair = { path = "./keypair", version = "0.5.0" }
|
||||
serde_json = "1.0.58"
|
||||
bs58 = "0.3.1"
|
||||
failure = "0.1.6"
|
||||
|
30
README.md
30
README.md
@ -62,31 +62,5 @@ func my_function(peer_id: string) -> u32:
|
||||
import { Fluence, KeyPair } from "@fluencelabs/fluence";
|
||||
import { krasnodar, Node } from "@fluencelabs/fluence-network-environment";
|
||||
```
|
||||
3. Create client (specify keypair if you are node owner
|
||||
[link](https://github.com/fluencelabs/node-distro/blob/main/fluence/Config.default.toml#L9))
|
||||
|
||||
```typescript
|
||||
await Fluence.start({ connectTo: relay /*, KeyPair: builtins_keypair*/});
|
||||
```
|
||||
4. Add root and issue root trust.
|
||||
```typescript
|
||||
let peer_id = Fluence.getStatus().peerId;
|
||||
let relay = Fluence.getStatus().relayPeerId;
|
||||
assert(peer_id !== null);
|
||||
assert(relay !== null);
|
||||
let max_chain_len = 2;
|
||||
let far_future = tg.timestamp_sec() + 9999999999;
|
||||
let error = await tg.add_root_trust(relay, peer_id, max_chain_len, far_future);
|
||||
if (error !== null) {
|
||||
console.log(error);
|
||||
}
|
||||
```
|
||||
5. For now, trusts/revocations can only be signed with the client's private key.
|
||||
Keypair specification will be available soon.
|
||||
```typescript
|
||||
// issue signed trust
|
||||
let error = await tg.issue_trust(relay, peer_id, issued_for_peer_id, expires_at_sec);
|
||||
if (error !== null) {
|
||||
console.log(error);
|
||||
}
|
||||
```
|
||||
3. Add root and issue root trust.
|
||||
4. For now, trusts/revocations can only be signed by client's private key.
|
@ -62,21 +62,20 @@ async function main(environment: Node[]) {
|
||||
let cur_time = await timestamp_sec(node);
|
||||
let expires_at = cur_time + 60 * 60 * 24 * 365;
|
||||
let certificates = [];
|
||||
let common_chain = [] as any;
|
||||
// self-signed root trust
|
||||
let root_trust = await issue_trust_helper(node, root_kp, root_kp.Libp2pPeerId.toB58String(), root_kp.Libp2pPeerId.toB58String(), expires_at, cur_time);
|
||||
common_chain.push(await issue_trust_helper(node, root_kp, root_kp.Libp2pPeerId.toB58String(), root_kp.Libp2pPeerId.toB58String(), expires_at, cur_time));
|
||||
// from root to issuer
|
||||
let issuer_trust = await issue_trust_helper(node, root_kp, root_kp.Libp2pPeerId.toB58String(), issuer_kp.Libp2pPeerId.toB58String(), expires_at, cur_time);
|
||||
common_chain.push(await issue_trust_helper(node, root_kp, root_kp.Libp2pPeerId.toB58String(), issuer_kp.Libp2pPeerId.toB58String(), expires_at, cur_time));
|
||||
// from root to example
|
||||
let example_trust = await issue_trust_helper(node, root_kp, root_kp.Libp2pPeerId.toB58String(), example_kp.Libp2pPeerId.toB58String(), expires_at, cur_time);
|
||||
|
||||
// cert for example key
|
||||
certificates.push({chain: [root_trust, example_trust]});
|
||||
let trust = await issue_trust_helper(node, root_kp, root_kp.Libp2pPeerId.toB58String(), example_kp.Libp2pPeerId.toB58String(), expires_at, cur_time);
|
||||
let cert = {chain: [...common_chain, trust]};
|
||||
certificates.push(cert);
|
||||
|
||||
for (let i = 0; i < krasnodar.length; i++) {
|
||||
// from issuer to node
|
||||
let node_trust = await issue_trust_helper(node, issuer_kp, issuer_kp.Libp2pPeerId.toB58String(), krasnodar[i].peerId, expires_at, cur_time);
|
||||
// cert for every krasnodar node
|
||||
let cert = {chain: [root_trust, issuer_trust, node_trust]};
|
||||
let trust = await issue_trust_helper(node, issuer_kp, issuer_kp.Libp2pPeerId.toB58String(), krasnodar[i].peerId, expires_at, cur_time);
|
||||
let cert = {chain: [...common_chain, trust]};
|
||||
certificates.push(cert);
|
||||
}
|
||||
|
||||
|
@ -1,39 +0,0 @@
|
||||
import "misc.aqua"
|
||||
import get_host_certs_from from "trust-graph-api.aqua"
|
||||
|
||||
alias Error: string
|
||||
|
||||
-- TrustGraph builtin distributed with predefined certificates which used to identify Fluence Labs peers.
|
||||
-- Each certificate contains 3 trusts: self-signed fluence root trust, trust for label trust and trust to target peer.
|
||||
--
|
||||
-- Usage:
|
||||
-- on target_node:
|
||||
-- result, error <- isFluencePeer()
|
||||
--
|
||||
-- Returns:
|
||||
-- `true, nil` if `target_node` is identified as official Fluence Labs peer
|
||||
-- `false, nil` otherwise
|
||||
--
|
||||
-- Errors:
|
||||
-- if get_host_certs_from failed, `nil, error_msg` is returned
|
||||
func isFluencePeer() -> ?bool, ?Error:
|
||||
fluence_root_peer_id = "12D3KooWNbZKaPWRZ8wgjGvrxdJFz9Fq5uVwkR6ERV1f74HhPdyB"
|
||||
label_peer_id = "12D3KooWM45u7AQxsb4MuQJNYT3NWHHMLU7JTbBV66RTfF3KSzdR"
|
||||
|
||||
result: ?bool
|
||||
error: *Error
|
||||
-- get all certs issued by `label_peer_id` to current host
|
||||
certs_result <- get_host_certs_from(label_peer_id)
|
||||
|
||||
if certs_result.success:
|
||||
for cert <- certs_result.certificates:
|
||||
len <- TrustOp.array_length(cert.chain)
|
||||
if len == 3:
|
||||
if cert.chain!0.issued_for == fluence_root_peer_id:
|
||||
if cert.chain!1.issued_for == label_peer_id:
|
||||
result <<- true
|
||||
if result == nil:
|
||||
result <<- false
|
||||
else:
|
||||
error <<- certs_result.error
|
||||
<- result, error
|
@ -1,15 +1,8 @@
|
||||
import "trust-graph.aqua"
|
||||
|
||||
alias Error: string
|
||||
|
||||
-- helpers for isFluencePeer
|
||||
service TrustOp("op"):
|
||||
array_length(a: []Trust) -> u32
|
||||
|
||||
service BoolOp("op"):
|
||||
array_length(a: []bool) -> u32
|
||||
|
||||
-- check if error is not nil and append to error_stream
|
||||
func append_error(error_stream: *Error, error: ?Error):
|
||||
if error != nil:
|
||||
error_stream <<- error!
|
||||
|
@ -1,11 +1,11 @@
|
||||
import Sig, Peer, PeerId from "@fluencelabs/aqua-lib/builtin.aqua"
|
||||
import "misc.aqua"
|
||||
import "trust-graph.aqua"
|
||||
import "misc.aqua"
|
||||
import Sig, Peer from "@fluencelabs/aqua-lib/builtin.aqua"
|
||||
|
||||
alias PeerId: string
|
||||
alias Error: string
|
||||
|
||||
-- Call context: any node with registered `trust-graph` service
|
||||
-- Set `peer_id` as a root
|
||||
-- Set peer_id as a root to TG instance on current node
|
||||
-- Self-signed trust should be added in next call for correct behaviour
|
||||
-- `max_chain_len` specifies maximum chain length after root trust,
|
||||
-- if `max_chain_len` is zero there is no trusts except self-signed root trust in certificates for this root
|
||||
@ -13,27 +13,23 @@ func set_root(peer_id: PeerId, max_chain_len: u32) -> SetRootResult:
|
||||
result <- TrustGraph.set_root(peer_id, max_chain_len)
|
||||
<- result
|
||||
|
||||
-- Call context: %init_peer_id%
|
||||
-- Create on relay and sign trust on client
|
||||
-- If `issuer` is not %init_peer_id%, Sig service with `issuer` peer id as service id should be defined
|
||||
-- Errors:
|
||||
-- If TrustGraph.get_trust_bytes or TrustGraph.issue_trust fails, (nil, error) is returned.
|
||||
func issue_trust(issuer: PeerId, issued_for: PeerId, expires_at_sec: u64) -> ?Trust, ?Error:
|
||||
-- after marine-web release this will be done on %init_peer_id%
|
||||
-- Create and sign trust with private key from 'sig_id' service
|
||||
-- If `sig_id` is nil, default Sig service will be used with %init_peer_id% private key
|
||||
func issue_trust(issued_for: PeerId, expires_at_sec: u64, sig_id: ?string) -> ?Trust, ?Error:
|
||||
on HOST_PEER_ID:
|
||||
issued_at_sec <- Peer.timestamp_sec()
|
||||
bytes <- TrustGraph.get_trust_bytes(issued_for, expires_at_sec, issued_at_sec)
|
||||
|
||||
result: ?Trust
|
||||
error: *Error
|
||||
error: ?string
|
||||
if bytes.success:
|
||||
-- for %init_peer_id% Sig service available by default and registered as "sig"
|
||||
-- for other peer ids custom Sig service should be implemented and registered with this peer id as service id
|
||||
if issuer != %init_peer_id%:
|
||||
Sig issuer
|
||||
sig_service: ?string
|
||||
if sig_id != nil:
|
||||
sig_service <<- sig_id!
|
||||
else:
|
||||
Sig "sig"
|
||||
sig_service <<- "sig"
|
||||
|
||||
Sig sig_service!
|
||||
signature <- Sig.sign(bytes.result)
|
||||
|
||||
on HOST_PEER_ID:
|
||||
@ -46,100 +42,94 @@ func issue_trust(issuer: PeerId, issued_for: PeerId, expires_at_sec: u64) -> ?Tr
|
||||
error <<- bytes.error
|
||||
<- result, error
|
||||
|
||||
-- Call context: any node with registered `trust-graph` service
|
||||
-- Add trust to TG
|
||||
-- Errors:
|
||||
-- If TrustGraph.add_trust fails, error is returned.
|
||||
-- Add trust to TG instance on current node
|
||||
func import_trust(trust: Trust, issuer: PeerId) -> ?Error:
|
||||
error: *Error
|
||||
error: ?string
|
||||
timestamp_sec <- Peer.timestamp_sec()
|
||||
add_result <- TrustGraph.add_trust(trust, issuer, timestamp_sec)
|
||||
if add_result.success != true:
|
||||
error <<- add_result.error
|
||||
<- error
|
||||
|
||||
-- Call context: %init_peer_id%
|
||||
-- Issue trust and add to TG instance on `node`
|
||||
-- If `issuer` is not %init_peer_id%, Sig service with `issuer` peer id as service id should be defined
|
||||
-- Errors:
|
||||
-- If issue_trust or import_trust fails, error is returned.
|
||||
-- If `issuer` != %init_peer_id%, Sig service should be registered with issuer's peer id as a service id.
|
||||
func add_trust(node: PeerId, issuer: PeerId, issued_for: PeerId, expires_at_sec: u64) -> ?Error:
|
||||
trust, issue_error <- issue_trust(issuer, issued_for, expires_at_sec)
|
||||
sig_service: ?string
|
||||
if issuer != %init_peer_id%:
|
||||
sig_service <<- issuer
|
||||
|
||||
error: *Error
|
||||
if issue_error != nil:
|
||||
error <<- issue_error!
|
||||
trust, issue_error <- issue_trust(issued_for, expires_at_sec, sig_service)
|
||||
|
||||
error: *?Error
|
||||
if trust == nil:
|
||||
error <<- issue_error
|
||||
else:
|
||||
on node:
|
||||
import_error <- import_trust(trust!, issuer)
|
||||
append_error(error, import_error)
|
||||
<- error
|
||||
error <- import_trust(trust!, issuer)
|
||||
|
||||
<- error!
|
||||
|
||||
-- Call context: %init_peer_id%
|
||||
-- Set `peer_id` as a root and add self-signed trust to TG instance on `node`
|
||||
-- If `peer_id` is not %init_peer_id%, Sig service with `peer_id` as service id should be defined
|
||||
-- Errors:
|
||||
-- If issue_trust, import_trust or set_root fails, error is returned.
|
||||
-- If `peer_id` != %init_peer_id%, Sig service should be registered with this peer id as a service id.
|
||||
func add_root_trust(node: PeerId, peer_id: PeerId, max_chain_len: u32, expires_at_sec: u64) -> ?Error:
|
||||
trust, issue_error <- issue_trust(peer_id, peer_id, expires_at_sec)
|
||||
sig_service: ?string
|
||||
if peer_id != %init_peer_id%:
|
||||
sig_service <<- peer_id
|
||||
|
||||
error: *Error
|
||||
if issue_error != nil:
|
||||
error <<- issue_error!
|
||||
trust, issue_error <- issue_trust(peer_id, expires_at_sec, sig_service)
|
||||
|
||||
error: *?Error
|
||||
if trust == nil:
|
||||
error <<- issue_error
|
||||
else:
|
||||
on node:
|
||||
set_root_result <- set_root(peer_id, max_chain_len)
|
||||
if set_root_result.success:
|
||||
import_error <- import_trust(trust!, peer_id)
|
||||
append_error(error, import_error)
|
||||
error <- import_trust(trust!, peer_id)
|
||||
else:
|
||||
error <<- set_root_result.error
|
||||
-- converting string to ?string
|
||||
tmp: *string
|
||||
tmp <<- set_root_result.error
|
||||
error <<- tmp
|
||||
|
||||
<- error
|
||||
<- error!
|
||||
|
||||
-- Call context: any node with registered `trust-graph` service
|
||||
-- Check signature and expiration time of trust
|
||||
func verify_trust(trust: Trust, issuer: PeerId) -> VerifyTrustResult:
|
||||
timestamp_sec <- Peer.timestamp_sec()
|
||||
result <- TrustGraph.verify_trust(trust, issuer, timestamp_sec)
|
||||
<- result
|
||||
|
||||
-- Call context: any node with registered `trust-graph` service
|
||||
-- Get the maximum weight of trust for `peer_id`
|
||||
-- Get the maximum weight of trust for one peer id
|
||||
-- Trust has weight if there is at least 1 trust chain from one of the roots
|
||||
func get_weight(peer_id: PeerId) -> WeightResult:
|
||||
timestamp_sec <- Peer.timestamp_sec()
|
||||
result <- TrustGraph.get_weight(peer_id, timestamp_sec)
|
||||
<- result
|
||||
|
||||
-- Call context: any node with registered `trust-graph` service
|
||||
-- Get maximum weight of trust for `peer_id` among all chains which contain trust from `issuer`
|
||||
-- Get maximum weight of trust among all chains which contain trust from `issuer`
|
||||
func get_weight_from(peer_id: PeerId, issuer: PeerId) -> WeightResult:
|
||||
timestamp_sec <- Peer.timestamp_sec()
|
||||
result <- TrustGraph.get_weight_from(peer_id, issuer, timestamp_sec)
|
||||
<- result
|
||||
|
||||
-- Call context: %init_peer_id%
|
||||
-- Create revocation signed by %init_peer_id%
|
||||
-- If `revoked_by` is not %init_peer_id%, Sig service with `revoked_by` peer id as service id should be defined
|
||||
-- Errors:
|
||||
-- If TrustGraph.get_revocation_bytes or TrustGraph.issue_revocation fails, (nil, error) is returned.
|
||||
func issue_revocation(revoked_by: PeerId, revoked: PeerId) -> ?Revocation, ?Error:
|
||||
-- after marine-web release this will be done on %init_peer_id%
|
||||
-- If `sig_id` is nil, default Sig service will be used with %init_peer_id% private key
|
||||
func issue_revocation(revoked_by: PeerId, revoked: PeerId, sig_id: ?string) -> ?Revocation, ?Error:
|
||||
on HOST_PEER_ID:
|
||||
issued_at_sec <- Peer.timestamp_sec()
|
||||
bytes <- TrustGraph.get_revocation_bytes(revoked, issued_at_sec)
|
||||
|
||||
result: ?Revocation
|
||||
error: *Error
|
||||
error: ?string
|
||||
if bytes.success:
|
||||
-- for %init_peer_id% Sig service available by default and registered as "sig"
|
||||
-- for other peer ids custom Sig service should be implemented and registered with this peer id as service id
|
||||
if revoked_by != %init_peer_id%:
|
||||
Sig revoked_by
|
||||
sig_service: ?string
|
||||
if sig_id != nil:
|
||||
sig_service <<- sig_id!
|
||||
else:
|
||||
Sig "sig"
|
||||
sig_service <<- "sig"
|
||||
|
||||
Sig sig_service!
|
||||
signature <- Sig.sign(bytes.result)
|
||||
|
||||
on HOST_PEER_ID:
|
||||
@ -152,12 +142,9 @@ func issue_revocation(revoked_by: PeerId, revoked: PeerId) -> ?Revocation, ?Erro
|
||||
error <<- bytes.error
|
||||
<- result, error
|
||||
|
||||
-- Call context: any node with registered `trust-graph` service
|
||||
-- Import revocation to TG
|
||||
-- Errors:
|
||||
-- If TrustGraph.revoke fails, error is returned.
|
||||
-- Import revocation to current node's TG instance
|
||||
func import_revocation(revocation: Revocation) -> ?Error:
|
||||
error: *Error
|
||||
error: ?string
|
||||
timestamp_sec <- Peer.timestamp_sec()
|
||||
add_result <- TrustGraph.revoke(revocation, timestamp_sec)
|
||||
if add_result.success != true:
|
||||
@ -165,55 +152,72 @@ func import_revocation(revocation: Revocation) -> ?Error:
|
||||
|
||||
<- error
|
||||
|
||||
-- Call context: %init_peer_id%
|
||||
-- Revoke all certificates on `node` TG instance
|
||||
-- which contain path from %init_peer_id% to `revoked_peer_id`
|
||||
-- If `revoked_by` is not %init_peer_id%, Sig service with `revoked_by` peer id as service id should be defined
|
||||
-- Errors:
|
||||
-- if issue_revocation or import_revocation fails, error is returned.
|
||||
-- If `revoked_by` != %init_peer_id%, Sig service should be registered with this peer id as a service id.
|
||||
func revoke(node: PeerId, revoked_by: PeerId, revoked: PeerId) -> ?Error:
|
||||
revocation, issue_error <- issue_revocation(revoked_by, revoked)
|
||||
sig_service: ?string
|
||||
if revoked_by != %init_peer_id%:
|
||||
sig_service <<- revoked_by
|
||||
|
||||
error: *Error
|
||||
revocation, issue_error <- issue_revocation(revoked_by, revoked, sig_service)
|
||||
|
||||
error: *?string
|
||||
if revocation == nil:
|
||||
error <<- issue_error!
|
||||
error <<- issue_error
|
||||
else:
|
||||
on node:
|
||||
import_error <- import_revocation(revocation!)
|
||||
append_error(error, import_error)
|
||||
<- error
|
||||
error <- import_revocation(revocation!)
|
||||
|
||||
<- error!
|
||||
|
||||
|
||||
|
||||
-- Call context: any node with registered `trust-graph` service
|
||||
-- Return all certificates issued for current node which contains trust from `issuer`
|
||||
func get_host_certs_from(issuer: PeerId) -> AllCertsResult:
|
||||
timestamp_sec <- Peer.timestamp_sec()
|
||||
result <- TrustGraph.get_host_certs_from(issuer, timestamp_sec)
|
||||
<- result
|
||||
|
||||
-- Call context: any node with registered `trust-graph` service
|
||||
-- Return all certificates issued for given peer id
|
||||
func get_all_certs(issued_for: PeerId) -> AllCertsResult:
|
||||
timestamp_sec <- Peer.timestamp_sec()
|
||||
result <- TrustGraph.get_all_certs(issued_for, timestamp_sec)
|
||||
<- result
|
||||
|
||||
-- Call context: any node with registered `trust-graph` service
|
||||
-- Return all certificates issued for given peer id which contains trust from `issuer`
|
||||
func get_all_certs_from(issued_for: PeerId, issuer: PeerId) -> AllCertsResult:
|
||||
timestamp_sec <- Peer.timestamp_sec()
|
||||
result <- TrustGraph.get_all_certs_from(issued_for, issuer, timestamp_sec)
|
||||
<- result
|
||||
|
||||
-- Call context: any node with registered `trust-graph` service
|
||||
-- Return all certificates issued for current node
|
||||
func get_host_certs() -> AllCertsResult:
|
||||
timestamp_sec <- Peer.timestamp_sec()
|
||||
result <- TrustGraph.get_host_certs(timestamp_sec)
|
||||
<- result
|
||||
|
||||
-- Call context: any node with registered `trust-graph` service
|
||||
-- Insert certificate to TG instance on current node
|
||||
func insert_cert(certificate: Certificate) -> InsertResult:
|
||||
timestamp_sec <- Peer.timestamp_sec()
|
||||
result <- TrustGraph.insert_cert(certificate, timestamp_sec)
|
||||
<- result
|
||||
|
||||
-- returns `true` if current node is identified as official Fluence Labs peer
|
||||
-- returns `false` otherwise
|
||||
func isFluencePeer() -> ?bool, ?Error:
|
||||
certs_result <- get_host_certs_from("12D3KooWM45u7AQxsb4MuQJNYT3NWHHMLU7JTbBV66RTfF3KSzdR")
|
||||
result: ?bool
|
||||
error: ?string
|
||||
if certs_result.success:
|
||||
for cert <- certs_result.certificates:
|
||||
len <- TrustOp.array_length(cert.chain)
|
||||
if len == 3:
|
||||
if cert.chain!0.issued_for == "12D3KooWNbZKaPWRZ8wgjGvrxdJFz9Fq5uVwkR6ERV1f74HhPdyB":
|
||||
if cert.chain!1.issued_for == "12D3KooWM45u7AQxsb4MuQJNYT3NWHHMLU7JTbBV66RTfF3KSzdR":
|
||||
result <<- true
|
||||
if result == nil:
|
||||
result <<- false
|
||||
else:
|
||||
error <<- certs_result.error
|
||||
<- result, error
|
||||
|
@ -1,6 +1,5 @@
|
||||
(seq
|
||||
(seq
|
||||
; set fluence root peer id as TG root
|
||||
(call relay ("trust-graph" "set_root") ["12D3KooWNbZKaPWRZ8wgjGvrxdJFz9Fq5uVwkR6ERV1f74HhPdyB" 5] add_root_res)
|
||||
(xor
|
||||
(match add_root_res.$.success! true
|
||||
@ -15,7 +14,6 @@
|
||||
(seq
|
||||
(seq
|
||||
(call relay ("peer" "timestamp_sec") [] cur_time)
|
||||
; insert all certificates from on_start.json
|
||||
(call relay ("trust-graph" "insert_cert") [i cur_time] insert_result)
|
||||
)
|
||||
(xor
|
||||
|
File diff suppressed because one or more lines are too long
@ -8,3 +8,6 @@ func timestamp_sec() -> u64:
|
||||
on HOST_PEER_ID:
|
||||
result <- Peer.timestamp_sec()
|
||||
<- result
|
||||
|
||||
service Sig:
|
||||
sign(msg: []u8) -> []u8
|
||||
|
@ -19,6 +19,7 @@ import * as tg from "./generated/export";
|
||||
import {Fluence, FluencePeer, KeyPair} from "@fluencelabs/fluence";
|
||||
import {krasnodar, Node, testNet, stage} from "@fluencelabs/fluence-network-environment";
|
||||
import assert from "assert";
|
||||
import {add_root_trust, registerSig} from "./generated/export";
|
||||
const bs58 = require('bs58');
|
||||
|
||||
let local: Node[] = [
|
||||
@ -42,18 +43,15 @@ let local: Node[] = [
|
||||
async function revoke_all(relay: string, revoked_by: string) {
|
||||
for (var node of local) {
|
||||
let error = await tg.revoke(relay, revoked_by, node.peerId);
|
||||
if (error === null) {
|
||||
console.log(error)
|
||||
}
|
||||
console.log(error)
|
||||
assert(error == null);
|
||||
}
|
||||
}
|
||||
async function add_root(relay: string, peer_id: string) {
|
||||
let current_time = await tg.timestamp_sec();
|
||||
let far_future = current_time + 9999999;
|
||||
let error = await tg.add_root_trust(relay, peer_id, 2, far_future);
|
||||
if (error === null) {
|
||||
console.log(error)
|
||||
}
|
||||
assert(error == null);
|
||||
}
|
||||
|
||||
async function add_new_trust_checked(relay: string, issuer: string, issued_for_peer_id: string, expires_at_sec: number) {
|
||||
|
@ -1 +1 @@
|
||||
E5ay3731i4HN8XjJozouV92RDMGAn3qSnb9dKSnujiWv
|
||||
E5ay3731i4HN8XjJozouV92RDMGAn3qSnb9dKSnujiWv
|
@ -1,6 +1,6 @@
|
||||
[package]
|
||||
name = "fluence-keypair"
|
||||
version = "0.6.0"
|
||||
version = "0.5.1"
|
||||
authors = ["Fluence Labs"]
|
||||
edition = "2018"
|
||||
description = "identity"
|
||||
@ -8,7 +8,7 @@ license = "Apache-2.0"
|
||||
repository = "https://github.com/fluencelabs/trust-graph"
|
||||
|
||||
[dependencies]
|
||||
serde = { version = "1.0.118", features = ["derive"] }
|
||||
serde = { version = "=1.0.118", features = ["derive"] }
|
||||
serde_json = "1.0.58"
|
||||
bs58 = "0.3.1"
|
||||
ed25519-dalek = { version = "1.0.1", features = ["serde", "std"] }
|
||||
@ -23,7 +23,7 @@ asn1_der = "0.6.1"
|
||||
sha2 = "0.9.1"
|
||||
zeroize = "1"
|
||||
serde_bytes = "0.11"
|
||||
libp2p-core = { version = "0.31", default-features = false, features = [ "secp256k1" ] }
|
||||
libp2p-core = { package = "fluence-fork-libp2p-core", version = "0.27.2", features = ["secp256k1"]}
|
||||
eyre = "0.6.5"
|
||||
|
||||
[target.'cfg(not(target_arch = "wasm32"))'.dependencies]
|
||||
|
@ -1,3 +0,0 @@
|
||||
[toolchain]
|
||||
channel = "nightly-2022-01-16"
|
||||
targets = [ "x86_64-apple-darwin", "x86_64-unknown-linux-gnu" ]
|
@ -109,7 +109,7 @@ impl PublicKey {
|
||||
}
|
||||
|
||||
pub fn to_peer_id(&self) -> PeerId {
|
||||
PeerId::from_public_key(&self.clone().into())
|
||||
PeerId::from_public_key(self.clone().into())
|
||||
}
|
||||
|
||||
pub fn get_key_format(&self) -> KeyFormat {
|
||||
@ -164,24 +164,13 @@ impl TryFrom<libp2p_core::PeerId> for PublicKey {
|
||||
type Error = DecodingError;
|
||||
|
||||
fn try_from(peer_id: libp2p_core::PeerId) -> Result<Self, Self::Error> {
|
||||
Ok(as_public_key(&peer_id)
|
||||
Ok(peer_id
|
||||
.as_public_key()
|
||||
.ok_or(DecodingError::PublicKeyNotInlined(peer_id.to_base58()))?
|
||||
.into())
|
||||
}
|
||||
}
|
||||
|
||||
/// Convert PeerId to libp2p's PublicKey
|
||||
fn as_public_key(peer_id: &PeerId) -> Option<libp2p_core::PublicKey> {
|
||||
use libp2p_core::multihash;
|
||||
|
||||
let mhash = peer_id.as_ref();
|
||||
|
||||
match multihash::Code::try_from(mhash.code()) {
|
||||
Ok(multihash::Code::Identity) => libp2p_core::PublicKey::from_protobuf_encoding(mhash.digest()).ok(),
|
||||
_ => None,
|
||||
}
|
||||
}
|
||||
|
||||
#[cfg(test)]
|
||||
mod tests {
|
||||
use super::*;
|
||||
|
@ -7,7 +7,7 @@ services:
|
||||
RUST_BACKTRACE: full
|
||||
RUST_LOG: info,network=trace,aquamarine=info,aquamarine::actor=info,tokio_threadpool=info,tokio_reactor=info,mio=info,tokio_io=info,soketto=info,yamux=info,multistream_select=info,libp2p_secio=info,libp2p_websocket::framed=info,libp2p_ping=info,libp2p_core::upgrade::apply=info,libp2p_kad::kbucket=info,cranelift_codegen=info,wasmer_wasi=info,async_io=info,polling=info,wasmer_interface_types_fl=info,cranelift_codegen=info,wasmer_wasi=info,async_io=info,polling=info,wasmer_interface_types_fl=info,particle_server::behaviour::identify=info,libp2p_mplex=info,libp2p_identify=info,walrus=info,particle_protocol::libp2p_protocol::upgrade=info,kademlia::behaviour=info
|
||||
WASM_LOG: info
|
||||
image: fluencelabs/node:latest
|
||||
image: fluencelabs/node:tg-hl-api_v345
|
||||
ports:
|
||||
- 7770:7770 # tcp
|
||||
- 9990:9990 # ws
|
||||
@ -29,7 +29,7 @@ services:
|
||||
RUST_BACKTRACE: full
|
||||
RUST_LOG: info,network=trace,aquamarine=info,aquamarine::actor=info,tokio_threadpool=info,tokio_reactor=info,mio=info,tokio_io=info,soketto=info,yamux=info,multistream_select=info,libp2p_secio=info,libp2p_websocket::framed=info,libp2p_ping=info,libp2p_core::upgrade::apply=info,libp2p_kad::kbucket=info,cranelift_codegen=info,wasmer_wasi=info,async_io=info,polling=info,wasmer_interface_types_fl=info,cranelift_codegen=info,wasmer_wasi=info,async_io=info,polling=info,wasmer_interface_types_fl=info,particle_server::behaviour::identify=info,libp2p_mplex=info,libp2p_identify=info,walrus=info,particle_protocol::libp2p_protocol::upgrade=info,kademlia::behaviour=info
|
||||
WASM_LOG: info
|
||||
image: fluencelabs/node:latest
|
||||
image: fluencelabs/node:tg-hl-api_v345
|
||||
ports:
|
||||
- 7771:7771 # tcp
|
||||
- 9991:9991 # ws
|
||||
@ -51,7 +51,7 @@ services:
|
||||
RUST_BACKTRACE: full
|
||||
RUST_LOG: info,network=trace,aquamarine=info,aquamarine::actor=info,tokio_threadpool=info,tokio_reactor=info,mio=info,tokio_io=info,soketto=info,yamux=info,multistream_select=info,libp2p_secio=info,libp2p_websocket::framed=info,libp2p_ping=info,libp2p_core::upgrade::apply=info,libp2p_kad::kbucket=info,cranelift_codegen=info,wasmer_wasi=info,async_io=info,polling=info,wasmer_interface_types_fl=info,cranelift_codegen=info,wasmer_wasi=info,async_io=info,polling=info,wasmer_interface_types_fl=info,particle_server::behaviour::identify=info,libp2p_mplex=info,libp2p_identify=info,walrus=info,particle_protocol::libp2p_protocol::upgrade=info,kademlia::behaviour=info
|
||||
WASM_LOG: info
|
||||
image: fluencelabs/node:latest
|
||||
image: fluencelabs/node:tg-hl-api_v345
|
||||
ports:
|
||||
- 7772:7772 # tcp
|
||||
- 9992:9992 # ws
|
||||
|
@ -1,3 +1,3 @@
|
||||
[toolchain]
|
||||
channel = "nightly-2022-01-16"
|
||||
channel = "nightly-2021-09-01"
|
||||
targets = [ "x86_64-apple-darwin", "x86_64-unknown-linux-gnu" ]
|
@ -12,11 +12,11 @@ path = "src/main.rs"
|
||||
|
||||
[dependencies]
|
||||
trust-graph = { version = "0.3.0", path = "../." }
|
||||
fluence-keypair = { version = "0.6.0", path = "../keypair" }
|
||||
fluence-keypair = { version = "0.5.0", path = "../keypair" }
|
||||
marine-rs-sdk = { version = "0.6.14", features = ["logger"] }
|
||||
marine-sqlite-connector = "0.5.2"
|
||||
|
||||
libp2p-core = { version = "0.31", default-features = false, features = [ "secp256k1" ] }
|
||||
libp2p-core = { package = "fluence-fork-libp2p-core", version = "0.27.2", features = ["secp256k1"]}
|
||||
|
||||
log = "0.4.8"
|
||||
anyhow = "1.0.31"
|
||||
|
@ -1,3 +1,3 @@
|
||||
[toolchain]
|
||||
channel = "nightly-2022-01-16"
|
||||
channel = "nightly-2021-09-01"
|
||||
targets = [ "x86_64-apple-darwin", "x86_64-unknown-linux-gnu" ]
|
@ -15,7 +15,7 @@ use std::time::Duration;
|
||||
use trust_graph::TrustGraph;
|
||||
|
||||
#[marine]
|
||||
/// Only service owner can set roots
|
||||
/// could set only a owner of a trust graph service
|
||||
fn set_root(peer_id: String, max_chain_len: u32) -> SetRootResult {
|
||||
let call_parameters: CallParameters = marine_rs_sdk::get_call_parameters();
|
||||
let init_peer_id = call_parameters.init_peer_id;
|
||||
|
@ -48,6 +48,7 @@ pub struct Revocation {
|
||||
}
|
||||
|
||||
impl Revocation {
|
||||
#[allow(dead_code)]
|
||||
pub fn new(
|
||||
revoked_by: PublicKey,
|
||||
pk: PublicKey,
|
||||
@ -63,6 +64,7 @@ impl Revocation {
|
||||
}
|
||||
|
||||
/// Creates new revocation signed by a revoker.
|
||||
#[allow(dead_code)]
|
||||
pub fn create(revoker: &KeyPair, to_revoke: PublicKey, revoked_at: Duration) -> Self {
|
||||
let msg = Revocation::signature_bytes(&to_revoke, revoked_at);
|
||||
let signature = revoker.sign(&msg).unwrap();
|
||||
|
Reference in New Issue
Block a user