Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

v0.10.0-rc2 #8459

Merged
merged 31 commits into from
Sep 27, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
31 commits
Select commit Hold shift + click to select a range
61b6394
fix(mkreleaselog): specify the parent commit when diffing
Stebalien Aug 23, 2021
0c5532e
ci: preload peerlog plugin, disable by default
guseggert Aug 24, 2021
b29c29b
test: add unit tests for peerlog config parsing
guseggert Aug 24, 2021
b4b7525
chore: add comments to peerlog plugin about being unsupported
guseggert Aug 25, 2021
9bf5c65
ci: publish Docker images for bifrost-* branches
guseggert Aug 26, 2021
1efe5fb
fix: fix bifrost typo in comment
guseggert Aug 26, 2021
f6acd0e
perf: use performance-enhancing FUSE mount options
max-privatevoid Aug 26, 2021
a441538
Cosmetic fixups in examples (#8325)
petar Aug 27, 2021
1883908
`go mod tidy` ipfs library example
jbouwman Aug 30, 2021
96cbf9d
add more buttons; remove some sections covered in the docs; general c…
RubenKelevra Jul 18, 2021
b936b07
chore: update IPFS Desktop testing steps (#8393)
guseggert Sep 3, 2021
da7083f
ci: use dynamic config for CircleCI
guseggert Sep 10, 2021
4a7c615
ci: drop unit tests make jobs back to 1
guseggert Sep 10, 2021
90f65d2
fix(sharness): add extra check in flush=false in files write
schomatis Sep 13, 2021
614e33d
feature: 'ipfs swarm peering' command (#8147)
TakashiMatsuda Sep 15, 2021
6b38eaa
fix: take the lock while listing peers
Stebalien Sep 15, 2021
623caae
feat: multibase transcode command (#8403)
andey-robins Sep 21, 2021
47ac6fe
feat(cli): add daemon option --agent-version-suffix (#8419)
schomatis Sep 21, 2021
958d596
feat: ipfs-webui v2.13.0 (#8430)
lidel Sep 21, 2021
6ebbf4e
feat: dag import --stats (#8237)
rvagg Sep 23, 2021
b770c12
make json, cbor, and git codecs error on empty input
mvdan Sep 8, 2021
85bcea7
chore: update go-libp2p to v0.15.0
marten-seemann Sep 9, 2021
65112ec
change names of ipfs dag put flags to make changes clearer
aschmahmann Sep 15, 2021
0f33e98
remove dag put option shortcuts
aschmahmann Sep 27, 2021
cce8cfc
test: check behavior of loading UnixFS sharded directories with missi…
aschmahmann Sep 23, 2021
336066e
chore: update go-path
aschmahmann Sep 15, 2021
ec081cf
change ipfs dag get flag name from format to output-codec
aschmahmann Sep 15, 2021
cd73b2a
test: add dag get --ouput-codec test
aschmahmann Sep 27, 2021
a495236
enable the legacy mDNS implementation
marten-seemann Sep 18, 2021
ab59afd
fuse: load unixfs adls as their dagpb substrates
aschmahmann Sep 27, 2021
c7873b5
Release v0.10.0-rc2
aschmahmann Sep 27, 2021
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
468 changes: 30 additions & 438 deletions .circleci/config.yml

Large diffs are not rendered by default.

458 changes: 458 additions & 0 deletions .circleci/main.yml

Large diffs are not rendered by default.

295 changes: 107 additions & 188 deletions README.md

Large diffs are not rendered by default.

3 changes: 1 addition & 2 deletions bin/mkreleaselog
Original file line number Diff line number Diff line change
Expand Up @@ -152,7 +152,7 @@ ignored_commit() {
local matches

# Check to see if this commit includes any non-ignored files.
matches=$(git -C "$dir" diff-tree --no-commit-id --name-only -r "$commit" \
matches=$(git -C "$dir" diff-tree --no-commit-id --name-only -r "$commit^" "$commit" \
-- "${IGNORE_FILES_PATHSPEC[@]}" | wc -l)
[[ "$matches" -eq 0 ]]
}
Expand Down Expand Up @@ -262,7 +262,6 @@ recursive_release_log() {
printf -- "- %s:\n" "$module"
release_log "$module" "$start" "$end" | indent


statlog "$module" "$start" "$end" > statlog.json

dep_changes old_deps.json new_deps.json |
Expand Down
5 changes: 5 additions & 0 deletions bin/push-docker-tags.sh
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,11 @@ elif [[ $GIT_TAG =~ ^v[0-9]+\.[0-9]+\.[0-9]+$ ]]; then
pushTag "latest"
pushTag "release" # see: https://github.com/ipfs/go-ipfs/issues/3999#issuecomment-742228981

elif [[ $GIT_BRANCH =~ ^bifrost-.* ]]; then
# sanitize the branch name since docker tags have stricter char limits than git branch names
branch=$(echo "$GIT_BRANCH" | tr '/' '-' | tr --delete --complement '[:alnum:]-')
pushTag "${branch}-${BUILD_NUM}-${GIT_SHA1_SHORT}"

elif [ "$GIT_BRANCH" = "master" ]; then
pushTag "master-${BUILD_NUM}-${GIT_SHA1_SHORT}"
pushTag "master-latest"
Expand Down
7 changes: 7 additions & 0 deletions cmd/ipfs/daemon.go
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,7 @@ const (
enablePubSubKwd = "enable-pubsub-experiment"
enableIPNSPubSubKwd = "enable-namesys-pubsub"
enableMultiplexKwd = "enable-mplex-experiment"
agentVersionSuffix = "agent-version-suffix"
// apiAddrKwd = "address-api"
// swarmAddrKwd = "address-swarm"
)
Expand Down Expand Up @@ -180,6 +181,7 @@ Headers.
cmds.BoolOption(enablePubSubKwd, "Instantiate the ipfs daemon with the experimental pubsub feature enabled."),
cmds.BoolOption(enableIPNSPubSubKwd, "Enable IPNS record distribution through pubsub; enables pubsub."),
cmds.BoolOption(enableMultiplexKwd, "DEPRECATED"),
cmds.StringOption(agentVersionSuffix, "Optional suffix to the AgentVersion presented by `ipfs id` and also advertised through BitSwap."),

// TODO: add way to override addresses. tricky part: updating the config if also --init.
// cmds.StringOption(apiAddrKwd, "Address for the daemon rpc API (overrides config)"),
Expand Down Expand Up @@ -410,6 +412,11 @@ func daemonFunc(req *cmds.Request, re cmds.ResponseEmitter, env cmds.Environment
return fmt.Errorf("unrecognized routing option: %s", routingOption)
}

agentVersionSuffixString, _ := req.Options[agentVersionSuffix].(string)
if agentVersionSuffixString != "" {
version.SetUserAgentSuffix(agentVersionSuffixString)
}

node, err := core.NewNode(req.Context, ncfg)
if err != nil {
log.Error("error from node construction: ", err)
Expand Down
5 changes: 5 additions & 0 deletions core/commands/commands_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -162,6 +162,7 @@ func TestCommands(t *testing.T) {
"/multibase",
"/multibase/decode",
"/multibase/encode",
"/multibase/transcode",
"/multibase/list",
"/name",
"/name/publish",
Expand Down Expand Up @@ -237,6 +238,10 @@ func TestCommands(t *testing.T) {
"/swarm/filters/add",
"/swarm/filters/rm",
"/swarm/peers",
"/swarm/peering",
"/swarm/peering/add",
"/swarm/peering/ls",
"/swarm/peering/rm",
"/tar",
"/tar/add",
"/tar/cat",
Expand Down
42 changes: 34 additions & 8 deletions core/commands/dag/dag.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,10 @@ import (
)

const (
pinRootsOptionName = "pin-roots"
progressOptionName = "progress"
silentOptionName = "silent"
pinRootsOptionName = "pin-roots"
statsOptionName = "stats"
)

// DagCmd provides a subset of commands for interacting with ipld dag objects
Expand Down Expand Up @@ -53,9 +54,15 @@ type ResolveOutput struct {
RemPath string
}

type CarImportStats struct {
BlockCount uint64
BlockBytesCount uint64
}

// CarImportOutput is the output type of the 'dag import' commands
type CarImportOutput struct {
Root RootMeta
Root *RootMeta `json:",omitempty"`
Stats *CarImportStats `json:",omitempty"`
}

// RootMeta is the metadata for a root pinning response
Expand All @@ -77,8 +84,8 @@ into an object of the specified format.
cmds.FileArg("object data", true, true, "The object to put").EnableStdin(),
},
Options: []cmds.Option{
cmds.StringOption("format", "f", "Format that the object will be added as.").WithDefault("dag-cbor"),
cmds.StringOption("input-enc", "Format that the input object will be.").WithDefault("dag-json"),
cmds.StringOption("store-codec", "Codec that the stored object will be encoded with").WithDefault("dag-cbor"),
cmds.StringOption("input-codec", "Codec that the input object is encoded in").WithDefault("dag-json"),
cmds.BoolOption("pin", "Pin this object when adding."),
cmds.StringOption("hash", "Hash function to use").WithDefault("sha2-256"),
},
Expand Down Expand Up @@ -109,7 +116,7 @@ format.
cmds.StringArg("ref", true, false, "The object to get").EnableStdin(),
},
Options: []cmds.Option{
cmds.StringOption("format", "f", "Format that the object will be serialized as.").WithDefault("dag-json"),
cmds.StringOption("output-codec", "Format that the object will be encoded as.").WithDefault("dag-json"),
},
Run: dagGet,
}
Expand Down Expand Up @@ -160,8 +167,10 @@ var DagResolveCmd = &cmds.Command{
}

type importResult struct {
roots map[cid.Cid]struct{}
err error
blockCount uint64
blockBytesCount uint64
roots map[cid.Cid]struct{}
err error
}

// DagImportCmd is a command for importing a car to ipfs
Expand Down Expand Up @@ -193,8 +202,9 @@ Maximum supported CAR version: 1
cmds.FileArg("path", true, true, "The path of a .car file.").EnableStdin(),
},
Options: []cmds.Option{
cmds.BoolOption(silentOptionName, "No output."),
cmds.BoolOption(pinRootsOptionName, "Pin optional roots listed in the .car headers after importing.").WithDefault(true),
cmds.BoolOption(silentOptionName, "No output."),
cmds.BoolOption(statsOptionName, "Output stats."),
},
Type: CarImportOutput{},
Run: dagImport,
Expand All @@ -206,6 +216,22 @@ Maximum supported CAR version: 1
return nil
}

// event should have only one of `Root` or `Stats` set, not both
if event.Root == nil {
if event.Stats == nil {
return fmt.Errorf("Unexpected message from DAG import")
}
stats, _ := req.Options[statsOptionName].(bool)
if stats {
fmt.Fprintf(w, "Imported %d blocks (%d bytes)\n", event.Stats.BlockCount, event.Stats.BlockBytesCount)
}
return nil
}

if event.Stats != nil {
return fmt.Errorf("Unexpected message from DAG import")
}

enc, err := cmdenv.GetLowLevelCidEncoder(req)
if err != nil {
return err
Expand Down
10 changes: 5 additions & 5 deletions core/commands/dag/get.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,9 @@ func dagGet(req *cmds.Request, res cmds.ResponseEmitter, env cmds.Environment) e
return err
}

format, _ := req.Options["format"].(string)
var fCodec mc.Code
if err := fCodec.Set(format); err != nil {
codecStr, _ := req.Options["output-codec"].(string)
var codec mc.Code
if err := codec.Set(codecStr); err != nil {
return err
}

Expand Down Expand Up @@ -54,9 +54,9 @@ func dagGet(req *cmds.Request, res cmds.ResponseEmitter, env cmds.Environment) e
}
}

encoder, err := multicodec.LookupEncoder(uint64(fCodec))
encoder, err := multicodec.LookupEncoder(uint64(codec))
if err != nil {
return fmt.Errorf("invalid encoding: %s - %s", format, err)
return fmt.Errorf("invalid encoding: %s - %s", codec, err)
}

r, w := io.Pipe()
Expand Down
23 changes: 21 additions & 2 deletions core/commands/dag/import.go
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ func dagImport(req *cmds.Request, res cmds.ResponseEmitter, env cmds.Environment
failedPins++
}

if err := res.Emit(&CarImportOutput{Root: ret}); err != nil {
if err := res.Emit(&CarImportOutput{Root: &ret}); err != nil {
return err
}
}
Expand All @@ -115,6 +115,19 @@ func dagImport(req *cmds.Request, res cmds.ResponseEmitter, env cmds.Environment
}
}

stats, _ := req.Options[statsOptionName].(bool)
if stats {
err = res.Emit(&CarImportOutput{
Stats: &CarImportStats{
BlockCount: done.blockCount,
BlockBytesCount: done.blockBytesCount,
},
})
if err != nil {
return err
}
}

return nil
}

Expand All @@ -126,6 +139,7 @@ func importWorker(req *cmds.Request, re cmds.ResponseEmitter, api iface.CoreAPI,
batch := ipld.NewBatch(req.Context, api.Dag())

roots := make(map[cid.Cid]struct{})
var blockCount, blockBytesCount uint64

it := req.Files.Entries()
for it.Next() {
Expand Down Expand Up @@ -176,6 +190,8 @@ func importWorker(req *cmds.Request, re cmds.ResponseEmitter, api iface.CoreAPI,
if err := batch.Add(req.Context, nd); err != nil {
return err
}
blockCount++
blockBytesCount += uint64(len(block.RawData()))
}

return nil
Expand All @@ -197,5 +213,8 @@ func importWorker(req *cmds.Request, re cmds.ResponseEmitter, api iface.CoreAPI,
return
}

ret <- importResult{roots: roots}
ret <- importResult{
blockCount: blockCount,
blockBytesCount: blockBytesCount,
roots: roots}
}
14 changes: 7 additions & 7 deletions core/commands/dag/put.go
Original file line number Diff line number Diff line change
Expand Up @@ -31,17 +31,17 @@ func dagPut(req *cmds.Request, res cmds.ResponseEmitter, env cmds.Environment) e
return err
}

ienc, _ := req.Options["input-enc"].(string)
format, _ := req.Options["format"].(string)
inputCodec, _ := req.Options["input-codec"].(string)
storeCodec, _ := req.Options["store-codec"].(string)
hash, _ := req.Options["hash"].(string)
dopin, _ := req.Options["pin"].(bool)

var icodec mc.Code
if err := icodec.Set(ienc); err != nil {
if err := icodec.Set(inputCodec); err != nil {
return err
}
var fcodec mc.Code
if err := fcodec.Set(format); err != nil {
var scodec mc.Code
if err := scodec.Set(storeCodec); err != nil {
return err
}
var mhType mc.Code
Expand All @@ -51,7 +51,7 @@ func dagPut(req *cmds.Request, res cmds.ResponseEmitter, env cmds.Environment) e

cidPrefix := cid.Prefix{
Version: 1,
Codec: uint64(fcodec),
Codec: uint64(scodec),
MhType: uint64(mhType),
MhLength: -1,
}
Expand All @@ -60,7 +60,7 @@ func dagPut(req *cmds.Request, res cmds.ResponseEmitter, env cmds.Environment) e
if err != nil {
return err
}
encoder, err := multicodec.LookupEncoder(uint64(fcodec))
encoder, err := multicodec.LookupEncoder(uint64(scodec))
if err != nil {
return err
}
Expand Down
2 changes: 1 addition & 1 deletion core/commands/id.go
Original file line number Diff line number Diff line change
Expand Up @@ -223,6 +223,6 @@ func printSelf(keyEnc ke.KeyEncoder, node *core.IpfsNode) (interface{}, error) {
sort.Strings(info.Protocols)
}
info.ProtocolVersion = identify.LibP2PVersion
info.AgentVersion = version.UserAgent
info.AgentVersion = version.GetUserAgentVersion()
return info, nil
}
59 changes: 56 additions & 3 deletions core/commands/multibase.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,10 @@ var MbaseCmd = &cmds.Command{
Tagline: "Encode and decode files or stdin with multibase format",
},
Subcommands: map[string]*cmds.Command{
"encode": mbaseEncodeCmd,
"decode": mbaseDecodeCmd,
"list": basesCmd,
"encode": mbaseEncodeCmd,
"decode": mbaseDecodeCmd,
"transcode": mbaseTranscodeCmd,
"list": basesCmd,
},
Extra: CreateCmdExtras(SetDoesNotUseRepo(true)),
}
Expand Down Expand Up @@ -116,3 +117,55 @@ This command expects multibase inside of a file or via stdin:
return resp.Emit(reader)
},
}

var mbaseTranscodeCmd = &cmds.Command{
Helptext: cmds.HelpText{
Tagline: "Transcode multibase string between bases",
LongDescription: `
This command expects multibase inside of a file or via stdin.

By default it will use URL-safe base64url encoding,
but one can customize used base with -b:

> echo -n hello | ipfs multibase encode > file
> cat file
uaGVsbG8

> ipfs multibase transcode file -b base16 > transcoded_file
> cat transcoded_file
f68656c6c6f
`,
},
Arguments: []cmds.Argument{
cmds.FileArg("encoded_file", true, false, "encoded data to decode").EnableStdin(),
},
Options: []cmds.Option{
cmds.StringOption(mbaseOptionName, "multibase encoding").WithDefault("base64url"),
},
Run: func(req *cmds.Request, resp cmds.ResponseEmitter, env cmds.Environment) error {
if err := req.ParseBodyArgs(); err != nil {
return err
}
encoderName, _ := req.Options[mbaseOptionName].(string)
encoder, err := mbase.EncoderByName(encoderName)
if err != nil {
return err
}
files := req.Files.Entries()
file, err := cmdenv.GetFileArg(files)
if err != nil {
return fmt.Errorf("failed to access file: %w", err)
}
encoded_data, err := ioutil.ReadAll(file)
if err != nil {
return fmt.Errorf("failed to read file contents: %w", err)
}
_, data, err := mbase.Decode(string(encoded_data))
if err != nil {
return fmt.Errorf("failed to decode multibase: %w", err)
}
encoded := encoder.Encode(data)
reader := strings.NewReader(encoded)
return resp.Emit(reader)
},
}
Loading