forked from cerc-io/ipld-eth-server
48 lines
1.3 KiB
Markdown
48 lines
1.3 KiB
Markdown
go-ipfs-addr
|
|
==================
|
|
|
|
[](http://ipn.io)
|
|
[](http://libp2p.io/)
|
|
[](http://webchat.freenode.net/?channels=%23ipfs)
|
|
[](https://coveralls.io/github/ipfs/go-ipfs-addr?branch=master)
|
|
[](https://travis-ci.org/ipfs/go-ipfs-addr)
|
|
|
|
> A parsing utility for ipfs multiaddrs.
|
|
|
|
|
|
## Table of Contents
|
|
|
|
- [Install](#install)
|
|
- [Usage](#usage)
|
|
- [API](#api)
|
|
- [Contribute](#contribute)
|
|
- [License](#license)
|
|
|
|
## Install
|
|
|
|
```sh
|
|
make install
|
|
```
|
|
|
|
## Examples
|
|
|
|
```go
|
|
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](https://github.com/RichardLitt/standard-readme) specification.
|
|
|
|
## License
|
|
|
|
MIT © Whyrusleeping
|