ipfs / ipfs/kubo

Multiple users publish to IPNS at the same time

Open
#8,433 5 comments 0 reactions 0 assignees View on GitHub
kind/feature
Dominant language
Go
Stars
17.1k
Forks
3.2k
Avg merge
3d 18h
Merged PRs (30d)
11

Description

### Checklist

- [X] My issue is specific & actionable.
- [X] I am not suggesting a protocol enhancement.
- [X] I have searched on the [issue tracker](https://github.com/ipfs/go-ipfs/issues?q=is%3Aissue) for my issue.

### Description

The json uploaded using "ipfs add" is published to ipns to get a fixed hash. If two users modify the json at the same time, use "ipfs add" to upload to IPFS, and then publish to ipns at the same time, it will be strange at this time The phenomenon of accessing the ipns hash obtained, the json obtained will be the value submitted by one of the users, but after a while, the value will become the value submitted by another user, and it will change back to the first after a while. Values submitted by users. Does anyone know how to deal with this situation?
Example:
```
$ echo'{ "Data": "abc" }'| ipfs add
>added QmXSvgfH6fLcWjCEjrS3YZwrAMMFM9fRPZEgz8XK25dn49 QmXSvgfH6fLcWjCEjrS3YZwrAMMFM9fRPZEgz8XK25dn49
$ ipfs name publish QmXSvgfH6fLcWjCEjrS3YZwrAMMFM9fRPZEgz8XK25dn49
>Published to k51qzi5uqu5dklydmy7y4npjqa7y7xyztehlv4ahbyus93ueoh7cwmdnd9dzf1: /ipfs/QmXSvgfH6fLcWjCEjrS3YZwrAMMFM9fRPZEgz8XK25dn49
```
Then the two users modify json and submit ipfs, and the obtained hash is published to ipns at the same time.
```
$ echo'{ "Data": "abcd" }'| ipfs add
>added QmTDxuFLfpHhRn8XsgXuVpaDxpTGwdki2soFFSaLeHfZkY QmTDxuFLfpHhRn8XsgXuVpaDxpTGwdki2soFFSaLeHfZkY
$ ipfs name publish QmTDxuFLfpHhRn8XsgXuVpaDxpTGwdki2soFFSaLeHfZkY
>Published to k51qzi5uqu5dklydmy7y4npjqa7y7xyztehlv4ahbyus93ueoh7cwmdnd9dzf1: /ipfs/QmTDxuFLfpHhRn8XsgXuVpaDxpTGwdki2soFFSaLeHfZkY
```
```
$ echo'{ "Data": "abcde" }'| ipfs add
>added QmfWkTLCx5aHouFzrC4cbbU9Efe9pJJYMLUUYjJdBBXj2K QmfWkTLCx5aHouFzrC4cbbU9Efe9pJJYMLUUYjJdBBXj2K
$ ipfs name publish QmfWkTLCx5aHouFzrC4cbbU9Efe9pJJYMLUUYjJdBBXj2K
>Published to k51qzi5uqu5dklydmy7y4npjqa7y7xyztehlv4ahbyus93ueoh7cwmdnd9dzf1: /ipfs/QmfWkTLCx5aHouFzrC4cbbU9Efe9pJJYMLUUYjJdBBXj2K
```
Then the two users modify json and submit ipfs, and the obtained hash is published to ipns at the same time.
Before ipfs name publish returns the result, visit /ipns/k51qzi5uqu5dklydmy7y4npjqa7y7xyztehlv4ahbyus93ueoh7cwmdnd9dzf1 and the result is'{ "Data": "abcde" }'. After a while, the result is'{"Data": "abcd"}'. Wait until all "ipfs name publish" is returned, and the next visit will return'{ "Data": "abcde" }'.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.