All Projects → aanupam23 → go-stellar-ipfs

aanupam23 / go-stellar-ipfs

Licence: Apache-2.0 license
🌀 A library that is a bridge between Stellar and IPFS.

Programming Languages

go
31211 projects - #10 most used programming language

Projects that are alternatives of or similar to go-stellar-ipfs

stellar-rust-sdk
A lightweight SDK for the stellar horizon api. Written in rust.
Stars: ✭ 34 (+36%)
Mutual labels:  horizon, stellar
react-native-sdk
[DEPRECATED] React Native bindings for https://github.com/textileio/go-textile
Stars: ✭ 38 (+52%)
Mutual labels:  ipfs
ipfs-crawler
A crawler for the IPFS network, code for our paper (https://arxiv.org/abs/2002.07747). Also holds scripts to evaluate the obtained data and make similar plots as in the paper.
Stars: ✭ 46 (+84%)
Mutual labels:  ipfs
ethereum-dapp-ipfs-node.js-mongodb
以太坊开发DApp实战教程——用区块链、星际文件系统(IPFS)、Node.js和MongoDB来构建电商平台
Stars: ✭ 46 (+84%)
Mutual labels:  ipfs
estuary
A custom IPFS/Filecoin node that makes it easy to pin IPFS content and make Filecoin deals.
Stars: ✭ 195 (+680%)
Mutual labels:  ipfs
docker-php-base
Docker Base Image with PHP 7.4
Stars: ✭ 29 (+16%)
Mutual labels:  horizon
apebase
Bored Ape Database
Stars: ✭ 110 (+340%)
Mutual labels:  ipfs
superhighway84
USENET-inspired, uncensorable, decentralized internet discussion system running on IPFS & OrbitDB
Stars: ✭ 437 (+1648%)
Mutual labels:  ipfs
ipfs-eth-database
An example of usage IPFS in Ethereum Smart Contracts
Stars: ✭ 55 (+120%)
Mutual labels:  ipfs
martianpins
Self hosted IPFS pinning service.
Stars: ✭ 23 (-8%)
Mutual labels:  ipfs
git-lfs-ipfs
Use IPFS as a git-lfs endpoint
Stars: ✭ 41 (+64%)
Mutual labels:  ipfs
orb
A DID method implementation that extends the Sidetree protocol into a Fediverse of interconnected nodes and witnessed using certificate transparency. Spec: https://trustbloc.github.io/did-method-orb/
Stars: ✭ 25 (+0%)
Mutual labels:  ipfs
almonit-plugin
ENS+IPFS Firefox plugin by Almonit
Stars: ✭ 17 (-32%)
Mutual labels:  ipfs
tiddlywiki-ipfs
IPFS with TiddlyWiki
Stars: ✭ 50 (+100%)
Mutual labels:  ipfs
php-ipfs-api
php client library for ipfs
Stars: ✭ 46 (+84%)
Mutual labels:  ipfs
scp
Standalone implementation of the Stellar Consensus Protocol.
Stars: ✭ 34 (+36%)
Mutual labels:  stellar
IPFSStreamingVideo
IPFS Streaming Video
Stars: ✭ 28 (+12%)
Mutual labels:  ipfs
demo-ipfs-todo
Simple ToDo app using window.ipfs
Stars: ✭ 16 (-36%)
Mutual labels:  ipfs
ipfs-add-from-url
A command line executable to add a file to IPFS from a URL instead of a file path
Stars: ✭ 24 (-4%)
Mutual labels:  ipfs
pollinations
Generate Art
Stars: ✭ 100 (+300%)
Mutual labels:  ipfs

go-stellar-ipfs

Version License Document

Dependencies

Install

go get -u github.com/aanupam23/go-stellar-ipfs

Getting Started

go-stellar-ipfs is a library that acts as a bridge between Stellar and IPFS. It combines the low fee and fast speed stellar with ipfs. Using this library you can build Stellar and IPFS application very quickly.

go-stellar-ipfs implements StellarShell that helps you use premade functions for sending any sort of data to IPFS using stellar transaction, memo, manage data and also allows reading of that data.

This library is divided in modular functions, which you can utilize in your application.

Refer the below examples for sample usage.

Example

A complete example which implements addition of IPFS data in stellar compatible format using memo hash field.

package main

import (
        "fmt"
        "github.com/stellar/go/txnbuild"
        si "github.com/aanupam23/go-stellar-ipfs"
)

func main() {
        kp, _ := keypair.Parse(SECRETKEY)
        client := horizonclient.DefaultTestNetClient
        ar := horizonclient.AccountRequest{AccountID: kp.Address()}
        sourceAccount, err := client.AccountDetail(ar)
        check(err)

        ss := si.NewStellarShell("localhost:5001", "public")

        // Adding file to IPFS
        thash, err := ss.AddIpfsString("Meow")
        if err != nil {
                error := ss.IsListening()
                panic(error) // ends where
        }
        
        op := Payment{
            Destination: DESITINATION,
            Amount:      "10",
            Asset:       NativeAsset{},
        }

        tx := Transaction{
            SourceAccount: &sourceAccount,
            Operations:    []Operation{&op},
            Timebounds:    NewInfiniteTimeout(),
            Memo:          MemoHash(thash),
            Network:       network.TestNetworkPassphrase,
        }

        txe, err := tx.BuildSignEncode(kp.(*keypair.Full))
        if err != nil {
                panic(error)
        }
        fmt.Println(txe)
}

Replace SECRETKEY and DESITINATION with your inputs.

Another example, that reads the IPFS hash data after converting hash to multiaddr IPFS hash.

package main

import (
        "fmt"
        si "github.com/aanupam23/go-stellar-ipfs"
)

func main() {
        ss := si.NewStellarShell("localhost:5001", "public")

        thash, err: ss.ReadMemoHash(txnid)

        output, err := ss.IpfsDataString(thash)
        if err != nil {
                error := ss.IsListening()
                panic(error) // ends where
        }

        fmt.Println(output)
}

If you wish to get data in an io.Reader, than replace IpfsDataString with IpfsData function

        output, err := ss.IpfsData(thash)
        if err != nil {
                error := ss.IsListening()
                panic(error)
        }

Check the godoc for complete list of functions.

Running your code

Start IPFS daemon

ipfs daemon

Once IPFS Daemon is initialized, run your code. If IPFS is not installed on your system, refer this guide for installing IPFS.

Featured

Mentions

Upcoming/Missing Features

This library acts as a bridge between go-ipfs-api and stellar to make features easier to use.

Features Status
1 Private Stellar ✔️
2 IPFS hash validation x
3 IPFS bootstrap x
4 SEP-0022 Support x
5 IPFS Add options x
6 Suggest any feature -

Contribute

go-stellar-ipfs is open source and all contributions are welcome.

Please refer CONTRIBUTING.md for information.

Licence

License

Stellar is trademark of Stellar Development Foundation.

IPFS is trademark of Protocol Labs.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].