
Product
Announcing Precomputed Reachability Analysis in Socket
Socket’s precomputed reachability slashes false positives by flagging up to 80% of vulnerabilities as irrelevant, with no setup and instant results.
thebigman.ddns.net/ipfs/go-ipns
ipns record definitions
This package contains all of the components necessary to create, understand, and validate IPNS records. It does not publish or resolve those records. go-ipfs
uses this package internally to manipulate records.
To create a new IPNS record:
import (
"time"
ipns "github.com/ipfs/go-ipns"
crypto "github.com/libp2p/go-libp2p-crypto"
)
// 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 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
ipnsRecord, err := ipns.Create(privateKey, []byte("/ipfs/Qme1knMqwt1hKZbc1BmQFmnm9f36nyQGwXxPGVpVJ9rMK5"), 0, time.Now().Add(1*time.Hour))
if err != nil {
panic(err)
}
Once you have the record, you’ll need to use IPFS to publish it.
There are several other major operations you can do with go-ipns
. Check out the API docs or look at the tests in this repo for examples.
https://godoc.org/github.com/ipfs/go-ipns
Feel free to join in. All welcome. Open an issue!
This repository falls under the IPFS Code of Conduct.
Copyright (c) Protocol Labs, Inc. under the MIT license. See LICENSE file for details.
FAQs
Unknown package
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Product
Socket’s precomputed reachability slashes false positives by flagging up to 80% of vulnerabilities as irrelevant, with no setup and instant results.
Product
Socket is launching experimental protection for Chrome extensions, scanning for malware and risky permissions to prevent silent supply chain attacks.
Product
Add secure dependency scanning to Claude Desktop with Socket MCP, a one-click extension that keeps your coding conversations safe from malicious packages.