Documentation ¶
Overview ¶
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 ¶
- func Decodebase64(s string) ([]byte, error)
- func Ipfs2Sipfs(ipfshash string) ([32]byte, error)
- func Ipfs2SipfsD(ipfshash string) ([]byte, error)
- func Sipfs2Ipfs(memo []byte) string
- type StellarShell
- func (s *StellarShell) AddIpfs(r io.Reader) (string, error)
- func (s *StellarShell) AddIpfsString(dstring string) (string, error)
- func (s *StellarShell) DataHash(r io.Reader) ([]byte, error)
- func (s *StellarShell) IpfsData(thash string) (io.ReadCloser, error)
- func (s *StellarShell) IpfsDataString(thash string) (string, error)
- func (s *StellarShell) IsListening() error
- func (s *StellarShell) IsReady(thash string)
- func (s *StellarShell) IsValid(thash string)
- func (s *StellarShell) MemoHash(r io.Reader) ([32]byte, error)
- func (s *StellarShell) ReadDataHash(publickey string, DataKeyid string) (string, error)
- func (s *StellarShell) ReadMemoHash(txnid string) (string, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Ipfs2Sipfs ¶
Ipfs2Sipfs converts IPFS multiaddr to stellar compatible memo hash type
func Ipfs2SipfsD ¶
Ipfs2SipfsD converts IPFS multiaddr to stellar compatible manage data byte
func Sipfs2Ipfs ¶
Sipfs2Ipfs Decodes Stellar memo hash to IPFS multiaddr hash
Types ¶
type StellarShell ¶
StellarShell adds new capabilities to package shell that implements a remote API interface for running a stellar compatible ipfs daemon
func NewStellarShell ¶
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 ¶
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 ¶
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 ¶
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 ¶
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 ¶
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 ¶
func (s *StellarShell) IsListening() error
IsListening implements basic method for checking if ipfs daemon is running
func (*StellarShell) IsReady ¶
func (s *StellarShell) IsReady(thash string)
IsReady implements method for checking if ipfs daemon is ready
func (*StellarShell) IsValid ¶
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 ¶
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 ¶
func (s *StellarShell) ReadDataHash(publickey string, DataKeyid string) (string, error)
ReadDataHash returns valid IPFS hash from a Datakey id of managedata
func (*StellarShell) ReadMemoHash ¶
func (s *StellarShell) ReadMemoHash(txnid string) (string, error)
ReadMemoHash returns valid IPFS hash from a transaction id