chore: update cargo dependencies (#55)

This commit is contained in:
Aleksey Proshutisnkiy 2023-01-30 14:42:12 +04:00 committed by GitHub
parent c717e4dc73
commit 664552d4f9
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
7 changed files with 727 additions and 562 deletions

View File

@ -1,14 +0,0 @@
#!/bin/bash
set -o pipefail -o errexit -o nounset
set -x
MARINE_RELEASE="https://api.github.com/repos/fluencelabs/marine/releases/latest"
OUT_DIR=~/.bin
# get metadata about release
curl -s -H "Accept: application/vnd.github.v3+json" $MARINE_RELEASE |
# extract url and name for asset with name "marine"
# also append $OUT_DIR to each name so file is saved to $OUT_DIR
jq -r ".assets | .[] | select(.name == \"marine\") | \"\(.browser_download_url) $OUT_DIR/\(.name)\"" |
# download assets
xargs -n2 bash -c 'curl -L $0 -o $1 && chmod +x $1'

View File

@ -25,14 +25,13 @@ jobs:
cache: npm
cache-dependency-path: "aqua/package-lock.json"
- run: mkdir -p ~/.bin
- run: echo "~/.bin" >> $GITHUB_PATH
- name: Setup Rust toolchain
uses: actions-rust-lang/setup-rust-toolchain@v1
- name: Download marine
run: bash $GITHUB_WORKSPACE/.github/download_marine.sh
- name: Install Marine
uses: baptiste0928/cargo-install@v1.3.0
with:
crate: marine
- name: Build trust-graph
working-directory: ./service

View File

@ -26,9 +26,6 @@ jobs:
~/.cargo/git
key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }}
- run: mkdir -p ~/.bin
- run: echo "~/.bin" >> $GITHUB_PATH
- name: Install toolchain
uses: actions-rs/toolchain@v1
with:
@ -38,13 +35,10 @@ jobs:
- name: Add wasm32-wasi target
run: rustup target add wasm32-wasi
- name: Download jq
run: |
curl -L https://github.com/stedolan/jq/releases/download/jq-1.5/jq-linux64 -o ~/.bin/jq
chmod +x ~/.bin/jq
- name: Download marine
run: bash $GITHUB_WORKSPACE/.github/download_marine.sh
- name: Install Marine
uses: baptiste0928/cargo-install@v1.3.0
with:
crate: marine
- name: Build
run: ./build.sh

1219
Cargo.lock generated

File diff suppressed because it is too large Load Diff

View File

@ -14,8 +14,8 @@ path = "src/main.rs"
[dependencies]
trust-graph = { version = "0.3.0", path = "../." }
fluence-keypair = { version = "0.9.0", path = "../keypair" }
marine-rs-sdk = { version = "0.6.14", features = ["logger"] }
marine-sqlite-connector = "0.5.2"
marine-rs-sdk = { version = "0.7.1", features = ["logger"] }
marine-sqlite-connector = "0.6.0"
libp2p-core = { workspace = true }
@ -32,8 +32,8 @@ serde_bencode = "^0.2.3"
thiserror = "1.0.23"
[dev-dependencies]
marine-rs-sdk-test = "0.4.0"
marine-rs-sdk-test = "0.8.1"
rusqlite = "0.26.1"
[build-dependencies]
marine-rs-sdk-test = "0.4.0"
marine-rs-sdk-test = "0.8.1"

View File

@ -15,5 +15,5 @@ cp ../target/wasm32-wasi/release/trust-graph.wasm artifacts/
# download SQLite 3 to use in tests
curl -L https://github.com/fluencelabs/sqlite/releases/download/v0.15.0_w/sqlite3.wasm -o artifacts/sqlite3.wasm
# # generate Aqua bindings
# marine aqua artifacts/trust-graph.wasm -s TrustGraph -i trust-graph > ../aqua/trust-graph.aqua
# generate Aqua bindings
marine aqua artifacts/trust-graph.wasm -s TrustGraph -i trust-graph > ../aqua/trust-graph.aqua

View File

@ -13,31 +13,10 @@ mod results;
mod service_api;
mod storage_impl;
mod tests;
/*
_initialize function that calls __wasm_call_ctors is required to mitigade memory leak
that is described in https://github.com/WebAssembly/wasi-libc/issues/298
In short, without this code rust wraps every export function
with __wasm_call_ctors/__wasm_call_dtors calls. This causes memory leaks. When compiler sees
an explicit call to __wasm_call_ctors in _initialize function, it disables export wrapping.
TODO: remove when updating to marine-rs-sdk with fix
*/
extern "C" {
pub fn __wasm_call_ctors();
}
#[no_mangle]
fn _initialize() {
unsafe {
__wasm_call_ctors();
}
}
//------------------------------
pub static TRUSTED_TIMESTAMP: (&str, &str) = ("peer", "timestamp_sec");
pub fn main() {
_initialize(); // As __wasm_call_ctors still does necessary work, we call it at the start of the module
WasmLoggerBuilder::new()
.with_log_level(log::LevelFilter::Trace)
.build()