go-stellar-ipfs: github.com/aanupam23/go-stellar-ipfs Index | Files | Directories

package stellarshell

import "github.com/aanupam23/go-stellar-ipfs"

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

Index

Package Files

addipfs.go conversion.go datahash.go ipfsdata.go memohash.go status.go stellarshell.go

func Decodebase64 Uses

func Decodebase64(s string) ([]byte, error)

Decodebase64 decodes base64 to byte

func Ipfs2Sipfs Uses

func Ipfs2Sipfs(ipfshash string) ([32]byte, error)

Ipfs2Sipfs converts IPFS multiaddr to stellar compatible memo hash type

func Ipfs2SipfsD Uses

func Ipfs2SipfsD(ipfshash string) ([]byte, error)

Ipfs2SipfsD converts IPFS multiaddr to stellar compatible manage data byte

func Sipfs2Ipfs Uses

func Sipfs2Ipfs(memo []byte) string

Sipfs2Ipfs Decodes Stellar memo hash to IPFS multiaddr hash

type StellarShell Uses

type StellarShell struct {
    SShell  *shi.Shell
    DClient *horizon.Client
}

StellarShell adds new capabilities to package shell that implements a remote API interface for running a stellar compatible ipfs daemon

func NewStellarShell Uses

func NewStellarShell(hostname string, sclient string) *StellarShell

NewStellarShell create a new Stellar shell for library methods hostname should be the host for IPFS(Use localhost:5001 for local client) sclient is passing Horizon client, use sclient="testnet" for https://horizon-testnet.stellar.org, use sclient="public" for https://horizon.stellar.org If you wish to use custom client, than pass your custom horizon client URL as string

func (*StellarShell) AddIpfs Uses

func (s *StellarShell) AddIpfs(r io.Reader) (string, error)

AddIpfs implements method for adding data from io Reader and returns the ipfs hash

func (*StellarShell) AddIpfsString Uses

func (s *StellarShell) AddIpfsString(dstring string) (string, error)

AddIpfsString implements method for adding data from a string and returns the ipfs hash

func (*StellarShell) DataHash Uses

func (s *StellarShell) DataHash(r io.Reader) ([]byte, error)

DataHash implements method for reading data from io Reader and returns stellar manage data compatible hash in byte

func (*StellarShell) IpfsData Uses

func (s *StellarShell) IpfsData(thash string) (io.ReadCloser, error)

IpfsData implements method for reading data from valid IPFS hash and returns data as io Reader

func (*StellarShell) IpfsDataString Uses

func (s *StellarShell) IpfsDataString(thash string) (string, error)

IpfsDataString implements method for reading data from valid IPFS hash and returns data in string

func (*StellarShell) IsListening Uses

func (s *StellarShell) IsListening() error

IsListening implements basic method for checking if ipfs daemon is running

func (*StellarShell) IsReady Uses

func (s *StellarShell) IsReady(thash string)

IsReady implements method for checking if ipfs daemon is ready

func (*StellarShell) IsValid Uses

func (s *StellarShell) IsValid(thash string)

TODO: Check if it is actually a valid IPFS hash IsValid checks the IPFS hash is a valid multiaddr hash

func (*StellarShell) MemoHash Uses

func (s *StellarShell) MemoHash(r io.Reader) ([32]byte, error)

MemoHash implements method for reading data from io Reader and returns stellar memo compatible hash in byte

func (*StellarShell) ReadDataHash Uses

func (s *StellarShell) ReadDataHash(publickey string, DataKeyid string) (string, error)

ReadDataHash returns valid IPFS hash from a Datakey id of managedata

func (*StellarShell) ReadMemoHash Uses

func (s *StellarShell) ReadMemoHash(txnid string) (string, error)

ReadMemoHash returns valid IPFS hash from a transaction id

Directories

PathSynopsis
tests

Package stellarshell imports 11 packages (graph) and is imported by 2 packages. Updated 2019-10-03. Refresh now. Tools for package owners.