Go to file
Anatolios Laskaris b6054cc05b
chore: Update renovate (#169)
* Do not update in nox-distro

* Update renovate
2024-09-04 21:08:36 +03:00
.cargo feat: support ipfs dag + e2e tests [NET-476] (#91) 2023-08-08 01:06:16 +03:00
.github chore: Update renovate (#169) 2024-09-04 21:08:36 +03:00
aqua chore(master): release aqua-ipfs 0.6.0 (#168) 2024-02-22 13:29:39 +01:00
aqua-tests fix(aqua-lib): update aqua-lib (#166) 2024-02-21 18:06:38 +00:00
builtin-package feat(builtin-package): use new blueprint (#81) 2023-05-08 17:42:29 +04:00
example fix(aqua-ipfs): Update example (#159) 2024-01-11 09:03:39 +00:00
local-network README + Aqua API doc (#15) 2021-07-21 20:19:13 +03:00
service chore(master): release aqua-ipfs 0.6.0 (#168) 2024-02-22 13:29:39 +01:00
.gitignore fix: distro crate config and modules names (#82) 2023-06-09 14:44:06 +02:00
CHANGELOG.md chore(master): release aqua-ipfs 0.6.0 (#168) 2024-02-22 13:29:39 +01:00
CONTRIBUTING.md docs: README, LICENSE and CONTRIBUTING update (#65) 2023-02-23 21:04:55 +03:00
LICENSE docs: README, LICENSE and CONTRIBUTING update (#65) 2023-02-23 21:04:55 +03:00
README.md docs: README, LICENSE and CONTRIBUTING update (#65) 2023-02-23 21:04:55 +03:00
rust-toolchain.toml fix(deps): rust toolchain 2023-12-06; cargo-workspaces 0.2.44 (#126) 2023-12-25 12:55:46 -03:00

Aqua IPFS bindings

npm

Aqua-ipfs is a native IPFS integration to Aqua language. It lets one call the API of an IPFS daemon, e.g., to transfer files between peers & services or to orchestrate IPFS nodes.

Quick Installation and Usage

First, make sure you have Fluence CLI installed. After this, installation is as simple as:

fluence dep npm i @fluencelabs/aqua-ipfs

Next, run:

import "@fluencelabs/aqua-ipfs/ipfs-api.aqua"
import "@fluencelabs/aqua-lib/builtin.aqua"

const PERIOD_SEC = 10

func install_scheduled_script_from_ipfs_to_peer(from: PeerId, to: PeerId, cid: string) -> ?string:
  script_id: ?string

  ipfs_maddr <- get_external_api_multiaddr(from)
  if ipfs_maddr.success:
    get <- get_from(to, cid, ipfs_maddr.multiaddr)
    if get.success:
      script_id <- Script.add_from_vault(get.path, ?[PERIOD_SEC])

  <- script_id

To run it in Marine REPL (mrepl), one needs to install mrepl via cargo install mrepl first. After that:

cd service
mrepl
new Config.toml
call ipfs_pure set_local_api_multiaddr ["/ip4/134.209.186.43/tcp/5001/p2p/12D3KooWEhCqQ9NBnmtSfNeXSNfhgccmH86xodkCUxZNEXab6pkw"]

call ipfs_pure set_external_api_multiaddr ["/ip4/134.209.186.43/tcp/5001/p2p/12D3KooWEhCqQ9NBnmtSfNeXSNfhgccmH86xodkCUxZNEXab6pkw"]

call ipfs_pure get_from ["QmfBRabun4FpaHV4wVXtnqtopUTro93XJHiWhNZscViCaq", "/ip4/134.209.186.43/tcp/5001/p2p/12D3KooWEhCqQ9NBnmtSfNeXSNfhgccmH86xodkCUxZNEXab6pkw"]

You can use interface and help inside mrepl to further discover what's possible.

A simple example of using aqua-ipfs in TypeScript is available here.

Documentation

Comprehensive documentation including API and usage examples can be found in Aqua Book.

Repository Structure

  • aqua is Aqua API of Aqua-ipfs. See its README for details.
  • builtin-package Files necessary to use Aqua-ipfs on peers
  • example A simple example of how to use IPFS adapter from TypeScript
  • local-network contains Docker Compose YAML config to run a local Fluence network of 3 nodes
  • service contains Rust service that implements all IPFS calls by using ipfs CLI mounted binary

Support

Please, file an issue if you find a bug. You can also contact us at Discord or Telegram. We will do our best to resolve the issue ASAP.

Contributing

Any interested person is welcome to contribute to the project. Please, make sure you read and follow some basic rules.

License

All software code is copyright (c) Fluence Labs, Inc. under the Apache-2.0 license.