在线时间:8:00-16:00
迪恩网络APP
随时随地掌握行业动态
扫描二维码
关注迪恩网络微信公众号
开源软件名称:equalitie/ipfs-cache开源软件地址:https://github.com/equalitie/ipfs-cache开源编程语言:C++ 79.5%开源软件介绍:IPFS CacheA C++ wrapper over go-ipfs to store key/value pairs in the IPFS network. ArchivedThis project has been split into two parts. The first part has moved into Asio.IPFS project. It contains only the Boost.Asio based bindings to IPFS. The other part with the rest of the code has been moved into Ouinet. RequirementsTo be able to use the IPFS Cache in platforms like Android, where running IPFS as an independent daemon is not a possibility, the wrapper needs to embed IPFS by linking directly with its Go code. Thus the source of go-ipfs is needed to build the main glue between C++ and IPFS. Building that source requires a recent version of Go. To avoid extra system dependencies, the build process automatically downloads the Go system and builds IPFS itself. In summary, the minimum build dependencies are:
For Debian, this translates to the following packages:
The build process is able to compile the IPFS Cache to different platforms with the help of a properly configured cross-compilation environment. If you actually intend to cross-compile you will need proper C/C++ cross-compiler packages, Boost libraries for the target system and a toolchain file for CMake to use them. To the date, the build process has only been tested on 64-bit GNU/Linux platforms. Linux cross-compilation exampleFor building binaries in a Debian Strech machine which are able to run on Raspbian Stretch on the Raspberry Pi:
Android cross-compilation exampleFor building binaries able to run in Android KitKat and above on ARM processors you
will need a Clang/LLVM standalone toolchain created with the Android NDK. Assuming
that the NDK is under
You will also need to build the Boost libraries for this platform. You may use
Boost for Android. Assuming that Boost
source is in
Create the After the previous steps you can use a CMake toolchain file like the following one:
Building
On success, the build directory shall contain the libipfs-bindings----.so
and libipfs-cache----.so shared libraries and two example programs:
injector---- and client----. To cross-compile to another system, you may either create a different
This will create the libipfs-cache--Linux--armv6l.so library and similarly named versions of the example programs. Using the examplesThe injector is a program which manipulates the IPFS key/value database. It does so by running a very simplistic HTTP server which listens to requests for adding new (key, value) pairs into the database. To start the injector listening on the TCP port 8080 start it as so:
Make a note of the Each IPFS application requires a repository which stores a config file and data being shared on the IPFS network. If the path to the repository doesn't exist, the application will try to create one. To insert a new (key, value) entry into the database, run the curl command with key and value variables set:
When this command succeeds, we can have a look at the database by pointing our browser to:
Which may look something like this:
Note that the value is not stored in the database directly, instead, it can be found
in the IPFS network under
Finally, to find the value of a key using the client example program, one would run it as so:
|
2023-10-27
2022-08-15
2022-08-17
2022-09-23
2022-08-13
请发表评论