Skip to content

Latest commit

 

History

History
48 lines (26 loc) · 1.33 KB

README.md

File metadata and controls

48 lines (26 loc) · 1.33 KB

IPFS http logo

Lua-ipfs

Lua Ipfs http client library, partialy implemented.

You need go-ipfs running in the background to use this module. Currently, it has only been tested with the Go implementation of ipfs.

Install

Via LuaRocks :

luarocks install luaipfs

Or compile it yourself (using make). You will need libcurl (C library), luajson, lpeg, luafilesystem, base64 and lua-protobuf.

Usage

Create a new ipfs object:

local luaipfs = require("luaipfs")

local ipfs = luaipfs:new()

And download a file from ifps:

local file = io.open("quick-start", "w+")
file:write(
   ipfs:cat("/ipfs/QmQPeNsJPyVWPFDVHb77w8G42Fvo15z4bG2X8D2GhfbSXc/quick-start")
)
file:close()

Documentation

See doc/luaipfs.md for a list of available functions. You can find some examples here.

Or use luarocks doc luaipfs

You can find the reference API on the ipfs website: https://docs.ipfs.io/reference/http/api/