-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
0 parents
commit 864db6b
Showing
23 changed files
with
2,648 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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* |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
|
||
 | ||
|
||
# [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) |
Oops, something went wrong.