mirror of
https://github.com/fluencelabs/aqua-ipfs
synced 2025-04-24 15:32:15 +00:00
Compare commits
7 Commits
aqua-ipfs-
...
master
Author | SHA1 | Date | |
---|---|---|---|
|
b6054cc05b | ||
|
459320d224 | ||
|
e3e89cf4d0 | ||
|
a1781d36cf | ||
|
41fbc08d11 | ||
|
cdaefbe536 | ||
|
32238f18c2 |
2
.github/release-please/manifest.json
vendored
2
.github/release-please/manifest.json
vendored
@ -1,3 +1,3 @@
|
||||
{
|
||||
".": "0.5.29"
|
||||
".": "0.6.0"
|
||||
}
|
||||
|
39
.github/renovate.json
vendored
39
.github/renovate.json
vendored
@ -1,39 +1,8 @@
|
||||
{
|
||||
"$schema": "https://docs.renovatebot.com/renovate-schema.json",
|
||||
"extends": [
|
||||
"config:base",
|
||||
":semanticCommitTypeAll(chore)"
|
||||
"github>fluencelabs/renovate",
|
||||
"github>fluencelabs/renovate:npm",
|
||||
"github>fluencelabs/renovate:cargo"
|
||||
],
|
||||
"enabledManagers": ["cargo", "npm", "github-actions", "pip_requirements"],
|
||||
"rangeStrategy": "pin",
|
||||
"schedule": "every weekend",
|
||||
"respectLatest": false,
|
||||
"packageRules": [
|
||||
{
|
||||
"matchManagers": ["cargo", "npm"],
|
||||
"matchPackagePatterns": [
|
||||
"@fluencelabs/.*",
|
||||
"fluence-.*",
|
||||
"marine-.*"
|
||||
],
|
||||
"semanticCommitType": "fix",
|
||||
"semanticCommitScope": "deps",
|
||||
"schedule": "at any time"
|
||||
},
|
||||
{
|
||||
"matchDepTypes": ["devDependencies"],
|
||||
"prPriority": -1,
|
||||
"semanticCommitType": "chore",
|
||||
"semanticCommitScope": "deps"
|
||||
},
|
||||
{
|
||||
"matchUpdateTypes": ["major"],
|
||||
"prConcurrentLimit": 1
|
||||
},
|
||||
{
|
||||
"matchManagers": ["github-actions"],
|
||||
"groupName": "all github-actions",
|
||||
"prPriority": -1
|
||||
}
|
||||
]
|
||||
"enabledManagers": ["cargo", "npm", "pip_requirements"]
|
||||
}
|
||||
|
1
.github/workflows/e2e.yml
vendored
1
.github/workflows/e2e.yml
vendored
@ -40,6 +40,7 @@ jobs:
|
||||
- snapshot
|
||||
uses: fluencelabs/nox/.github/workflows/build.yml@master
|
||||
with:
|
||||
ref: new-vault
|
||||
cargo-dependencies: |
|
||||
[
|
||||
{
|
||||
|
2
.github/workflows/tests.yml
vendored
2
.github/workflows/tests.yml
vendored
@ -117,7 +117,7 @@ jobs:
|
||||
- name: Install fluence deps
|
||||
env:
|
||||
FLUENCE_USER_DIR: "${{ github.workspace }}/tmp/.fluence"
|
||||
run: npx fluence dependency npm install
|
||||
run: npx fluence dep install
|
||||
working-directory: aqua-tests
|
||||
|
||||
- name: Install ipfs
|
||||
|
25
CHANGELOG.md
25
CHANGELOG.md
@ -1,5 +1,30 @@
|
||||
# Changelog
|
||||
|
||||
## [0.6.0](https://github.com/fluencelabs/aqua-ipfs/compare/aqua-ipfs-v0.5.31...aqua-ipfs-v0.6.0) (2024-02-22)
|
||||
|
||||
|
||||
### ⚠ BREAKING CHANGES
|
||||
|
||||
* Support CallParameters and Particle Vault File Format ([#165](https://github.com/fluencelabs/aqua-ipfs/issues/165))
|
||||
|
||||
### Features
|
||||
|
||||
* Support CallParameters and Particle Vault File Format ([#165](https://github.com/fluencelabs/aqua-ipfs/issues/165)) ([e3e89cf](https://github.com/fluencelabs/aqua-ipfs/commit/e3e89cf4d0855712ad181894c0cf5668f8798ca5))
|
||||
|
||||
## [0.5.31](https://github.com/fluencelabs/aqua-ipfs/compare/aqua-ipfs-v0.5.30...aqua-ipfs-v0.5.31) (2024-02-21)
|
||||
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* **aqua-lib:** update aqua-lib ([#166](https://github.com/fluencelabs/aqua-ipfs/issues/166)) ([41fbc08](https://github.com/fluencelabs/aqua-ipfs/commit/41fbc08d11e0974b93a7c27209a493516c4fb8a8))
|
||||
|
||||
## [0.5.30](https://github.com/fluencelabs/aqua-ipfs/compare/aqua-ipfs-v0.5.29...aqua-ipfs-v0.5.30) (2024-01-11)
|
||||
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* **aqua-ipfs:** Update example ([#159](https://github.com/fluencelabs/aqua-ipfs/issues/159)) ([32238f1](https://github.com/fluencelabs/aqua-ipfs/commit/32238f18c2df5edfe39a43c051bf4f08d76721f4))
|
||||
|
||||
## [0.5.29](https://github.com/fluencelabs/aqua-ipfs/compare/aqua-ipfs-v0.5.28...aqua-ipfs-v0.5.29) (2024-01-04)
|
||||
|
||||
|
||||
|
@ -4,6 +4,14 @@
|
||||
|
||||
# Documentation: https://github.com/fluencelabs/fluence-cli/tree/main/docs/configs/fluence.md
|
||||
|
||||
version: 5
|
||||
version: 8
|
||||
|
||||
aquaInputPath: src/aqua/main.aqua
|
||||
aquaDependencies:
|
||||
"@fluencelabs/aqua-lib": 0.9.1
|
||||
"@fluencelabs/spell": 0.6.9
|
||||
|
||||
compileAqua:
|
||||
default:
|
||||
input: src/aqua/main.aqua
|
||||
output: src/compiled-aqua
|
||||
target: ts
|
||||
|
8210
aqua-tests/package-lock.json
generated
8210
aqua-tests/package-lock.json
generated
File diff suppressed because it is too large
Load Diff
@ -3,7 +3,7 @@
|
||||
"version": "1.0.0",
|
||||
"description": "Aqua-IPFS tests",
|
||||
"dependencies": {
|
||||
"@fluencelabs/aqua-lib": "0.9.0",
|
||||
"@fluencelabs/aqua-lib": "0.10.1",
|
||||
"@fluencelabs/aqua-ipfs": "file:../aqua"
|
||||
},
|
||||
"scripts": {
|
||||
@ -28,7 +28,7 @@
|
||||
},
|
||||
"homepage": "https://github.com/fluencelabs/aqua-ipfs",
|
||||
"devDependencies": {
|
||||
"@fluencelabs/cli": "0.13.1",
|
||||
"@fluencelabs/cli": "0.15.1",
|
||||
"@fluencelabs/fluence-network-environment": "1.1.2"
|
||||
}
|
||||
}
|
||||
|
@ -10,9 +10,6 @@ import "@fluencelabs/aqua-lib/builtin.aqua"
|
||||
import "ipfs.aqua"
|
||||
|
||||
alias Multiaddr: string
|
||||
alias PeerId: string
|
||||
alias CID: string
|
||||
alias Path: string
|
||||
|
||||
-- Download file from remote IPFS node to Fluence node and then
|
||||
-- put that file to local IPFS node, effectively caching it on the local IPFS node.
|
||||
|
12
aqua/package-lock.json
generated
12
aqua/package-lock.json
generated
@ -1,21 +1,21 @@
|
||||
{
|
||||
"name": "@fluencelabs/aqua-ipfs",
|
||||
"version": "0.5.29",
|
||||
"version": "0.6.0",
|
||||
"lockfileVersion": 3,
|
||||
"requires": true,
|
||||
"packages": {
|
||||
"": {
|
||||
"name": "@fluencelabs/aqua-ipfs",
|
||||
"version": "0.5.29",
|
||||
"version": "0.6.0",
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"@fluencelabs/aqua-lib": "0.9.0"
|
||||
"@fluencelabs/aqua-lib": "0.10.1"
|
||||
}
|
||||
},
|
||||
"node_modules/@fluencelabs/aqua-lib": {
|
||||
"version": "0.9.0",
|
||||
"resolved": "https://registry.npmjs.org/@fluencelabs/aqua-lib/-/aqua-lib-0.9.0.tgz",
|
||||
"integrity": "sha512-V0xhc0UXBF6kjfL9Y/agWGQuW+ie2zckj37KWv8Dq4teYuo9N94O4Ynm7XULWHaaWtbWvzFcDcc6nc9qG7gxcQ=="
|
||||
"version": "0.10.1",
|
||||
"resolved": "https://registry.npmjs.org/@fluencelabs/aqua-lib/-/aqua-lib-0.10.1.tgz",
|
||||
"integrity": "sha512-zwg7faVsmUmfiV5EScVs0p+BArzJzFRfgjcigKzoxB5DvQRb64+OSs7Pmt8flSfV4iprPf1RQT9vhsDvdOsK0g=="
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -1,12 +1,12 @@
|
||||
{
|
||||
"name": "@fluencelabs/aqua-ipfs",
|
||||
"version": "0.5.29",
|
||||
"version": "0.6.0",
|
||||
"description": "Aqua IPFS library",
|
||||
"files": [
|
||||
"*.aqua"
|
||||
],
|
||||
"dependencies": {
|
||||
"@fluencelabs/aqua-lib": "0.9.0"
|
||||
"@fluencelabs/aqua-lib": "0.10.1"
|
||||
},
|
||||
"scripts": {
|
||||
"generate-aqua": "../service/build.sh",
|
||||
|
@ -1,8 +1,8 @@
|
||||
# Run example on TestNet
|
||||
While in `example` directory, `npm start` will run `index.ts` against Fluence TestNet
|
||||
While in `example` directory, `npm run start` will run `index.ts` against Fluence TestNet
|
||||
|
||||
# Run example locally
|
||||
1. Go to `local-network`
|
||||
2. Run `docker compose up -d` to start Fluence cluster of 3 nodes
|
||||
3. Go back to `../example`
|
||||
4. Run `npm run start:local`
|
||||
To run example locally:
|
||||
1. Spin up local environment through [Fluence CLI](https://github.com/fluencelabs/cli)'s `local` command
|
||||
2. Pass local fluence peers multi addresses to `main` in `index.ts`
|
||||
3. (Optional) Change `IPFS_MULTIADDR` to address of your preferred IPFS node
|
||||
|
@ -1,3 +1,4 @@
|
||||
module Exports
|
||||
aqua Exports
|
||||
|
||||
import put, get_from, set_timeout from "@fluencelabs/aqua-ipfs/ipfs-api.aqua"
|
||||
export put, get_from, set_timeout
|
||||
|
122
example/index.ts
122
example/index.ts
@ -13,94 +13,72 @@
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
import { Fluence, testNet, Relay } from "@fluencelabs/js-client";
|
||||
|
||||
import { put, get_from, set_timeout } from "./generated/export";
|
||||
import { Fluence } from "@fluencelabs/fluence";
|
||||
import { Node, testNet } from "@fluencelabs/fluence-network-environment";
|
||||
import { put, get_from, set_timeout } from "./generated/export.js";
|
||||
|
||||
const { create, urlSource } = require("ipfs-http-client");
|
||||
const all = require("it-all");
|
||||
const uint8ArrayConcat = require("uint8arrays/concat");
|
||||
import { multiaddr } from "@multiformats/multiaddr";
|
||||
import { create } from "kubo-rpc-client";
|
||||
import all from "it-all";
|
||||
import uint8ArrayConcat from "uint8arrays/concat.js";
|
||||
|
||||
let local: Node[] = [
|
||||
{
|
||||
peerId: "12D3KooWHBG9oaVx4i3vi6c1rSBUm7MLBmyGmmbHoZ23pmjDCnvK",
|
||||
multiaddr:
|
||||
"/ip4/127.0.0.1/tcp/9990/ws/p2p/12D3KooWHBG9oaVx4i3vi6c1rSBUm7MLBmyGmmbHoZ23pmjDCnvK",
|
||||
},
|
||||
{
|
||||
peerId: "12D3KooWRABanQHUn28dxavN9ZS1zZghqoZVAYtFpoN7FdtoGTFv",
|
||||
multiaddr:
|
||||
"/ip4/127.0.0.1/tcp/9991/ws/p2p/12D3KooWRABanQHUn28dxavN9ZS1zZghqoZVAYtFpoN7FdtoGTFv",
|
||||
},
|
||||
{
|
||||
peerId: "12D3KooWFpQ7LHxcC9FEBUh3k4nSCC12jBhijJv3gJbi7wsNYzJ5",
|
||||
multiaddr:
|
||||
"/ip4/127.0.0.1/tcp/9992/ws/p2p/12D3KooWFpQ7LHxcC9FEBUh3k4nSCC12jBhijJv3gJbi7wsNYzJ5",
|
||||
},
|
||||
];
|
||||
// Multi address of the IPFS node
|
||||
// we will work with through the Fluence Network
|
||||
const IPFS_MULTIADDR = multiaddr("/dns4/ipfs.fluence.dev/tcp/5001");
|
||||
|
||||
/**
|
||||
* @param environment - array of fluence network nodes (two are needed)
|
||||
* @note Pass addresses of local nodes to experiment locally
|
||||
*/
|
||||
async function main(environment: Relay[]) {
|
||||
const relay = environment[0];
|
||||
const node = environment[1];
|
||||
|
||||
const ipfs = await create({ url: IPFS_MULTIADDR });
|
||||
console.log("📗 Created IPFS HTTP Client");
|
||||
|
||||
const content = "Hola, Fluence!";
|
||||
const encoder = new TextEncoder();
|
||||
|
||||
const added = await ipfs.add(encoder.encode(content));
|
||||
console.log("📗 Uploaded content, got CID:", added.cid.toString());
|
||||
|
||||
let stream = await ipfs.cat(added.path);
|
||||
let data = uint8ArrayConcat(await all(stream));
|
||||
const decoder = new TextDecoder();
|
||||
console.log("📗 Retrieved content: ", decoder.decode(data));
|
||||
|
||||
await Fluence.connect(relay);
|
||||
const client = Fluence.getClient();
|
||||
|
||||
async function main(environment: Node[]) {
|
||||
// setLogLevel('DEBUG');
|
||||
await Fluence.start({ connectTo: environment[1] });
|
||||
console.log(
|
||||
"📗 created a fluence peer %s with relay %s",
|
||||
Fluence.getStatus().peerId,
|
||||
Fluence.getStatus().relayPeerId
|
||||
"📗 Created a Fluence Peer %s with Relay %s",
|
||||
client.getPeerId(),
|
||||
client.getRelayPeerId()
|
||||
);
|
||||
|
||||
let ipfsAddr = "https://stage.fluence.dev:15001";
|
||||
let ipfsMultiaddr =
|
||||
"/ip4/134.209.186.43/tcp/5001/p2p/12D3KooWEhCqQ9NBnmtSfNeXSNfhgccmH86xodkCUxZNEXab6pkw";
|
||||
const ipfs = create(ipfsAddr);
|
||||
console.log("📗 created ipfs client");
|
||||
// default IPFS timeout is 1 sec,
|
||||
// set to 10 secs to retrieve file from remote node
|
||||
await set_timeout(node.peerId, 10);
|
||||
console.log("📘 Ipfs.set_timeout");
|
||||
|
||||
await ipfs.id();
|
||||
console.log("📗 connected to ipfs");
|
||||
|
||||
let source = urlSource(
|
||||
"https://images.adsttc.com/media/images/5ecd/d4ac/b357/65c6/7300/009d/large_jpg/02C.jpg?1590547607"
|
||||
);
|
||||
const file = await ipfs.add(source);
|
||||
console.log("📗 uploaded file:", file);
|
||||
|
||||
let files = await ipfs.get(file.cid);
|
||||
for await (const file of files) {
|
||||
const content = uint8ArrayConcat(await all(file.content));
|
||||
console.log("📗 downloaded file of length ", content.length);
|
||||
}
|
||||
|
||||
// default IPFS timeout is 1 sec, set to 10 secs to retrieve file from remote node
|
||||
await set_timeout(environment[2].peerId, 10);
|
||||
|
||||
console.log("📘 file hash: ", file.cid);
|
||||
let getResult = await get_from(
|
||||
environment[2].peerId,
|
||||
file.cid.toString(),
|
||||
ipfsMultiaddr,
|
||||
{ ttl: 10000 }
|
||||
node.peerId,
|
||||
added.cid.toString(),
|
||||
IPFS_MULTIADDR.toString(),
|
||||
{ ttl: 20000 }
|
||||
);
|
||||
console.log("📘 Ipfs.get", getResult);
|
||||
console.log("📘 Ipfs.get_from", getResult);
|
||||
|
||||
let putResult = await put(environment[2].peerId, getResult.path, {
|
||||
ttl: 10000,
|
||||
let putResult = await put(node.peerId, getResult.path, {
|
||||
ttl: 20000,
|
||||
});
|
||||
console.log("📘 Ipfs.put", putResult);
|
||||
|
||||
return;
|
||||
await ipfs.stop();
|
||||
}
|
||||
|
||||
let args = process.argv.slice(2);
|
||||
var environment: Node[];
|
||||
if (args.length >= 1 && args[0] == "local") {
|
||||
environment = local;
|
||||
console.log("📘 Will connect to local nodes");
|
||||
} else {
|
||||
environment = testNet;
|
||||
console.log("📘 Will connect to testNet");
|
||||
}
|
||||
|
||||
main(environment)
|
||||
main(testNet)
|
||||
.then(() => process.exit(0))
|
||||
.catch((error) => {
|
||||
console.error(error);
|
||||
|
15828
example/package-lock.json
generated
15828
example/package-lock.json
generated
File diff suppressed because it is too large
Load Diff
@ -1,10 +1,11 @@
|
||||
{
|
||||
"type": "module",
|
||||
"name": "ipfs-aqua-example",
|
||||
"version": "1.0.0",
|
||||
"description": "A simple example of how to use ipfs-aqua in TS",
|
||||
"main": "index.js",
|
||||
"scripts": {
|
||||
"compile-aqua": "aqua -i aqua -o generated",
|
||||
"compile-aqua": "fluence aqua -i aqua -o generated",
|
||||
"prebuild": "npm run compile-aqua",
|
||||
"build": "tsc",
|
||||
"start": "node dist/index.js",
|
||||
@ -13,12 +14,11 @@
|
||||
"author": "Fluence Labs",
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"@fluencelabs/aqua-ipfs": "file:../aqua",
|
||||
"@fluencelabs/aqua-ipfs": "^0.5.29",
|
||||
"@fluencelabs/aqua-lib": "^0.9.0",
|
||||
"@fluencelabs/aqua": "0.7.4-322",
|
||||
"@fluencelabs/fluence": "^0.23.0",
|
||||
"@fluencelabs/fluence-network-environment": "^1.1.2",
|
||||
"ipfs-http-client": "^50.1.2",
|
||||
"@fluencelabs/js-client": "^0.4.2",
|
||||
"kubo-rpc-client": "^3.0.2",
|
||||
"@multiformats/multiaddr": "^12.1.1",
|
||||
"it-all": "^1.0.5",
|
||||
"uint8arrays": "^2.1.5"
|
||||
},
|
||||
|
@ -5,7 +5,7 @@
|
||||
/* Basic Options */
|
||||
// "incremental": true, /* Enable incremental compilation */
|
||||
"target": "es5", /* Specify ECMAScript target version: 'ES3' (default), 'ES5', 'ES2015', 'ES2016', 'ES2017', 'ES2018', 'ES2019', 'ES2020', or 'ESNEXT'. */
|
||||
"module": "commonjs", /* Specify module code generation: 'none', 'commonjs', 'amd', 'system', 'umd', 'es2015', 'es2020', or 'ESNext'. */
|
||||
"module": "ES2020", /* Specify module code generation: 'none', 'commonjs', 'amd', 'system', 'umd', 'es2015', 'es2020', or 'ESNext'. */
|
||||
// "lib": [], /* Specify library files to be included in the compilation. */
|
||||
// "allowJs": true, /* Allow javascript files to be compiled. */
|
||||
// "checkJs": true, /* Report errors in .js files. */
|
||||
@ -41,7 +41,7 @@
|
||||
// "noFallthroughCasesInSwitch": true, /* Report errors for fallthrough cases in switch statement. */
|
||||
|
||||
/* Module Resolution Options */
|
||||
// "moduleResolution": "node", /* Specify module resolution strategy: 'node' (Node.js) or 'classic' (TypeScript pre-1.6). */
|
||||
"moduleResolution": "node", /* Specify module resolution strategy: 'node' (Node.js) or 'classic' (TypeScript pre-1.6). */
|
||||
// "baseUrl": "./", /* Base directory to resolve non-absolute module names. */
|
||||
// "paths": {}, /* A series of entries which re-map imports to lookup locations relative to the 'baseUrl'. */
|
||||
// "rootDirs": [], /* List of root folders whose combined content represents the structure of the project at runtime. */
|
||||
|
201
service/Cargo.lock
generated
201
service/Cargo.lock
generated
@ -58,7 +58,7 @@ checksum = "a4668cab20f66d8d020e1fbc0ebe47217433c1b6c8f2040faf858554e394ace6"
|
||||
|
||||
[[package]]
|
||||
name = "aqua-ipfs-distro"
|
||||
version = "0.5.29"
|
||||
version = "0.6.0"
|
||||
dependencies = [
|
||||
"built",
|
||||
"maplit",
|
||||
@ -677,9 +677,9 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "fluence-app-service"
|
||||
version = "0.31.0"
|
||||
version = "0.33.0"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "5be1794d6900d3b0376a54d8017d656a1d549e4503b7075f977cbc476c9293b3"
|
||||
checksum = "ec5358cd011d91885b81539bc36f8f67075cd6bb1bf260c7ab35a7ff31b5870d"
|
||||
dependencies = [
|
||||
"log",
|
||||
"maplit",
|
||||
@ -1018,7 +1018,7 @@ checksum = "bffb4def18c48926ccac55c1223e02865ce1a821751a95920448662696e7472c"
|
||||
|
||||
[[package]]
|
||||
name = "ipfs-effector"
|
||||
version = "0.5.29"
|
||||
version = "0.6.0"
|
||||
dependencies = [
|
||||
"eyre",
|
||||
"fluence-fork-parity-multiaddr",
|
||||
@ -1032,7 +1032,7 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "ipfs-pure"
|
||||
version = "0.5.29"
|
||||
version = "0.6.0"
|
||||
dependencies = [
|
||||
"bs58 0.5.0",
|
||||
"eyre",
|
||||
@ -1064,9 +1064,9 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "it-json-serde"
|
||||
version = "0.5.0"
|
||||
version = "0.5.1"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "0bdf951681696f6c957026a6aa576c9a6b1a25e753c1f4d62f75fcf0ff38abe5"
|
||||
checksum = "a74b6ed688d9de56b4e4cb5aca2bd7a883909f1be8d8d6ba40e3a2d25b9feba5"
|
||||
dependencies = [
|
||||
"serde",
|
||||
"serde_derive",
|
||||
@ -1228,29 +1228,51 @@ checksum = "3e2e65a1a2e43cfcb47a895c4c8b10d1f4a61097f9f254f183aee60cad9c651d"
|
||||
|
||||
[[package]]
|
||||
name = "marine-build-rs-generator"
|
||||
version = "0.12.1"
|
||||
version = "0.14.0"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "733bc760227adf6efd733341d67e948d0cbaa71e9a64bd9076de5a79ab595d25"
|
||||
checksum = "1d2653ea504c4d2bef9389793693fa8eb8bfd7edd8a312317e2f7ecf2ff2defa"
|
||||
dependencies = [
|
||||
"marine-test-macro-impl",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "marine-call-parameters"
|
||||
version = "0.10.2"
|
||||
version = "0.10.3"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "60dfc6d5a00b2d5aadbd60a13bdd6c6d6a5f46b31bf8db9f80ad295032f3bda3"
|
||||
checksum = "ef9a7c6ed5fa9052474c1cd76d3b3e67dbc4c455c76263c2c043214e12cce6bd"
|
||||
dependencies = [
|
||||
"marine-macro",
|
||||
"marine-rs-sdk-main",
|
||||
"marine-macro 0.10.3",
|
||||
"marine-rs-sdk-main 0.10.3",
|
||||
"serde",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "marine-call-parameters"
|
||||
version = "0.12.0"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "f47b1186bad0b2a5e9218e3f6fbe0612ef6b17c58c58537d77bd08044596ea95"
|
||||
dependencies = [
|
||||
"marine-macro 0.12.0",
|
||||
"marine-rs-sdk-main 0.12.0",
|
||||
"serde",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "marine-call-parameters"
|
||||
version = "0.13.0"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "8d16852b36a3cfc8fa044955380901e78109db0035dc93eea4f666d8f3979072"
|
||||
dependencies = [
|
||||
"marine-macro 0.13.0",
|
||||
"marine-rs-sdk-main 0.13.0",
|
||||
"serde",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "marine-core"
|
||||
version = "0.26.0"
|
||||
version = "0.28.0"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "eb4758abae2100ab5a89e6df2341492ac753a7c9be72076528b5adf94aeaeb8f"
|
||||
checksum = "9b9a08bd99ea96356abdac57700a58496dc4034d1f48000fb54e532fc5021c8d"
|
||||
dependencies = [
|
||||
"anyhow",
|
||||
"bytesize",
|
||||
@ -1277,13 +1299,13 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "marine-it-generator"
|
||||
version = "0.13.0"
|
||||
version = "0.15.0"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "416d13df5d4d301fc780ae85368e031c1526dc23c9609ecc8a89c09b246d999c"
|
||||
checksum = "64902f7fee0488f2b1e27e8f595772f1a7a386d07f74e55a07def1ad967a64fd"
|
||||
dependencies = [
|
||||
"it-lilo",
|
||||
"marine-it-parser",
|
||||
"marine-macro-impl 0.7.1",
|
||||
"marine-macro-impl 0.13.0",
|
||||
"once_cell",
|
||||
"serde",
|
||||
"serde_json",
|
||||
@ -1294,9 +1316,9 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "marine-it-interfaces"
|
||||
version = "0.9.0"
|
||||
version = "0.9.1"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "942f05f37d694802550d9dfed55a1d56fe53f15ef3a3219b9345e9a235c042cd"
|
||||
checksum = "1c610d90a031911c17b2babc32c9fad7261bae6ab0bf118051cd665b5d9bcfbe"
|
||||
dependencies = [
|
||||
"multimap",
|
||||
"wasmer-interface-types-fl",
|
||||
@ -1304,9 +1326,9 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "marine-it-parser"
|
||||
version = "0.15.0"
|
||||
version = "0.15.1"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "ec9325e7cf7c4e01087be83ae5abb26fe76445b0df517a201fbe6ca298b8661b"
|
||||
checksum = "921afa7f139791b24c4cb91c918d1ef7411ef40c3b801309ec43f6b2c89b107b"
|
||||
dependencies = [
|
||||
"anyhow",
|
||||
"itertools 0.10.5",
|
||||
@ -1323,19 +1345,39 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "marine-macro"
|
||||
version = "0.10.2"
|
||||
version = "0.10.3"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "3f4bef66ff0a930272053bc622e60ae07a444b6bdd6b2406ee2e85ee93fa34a8"
|
||||
checksum = "acdaa50f8239afa104ef8a99d4219288f68169e29c913485bbd094a35fe79113"
|
||||
dependencies = [
|
||||
"marine-macro-impl 0.10.2",
|
||||
"marine-rs-sdk-main",
|
||||
"marine-macro-impl 0.10.3",
|
||||
"marine-rs-sdk-main 0.10.3",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "marine-macro"
|
||||
version = "0.12.0"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "727b1a5449eb1676837c5fc22a8c31dc9980dcef4de938f26f2eaf7c2c54331b"
|
||||
dependencies = [
|
||||
"marine-macro-impl 0.12.0",
|
||||
"marine-rs-sdk-main 0.12.0",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "marine-macro"
|
||||
version = "0.13.0"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "cec2cd19fedf559833d0f1e6a33cbcc5cf0efa338bb0975346ff12538a3cdde4"
|
||||
dependencies = [
|
||||
"marine-macro-impl 0.13.0",
|
||||
"marine-rs-sdk-main 0.13.0",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "marine-macro-impl"
|
||||
version = "0.7.1"
|
||||
version = "0.10.3"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "ca474b63cabaf8d7d9b38de87d630023cbc91ddc77e92f9c7bb745462a131b44"
|
||||
checksum = "460ef42c1bf6dbb88976a00514f8e1b97a7ccb60e3e6009cbb563b0d163166c7"
|
||||
dependencies = [
|
||||
"proc-macro2",
|
||||
"quote",
|
||||
@ -1346,9 +1388,22 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "marine-macro-impl"
|
||||
version = "0.10.2"
|
||||
version = "0.12.0"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "51866ba9045c01e96a716343c30b2d9302d1451c969ceba8f8e3cb52b78053c8"
|
||||
checksum = "57c8cd8a228856db057bd4a32c6e2708848b2b1db7552be0a6063d534cafb4e2"
|
||||
dependencies = [
|
||||
"proc-macro2",
|
||||
"quote",
|
||||
"serde",
|
||||
"serde_json",
|
||||
"syn 1.0.109",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "marine-macro-impl"
|
||||
version = "0.13.0"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "e09acb3ada67e69a301b6d7b52a915a36176c5eedb312647de7d5b6cf17f51e4"
|
||||
dependencies = [
|
||||
"proc-macro2",
|
||||
"quote",
|
||||
@ -1359,9 +1414,9 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "marine-min-it-version"
|
||||
version = "0.3.1"
|
||||
version = "0.3.2"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "a84be3c30abaa13df50cdaceb6b62ca806ac8a10fd5bacfeb4371ec1bd0f5101"
|
||||
checksum = "147e6e4c9d3dc9afbb06b2e3bc069b63c749733f698d0c364c320a72b133f1d5"
|
||||
dependencies = [
|
||||
"once_cell",
|
||||
"semver",
|
||||
@ -1369,14 +1424,14 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "marine-module-info-parser"
|
||||
version = "0.11.0"
|
||||
version = "0.13.0"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "5b3c94cb70c951bf8ef26bd921ef9ddc5b61e2a45b7c62683ad98313f21fb8df"
|
||||
checksum = "e39ef4b727e6e895b0b53682dc35463e00004aa0089d49797b4f289227ea3b5d"
|
||||
dependencies = [
|
||||
"anyhow",
|
||||
"chrono",
|
||||
"derivative",
|
||||
"marine-rs-sdk-main",
|
||||
"marine-rs-sdk-main 0.13.0",
|
||||
"marine-wasm-backend-traits",
|
||||
"semver",
|
||||
"serde",
|
||||
@ -1386,9 +1441,9 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "marine-module-interface"
|
||||
version = "0.8.0"
|
||||
version = "0.8.1"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "8ace780e273bfa9c2124e53da578af10059e053ba9c22400e1e86a99c00576c4"
|
||||
checksum = "d92d2243bf0d3aea6401d9e57a1ee17677b624337981322e0153cc2d54744080"
|
||||
dependencies = [
|
||||
"anyhow",
|
||||
"itertools 0.10.5",
|
||||
@ -1403,22 +1458,42 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "marine-rs-sdk"
|
||||
version = "0.10.2"
|
||||
version = "0.13.0"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "d189b674dfcebfbb5668ead5335c3ba52fd4f8e8947b6f2d48869765ab403bd9"
|
||||
checksum = "6f33834365d1e6dd041e821a758000f32bed5b960edb09f9d8c61e340dd82e29"
|
||||
dependencies = [
|
||||
"marine-call-parameters",
|
||||
"marine-macro",
|
||||
"marine-rs-sdk-main",
|
||||
"marine-call-parameters 0.13.0",
|
||||
"marine-macro 0.13.0",
|
||||
"marine-rs-sdk-main 0.13.0",
|
||||
"marine-timestamp-macro",
|
||||
"serde",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "marine-rs-sdk-main"
|
||||
version = "0.10.2"
|
||||
version = "0.10.3"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "d3b4d597243fa88bf33fe91e080ab155cc1679ac4970e1a20dce6b58df084673"
|
||||
checksum = "031eeea016dab58c1ccb0c65b798cb5e47d214b05115c8c06198717d18275756"
|
||||
dependencies = [
|
||||
"log",
|
||||
"serde",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "marine-rs-sdk-main"
|
||||
version = "0.12.0"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "6cba9000500575b4965ec44e44bbbfd056d121be1195969ce1a5cc146646c37b"
|
||||
dependencies = [
|
||||
"log",
|
||||
"serde",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "marine-rs-sdk-main"
|
||||
version = "0.13.0"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "58b487a1a1b288ba06c832942eadb43384cd99c9754c1454e1e061dd9866be92"
|
||||
dependencies = [
|
||||
"log",
|
||||
"serde",
|
||||
@ -1426,9 +1501,9 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "marine-rs-sdk-test"
|
||||
version = "0.12.1"
|
||||
version = "0.14.0"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "d549eb527d35885391ec73786a7b36c91507ff1e2f2ca5ec5015953f3d8320a2"
|
||||
checksum = "d0226e1bc7755fc1c6edd2c0162e7a585a47b6cf32450f4c3a3b03755f5592f8"
|
||||
dependencies = [
|
||||
"fluence-app-service",
|
||||
"marine-build-rs-generator",
|
||||
@ -1440,19 +1515,21 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "marine-runtime"
|
||||
version = "0.32.0"
|
||||
version = "0.34.0"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "4254658402bf40cb64c0116f44124de84fee46e7fcd413ae6cc6097cbd6b3bff"
|
||||
checksum = "e26c68703d0dc853790adf27813734a696dc75182a93c2a7b3d24a86eed56254"
|
||||
dependencies = [
|
||||
"bytesize",
|
||||
"it-json-serde",
|
||||
"it-memory-traits",
|
||||
"itertools 0.10.5",
|
||||
"log",
|
||||
"marine-call-parameters 0.10.3",
|
||||
"marine-call-parameters 0.12.0",
|
||||
"marine-core",
|
||||
"marine-module-interface",
|
||||
"marine-rs-sdk",
|
||||
"marine-rs-sdk-main",
|
||||
"marine-rs-sdk-main 0.13.0",
|
||||
"marine-utils",
|
||||
"marine-wasm-backend-traits",
|
||||
"marine-wasmtime-backend",
|
||||
@ -1469,9 +1546,9 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "marine-test-macro"
|
||||
version = "0.12.1"
|
||||
version = "0.14.0"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "17d51e361ae860da35f2a8f189a89a36dcb6657d0e44057dc3658dc7236fe630"
|
||||
checksum = "f0c9e6b85b9f96f8ac0dd5785991526c630bc81414126d4f373bbe7725bc191c"
|
||||
dependencies = [
|
||||
"marine-test-macro-impl",
|
||||
"proc-macro-error",
|
||||
@ -1482,9 +1559,9 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "marine-test-macro-impl"
|
||||
version = "0.12.1"
|
||||
version = "0.14.0"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "f3a7c981122443dd9ab5e4192ff34d41805dfb3402a03be4c3a39c0d425675f6"
|
||||
checksum = "c15d3f54fdf628f05db7693d7058304f27790d468e96c78e4e799c3cb646b3cb"
|
||||
dependencies = [
|
||||
"darling",
|
||||
"fluence-app-service",
|
||||
@ -1500,9 +1577,9 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "marine-timestamp-macro"
|
||||
version = "0.10.2"
|
||||
version = "0.13.0"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "d1465b4dcc7d85940cf33f8d64fd0bb2f98093cc3a5384e2d224bf6e50069adb"
|
||||
checksum = "1a5086357724dc2a65e7abe39c85d58b9971198f8678ebc642a69aae1bbc7ae0"
|
||||
dependencies = [
|
||||
"chrono",
|
||||
"quote",
|
||||
@ -1510,15 +1587,15 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "marine-utils"
|
||||
version = "0.5.0"
|
||||
version = "0.5.1"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "7e86cb57ff0e2fdc8e188a52d388287d38e5cc781eddd09a82d20f8ee1f48b80"
|
||||
checksum = "fce56bfabfd0af5326ff81c32c8d2261aa03b10e00ea6c165de4ebf8a3f998e4"
|
||||
|
||||
[[package]]
|
||||
name = "marine-wasm-backend-traits"
|
||||
version = "0.5.0"
|
||||
version = "0.5.1"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "470aaec9c93cec6a4cfd6ce78e338c92e688da14d3203863c517a96027aec417"
|
||||
checksum = "220bc47cfabb8b4ab97bf2bd7bbab9738857b69beeda0a1ac5776c600b64bb46"
|
||||
dependencies = [
|
||||
"anyhow",
|
||||
"it-memory-traits",
|
||||
@ -1531,9 +1608,9 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "marine-wasmtime-backend"
|
||||
version = "0.5.0"
|
||||
version = "0.5.1"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "e1f9991a1c37b7d414c6865ddb04e93c27b260d8e575cb2b6d994454c69ebf76"
|
||||
checksum = "aaa0dc5a7da0e3334f3ce5b341ba4354341af9a1f9efae24884a1b931efdf23e"
|
||||
dependencies = [
|
||||
"anyhow",
|
||||
"it-memory-traits",
|
||||
@ -2318,7 +2395,7 @@ checksum = "42ff0bf0c66b8238c6f3b578df37d0b7848e55df8577b3f74f92a69acceeb825"
|
||||
|
||||
[[package]]
|
||||
name = "types"
|
||||
version = "0.5.29"
|
||||
version = "0.6.0"
|
||||
dependencies = [
|
||||
"eyre",
|
||||
"marine-rs-sdk",
|
||||
|
@ -5,3 +5,6 @@ members = [
|
||||
"distro",
|
||||
"types",
|
||||
]
|
||||
[workspace.dependencies]
|
||||
marine-rs-sdk = { version = "0.13.0", features = ["logger"] }
|
||||
marine-rs-sdk-test = "0.14.0"
|
||||
|
@ -1,6 +1,6 @@
|
||||
[package]
|
||||
name = "aqua-ipfs-distro"
|
||||
version = "0.5.29"
|
||||
version = "0.6.0"
|
||||
description = "distribution of aqua ipfs service"
|
||||
edition = "2021"
|
||||
build = "build.rs"
|
||||
|
@ -1,6 +1,6 @@
|
||||
[package]
|
||||
name = "ipfs-effector"
|
||||
version = "0.5.29"
|
||||
version = "0.6.0"
|
||||
authors = ["Fluence Labs"]
|
||||
edition = "2018"
|
||||
publish = false
|
||||
@ -10,7 +10,7 @@ name = "ipfs_effector"
|
||||
path = "src/main.rs"
|
||||
|
||||
[dependencies]
|
||||
marine-rs-sdk = { version = "0.10.2", features = ["logger"] }
|
||||
marine-rs-sdk = { workspace = true }
|
||||
multiaddr = { version = "0.11.2", package = "fluence-fork-parity-multiaddr" }
|
||||
log = "0.4.20"
|
||||
eyre = "0.6.8"
|
||||
@ -20,7 +20,7 @@ itertools = "0.12.0"
|
||||
types = { path = "../types" }
|
||||
|
||||
[dev-dependencies]
|
||||
marine-rs-sdk-test = "0.12.1"
|
||||
marine-rs-sdk-test = { workspace = true }
|
||||
|
||||
[build-dependencies]
|
||||
marine-rs-sdk-test = "0.12.1"
|
||||
marine-rs-sdk-test = { workspace = true }
|
||||
|
@ -185,7 +185,7 @@ pub fn cat(hash: String, api_multiaddr: String, timeout_sec: u64) -> IpfsCatResu
|
||||
}
|
||||
|
||||
#[marine]
|
||||
#[link(wasm_import_module = "host")]
|
||||
#[host_import]
|
||||
extern "C" {
|
||||
/// Execute provided cmd as a parameters of ipfs cli, return result.
|
||||
pub fn ipfs(cmd: Vec<String>) -> MountedBinaryResult;
|
||||
|
@ -1,6 +1,6 @@
|
||||
[package]
|
||||
name = "ipfs-pure"
|
||||
version = "0.5.29"
|
||||
version = "0.6.0"
|
||||
authors = ["Fluence Labs"]
|
||||
edition = "2018"
|
||||
publish = false
|
||||
@ -10,7 +10,7 @@ name = "ipfs_pure"
|
||||
path = "src/main.rs"
|
||||
|
||||
[dependencies]
|
||||
marine-rs-sdk = { version = "0.10.2", features = ["logger"] }
|
||||
marine-rs-sdk = { workspace = true }
|
||||
multiaddr = { version = "0.11.2", package = "fluence-fork-parity-multiaddr" }
|
||||
log = "0.4.20"
|
||||
eyre = "0.6.8"
|
||||
@ -21,7 +21,7 @@ bs58 = "0.5.0"
|
||||
types = { path = "../types" }
|
||||
|
||||
[dev-dependencies]
|
||||
marine-rs-sdk-test = "0.12.1"
|
||||
marine-rs-sdk-test = { workspace = true }
|
||||
|
||||
[build-dependencies]
|
||||
marine-rs-sdk-test = "0.12.1"
|
||||
marine-rs-sdk-test = { workspace = true }
|
||||
|
@ -23,6 +23,7 @@ use types::{
|
||||
|
||||
use marine_rs_sdk::marine;
|
||||
use marine_rs_sdk::module_manifest;
|
||||
use marine_rs_sdk::ParticleParameters;
|
||||
use marine_rs_sdk::WasmLoggerBuilder;
|
||||
|
||||
use eyre::WrapErr;
|
||||
@ -110,6 +111,10 @@ pub fn get_peer_id(api_multiaddr: String, timeout: u64) -> eyre::Result<Protocol
|
||||
))
|
||||
}
|
||||
|
||||
fn vault_path(particle: &ParticleParameters) -> String {
|
||||
format!("/tmp/vault/{}-{}", particle.id, particle.token)
|
||||
}
|
||||
|
||||
#[marine]
|
||||
pub fn connect(multiaddr: String) -> IpfsResult {
|
||||
if Multiaddr::from_str(&multiaddr).is_err() {
|
||||
@ -167,8 +172,8 @@ pub fn get_from(hash: String, external_multiaddr: String) -> IpfsGetResult {
|
||||
return Err(eyre::eyre!("invalid multiaddr: {}", external_multiaddr)).into();
|
||||
}
|
||||
|
||||
let particle_id = marine_rs_sdk::get_call_parameters().particle_id;
|
||||
let particle_vault_path = format!("/tmp/vault/{}", particle_id);
|
||||
let particle = marine_rs_sdk::get_call_parameters().particle;
|
||||
let particle_vault_path = vault_path(&particle);
|
||||
let path = format!("{}/{}", particle_vault_path, hash);
|
||||
let get_result = ipfs_get(hash, &path, external_multiaddr, timeout);
|
||||
|
||||
@ -198,8 +203,8 @@ pub fn dag_get_from(hash: String, external_multiaddr: String) -> IpfsGetResult {
|
||||
return Err(eyre::eyre!("invalid multiaddr: {}", external_multiaddr)).into();
|
||||
}
|
||||
|
||||
let particle_id = marine_rs_sdk::get_call_parameters().particle_id;
|
||||
let particle_vault_path = format!("/tmp/vault/{}", particle_id);
|
||||
let particle = marine_rs_sdk::get_call_parameters().particle;
|
||||
let particle_vault_path = vault_path(&particle);
|
||||
let path = format!("{}/{}", particle_vault_path, hash);
|
||||
let get_result = ipfs_dag_get(hash, &path, external_multiaddr, timeout);
|
||||
|
||||
@ -240,7 +245,7 @@ pub fn get_external_api_multiaddr() -> IpfsMultiaddrResult {
|
||||
#[marine]
|
||||
pub fn set_external_api_multiaddr(multiaddr: String) -> IpfsResult {
|
||||
let call_parameters = marine_rs_sdk::get_call_parameters();
|
||||
if call_parameters.init_peer_id != call_parameters.service_creator_peer_id {
|
||||
if call_parameters.particle.init_peer_id != call_parameters.service_creator_peer_id {
|
||||
return eyre::Result::<()>::Err(eyre::eyre!(
|
||||
"only service creator can set external api multiaddr"
|
||||
))
|
||||
@ -291,7 +296,7 @@ pub fn get_local_api_multiaddr() -> IpfsMultiaddrResult {
|
||||
#[marine]
|
||||
pub fn set_local_api_multiaddr(multiaddr: String) -> IpfsResult {
|
||||
let call_parameters = marine_rs_sdk::get_call_parameters();
|
||||
if call_parameters.init_peer_id != call_parameters.service_creator_peer_id {
|
||||
if call_parameters.particle.init_peer_id != call_parameters.service_creator_peer_id {
|
||||
return eyre::Result::<()>::Err(eyre::eyre!(
|
||||
"only service creator can set local api multiaddr"
|
||||
))
|
||||
@ -320,7 +325,7 @@ pub fn get_external_swarm_multiaddr() -> IpfsMultiaddrResult {
|
||||
#[marine]
|
||||
pub fn set_external_swarm_multiaddr(multiaddr: String) -> IpfsResult {
|
||||
let call_parameters = marine_rs_sdk::get_call_parameters();
|
||||
if call_parameters.init_peer_id != call_parameters.service_creator_peer_id {
|
||||
if call_parameters.particle.init_peer_id != call_parameters.service_creator_peer_id {
|
||||
return eyre::Result::<()>::Err(eyre::eyre!(
|
||||
"only service creator can set external swarm multiaddr"
|
||||
))
|
||||
@ -371,7 +376,7 @@ pub fn set_timeout(timeout_sec: u64) {
|
||||
}
|
||||
|
||||
#[marine]
|
||||
#[link(wasm_import_module = "ipfs_effector")]
|
||||
#[module_import("ipfs_effector")]
|
||||
extern "C" {
|
||||
#[link_name = "connect"]
|
||||
pub fn ipfs_connect(
|
||||
|
@ -1,11 +1,11 @@
|
||||
[package]
|
||||
name = "types"
|
||||
version = "0.5.29"
|
||||
version = "0.6.0"
|
||||
edition = "2018"
|
||||
publish = false
|
||||
|
||||
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
|
||||
|
||||
[dependencies]
|
||||
marine-rs-sdk = { version = "0.10.2", features = ["logger"] }
|
||||
marine-rs-sdk = { workspace = true }
|
||||
eyre = "0.6.8"
|
||||
|
Loading…
x
Reference in New Issue
Block a user