mirror of
https://github.com/ipfs/kubo.git
synced 2026-02-21 18:37:45 +08:00
chore: update to go1.21 for gateway over libp2p
This commit is contained in:
commit
3f33e61d3a
20
.github/workflows/build.yml
vendored
20
.github/workflows/build.yml
vendored
@ -10,7 +10,7 @@ on:
|
||||
- 'master'
|
||||
|
||||
env:
|
||||
GO_VERSION: 1.20.x
|
||||
GO_VERSION: 1.21.x
|
||||
|
||||
concurrency:
|
||||
group: ${{ github.workflow }}-${{ github.event_name }}-${{ github.event_name == 'push' && github.sha || github.ref }}
|
||||
@ -36,13 +36,10 @@ jobs:
|
||||
run:
|
||||
shell: bash
|
||||
steps:
|
||||
- uses: actions/setup-go@v3
|
||||
- uses: actions/setup-go@v4
|
||||
with:
|
||||
go-version: ${{ env.GO_VERSION }}
|
||||
- uses: actions/checkout@v3
|
||||
- uses: protocol/cache-go-action@v1
|
||||
with:
|
||||
name: ${{ github.job }}
|
||||
- uses: actions/checkout@v4
|
||||
- run: make build
|
||||
- uses: actions/upload-artifact@v3
|
||||
with:
|
||||
@ -76,7 +73,7 @@ jobs:
|
||||
restore-keys: ${{ runner.os }}-${{ github.job }}-${{ matrix.repo-to-test-against }}-
|
||||
- run: sudo apt update
|
||||
- run: sudo apt install -y libxkbcommon0 libxdamage1 libgbm1 libpango-1.0-0 libcairo2 # dependencies for playwright
|
||||
- uses: actions/checkout@v3
|
||||
- uses: actions/checkout@v4
|
||||
with:
|
||||
repository: ipfs/${{ matrix.repo-to-test-against }}
|
||||
fetch-depth: 0
|
||||
@ -118,7 +115,7 @@ jobs:
|
||||
run:
|
||||
shell: bash
|
||||
steps:
|
||||
- uses: actions/setup-go@v3
|
||||
- uses: actions/setup-go@v4
|
||||
with:
|
||||
go-version: ${{ env.GO_VERSION }}
|
||||
- uses: actions/download-artifact@v3
|
||||
@ -126,7 +123,7 @@ jobs:
|
||||
name: kubo
|
||||
path: cmd/ipfs
|
||||
- run: chmod +x cmd/ipfs/ipfs
|
||||
- uses: actions/checkout@v3
|
||||
- uses: actions/checkout@v4
|
||||
with:
|
||||
repository: ipfs/go-ipfs-api
|
||||
path: go-ipfs-api
|
||||
@ -136,9 +133,6 @@ jobs:
|
||||
sleep 1
|
||||
done
|
||||
timeout-minutes: 5
|
||||
- uses: protocol/cache-go-action@v1
|
||||
with:
|
||||
name: ${{ github.job }}
|
||||
- run: go test -count=1 -v ./...
|
||||
working-directory: go-ipfs-api
|
||||
- run: cmd/ipfs/ipfs shutdown
|
||||
@ -167,7 +161,7 @@ jobs:
|
||||
name: kubo
|
||||
path: cmd/ipfs
|
||||
- run: chmod +x cmd/ipfs/ipfs
|
||||
- uses: actions/checkout@v3
|
||||
- uses: actions/checkout@v4
|
||||
with:
|
||||
repository: ipfs/ipfs-webui
|
||||
path: ipfs-webui
|
||||
|
||||
2
.github/workflows/codeql-analysis.yml
vendored
2
.github/workflows/codeql-analysis.yml
vendored
@ -29,7 +29,7 @@ jobs:
|
||||
|
||||
steps:
|
||||
- name: Checkout repository
|
||||
uses: actions/checkout@v3
|
||||
uses: actions/checkout@v4
|
||||
|
||||
# Initializes the CodeQL tools for scanning.
|
||||
- name: Initialize CodeQL
|
||||
|
||||
6
.github/workflows/docker-build.yml
vendored
6
.github/workflows/docker-build.yml
vendored
@ -26,9 +26,9 @@ jobs:
|
||||
run:
|
||||
shell: bash
|
||||
steps:
|
||||
- uses: actions/setup-go@v3
|
||||
- uses: actions/setup-go@v4
|
||||
with:
|
||||
go-version: 1.20.x
|
||||
- uses: actions/checkout@v3
|
||||
go-version: 1.21.x
|
||||
- uses: actions/checkout@v4
|
||||
- run: docker build -t $IMAGE_NAME:$WIP_IMAGE_TAG .
|
||||
- run: docker run --rm $IMAGE_NAME:$WIP_IMAGE_TAG --version
|
||||
|
||||
2
.github/workflows/docker-image.yml
vendored
2
.github/workflows/docker-image.yml
vendored
@ -37,7 +37,7 @@ jobs:
|
||||
LEGACY_IMAGE_NAME: ipfs/go-ipfs
|
||||
steps:
|
||||
- name: Check out the repo
|
||||
uses: actions/checkout@v3
|
||||
uses: actions/checkout@v4
|
||||
|
||||
- name: Set up QEMU
|
||||
uses: docker/setup-qemu-action@v2
|
||||
|
||||
2
.github/workflows/gateway-conformance.yml
vendored
2
.github/workflows/gateway-conformance.yml
vendored
@ -49,7 +49,7 @@ jobs:
|
||||
- name: Setup Go
|
||||
uses: actions/setup-go@v4
|
||||
with:
|
||||
go-version: 1.20.x
|
||||
go-version: 1.21.x
|
||||
- uses: protocol/cache-go-action@v1
|
||||
with:
|
||||
name: ${{ github.job }}
|
||||
|
||||
9
.github/workflows/gobuild.yml
vendored
9
.github/workflows/gobuild.yml
vendored
@ -28,13 +28,10 @@ jobs:
|
||||
run:
|
||||
shell: bash
|
||||
steps:
|
||||
- uses: actions/setup-go@v3
|
||||
- uses: actions/setup-go@v4
|
||||
with:
|
||||
go-version: 1.20.x
|
||||
- uses: actions/checkout@v3
|
||||
- uses: protocol/cache-go-action@v1
|
||||
with:
|
||||
name: ${{ github.job }}
|
||||
go-version: 1.21.x
|
||||
- uses: actions/checkout@v4
|
||||
- run: make cmd/ipfs-try-build
|
||||
env:
|
||||
TEST_FUSE: 1
|
||||
|
||||
10
.github/workflows/golang-analysis.yml
vendored
10
.github/workflows/golang-analysis.yml
vendored
@ -22,14 +22,14 @@ jobs:
|
||||
runs-on: ubuntu-latest
|
||||
timeout-minutes: 10
|
||||
steps:
|
||||
- uses: actions/checkout@v3
|
||||
- uses: actions/checkout@v4
|
||||
with:
|
||||
submodules: recursive
|
||||
- uses: actions/setup-go@v2
|
||||
- uses: actions/setup-go@v4
|
||||
with:
|
||||
go-version: "1.20.x"
|
||||
go-version: "1.21.x"
|
||||
- name: Check that go.mod is tidy
|
||||
uses: protocol/multiple-go-modules@v1.2
|
||||
uses: protocol/multiple-go-modules@v1.4
|
||||
with:
|
||||
run: |
|
||||
go mod tidy
|
||||
@ -49,6 +49,6 @@ jobs:
|
||||
fi
|
||||
- name: go vet
|
||||
if: always() # run this step even if the previous one failed
|
||||
uses: protocol/multiple-go-modules@v1.2
|
||||
uses: protocol/multiple-go-modules@v1.4
|
||||
with:
|
||||
run: go vet ./...
|
||||
|
||||
9
.github/workflows/golint.yml
vendored
9
.github/workflows/golint.yml
vendored
@ -29,11 +29,8 @@ jobs:
|
||||
run:
|
||||
shell: bash
|
||||
steps:
|
||||
- uses: actions/setup-go@v3
|
||||
- uses: actions/setup-go@v4
|
||||
with:
|
||||
go-version: 1.20.x
|
||||
- uses: actions/checkout@v3
|
||||
- uses: protocol/cache-go-action@v1
|
||||
with:
|
||||
name: ${{ github.job }}
|
||||
go-version: 1.21.x
|
||||
- uses: actions/checkout@v4
|
||||
- run: make -O test_go_lint
|
||||
|
||||
10
.github/workflows/gotest.yml
vendored
10
.github/workflows/gotest.yml
vendored
@ -30,17 +30,13 @@ jobs:
|
||||
shell: bash
|
||||
steps:
|
||||
- name: Set up Go
|
||||
uses: actions/setup-go@v3
|
||||
uses: actions/setup-go@v4
|
||||
with:
|
||||
go-version: 1.20.x
|
||||
go-version: 1.21.x
|
||||
- name: Check out Kubo
|
||||
uses: actions/checkout@v3
|
||||
uses: actions/checkout@v4
|
||||
- name: Install missing tools
|
||||
run: sudo apt update && sudo apt install -y zsh
|
||||
- name: Restore Go cache
|
||||
uses: protocol/cache-go-action@v1
|
||||
with:
|
||||
name: ${{ github.job }}
|
||||
- name: 👉️ If this step failed, go to «Summary» (top left) → inspect the «Failures/Errors» table
|
||||
env:
|
||||
# increasing parallelism beyond 2 doesn't speed up the tests much
|
||||
|
||||
10
.github/workflows/sharness.yml
vendored
10
.github/workflows/sharness.yml
vendored
@ -23,19 +23,15 @@ jobs:
|
||||
shell: bash
|
||||
steps:
|
||||
- name: Setup Go
|
||||
uses: actions/setup-go@v3
|
||||
uses: actions/setup-go@v4
|
||||
with:
|
||||
go-version: 1.20.x
|
||||
go-version: 1.21.x
|
||||
- name: Checkout Kubo
|
||||
uses: actions/checkout@v3
|
||||
uses: actions/checkout@v4
|
||||
with:
|
||||
path: kubo
|
||||
- name: Install missing tools
|
||||
run: sudo apt update && sudo apt install -y socat net-tools fish libxml2-utils
|
||||
- name: Restore Go Cache
|
||||
uses: protocol/cache-go-action@v1
|
||||
with:
|
||||
name: ${{ github.job }}
|
||||
- uses: actions/cache@v3
|
||||
with:
|
||||
path: test/sharness/lib/dependencies
|
||||
|
||||
2
.github/workflows/sync-release-assets.yml
vendored
2
.github/workflows/sync-release-assets.yml
vendored
@ -22,7 +22,7 @@ jobs:
|
||||
- uses: ipfs/start-ipfs-daemon-action@v1
|
||||
with:
|
||||
args: --init --init-profile=flatfs,server --enable-gc=false
|
||||
- uses: actions/setup-node@v2
|
||||
- uses: actions/setup-node@v3
|
||||
with:
|
||||
node-version: 14
|
||||
- name: Sync the latest 5 github releases
|
||||
|
||||
@ -1,4 +1,4 @@
|
||||
FROM --platform=${BUILDPLATFORM:-linux/amd64} golang:1.20 AS builder
|
||||
FROM --platform=${BUILDPLATFORM:-linux/amd64} golang:1.21 AS builder
|
||||
|
||||
ARG TARGETOS TARGETARCH
|
||||
|
||||
|
||||
@ -17,7 +17,7 @@ func (api *DhtAPI) FindPeer(ctx context.Context, p peer.ID) (peer.AddrInfo, erro
|
||||
Type routing.QueryEventType
|
||||
Responses []peer.AddrInfo
|
||||
}
|
||||
resp, err := api.core().Request("dht/findpeer", p.Pretty()).Send(ctx)
|
||||
resp, err := api.core().Request("dht/findpeer", p.String()).Send(ctx)
|
||||
if err != nil {
|
||||
return peer.AddrInfo{}, err
|
||||
}
|
||||
|
||||
@ -14,7 +14,7 @@ import (
|
||||
type SwarmAPI HttpApi
|
||||
|
||||
func (api *SwarmAPI) Connect(ctx context.Context, pi peer.AddrInfo) error {
|
||||
pidma, err := multiaddr.NewComponent("p2p", pi.ID.Pretty())
|
||||
pidma, err := multiaddr.NewComponent("p2p", pi.ID.String())
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
@ -237,7 +237,7 @@ func CreateIdentity(out io.Writer, opts []options.KeyGenerateOption) (Identity,
|
||||
if err != nil {
|
||||
return ident, err
|
||||
}
|
||||
ident.PeerID = id.Pretty()
|
||||
ident.PeerID = id.String()
|
||||
fmt.Fprintf(out, "peer identity: %s\n", ident.PeerID)
|
||||
return ident, nil
|
||||
}
|
||||
|
||||
@ -234,10 +234,10 @@ Specification of CAR formats: https://ipld.io/specs/transport/car/
|
||||
|
||||
if event.Root.PinErrorMsg != "" {
|
||||
return fmt.Errorf("pinning root %q FAILED: %s", enc.Encode(event.Root.Cid), event.Root.PinErrorMsg)
|
||||
} else {
|
||||
event.Root.PinErrorMsg = "success"
|
||||
}
|
||||
|
||||
event.Root.PinErrorMsg = "success"
|
||||
|
||||
_, err = fmt.Fprintf(
|
||||
w,
|
||||
"Pinned root\t%s\t%s\n",
|
||||
|
||||
@ -14,12 +14,12 @@ func TestKeyTranslation(t *testing.T) {
|
||||
pkname := namesys.PkKeyForID(pid)
|
||||
ipnsname := ipns.NameFromPeer(pid).RoutingKey()
|
||||
|
||||
pkk, err := escapeDhtKey("/pk/" + pid.Pretty())
|
||||
pkk, err := escapeDhtKey("/pk/" + pid.String())
|
||||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
|
||||
ipnsk, err := escapeDhtKey("/ipns/" + pid.Pretty())
|
||||
ipnsk, err := escapeDhtKey("/ipns/" + pid.String())
|
||||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
|
||||
@ -93,7 +93,7 @@ Resolve the value of a dnslink:
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
name = self.ID().Pretty()
|
||||
name = self.ID().String()
|
||||
} else {
|
||||
name = req.Arguments[0]
|
||||
}
|
||||
|
||||
@ -79,7 +79,7 @@ trip latency information.
|
||||
if len(n.Peerstore.Addrs(pid)) == 0 {
|
||||
// Make sure we can find the node in question
|
||||
if err := res.Emit(&PingResult{
|
||||
Text: fmt.Sprintf("Looking up peer %s", pid.Pretty()),
|
||||
Text: fmt.Sprintf("Looking up peer %s", pid),
|
||||
Success: true,
|
||||
}); err != nil {
|
||||
return err
|
||||
@ -95,7 +95,7 @@ trip latency information.
|
||||
}
|
||||
|
||||
if err := res.Emit(&PingResult{
|
||||
Text: fmt.Sprintf("PING %s.", pid.Pretty()),
|
||||
Text: fmt.Sprintf("PING %s.", pid),
|
||||
Success: true,
|
||||
}); err != nil {
|
||||
return err
|
||||
|
||||
@ -110,7 +110,7 @@ TOPIC AND DATA ENCODING
|
||||
encoder, _ := mbase.EncoderByName("base64url")
|
||||
psm := pubsubMessage{
|
||||
Data: encoder.Encode(msg.Data()),
|
||||
From: msg.From().Pretty(),
|
||||
From: msg.From().String(),
|
||||
Seqno: encoder.Encode(msg.Seq()),
|
||||
}
|
||||
for _, topic := range msg.Topics() {
|
||||
@ -323,7 +323,7 @@ TOPIC AND DATA ENCODING
|
||||
list := &stringList{make([]string, 0, len(peers))}
|
||||
|
||||
for _, peer := range peers {
|
||||
list.Strings = append(list.Strings, peer.Pretty())
|
||||
list.Strings = append(list.Strings, peer.String())
|
||||
}
|
||||
sort.Strings(list.Strings)
|
||||
return cmds.EmitOnce(res, list)
|
||||
|
||||
@ -114,7 +114,7 @@ var findProvidersRoutingCmd = &cmds.Command{
|
||||
if verbose {
|
||||
fmt.Fprintf(out, "provider: ")
|
||||
}
|
||||
fmt.Fprintf(out, "%s\n", prov.ID.Pretty())
|
||||
fmt.Fprintf(out, "%s\n", prov.ID)
|
||||
if verbose {
|
||||
for _, a := range prov.Addrs {
|
||||
fmt.Fprintf(out, "\t%s\n", a)
|
||||
@ -479,7 +479,7 @@ identified by QmFoo.
|
||||
return nil
|
||||
},
|
||||
routing.Value: func(obj *routing.QueryEvent, out io.Writer, verbose bool) error {
|
||||
fmt.Fprintf(out, "%s\n", obj.ID.Pretty())
|
||||
fmt.Fprintf(out, "%s\n", obj.ID)
|
||||
return nil
|
||||
},
|
||||
}
|
||||
|
||||
@ -262,7 +262,7 @@ var swarmPeersCmd = &cmds.Command{
|
||||
for _, c := range conns {
|
||||
ci := connInfo{
|
||||
Addr: c.Address().String(),
|
||||
Peer: c.ID().Pretty(),
|
||||
Peer: c.ID().String(),
|
||||
}
|
||||
|
||||
if verbose || direction {
|
||||
@ -536,7 +536,7 @@ var swarmAddrsCmd = &cmds.Command{
|
||||
|
||||
out := make(map[string][]string)
|
||||
for p, paddrs := range addrs {
|
||||
s := p.Pretty()
|
||||
s := p.String()
|
||||
for _, a := range paddrs {
|
||||
out[s] = append(out[s], a.String())
|
||||
}
|
||||
@ -599,7 +599,7 @@ var swarmAddrsLocalCmd = &cmds.Command{
|
||||
for _, addr := range maddrs {
|
||||
saddr := addr.String()
|
||||
if showid {
|
||||
saddr = path.Join(saddr, p2pProtocolName, self.ID().Pretty())
|
||||
saddr = path.Join(saddr, p2pProtocolName, self.ID().String())
|
||||
}
|
||||
addrs = append(addrs, saddr)
|
||||
}
|
||||
@ -680,7 +680,7 @@ ipfs swarm connect /ip4/104.131.131.82/tcp/4001/p2p/QmaCpDMGvV2BGHeYERUEnRQAwe3N
|
||||
|
||||
output := make([]string, len(pis))
|
||||
for i, pi := range pis {
|
||||
output[i] = "connect " + pi.ID.Pretty()
|
||||
output[i] = "connect " + pi.ID.String()
|
||||
|
||||
err := api.Swarm().Connect(req.Context, pi)
|
||||
if err != nil {
|
||||
@ -745,7 +745,7 @@ it will reconnect.
|
||||
// a good backwards compat solution. Right now, I'm just
|
||||
// preserving the current behavior.
|
||||
for _, addr := range maddrs {
|
||||
msg := "disconnect " + ainfo.ID.Pretty()
|
||||
msg := "disconnect " + ainfo.ID.String()
|
||||
if err := api.Swarm().Disconnect(req.Context, addr); err != nil {
|
||||
msg += " failure: " + err.Error()
|
||||
} else {
|
||||
|
||||
@ -56,7 +56,7 @@ func (NodeProvider) MakeAPISwarm(t *testing.T, ctx context.Context, fullIdentity
|
||||
}
|
||||
|
||||
ident = config.Identity{
|
||||
PeerID: id.Pretty(),
|
||||
PeerID: id.String(),
|
||||
PrivKey: base64.StdEncoding.EncodeToString(kbytes),
|
||||
}
|
||||
} else {
|
||||
|
||||
@ -51,10 +51,9 @@ func TestCheckVersionOption(t *testing.T) {
|
||||
called = true
|
||||
if !tc.shouldHandle {
|
||||
t.Error("handler was called even though version didn't match")
|
||||
} else {
|
||||
if _, err := io.WriteString(w, "check!"); err != nil {
|
||||
t.Error(err)
|
||||
}
|
||||
}
|
||||
if _, err := io.WriteString(w, "check!"); err != nil {
|
||||
t.Error(err)
|
||||
}
|
||||
})
|
||||
|
||||
|
||||
@ -100,10 +100,9 @@ func (it *peerChanIter) Next() bool {
|
||||
if ok {
|
||||
it.next = &addr
|
||||
return true
|
||||
} else {
|
||||
it.next = nil
|
||||
return false
|
||||
}
|
||||
it.next = nil
|
||||
return false
|
||||
}
|
||||
|
||||
func (it *peerChanIter) Val() types.Record {
|
||||
|
||||
@ -1,11 +1,12 @@
|
||||
package corehttp
|
||||
|
||||
// TODO: move to IPNS
|
||||
const WebUIPath = "/ipfs/bafybeicyp7ssbnj3hdzehcibmapmpuc3atrsc4ch3q6acldfh4ojjdbcxe" // v4.0.2
|
||||
const WebUIPath = "/ipfs/bafybeieqdeoqkf7xf4aozd524qncgiloh33qgr25lyzrkusbcre4c3fxay" // v4.1.0
|
||||
|
||||
// WebUIPaths is a list of all past webUI paths.
|
||||
var WebUIPaths = []string{
|
||||
WebUIPath,
|
||||
"/ipfs/bafybeicyp7ssbnj3hdzehcibmapmpuc3atrsc4ch3q6acldfh4ojjdbcxe",
|
||||
"/ipfs/bafybeigs6d53gpgu34553mbi5bbkb26e4ikruoaaar75jpfdywpup2r3my",
|
||||
"/ipfs/bafybeic4gops3d3lyrisqku37uio33nvt6fqxvkxihrwlqsuvf76yln4fm",
|
||||
"/ipfs/bafybeifeqt7mvxaniphyu2i3qhovjaf3sayooxbh5enfdqtiehxjv2ldte",
|
||||
|
||||
@ -141,7 +141,7 @@ func defaultRepo(dstore repo.Datastore) (repo.Repo, error) {
|
||||
|
||||
c.Bootstrap = cfg.DefaultBootstrapAddresses
|
||||
c.Addresses.Swarm = []string{"/ip4/0.0.0.0/tcp/4001", "/ip4/0.0.0.0/udp/4001/quic-v1"}
|
||||
c.Identity.PeerID = pid.Pretty()
|
||||
c.Identity.PeerID = pid.String()
|
||||
c.Identity.PrivKey = base64.StdEncoding.EncodeToString(privkeyb)
|
||||
|
||||
return &repo.Mock{
|
||||
|
||||
@ -17,7 +17,7 @@ var DefaultHostOption HostOption = constructPeerHost
|
||||
func constructPeerHost(id peer.ID, ps peerstore.Peerstore, options ...libp2p.Option) (host.Host, error) {
|
||||
pkey := ps.PrivKey(id)
|
||||
if pkey == nil {
|
||||
return nil, fmt.Errorf("missing private key for node ID: %s", id.Pretty())
|
||||
return nil, fmt.Errorf("missing private key for node ID: %s", id)
|
||||
}
|
||||
options = append([]libp2p.Option{libp2p.Identity(pkey), libp2p.Peerstore(ps)}, options...)
|
||||
return libp2p.New(options...)
|
||||
|
||||
@ -360,7 +360,7 @@ func LimitConfigsToInfo(stats LimitsConfigAndUsage) ResourceInfos {
|
||||
|
||||
for i, p := range stats.Peers {
|
||||
result = append(result, resourceLimitsAndUsageToResourceInfo(
|
||||
config.ResourceMgrPeerScopePrefix+i.Pretty(),
|
||||
config.ResourceMgrPeerScopePrefix+i.String(),
|
||||
p,
|
||||
)...)
|
||||
}
|
||||
|
||||
@ -38,17 +38,16 @@ func makeSmuxTransportOption(tptConfig config.Transports) (libp2p.Option, error)
|
||||
}
|
||||
}
|
||||
return libp2p.ChainOptions(opts...), nil
|
||||
} else {
|
||||
return prioritizeOptions([]priorityOption{{
|
||||
priority: tptConfig.Multiplexers.Yamux,
|
||||
defaultPriority: 100,
|
||||
opt: libp2p.Muxer(yamux.ID, yamux.DefaultTransport),
|
||||
}, {
|
||||
priority: tptConfig.Multiplexers.Mplex,
|
||||
defaultPriority: config.Disabled,
|
||||
opt: libp2p.Muxer(mplex.ID, mplex.DefaultTransport),
|
||||
}}), nil
|
||||
}
|
||||
return prioritizeOptions([]priorityOption{{
|
||||
priority: tptConfig.Multiplexers.Yamux,
|
||||
defaultPriority: 100,
|
||||
opt: libp2p.Muxer(yamux.ID, yamux.DefaultTransport),
|
||||
}, {
|
||||
priority: tptConfig.Multiplexers.Mplex,
|
||||
defaultPriority: config.Disabled,
|
||||
opt: libp2p.Muxer(mplex.ID, mplex.DefaultTransport),
|
||||
}}), nil
|
||||
}
|
||||
|
||||
func SmuxTransport(tptConfig config.Transports) func() (opts Libp2pOpts, err error) {
|
||||
|
||||
@ -46,7 +46,8 @@ by passing `--v1compat=false`. By default, we still create V1+V2 records, such
|
||||
that there is the highest chance of backwards compatibility. The goal is to move
|
||||
to V2 only in the future.
|
||||
|
||||
**TODO**: add links to IPIP https://github.com/ipfs/specs/issues/376
|
||||
For more details, see [IPIP-428](https://specs.ipfs.tech/ipips/ipip-0428/)
|
||||
and the updated [IPNS Record Verification](https://specs.ipfs.tech/ipns/ipns-record/#record-verification) logic.
|
||||
|
||||
#### IPNS name resolution has been fixed
|
||||
|
||||
|
||||
@ -7,7 +7,7 @@ go 1.20
|
||||
replace github.com/ipfs/kubo => ./../../..
|
||||
|
||||
require (
|
||||
github.com/ipfs/boxo v0.12.1-0.20230825151903-13569468babd
|
||||
github.com/ipfs/boxo v0.13.0
|
||||
github.com/ipfs/kubo v0.0.0-00010101000000-000000000000
|
||||
github.com/libp2p/go-libp2p v0.31.0
|
||||
github.com/multiformats/go-multiaddr v0.11.0
|
||||
|
||||
@ -300,8 +300,8 @@ github.com/ianlancetaylor/demangle v0.0.0-20181102032728-5e5cf60278f6/go.mod h1:
|
||||
github.com/inconshreveable/mousetrap v1.0.0/go.mod h1:PxqpIevigyE2G7u3NXJIT2ANytuPF1OarO4DADm73n8=
|
||||
github.com/ipfs/bbloom v0.0.4 h1:Gi+8EGJ2y5qiD5FbsbpX/TMNcJw8gSqr7eyjHa4Fhvs=
|
||||
github.com/ipfs/bbloom v0.0.4/go.mod h1:cS9YprKXpoZ9lT0n/Mw/a6/aFV6DTjTLYHeA+gyqMG0=
|
||||
github.com/ipfs/boxo v0.12.1-0.20230825151903-13569468babd h1:uAp9W7FRQ7W16FENlURZqBh7/3PnakG0DjHpKPirKVY=
|
||||
github.com/ipfs/boxo v0.12.1-0.20230825151903-13569468babd/go.mod h1:btrtHy0lmO1ODMECbbEY1pxNtrLilvKSYLoGQt1yYCk=
|
||||
github.com/ipfs/boxo v0.13.0 h1:uzCQekieYS4PysbYYdodNmKLuqOdLjlUziXVZ19oDeQ=
|
||||
github.com/ipfs/boxo v0.13.0/go.mod h1:btrtHy0lmO1ODMECbbEY1pxNtrLilvKSYLoGQt1yYCk=
|
||||
github.com/ipfs/go-bitfield v1.1.0 h1:fh7FIo8bSwaJEh6DdTWbCeZ1eqOaOkKFI74SCnsWbGA=
|
||||
github.com/ipfs/go-bitfield v1.1.0/go.mod h1:paqf1wjq/D2BBmzfTVFlJQ9IlFOZpg422HL0HqsGWHU=
|
||||
github.com/ipfs/go-block-format v0.0.2/go.mod h1:AWR46JfpcObNfg3ok2JHDUfdiHRgWhJgCQF+KIgOPJY=
|
||||
|
||||
@ -151,7 +151,7 @@ func TestIpnsLocalLink(t *testing.T) {
|
||||
t.Fatal(err)
|
||||
}
|
||||
|
||||
if linksto != nd.Identity.Pretty() {
|
||||
if linksto != nd.Identity.String() {
|
||||
t.Fatal("Link invalid")
|
||||
}
|
||||
}
|
||||
@ -176,7 +176,7 @@ func TestIpnsBasicIO(t *testing.T) {
|
||||
t.Fatal("Incorrect Read!")
|
||||
}
|
||||
|
||||
fname2 := mnt.Dir + "/" + nd.Identity.Pretty() + "/testfile"
|
||||
fname2 := mnt.Dir + "/" + nd.Identity.String() + "/testfile"
|
||||
rbuf, err = os.ReadFile(fname2)
|
||||
if err != nil {
|
||||
t.Fatal(err)
|
||||
|
||||
@ -220,7 +220,7 @@ func (r *Root) ReadDirAll(ctx context.Context) ([]fuse.Dirent, error) {
|
||||
listing := make([]fuse.Dirent, 0, len(r.Keys)*2)
|
||||
for alias, k := range r.Keys {
|
||||
ent := fuse.Dirent{
|
||||
Name: k.ID().Pretty(),
|
||||
Name: k.ID().String(),
|
||||
Type: fuse.DT_Dir,
|
||||
}
|
||||
link := fuse.Dirent{
|
||||
|
||||
@ -141,9 +141,8 @@ func darwinFuseCheckVersion(node *core.IpfsNode) error {
|
||||
return err
|
||||
} else if skip {
|
||||
return nil // user told us not to check version... ok....
|
||||
} else {
|
||||
return errGFV
|
||||
}
|
||||
return errGFV
|
||||
}
|
||||
|
||||
log.Debug("mount: osxfuse version:", ov)
|
||||
|
||||
@ -284,7 +284,7 @@ func (s *Node) Read(ctx context.Context, req *fuse.ReadRequest, resp *fuse.ReadR
|
||||
return nil // may be non-nil / not succeeded
|
||||
}
|
||||
|
||||
// to check that out Node implements all the interfaces we want.
|
||||
// to check that our Node implements all the interfaces we want.
|
||||
type roRoot interface {
|
||||
fs.Node
|
||||
fs.HandleReadDirAller
|
||||
|
||||
2
go.mod
2
go.mod
@ -15,7 +15,7 @@ require (
|
||||
github.com/fsnotify/fsnotify v1.6.0
|
||||
github.com/google/uuid v1.3.0
|
||||
github.com/hashicorp/go-multierror v1.1.1
|
||||
github.com/ipfs/boxo v0.12.1-0.20230825151903-13569468babd
|
||||
github.com/ipfs/boxo v0.13.0
|
||||
github.com/ipfs/go-block-format v0.1.2
|
||||
github.com/ipfs/go-cid v0.4.1
|
||||
github.com/ipfs/go-cidutil v0.1.0
|
||||
|
||||
4
go.sum
4
go.sum
@ -335,8 +335,8 @@ github.com/ianlancetaylor/demangle v0.0.0-20181102032728-5e5cf60278f6/go.mod h1:
|
||||
github.com/inconshreveable/mousetrap v1.0.0/go.mod h1:PxqpIevigyE2G7u3NXJIT2ANytuPF1OarO4DADm73n8=
|
||||
github.com/ipfs/bbloom v0.0.4 h1:Gi+8EGJ2y5qiD5FbsbpX/TMNcJw8gSqr7eyjHa4Fhvs=
|
||||
github.com/ipfs/bbloom v0.0.4/go.mod h1:cS9YprKXpoZ9lT0n/Mw/a6/aFV6DTjTLYHeA+gyqMG0=
|
||||
github.com/ipfs/boxo v0.12.1-0.20230825151903-13569468babd h1:uAp9W7FRQ7W16FENlURZqBh7/3PnakG0DjHpKPirKVY=
|
||||
github.com/ipfs/boxo v0.12.1-0.20230825151903-13569468babd/go.mod h1:btrtHy0lmO1ODMECbbEY1pxNtrLilvKSYLoGQt1yYCk=
|
||||
github.com/ipfs/boxo v0.13.0 h1:uzCQekieYS4PysbYYdodNmKLuqOdLjlUziXVZ19oDeQ=
|
||||
github.com/ipfs/boxo v0.13.0/go.mod h1:btrtHy0lmO1ODMECbbEY1pxNtrLilvKSYLoGQt1yYCk=
|
||||
github.com/ipfs/go-bitfield v1.1.0 h1:fh7FIo8bSwaJEh6DdTWbCeZ1eqOaOkKFI74SCnsWbGA=
|
||||
github.com/ipfs/go-bitfield v1.1.0/go.mod h1:paqf1wjq/D2BBmzfTVFlJQ9IlFOZpg422HL0HqsGWHU=
|
||||
github.com/ipfs/go-bitswap v0.11.0 h1:j1WVvhDX1yhG32NTC9xfxnqycqYIlhzEzLXG/cU1HyQ=
|
||||
|
||||
@ -76,7 +76,7 @@ func (l *localListener) setupStream(local manet.Conn) {
|
||||
remote, err := l.dial(l.ctx)
|
||||
if err != nil {
|
||||
local.Close()
|
||||
log.Warnf("failed to dial to remote %s/%s", l.peer.Pretty(), l.proto)
|
||||
log.Warnf("failed to dial to remote %s/%s", l.peer, l.proto)
|
||||
return
|
||||
}
|
||||
|
||||
@ -109,7 +109,7 @@ func (l *localListener) ListenAddress() ma.Multiaddr {
|
||||
}
|
||||
|
||||
func (l *localListener) TargetAddress() ma.Multiaddr {
|
||||
addr, err := ma.NewMultiaddr(maPrefix + l.peer.Pretty())
|
||||
addr, err := ma.NewMultiaddr(maPrefix + l.peer.String())
|
||||
if err != nil {
|
||||
panic(err)
|
||||
}
|
||||
|
||||
@ -55,13 +55,13 @@ func (l *remoteListener) handleStream(remote net.Stream) {
|
||||
peer := remote.Conn().RemotePeer()
|
||||
|
||||
if l.reportRemote {
|
||||
if _, err := fmt.Fprintf(local, "%s\n", peer.Pretty()); err != nil {
|
||||
if _, err := fmt.Fprintf(local, "%s\n", peer); err != nil {
|
||||
_ = remote.Reset()
|
||||
return
|
||||
}
|
||||
}
|
||||
|
||||
peerMa, err := ma.NewMultiaddr(maPrefix + peer.Pretty())
|
||||
peerMa, err := ma.NewMultiaddr(maPrefix + peer.String())
|
||||
if err != nil {
|
||||
_ = remote.Reset()
|
||||
return
|
||||
@ -88,7 +88,7 @@ func (l *remoteListener) Protocol() protocol.ID {
|
||||
}
|
||||
|
||||
func (l *remoteListener) ListenAddress() ma.Multiaddr {
|
||||
addr, err := ma.NewMultiaddr(maPrefix + l.p2p.identity.Pretty())
|
||||
addr, err := ma.NewMultiaddr(maPrefix + l.p2p.identity.String())
|
||||
if err != nil {
|
||||
panic(err)
|
||||
}
|
||||
|
||||
@ -148,7 +148,7 @@ func (pl *peerLogPlugin) collectEvents(node *core.IpfsNode) {
|
||||
case e = <-pl.events:
|
||||
}
|
||||
|
||||
peerID := zap.String("peer", e.peer.Pretty())
|
||||
peerID := zap.String("peer", e.peer.String())
|
||||
|
||||
switch e.kind {
|
||||
case eventConnect:
|
||||
|
||||
@ -37,7 +37,7 @@ const LockFile = "repo.lock"
|
||||
var log = logging.Logger("fsrepo")
|
||||
|
||||
// RepoVersion is the version number that we are currently expecting to see.
|
||||
var RepoVersion = 14
|
||||
var RepoVersion = 15
|
||||
|
||||
var migrationInstructions = `See https://github.com/ipfs/fs-repo-migrations/blob/master/run.md
|
||||
Sorry for the inconvenience. In the future, these will run automatically.`
|
||||
|
||||
@ -11,7 +11,7 @@ import (
|
||||
|
||||
const (
|
||||
// Current distribution to fetch migrations from.
|
||||
CurrentIpfsDist = "/ipfs/QmYerugGRCZWA8yQMKDsd9daEVXUR3C5nuw3VXuX1mggHa" // fs-repo-13-to-14 v1.0.0
|
||||
CurrentIpfsDist = "/ipfs/QmZPedUiZNe6Gq9oDvoizuuCMVoeb7shwq9xKhysq7exMo" // fs-repo-14-to-15 v1.0.1
|
||||
// Latest distribution path. Default for fetchers.
|
||||
LatestIpfsDist = "/ipns/dist.ipfs.tech"
|
||||
|
||||
|
||||
@ -7,7 +7,7 @@ replace github.com/ipfs/kubo => ../../
|
||||
require (
|
||||
github.com/Kubuxu/gocovmerge v0.0.0-20161216165753-7ecaa51963cd
|
||||
github.com/golangci/golangci-lint v1.54.1
|
||||
github.com/ipfs/boxo v0.12.1-0.20230825151903-13569468babd
|
||||
github.com/ipfs/boxo v0.13.0
|
||||
github.com/ipfs/go-cid v0.4.1
|
||||
github.com/ipfs/go-cidutil v0.1.0
|
||||
github.com/ipfs/go-datastore v0.6.0
|
||||
|
||||
@ -396,8 +396,8 @@ github.com/inconshreveable/mousetrap v1.1.0 h1:wN+x4NVGpMsO7ErUn/mUI3vEoE6Jt13X2
|
||||
github.com/inconshreveable/mousetrap v1.1.0/go.mod h1:vpF70FUmC8bwa3OWnCshd2FqLfsEA9PFc4w1p2J65bw=
|
||||
github.com/ipfs/bbloom v0.0.4 h1:Gi+8EGJ2y5qiD5FbsbpX/TMNcJw8gSqr7eyjHa4Fhvs=
|
||||
github.com/ipfs/bbloom v0.0.4/go.mod h1:cS9YprKXpoZ9lT0n/Mw/a6/aFV6DTjTLYHeA+gyqMG0=
|
||||
github.com/ipfs/boxo v0.12.1-0.20230825151903-13569468babd h1:uAp9W7FRQ7W16FENlURZqBh7/3PnakG0DjHpKPirKVY=
|
||||
github.com/ipfs/boxo v0.12.1-0.20230825151903-13569468babd/go.mod h1:btrtHy0lmO1ODMECbbEY1pxNtrLilvKSYLoGQt1yYCk=
|
||||
github.com/ipfs/boxo v0.13.0 h1:uzCQekieYS4PysbYYdodNmKLuqOdLjlUziXVZ19oDeQ=
|
||||
github.com/ipfs/boxo v0.13.0/go.mod h1:btrtHy0lmO1ODMECbbEY1pxNtrLilvKSYLoGQt1yYCk=
|
||||
github.com/ipfs/go-bitfield v1.1.0 h1:fh7FIo8bSwaJEh6DdTWbCeZ1eqOaOkKFI74SCnsWbGA=
|
||||
github.com/ipfs/go-bitfield v1.1.0/go.mod h1:paqf1wjq/D2BBmzfTVFlJQ9IlFOZpg422HL0HqsGWHU=
|
||||
github.com/ipfs/go-block-format v0.1.2 h1:GAjkfhVx1f4YTODS6Esrj1wt2HhrtwTnhEr+DyPUaJo=
|
||||
|
||||
Loading…
Reference in New Issue
Block a user