diff --git a/README.md b/README.md index e59d141..d5fce58 100644 --- a/README.md +++ b/README.md @@ -29,15 +29,32 @@ func install_scheduled_script_from_ipfs_to_peer(from: PeerId, to: PeerId, cid: s ## Documentation See [aqua-ipfs in Aqua Book](https://fluence.dev/docs/aqua-book/libraries/aqua-ipfs). -## How to use it in TypeScript -There's a simple example in [example](/example/index.ts) - ## Directory structure - `aqua` Aqua API of AquaIPFS. See [aqua/README](/aqua/README.md) - `service` contains Rust service that implements all the IPFS calls by using `ipfs` cli mounted binary - `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 +## How to use it in TypeScript +There's a simple example in [example](/example/index.ts) + +## How to run it in MREPL +First, you would need to install mrepl via `cargo install mrepl` + +After that, here's an example +``` +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. + # Contribution Contributions are welcome! diff --git a/service/Config.toml b/service/Config.toml index c5e30c6..26f5952 100644 --- a/service/Config.toml +++ b/service/Config.toml @@ -6,10 +6,10 @@ modules_dir = "artifacts/" logger_enabled = true [module.mounted_binaries] - ipfs = "/usr/local/bin/ipfs" + ipfs = "/opt/homebrew/bin/ipfs" [module.wasi] - envs = { "IPFS_ADDR" = "/dns4/relay02.fluence.dev/tcp/15001", "timeout" = "1s" } + envs = { "/tmp/vault" = "/tmp" } [[module]] name = "ipfs_pure"