mirror of
https://github.com/ipfs/kubo.git
synced 2025-12-16 06:30:09 +08:00
feat(ipns): support passing custom sequence number during publishing (#10851)
* feat(ipns): Add a parameter in name.publish to change the sequence number * test: monotonic name publish --sequence * docs: `name publish --sequence` * chore: boxo main with PR 962 --------- Co-authored-by: Marcin Rataj <lidel@lidel.org>
This commit is contained in:
@@ -66,6 +66,10 @@ func (api *NameAPI) Publish(ctx context.Context, p path.Path, opts ...caopts.Nam
|
||||
publishOptions = append(publishOptions, namesys.PublishWithTTL(*options.TTL))
|
||||
}
|
||||
|
||||
if options.Sequence != nil {
|
||||
publishOptions = append(publishOptions, namesys.PublishWithSequence(*options.Sequence))
|
||||
}
|
||||
|
||||
err = api.namesys.Publish(ctx, k, p, publishOptions...)
|
||||
if err != nil {
|
||||
return ipns.Name{}, err
|
||||
|
||||
Reference in New Issue
Block a user