ProductPromotion
Logo

Elixir

made by https://0x3d.site

GitHub - zabirauf/elixir-ipfs-api: The Elixir library that is used to communicate with the IPFS REST endpoint.
The Elixir library that is used to communicate with the IPFS REST endpoint. - zabirauf/elixir-ipfs-api
Visit Site

GitHub - zabirauf/elixir-ipfs-api: The Elixir library that is used to communicate with the IPFS REST endpoint.

GitHub - zabirauf/elixir-ipfs-api: The Elixir library that is used to communicate with the IPFS REST endpoint.

Build Status Inline docs

Current Version: v0.1.0

Elixir-Ipfs-Api

The Elixir library that is used to communicate with the IPFS REST endpoint.

elixir_ipfs_api

Documentation

The documentation is posted at hexdocs

How to use it

1. Add the library to mix.exs

The package is published on Hex. Add the elixir_ipfs_api as follow

defp deps do
    [
        ...
        {:elixir_ipfs_api, "~> 0.1.0"}
        ...
    ]
end

2. Start the IPFS Daemon

Start the IPFS daemon by running the following in terminal

$ ipfs daemon

This will start the ipfs daemon with the API endpoint at localhost:5001. If you want to start the API endpoint at a different address then add to the config

$ ipfs config Addresses.API /ipfs/127.0.0.1/tcp/5007

3. Create the IpfsConnection in your code

The IpfsConnection entity contains the information of the IPFS API endpoint. By default it will try to connect to http://localhost:5001/api/v0

conn = %IpfsConnection{host: "127.0.0.1", base: "api/v0", port: 5007}

Examples

Adding content to IPFS

iex> conn = %IpfsConnection{}
iex> IpfsApi.add(conn, "Hello world from Elixir-Ipfs-Api")
{:ok,
 %{"Hash" => "QmTcCZJEW1kUcYU1bKQk9SMGRsTisMMWXuxJ1AQerHwyaA",
 "Name" => "QmTcCZJEW1kUcYU1bKQk9SMGRsTisMMWXuxJ1AQerHwyaA"}}

Getting content from IPFS

iex> conn = %IpfsConnection{}
iex> IpfsApi.get(conn, "QmTcCZJEW1kUcYU1bKQk9SMGRsTisMMWXuxJ1AQerHwyaA")
<<81, 109, 84, 99, 67, 90, 74, 69, 87, 49, 107, 85, 99, 89, 85, 49, 98, 75, 81, 107, 57, 83, 77, 71, 82, 115, 84, 105, 115, 77, 77, 87, 88, 117, 120, 74, 49, 65, 81, 101, 114, 72, 119, 121, 97, 65, 0, 0, 0, 0, ...>>

TODO

  • [] Add stream for adding & getting files to and from IPFS
  • [] Add a pool to request from multiple different IPFS nodes

Articles
to learn more about the elixir concepts.

Resources
which are currently available to browse on.

mail [email protected] to add your project or resources here 🔥.

FAQ's
to know more about the topic.

mail [email protected] to add your project or resources here 🔥.

Queries
or most google FAQ's about Elixir.

mail [email protected] to add more queries here 🔍.

More Sites
to check out once you're finished browsing here.

0x3d
https://www.0x3d.site/
0x3d is designed for aggregating information.
NodeJS
https://nodejs.0x3d.site/
NodeJS Online Directory
Cross Platform
https://cross-platform.0x3d.site/
Cross Platform Online Directory
Open Source
https://open-source.0x3d.site/
Open Source Online Directory
Analytics
https://analytics.0x3d.site/
Analytics Online Directory
JavaScript
https://javascript.0x3d.site/
JavaScript Online Directory
GoLang
https://golang.0x3d.site/
GoLang Online Directory
Python
https://python.0x3d.site/
Python Online Directory
Swift
https://swift.0x3d.site/
Swift Online Directory
Rust
https://rust.0x3d.site/
Rust Online Directory
Scala
https://scala.0x3d.site/
Scala Online Directory
Ruby
https://ruby.0x3d.site/
Ruby Online Directory
Clojure
https://clojure.0x3d.site/
Clojure Online Directory
Elixir
https://elixir.0x3d.site/
Elixir Online Directory
Elm
https://elm.0x3d.site/
Elm Online Directory
Lua
https://lua.0x3d.site/
Lua Online Directory
C Programming
https://c-programming.0x3d.site/
C Programming Online Directory
C++ Programming
https://cpp-programming.0x3d.site/
C++ Programming Online Directory
R Programming
https://r-programming.0x3d.site/
R Programming Online Directory
Perl
https://perl.0x3d.site/
Perl Online Directory
Java
https://java.0x3d.site/
Java Online Directory
Kotlin
https://kotlin.0x3d.site/
Kotlin Online Directory
PHP
https://php.0x3d.site/
PHP Online Directory
React JS
https://react.0x3d.site/
React JS Online Directory
Angular
https://angular.0x3d.site/
Angular JS Online Directory