Skip to content
This repository has been archived by the owner on Mar 26, 2024. It is now read-only.

ifraixedes/rust-ipfs-cids-owners

Repository files navigation

IPFS CIDs Owners

Command-line tool for uploading a file to IPFS and stores the CID in a smart contract, built in Rust as an example.

Repository structure

Directories:

  • smart-contracts: Solidity smart contracts that the application interact with. The directory is a Truffle project.
  • contract-bindings: Rust bindings for the contracts in the smart-contracts directory. They auto-generated by ethers crate.
  • cli: The command-line tool implemented with Rust.

Files in the root of the repository out of the usual ones:

  • Cargo.toml: This cargo only defines a Cargo workspace to gather the different crates present in this repository.

  • docker-compose.yaml: Defines a set of services that run in Docker needed for development and testing purposes.

  • Makefile: Define a set of recipes to conduct several development, testing, and build purposes for not having to document (in this README) nor remembering what's needed for executing each one.

    Execute make or make help to see the list of public recipes with a brief description of each one of them

    NOTE some Make recipes won't work on Windows, or it's even possible that the Makefile doesn't work on Windows at all. I expect to mostly work in OSX, however, I'm executed it in Linux.

Requirements

These are the tools that you have install and be available in PATH:

  • NodeJS and its corresponding NPM. I used v18.7.x, but a later version should work.

    It's used for compiling the smart contract and get the ABI and to compile and deploy it to the local Ethereum node used for testing (see Docker below).

  • Docker with Compose command; it's accepted that Compose is available through docker compose or docker-compose.

    Docker Compose run an IPFS and Ethereum node local services that are used for testing.

  • Rust toolchain. I used v1.67.x, but I expect that it would work with later versions.

    Rust is needed for the two crates that this repository contains under the Cargo workspace.

    The cli crate requires some specific setup for running all the tests, otherwise, some of them are skipped. See its README.

About

Command-line tool for uploading a file to IPFS and stores the CID in a smart contract, built in Rust as an example.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published