Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
10
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Open sidebar
dms3
go-dms3ns
Commits
9d172067
Unverified
Commit
9d172067
authored
6 years ago
by
Rob Brackett
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Satisfy `go vet`
License: MIT Signed-off-by:
Rob Brackett
<
rob@robbrackett.com
>
parent
a52d149c
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
10 additions
and
1 deletion
+10
-1
README.md
README.md
+3
-0
ipns_test.go
ipns_test.go
+7
-1
No files found.
README.md
View file @
9d172067
...
...
@@ -26,6 +26,9 @@ import (
// however, you'll want to retrieve an already-existing key from IPFS using the
// go-ipfs/core/coreapi CoreAPI.KeyAPI() interface.
privateKey
,
publicKey
,
err
:=
crypto
.
GenerateKeyPair
(
crypto
.
RSA
,
2048
)
if
err
!=
nil
{
panic
(
err
)
}
// Create an IPNS record that expires in one hour and points to the IPFS address
// /ipfs/Qme1knMqwt1hKZbc1BmQFmnm9f36nyQGwXxPGVpVJ9rMK5
...
...
This diff is collapsed.
Click to expand it.
ipns_test.go
View file @
9d172067
package
ipns
import
(
"fmt"
"testing"
"time"
...
...
@@ -46,7 +47,10 @@ func ExampleCreate() {
// Generate a private key to sign the IPNS record with. Most of the time,
// however, you'll want to retrieve an already-existing key from IPFS using
// go-ipfs/core/coreapi CoreAPI.KeyAPI() interface.
privateKey
,
publicKey
,
err
:=
ic
.
GenerateKeyPair
(
ic
.
RSA
,
2048
)
privateKey
,
_
,
err
:=
ci
.
GenerateKeyPair
(
ci
.
RSA
,
2048
)
if
err
!=
nil
{
panic
(
err
)
}
// Create an IPNS record that expires in one hour and points to the IPFS address
// /ipfs/Qme1knMqwt1hKZbc1BmQFmnm9f36nyQGwXxPGVpVJ9rMK5
...
...
@@ -54,4 +58,6 @@ func ExampleCreate() {
if
err
!=
nil
{
panic
(
err
)
}
fmt
.
Println
(
ipnsRecord
)
}
This diff is collapsed.
Click to expand it.
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment