• Home
  • History
  • Annotate
Name Date Size #Lines LOC

..03-May-2022-

.gx/H03-Dec-2019-21

examples/H03-Dec-2019-11487

pb/H03-Dec-2019-697640

.travis.ymlH A D03-Dec-2019387 3121

LICENSEH A D03-Dec-20191.1 KiB2117

MakefileH A D03-Dec-2019174 107

README.mdH A D03-Dec-20192.5 KiB6643

codecov.ymlH A D03-Dec-201943 43

errors.goH A D03-Dec-20191.4 KiB3812

go.modH A D03-Dec-2019284 1310

go.sumH A D03-Dec-201922.1 KiB231230

ipns.goH A D03-Dec-20194.3 KiB169106

ipns_test.goH A D03-Dec-20191.5 KiB6449

record.goH A D03-Dec-20192.9 KiB12793

select_test.goH A D03-Dec-20192.4 KiB12795

validate_test.goH A D03-Dec-20194.9 KiB179141

README.md

1# go-ipns
2
3[![](https://img.shields.io/badge/made%20by-Protocol%20Labs-blue.svg?style=flat-square)](http://protocol.ai)
4[![](https://img.shields.io/badge/project-IPFS-blue.svg?style=flat-square)](http://ipfs.io/)
5[![](https://img.shields.io/badge/freenode-%23ipfs-blue.svg?style=flat-square)](http://webchat.freenode.net/?channels=%23ipfs)
6[![standard-readme compliant](https://img.shields.io/badge/standard--readme-OK-green.svg?style=flat-square)](https://github.com/RichardLitt/standard-readme)
7[![GoDoc](https://godoc.org/github.com/ipfs/go-datastore?status.svg)](https://godoc.org/github.com/ipfs/go-ipns)
8
9> ipns record definitions
10
11This package contains all of the components necessary to create, understand, and validate IPNS records. It does *not* publish or resolve those records. [`go-ipfs`](https://github.com/ipfs/go-ipfs) uses this package internally to manipulate records.
12
13## Lead Maintainer
14
15[Adin Schmahmann](https://github.com/aschmahmann)
16
17## Usage
18
19To create a new IPNS record:
20
21```go
22import (
23	"time"
24
25	ipns "github.com/ipfs/go-ipns"
26	crypto "github.com/libp2p/go-libp2p-crypto"
27)
28
29// Generate a private key to sign the IPNS record with. Most of the time,
30// however, you'll want to retrieve an already-existing key from IPFS using the
31// go-ipfs/core/coreapi CoreAPI.KeyAPI() interface.
32privateKey, publicKey, err := crypto.GenerateKeyPair(crypto.RSA, 2048)
33if err != nil {
34  panic(err)
35}
36
37// Create an IPNS record that expires in one hour and points to the IPFS address
38// /ipfs/Qme1knMqwt1hKZbc1BmQFmnm9f36nyQGwXxPGVpVJ9rMK5
39ipnsRecord, err := ipns.Create(privateKey, []byte("/ipfs/Qme1knMqwt1hKZbc1BmQFmnm9f36nyQGwXxPGVpVJ9rMK5"), 0, time.Now().Add(1*time.Hour))
40if err != nil {
41	panic(err)
42}
43```
44
45Once you have the record, you’ll need to use IPFS to *publish* it.
46
47There are several other major operations you can do with `go-ipns`. Check out the [API docs](https://godoc.org/github.com/ipfs/go-ipns) or look at the tests in this repo for examples.
48
49## Documentation
50
51https://godoc.org/github.com/ipfs/go-ipns
52
53## Contribute
54
55Feel free to join in. All welcome. Open an [issue](https://github.com/ipfs/go-ipns/issues)!
56
57This repository falls under the IPFS [Code of Conduct](https://github.com/ipfs/community/blob/master/code-of-conduct.md).
58
59### Want to hack on IPFS?
60
61[![](https://cdn.rawgit.com/jbenet/contribute-ipfs-gif/master/img/contribute.gif)](https://github.com/ipfs/community/blob/master/CONTRIBUTING.md)
62
63## License
64
65Copyright (c) Protocol Labs, Inc. under the **MIT license**. See [LICENSE file](./LICENSE) for details.
66