Skip to content

Commit

Permalink
Initial commit
Browse files Browse the repository at this point in the history
  • Loading branch information
Neph-Oo committed Feb 13, 2018
0 parents commit 864db6b
Show file tree
Hide file tree
Showing 23 changed files with 2,648 additions and 0 deletions.
11 changes: 11 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
*.so
*.[oa]
*.dll
*.ba[kc]
*.back
*.save
*.bin
*.rock
*.rockspec
.vscode
.vs*
13 changes: 13 additions & 0 deletions LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE
Version 2, December 2004

Copyright (C) 2004 Sam Hocevar <[email protected]>

Everyone is permitted to copy and distribute verbatim or modified
copies of this license document, and changing it is allowed as long
as the name is changed.

DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE
TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION

0. You just DO WHAT THE FUCK YOU WANT TO.
8 changes: 8 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
All: modhttp

modhttp:
cd luaipfs && gcc -fPIC -shared -o http.so src/*.c -Iinclude `pkg-config --libs lua` `pkg-config --libs libcurl` -Wl,-rpath=".:lib/:../lib" -Wall

clean:
cd luaipfs && test -f http.so && rm -f http.so || test 0
cd luaipfs && rm -f src/*.o
49 changes: 49 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@

![IPFS http logo](https://user-images.githubusercontent.com/1211152/29604883-ca3a4028-87e0-11e7-9f9a-75de49b06048.png)

# [WIP] Lua-ipfs
Ipfs API Lua module. Partialy implemented.

You need a running ipfs daemon. Currently, tested with the Go implementation of ipfs.


## Install

```luarocks install luaipfs``` [wip]

Or compile it yourself. Libcurl (C library), luajson and luafilesystem modules are needed.



## Usage

Create a new ipfs object:
```
local luaipfs = require("luaipfs")
local ipfs = luaipfs:new()
```

And use it to download a file from ifps:
```
local file = io.open("dot.gif", "w+")
file:write(
ipfs:cat("/ipfs/QmbwqqE78Xba5z8j3CiaAMfPxjSNSda9Z9Rc5VhjyhLkt1")
)
file:close()
```

Of course, you can do a lot more. Read the documentation.


## Documentation

See *doc/lipfs.md* for a list of available functions.

Or ```luarocks doc luaipfs```.

Some useful informations can be found on the ipfs website.
The API reference is here: https://ipfs.io/docs/api/.


De la doc en français est également disponible à cette addresse: https://wifi.gauf.re/p2p/lua-ipfs-api (wip)
Loading

0 comments on commit 864db6b

Please sign in to comment.