You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
AllowBigBlockOption=cmds.BoolOption(AllowBigBlockOptionName, "Disable block size check and allow creation of blocks bigger than 1MiB. WARNING: such blocks won't be transferable over the standard bitswap.").WithDefault(false)
21
+
}
22
+
23
+
funcCheckCIDSize(req*cmds.Request, c cid.Cid, dagAPI coreiface.APIDagService) error {
// We do not allow producing blocks bigger than 1 MiB to avoid errors
44
+
// when transmitting them over BitSwap. The 1 MiB constant is an
45
+
// unenforced and undeclared rule of thumb hard-coded here.
46
+
ifsize>SoftBlockLimit {
47
+
returnfmt.Errorf("produced block is over 1MiB: big blocks can't be exchanged with other peers. consider using UnixFS for automatic chunking of bigger files, or pass --allow-big-block to override")
Tagline: "Deprecated way to create a new merkledag object based on an existing one. Use MFS with 'files cp|rm' instead.",
@@ -49,7 +43,7 @@ For modern use cases, use MFS with 'files' commands: 'ipfs files --help'.
49
43
"set-data": patchSetDataCmd,
50
44
},
51
45
Options: []cmds.Option{
52
-
cmds.BoolOption(allowBigBlock, "Disable block size check and allow creation of blocks bigger than 1MB. WARNING: such blocks won't be transferable over the standard bitswap.").WithDefault(false),
// We do not allow producing blocks bigger than 1 MiB to avoid errors
279
-
// when transmitting them over BitSwap. The 1 MiB constant is an
280
-
// unenforced and undeclared rule of thumb hard-coded here.
281
-
modifiedNode, err:=dagAPI.Get(req.Context, c)
282
-
iferr!=nil {
283
-
returnerr
284
-
}
285
-
modifiedNodeSize, err:=modifiedNode.Size()
286
-
iferr!=nil {
287
-
returnerr
288
-
}
289
-
ifmodifiedNodeSize>softBlockLimit {
290
-
returnfmt.Errorf("produced block is over 1MB, object API is deprecated and does not support HAMT-sharding: to create big directories, please use the files API (MFS)")
test_expect_success "ipfs object patch add-link output has the correct error"'
237
-
grep "produced block is over 1MB, object API is deprecated and does not support HAMT-sharding: to create big directories, please use the files API (MFS)" patch_out
0 commit comments