Skip to content
This repository was archived by the owner on Apr 29, 2020. It is now read-only.

Files

Latest commit

cc71764 · Apr 28, 2020

History

History
51 lines (33 loc) · 1.64 KB

README.md

File metadata and controls

51 lines (33 loc) · 1.64 KB

go-ipfs-addr

DEPRECATED

This package was introduced at a time when multiaddr didn't support "ipfs" (or libp2p) addresses. Please use SplitAddr and AddrInfoFromP2pAddrs from github.com/libp2p/go-libp2p-peer.

Coverage Status Travis CI

A parsing utility for ipfs multiaddrs.

Table of Contents

Install

make install

Examples

import "github.com/ipfs/go-ipfs-addr"

addrstr := "/ip4/104.131.131.82/tcp/4001/ipfs/QmaCpDMGvV2BGHeYERUEnRQAwe3N8SzbUtfsmvsqQLuvuJ"
a, _ := ipfsaddr.ParseString(addr)

fmt.Println("peer id: ", a.ID())
fmt.Println("transport multiaddr: ", a.Transport())

Contribute

PRs are welcome!

Small note: If editing the Readme, please conform to the standard-readme specification.

License

MIT © Whyrusleeping