From 44c1a5b0a64e87f8b112bc06c44f22e9fffcc1b6 Mon Sep 17 00:00:00 2001 From: marston Date: Mon, 9 Sep 2024 15:57:24 -0400 Subject: [PATCH 01/12] adding better IPFS folder support --- api/file_handler.go | 21 +++++++++++++-------- api/types/responses.go | 3 ++- file_system/file_system.go | 34 +++++++++++++++++++++------------- 3 files changed, 36 insertions(+), 22 deletions(-) diff --git a/api/file_handler.go b/api/file_handler.go index fed090a..6097c5b 100644 --- a/api/file_handler.go +++ b/api/file_handler.go @@ -7,7 +7,6 @@ import ( "io" "net/http" "strconv" - "strings" "time" "github.com/ipfs/go-cid" @@ -138,19 +137,24 @@ func PostIPFSFolder(f *file_system.FileSystem) func(http.ResponseWriter, *http.R } defer req.Body.Close() - cidList := strings.Split(string(body), ",") + var cidList map[string]string - childCIDs := make([]cid.Cid, len(cidList)) - - fmt.Println(cidList) + err = json.Unmarshal(body, &cidList) + if err != nil { + if err != nil { + http.Error(w, "Error parsing request body", http.StatusInternalServerError) + return + } + } - for i, s := range cidList { + childCIDs := make(map[string]cid.Cid) + for key, s := range cidList { c, err := cid.Parse(s) if err != nil { http.Error(w, fmt.Sprintf("Could not parse %s", s), http.StatusInternalServerError) return } - childCIDs[i] = c + childCIDs[key] = c } root, err := f.CreateIPFSFolder(childCIDs) @@ -160,7 +164,8 @@ func PostIPFSFolder(f *file_system.FileSystem) func(http.ResponseWriter, *http.R } f := types.CidFolderResponse{ - Cid: root, + Cid: root.Cid().String(), + Data: root.RawData(), } err = json.NewEncoder(w).Encode(f) diff --git a/api/types/responses.go b/api/types/responses.go index 1b9ab13..22d7251 100644 --- a/api/types/responses.go +++ b/api/types/responses.go @@ -65,7 +65,8 @@ type CidResponse struct { } type CidFolderResponse struct { - Cid string `json:"cid"` + Cid string `json:"cid"` + Data []byte `json:"data"` } type CidMapResponse struct { diff --git a/file_system/file_system.go b/file_system/file_system.go index d814301..4220cc1 100644 --- a/file_system/file_system.go +++ b/file_system/file_system.go @@ -116,31 +116,39 @@ func (f *FileSystem) WriteFile(reader io.Reader, merkle []byte, owner string, st return size, n.Cid().String(), nil } -func (f *FileSystem) CreateIPFSFolder(childCIDs []cid.Cid) (cidRes string, err error) { +func (f *FileSystem) CreateIPFSFolder(childCIDs map[string]cid.Cid) (node ipldFormat.Node, err error) { + n, err := f.GenIPFSFolderData(childCIDs) + if err != nil { + return nil, err + } + + // Add the folder node to the DAG service + err = f.ipfs.Add(context.Background(), n) + if err != nil { + return nil, err + } + + return n, nil +} + +func (f *FileSystem) GenIPFSFolderData(childCIDs map[string]cid.Cid) (node ipldFormat.Node, err error) { folderNode := unixfs.EmptyDirNode() - for i, childCID := range childCIDs { + for key, childCID := range childCIDs { // Create a link - linkName := fmt.Sprintf("%d", i) link := &ipldFormat.Link{ - Name: linkName, + Name: key, Cid: childCID, } // Add the link to the folder node - err := folderNode.AddRawLink(linkName, link) + err := folderNode.AddRawLink(key, link) if err != nil { - return "", err + return nil, err } } - // Add the folder node to the DAG service - err = f.ipfs.Add(context.Background(), folderNode) - if err != nil { - return "", err - } - - return folderNode.Cid().String(), nil + return folderNode, nil } func (f *FileSystem) DeleteFile(merkle []byte, owner string, start int64) error { From 09bb848e278f8f3b0a1d86b0da41054ac1b70e42 Mon Sep 17 00:00:00 2001 From: marston Date: Mon, 9 Sep 2024 16:53:13 -0400 Subject: [PATCH 02/12] adding secondary proof type for IPFS folders --- api/file_handler.go | 12 +++++++++++- file_system/file_system.go | 19 +++++++++++++++---- file_system/file_system_test.go | 8 ++++---- network/downloads.go | 8 ++++---- recycle/recycle.go | 2 +- strays/hands.go | 3 ++- 6 files changed, 37 insertions(+), 15 deletions(-) diff --git a/api/file_handler.go b/api/file_handler.go index 6097c5b..4884778 100644 --- a/api/file_handler.go +++ b/api/file_handler.go @@ -58,6 +58,16 @@ func PostFileHandler(fio *file_system.FileSystem, prover *proofs.Prover, wl *wal return } + proofTypeString := req.Form.Get("start") + if len(proofTypeString) == 0 { + proofTypeString = "0" + } + proofType, err := strconv.ParseInt(proofTypeString, 10, 64) + if err != nil { + handleErr(fmt.Errorf("cannot parse proof type: %w", err), w, http.StatusBadRequest) + return + } + file, fh, err := req.FormFile("file") // Retrieve the file from form data if err != nil { handleErr(fmt.Errorf("cannot get file from form: %w", err), w, http.StatusBadRequest) @@ -101,7 +111,7 @@ func PostFileHandler(fio *file_system.FileSystem, prover *proofs.Prover, wl *wal } } - size, c, err := fio.WriteFile(file, merkle, sender, startBlock, wl.AccAddress(), chunkSize) + size, c, err := fio.WriteFile(file, merkle, sender, startBlock, wl.AccAddress(), chunkSize, proofType) if err != nil { handleErr(fmt.Errorf("failed to write file to disk: %w", err), w, http.StatusInternalServerError) return diff --git a/file_system/file_system.go b/file_system/file_system.go index 4220cc1..6b4922c 100644 --- a/file_system/file_system.go +++ b/file_system/file_system.go @@ -73,7 +73,7 @@ func BuildTree(buf io.Reader, chunkSize int64) ([]byte, []byte, [][]byte, int, e return r, exportedTree, chunks, size, nil } -func (f *FileSystem) WriteFile(reader io.Reader, merkle []byte, owner string, start int64, address string, chunkSize int64) (size int, cid string, err error) { +func (f *FileSystem) WriteFile(reader io.Reader, merkle []byte, owner string, start int64, address string, chunkSize int64, proofType int64) (size int, cid string, err error) { log.Info().Msg(fmt.Sprintf("Writing %x to disk", merkle)) root, exportedTree, chunks, s, err := BuildTree(reader, chunkSize) if err != nil { @@ -91,9 +91,20 @@ func (f *FileSystem) WriteFile(reader io.Reader, merkle []byte, owner string, st } buf := bytes.NewBuffer(b) - n, err := f.ipfs.AddFile(context.Background(), buf, nil) - if err != nil { - return 0, "", err + var n ipldFormat.Node + if proofType == 1 { + folderNode := unixfs.EmptyDirNode() + folderNode.SetData(buf.Bytes()) + err := f.ipfs.Add(context.Background(), folderNode) + if err != nil { + return 0, "", err + } + n = folderNode + } else { + n, err = f.ipfs.AddFile(context.Background(), buf, nil) + if err != nil { + return 0, "", err + } } err = f.db.Update(func(txn *badger.Txn) error { diff --git a/file_system/file_system_test.go b/file_system/file_system_test.go index 3bae0df..b3c4bd8 100644 --- a/file_system/file_system_test.go +++ b/file_system/file_system_test.go @@ -74,7 +74,7 @@ func BenchmarkFileWrites(b *testing.B) { root, _, _, _, err := BuildTree(buf2, 10240) require.NoError(b, err) - _, _, err = f.WriteFile(buf, root, "file_owner", 0, "myself", 10240) + _, _, err = f.WriteFile(buf, root, "file_owner", 0, "myself", 10240, 0) require.NoError(b, err) } @@ -104,7 +104,7 @@ func TestWriteFile(t *testing.T) { m, err := hex.DecodeString(merkle) require.NoError(t, err) - size, _, err := f.WriteFile(buf, m, "file_owner", 0, "myself", 1024) + size, _, err := f.WriteFile(buf, m, "file_owner", 0, "myself", 1024, 0) require.NoError(t, err) @@ -150,7 +150,7 @@ func TestWriteFileWithDomain(t *testing.T) { m, err := hex.DecodeString(merkle) require.NoError(t, err) - size, _, err := f.WriteFile(buf, m, "file_owner", 0, "myself", 1024) + size, _, err := f.WriteFile(buf, m, "file_owner", 0, "myself", 1024, 0) require.NoError(t, err) @@ -209,7 +209,7 @@ func TestWriteAndProveFiles(t *testing.T) { owner := "file_owner" var start int64 = 0 - _, _, err = f.WriteFile(b2, root, owner, start, "myself", chunkSize) + _, _, err = f.WriteFile(b2, root, owner, start, "myself", chunkSize, 0) require.NoError(t, err) ms, _, _, err := f.ListFiles() diff --git a/network/downloads.go b/network/downloads.go index 946c32d..3aa3881 100644 --- a/network/downloads.go +++ b/network/downloads.go @@ -13,7 +13,7 @@ import ( "github.com/rs/zerolog/log" ) -func DownloadFile(f *file_system.FileSystem, merkle []byte, owner string, start int64, wallet *wallet.Wallet, fileSize int64, myUrl string, chunkSize int64) error { +func DownloadFile(f *file_system.FileSystem, merkle []byte, owner string, start int64, wallet *wallet.Wallet, fileSize int64, myUrl string, chunkSize int64, proofType int64) error { queryParams := &types.QueryFindFile{ Merkle: merkle, } @@ -37,7 +37,7 @@ func DownloadFile(f *file_system.FileSystem, merkle []byte, owner string, start continue } - size, err := DownloadFileFromURL(f, url, merkle, owner, start, wallet.AccAddress(), chunkSize) + size, err := DownloadFileFromURL(f, url, merkle, owner, start, wallet.AccAddress(), chunkSize, proofType) if err != nil { log.Info().Msg(fmt.Sprintf("Couldn't get %x from %s, trying again...", merkle, url)) continue @@ -58,7 +58,7 @@ func DownloadFile(f *file_system.FileSystem, merkle []byte, owner string, start return nil } -func DownloadFileFromURL(f *file_system.FileSystem, url string, merkle []byte, owner string, start int64, address string, chunkSize int64) (int, error) { +func DownloadFileFromURL(f *file_system.FileSystem, url string, merkle []byte, owner string, start int64, address string, chunkSize int64, proofType int64) (int, error) { log.Info().Msg(fmt.Sprintf("Downloading %x from %s...", merkle, url)) cli := http.Client{} req, err := http.NewRequest("GET", fmt.Sprintf("%s/download/%x", url, merkle), nil) @@ -93,7 +93,7 @@ func DownloadFileFromURL(f *file_system.FileSystem, url string, merkle []byte, o reader := bytes.NewReader(buff.Bytes()) - size, _, err := f.WriteFile(reader, merkle, owner, start, address, chunkSize) + size, _, err := f.WriteFile(reader, merkle, owner, start, address, chunkSize, proofType) if err != nil { return 0, err } diff --git a/recycle/recycle.go b/recycle/recycle.go index 3ec547c..3af875a 100644 --- a/recycle/recycle.go +++ b/recycle/recycle.go @@ -198,7 +198,7 @@ func (r *RecycleDepot) activateFile(openFile types.UnifiedFile) (size int, cid s openFile.Owner, openFile.Start, "", - r.chunkSize) + r.chunkSize, 0) if err != nil { return 0, "", fmt.Errorf("could not write file | %w", err) } diff --git a/strays/hands.go b/strays/hands.go index e510758..87674b7 100644 --- a/strays/hands.go +++ b/strays/hands.go @@ -37,8 +37,9 @@ func (h *Hand) Start(f *file_system.FileSystem, wallet *wallet.Wallet, myUrl str signee := h.stray.Owner merkle := h.stray.Merkle start := h.stray.Start + proofType := h.stray.ProofType - err := network.DownloadFile(f, merkle, signee, start, wallet, h.stray.FileSize, myUrl, chunkSize) + err := network.DownloadFile(f, merkle, signee, start, wallet, h.stray.FileSize, myUrl, chunkSize, proofType) if err != nil { log.Error().Err(err) h.stray = nil From f896454ea0a2697b4471a627e3275a9c7c95b090 Mon Sep 17 00:00:00 2001 From: marston Date: Mon, 9 Sep 2024 18:29:39 -0400 Subject: [PATCH 03/12] fix type string --- api/file_handler.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/api/file_handler.go b/api/file_handler.go index 4884778..0e99ae8 100644 --- a/api/file_handler.go +++ b/api/file_handler.go @@ -58,7 +58,7 @@ func PostFileHandler(fio *file_system.FileSystem, prover *proofs.Prover, wl *wal return } - proofTypeString := req.Form.Get("start") + proofTypeString := req.Form.Get("type") if len(proofTypeString) == 0 { proofTypeString = "0" } From b540f3dbdbcf99cdcca4798746a82747be0dbeac Mon Sep 17 00:00:00 2001 From: marston Date: Tue, 10 Sep 2024 22:56:11 -0400 Subject: [PATCH 04/12] json nodes --- file_system/file_system.go | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/file_system/file_system.go b/file_system/file_system.go index 6b4922c..8dd3b8c 100644 --- a/file_system/file_system.go +++ b/file_system/file_system.go @@ -94,8 +94,12 @@ func (f *FileSystem) WriteFile(reader io.Reader, merkle []byte, owner string, st var n ipldFormat.Node if proofType == 1 { folderNode := unixfs.EmptyDirNode() - folderNode.SetData(buf.Bytes()) - err := f.ipfs.Add(context.Background(), folderNode) + err := folderNode.UnmarshalJSON(buf.Bytes()) + if err != nil { + return 0, "", err + } + + err = f.ipfs.Add(context.Background(), folderNode) if err != nil { return 0, "", err } From a47b6fa2ec655f1f8f2cd814ef282778ec13de59 Mon Sep 17 00:00:00 2001 From: marston Date: Tue, 10 Sep 2024 23:17:17 -0400 Subject: [PATCH 05/12] support for different proofs --- file_system/file_system.go | 23 +++++++++++++++++++---- file_system/file_system_test.go | 2 +- proofs/proofs.go | 6 +++--- proofs/types.go | 2 +- strays/hands.go | 2 +- 5 files changed, 25 insertions(+), 10 deletions(-) diff --git a/file_system/file_system.go b/file_system/file_system.go index 8dd3b8c..9782d7e 100644 --- a/file_system/file_system.go +++ b/file_system/file_system.go @@ -9,6 +9,8 @@ import ( "fmt" "io" + "github.com/ipfs/boxo/ipld/merkledag" + "github.com/ipfs/boxo/ipld/unixfs" "github.com/dgraph-io/badger/v4" @@ -304,7 +306,7 @@ func (f *FileSystem) Dump() (map[string]string, error) { return files, err } -func (f *FileSystem) GetFileTreeByChunk(merkle []byte, owner string, start int64, chunkToLoad int, chunkSize int) (*merkletree.MerkleTree, []byte, error) { +func (f *FileSystem) GetFileTreeByChunk(merkle []byte, owner string, start int64, chunkToLoad int, chunkSize int, proofType int64) (*merkletree.MerkleTree, []byte, error) { tree := treeKey(merkle, owner, start) var newTree merkletree.MerkleTree @@ -353,9 +355,22 @@ func (f *FileSystem) GetFileTreeByChunk(merkle []byte, owner string, start int64 return nil, nil, fmt.Errorf("failed to decode cid: %s | %w", fcid, err) } - chunkOut, err := f.ipfs.GetFileChunk(context.Background(), c, chunkToLoad, chunkSize) - if err != nil { - return nil, nil, fmt.Errorf("failed to get chunk from unixfs %w", err) + var chunkOut []byte + if proofType == 1 { + n, err := f.ipfs.Get(context.Background(), c) + if err != nil { + return nil, nil, fmt.Errorf("failed to get node chunk for cid: %s | %w", fcid, err) + } + data, err := n.(*merkledag.ProtoNode).MarshalJSON() + if err != nil { + return nil, nil, fmt.Errorf("failed to cast proto node: %s | %w", fcid, err) + } + chunkOut = data + } else { + chunkOut, err = f.ipfs.GetFileChunk(context.Background(), c, chunkToLoad, chunkSize) + if err != nil { + return nil, nil, fmt.Errorf("failed to get chunk from unixfs %w", err) + } } if chunkOut == nil { diff --git a/file_system/file_system_test.go b/file_system/file_system_test.go index b3c4bd8..e3111a7 100644 --- a/file_system/file_system_test.go +++ b/file_system/file_system_test.go @@ -220,7 +220,7 @@ func TestWriteAndProveFiles(t *testing.T) { totalBlocks := size / int(chunkSize) for i := 0; i < totalBlocks; i++ { - p, c, err := proofs.GenProof(f, root, owner, start, i, int(chunkSize)) + p, c, err := proofs.GenProof(f, root, owner, start, i, int(chunkSize), 0) require.NoError(t, err) h := sha256.New() diff --git a/proofs/proofs.go b/proofs/proofs.go index 67134b6..b7f69e3 100644 --- a/proofs/proofs.go +++ b/proofs/proofs.go @@ -51,8 +51,8 @@ func GenerateMerkleProof(tree *merkletree.MerkleTree, index int, item []byte) (b // GenProof generates a proof from an arbitrary file on the file system // // returns proof, item and error -func GenProof(io FileSystem, merkle []byte, owner string, start int64, block int, chunkSize int) ([]byte, []byte, error) { - tree, chunk, err := io.GetFileTreeByChunk(merkle, owner, start, block, chunkSize) +func GenProof(io FileSystem, merkle []byte, owner string, start int64, block int, chunkSize int, proofType int64) ([]byte, []byte, error) { + tree, chunk, err := io.GetFileTreeByChunk(merkle, owner, start, block, chunkSize, proofType) if err != nil { e := fmt.Errorf("cannot get chunk for %x at %d | %w", merkle, block, err) log.Error().Err(e) @@ -143,7 +143,7 @@ func (p *Prover) GenerateProof(merkle []byte, owner string, start int64, blockHe log.Debug().Msg(fmt.Sprintf("Getting file tree by chunk for %x", merkle)) - proof, item, err := GenProof(p.io, merkle, owner, start, block, p.chunkSize) + proof, item, err := GenProof(p.io, merkle, owner, start, block, p.chunkSize, file.ProofType) return proof, item, newProof.ChunkToProve, err } diff --git a/proofs/types.go b/proofs/types.go index cc70073..dba2501 100644 --- a/proofs/types.go +++ b/proofs/types.go @@ -24,7 +24,7 @@ type Prover struct { type FileSystem interface { DeleteFile([]byte, string, int64) error ProcessFiles(func([]byte, string, int64)) error - GetFileTreeByChunk([]byte, string, int64, int, int) (*merkletree.MerkleTree, []byte, error) + GetFileTreeByChunk([]byte, string, int64, int, int, int64) (*merkletree.MerkleTree, []byte, error) } func (p *Prover) Inc() { diff --git a/strays/hands.go b/strays/hands.go index 87674b7..9ecdd2d 100644 --- a/strays/hands.go +++ b/strays/hands.go @@ -46,7 +46,7 @@ func (h *Hand) Start(f *file_system.FileSystem, wallet *wallet.Wallet, myUrl str continue } - tree, chunk, err := f.GetFileTreeByChunk(merkle, signee, start, 0, int(chunkSize)) + tree, chunk, err := f.GetFileTreeByChunk(merkle, signee, start, 0, int(chunkSize), proofType) if err != nil { log.Error().Err(err) h.stray = nil From 36fc28111258fd9b2c94d22f4d235996a5a966fe Mon Sep 17 00:00:00 2001 From: marston Date: Wed, 11 Sep 2024 00:47:59 -0400 Subject: [PATCH 06/12] adding more NAT options to IPFS --- go.mod | 8 +++++++- go.sum | 32 ++++++++++++++++++++++++++++++++ ipfs/ipfs.go | 25 +++++++++++++++++++++---- 3 files changed, 60 insertions(+), 5 deletions(-) diff --git a/go.mod b/go.mod index 7af8443..c21c439 100644 --- a/go.mod +++ b/go.mod @@ -20,12 +20,14 @@ require ( github.com/jackalLabs/canine-chain/v4 v4.0.3 github.com/json-iterator/go v1.1.12 github.com/libp2p/go-libp2p v0.32.2 + github.com/libp2p/go-libp2p-tls v0.3.0 github.com/multiformats/go-multiaddr v0.12.3 github.com/prometheus/client_golang v1.18.0 github.com/rs/cors v1.11.0 github.com/rs/zerolog v1.33.0 github.com/spf13/cobra v1.8.0 github.com/stretchr/testify v1.9.0 + github.com/tendermint/tendermint v0.34.27 github.com/wealdtech/go-merkletree/v2 v2.6.0 gopkg.in/yaml.v3 v3.0.1 ) @@ -48,6 +50,7 @@ require ( github.com/benbjohnson/clock v1.3.5 // indirect github.com/beorn7/perks v1.0.1 // indirect github.com/bgentry/speakeasy v0.1.1-0.20220910012023-760eaf8b6816 // indirect + github.com/btcsuite/btcd v0.22.2 // indirect github.com/btcsuite/btcd/btcec/v2 v2.3.2 // indirect github.com/cenkalti/backoff/v4 v4.2.1 // indirect github.com/cespare/xxhash v1.1.0 // indirect @@ -163,6 +166,7 @@ require ( github.com/libp2p/go-cidranger v1.1.0 // indirect github.com/libp2p/go-flow-metrics v0.1.0 // indirect github.com/libp2p/go-libp2p-asn-util v0.4.1 // indirect + github.com/libp2p/go-libp2p-core v0.14.0 // indirect github.com/libp2p/go-libp2p-kad-dht v0.25.2 // indirect github.com/libp2p/go-libp2p-kbucket v0.6.3 // indirect github.com/libp2p/go-libp2p-record v0.2.0 // indirect @@ -170,6 +174,7 @@ require ( github.com/libp2p/go-msgio v0.3.0 // indirect github.com/libp2p/go-nat v0.2.0 // indirect github.com/libp2p/go-netroute v0.2.1 // indirect + github.com/libp2p/go-openssl v0.1.0 // indirect github.com/libp2p/go-reuseport v0.4.0 // indirect github.com/libp2p/go-yamux/v4 v4.0.1 // indirect github.com/linxGnu/grocksdb v1.7.10 // indirect @@ -178,6 +183,7 @@ require ( github.com/marten-seemann/tcp v0.0.0-20210406111302-dfbc87cc63fd // indirect github.com/mattn/go-colorable v0.1.13 // indirect github.com/mattn/go-isatty v0.0.20 // indirect + github.com/mattn/go-pointer v0.0.1 // indirect github.com/matttproud/golang_protobuf_extensions/v2 v2.0.0 // indirect github.com/miekg/dns v1.1.57 // indirect github.com/mikioh/tcpinfo v0.0.0-20190314235526-30a79bb1804b // indirect @@ -222,6 +228,7 @@ require ( github.com/regen-network/cosmos-proto v0.3.1 // indirect github.com/rogpeppe/go-internal v1.11.0 // indirect github.com/sasha-s/go-deadlock v0.3.1 // indirect + github.com/spacemonkeygo/spacelog v0.0.0-20180420211403-2296661a0572 // indirect github.com/spaolacci/murmur3 v1.1.0 // indirect github.com/spf13/afero v1.9.5 // indirect github.com/spf13/cast v1.5.1 // indirect @@ -232,7 +239,6 @@ require ( github.com/syndtr/goleveldb v1.0.1-0.20220721030215-126854af5e6d // indirect github.com/tecbot/gorocksdb v0.0.0-20191217155057-f0fad39f321c // indirect github.com/tendermint/go-amino v0.16.0 // indirect - github.com/tendermint/tendermint v0.34.27 // indirect github.com/tendermint/tm-db v0.6.7 // indirect github.com/tidwall/btree v1.5.0 // indirect github.com/wealdtech/go-merkletree v1.0.0 // indirect diff --git a/go.sum b/go.sum index d9f3bc6..a13c7f1 100644 --- a/go.sum +++ b/go.sum @@ -192,6 +192,7 @@ github.com/btcsuite/btcd v0.20.1-beta/go.mod h1:wVuoA8VJLEcwgqHBwHmzLRazpKxTv13P github.com/btcsuite/btcd v0.21.0-beta.0.20201114000516-e9c7a5ac6401/go.mod h1:Sv4JPQ3/M+teHz9Bo5jBpkNcP0x6r7rdihlNL/7tTAs= github.com/btcsuite/btcd v0.22.1/go.mod h1:wqgTSL29+50LRkmOVknEdmt8ZojIzhuWvgu/iptuN7Y= github.com/btcsuite/btcd v0.22.2 h1:vBZ+lGGd1XubpOWO67ITJpAEsICWhA0YzqkcpkgNBfo= +github.com/btcsuite/btcd v0.22.2/go.mod h1:wqgTSL29+50LRkmOVknEdmt8ZojIzhuWvgu/iptuN7Y= github.com/btcsuite/btcd/btcec/v2 v2.1.2/go.mod h1:ctjw4H1kknNJmRN4iP1R7bTQ+v3GJkZBd6mui8ZsAZE= github.com/btcsuite/btcd/btcec/v2 v2.2.0/go.mod h1:U7MHm051Al6XmscBQ0BoNydpOTsFAn707034b5nY8zU= github.com/btcsuite/btcd/btcec/v2 v2.3.2 h1:5n0X6hX0Zk+6omWcihdYvdAlGf2DfasC0GMf7DClJ3U= @@ -807,6 +808,7 @@ github.com/ipfs/go-bitfield v1.1.0 h1:fh7FIo8bSwaJEh6DdTWbCeZ1eqOaOkKFI74SCnsWbG github.com/ipfs/go-bitfield v1.1.0/go.mod h1:paqf1wjq/D2BBmzfTVFlJQ9IlFOZpg422HL0HqsGWHU= github.com/ipfs/go-block-format v0.2.0 h1:ZqrkxBA2ICbDRbK8KJs/u0O3dlp6gmAuuXUJNiW1Ycs= github.com/ipfs/go-block-format v0.2.0/go.mod h1:+jpL11nFx5A/SPpsoBn6Bzkra/zaArfSmsknbPMYgzM= +github.com/ipfs/go-cid v0.0.7/go.mod h1:6Ux9z5e+HpkQdckYoX1PG/6xqKspzlEIR5SDmgqgC/I= github.com/ipfs/go-cid v0.4.1 h1:A/T3qGvxi4kpKWWcPC/PgbvDA2bjVLO7n4UeVwnbs/s= github.com/ipfs/go-cid v0.4.1/go.mod h1:uQHwDeX4c6CtyrFwdqyhpNcxVewur1M7l7fNU7LKwZk= github.com/ipfs/go-cidutil v0.1.0 h1:RW5hO7Vcf16dplUU60Hs0AKDkQAVPVplr7lk97CFL+Q= @@ -971,16 +973,21 @@ github.com/leodido/go-urn v1.2.1/go.mod h1:zt4jvISO2HfUBqxjfIshjdMTYS56ZS/qv49ic github.com/lib/pq v1.0.0/go.mod h1:5WUZQaWbwv1U+lTReE5YruASi9Al49XbQIvNi/34Woo= github.com/lib/pq v1.10.7 h1:p7ZhMD+KsSRozJr34udlUrhboJwWAgCg34+/ZZNvZZw= github.com/lib/pq v1.10.7/go.mod h1:AlVN5x4E4T544tWzH6hKfbfQvm3HdbOxrmggDNAPY9o= +github.com/libp2p/go-buffer-pool v0.0.2/go.mod h1:MvaB6xw5vOrDl8rYZGLFdKAuk/hRoRZd1Vi32+RXyFM= github.com/libp2p/go-buffer-pool v0.1.0 h1:oK4mSFcQz7cTQIfqbe4MIj9gLW+mnanjyFtc6cdF0Y8= github.com/libp2p/go-buffer-pool v0.1.0/go.mod h1:N+vh8gMqimBzdKkSMVuydVDq+UV5QTWy5HSiZacSbPg= github.com/libp2p/go-cidranger v1.1.0 h1:ewPN8EZ0dd1LSnrtuwd4709PXVcITVeuwbag38yPW7c= github.com/libp2p/go-cidranger v1.1.0/go.mod h1:KWZTfSr+r9qEo9OkI9/SIEeAtw+NNoU0dXIXt15Okic= +github.com/libp2p/go-flow-metrics v0.0.3/go.mod h1:HeoSNUrOJVK1jEpDqVEiUOIXqhbnS27omG0uWU5slZs= github.com/libp2p/go-flow-metrics v0.1.0 h1:0iPhMI8PskQwzh57jB9WxIuIOQ0r+15PChFGkx3Q3WM= github.com/libp2p/go-flow-metrics v0.1.0/go.mod h1:4Xi8MX8wj5aWNDAZttg6UPmc0ZrnFNsMtpsYUClFtro= github.com/libp2p/go-libp2p v0.32.2 h1:s8GYN4YJzgUoyeYNPdW7JZeZ5Ee31iNaIBfGYMAY4FQ= github.com/libp2p/go-libp2p v0.32.2/go.mod h1:E0LKe+diV/ZVJVnOJby8VC5xzHF0660osg71skcxJvk= github.com/libp2p/go-libp2p-asn-util v0.4.1 h1:xqL7++IKD9TBFMgnLPZR6/6iYhawHKHl950SO9L6n94= github.com/libp2p/go-libp2p-asn-util v0.4.1/go.mod h1:d/NI6XZ9qxw67b4e+NgpQexCIiFYJjErASrYW4PFDN8= +github.com/libp2p/go-libp2p-core v0.10.0/go.mod h1:ECdxehoYosLYHgDDFa2N4yE8Y7aQRAMf0sX9mf2sbGg= +github.com/libp2p/go-libp2p-core v0.14.0 h1:0kYSgiK/D7Eo28GTuRXo5YHsWwAisVpFCqCVPUd/vJs= +github.com/libp2p/go-libp2p-core v0.14.0/go.mod h1:tLasfcVdTXnixsLB0QYaT1syJOhsbrhG7q6pGrHtBg8= github.com/libp2p/go-libp2p-kad-dht v0.25.2 h1:FOIk9gHoe4YRWXTu8SY9Z1d0RILol0TrtApsMDPjAVQ= github.com/libp2p/go-libp2p-kad-dht v0.25.2/go.mod h1:6za56ncRHYXX4Nc2vn8z7CZK0P4QiMcrn77acKLM2Oo= github.com/libp2p/go-libp2p-kbucket v0.6.3 h1:p507271wWzpy2f1XxPzCQG9NiN6R6lHL9GiSErbQQo0= @@ -991,12 +998,18 @@ github.com/libp2p/go-libp2p-routing-helpers v0.7.3 h1:u1LGzAMVRK9Nqq5aYDVOiq/HaB github.com/libp2p/go-libp2p-routing-helpers v0.7.3/go.mod h1:cN4mJAD/7zfPKXBcs9ze31JGYAZgzdABEm+q/hkswb8= github.com/libp2p/go-libp2p-testing v0.12.0 h1:EPvBb4kKMWO29qP4mZGyhVzUyR25dvfUIK5WDu6iPUA= github.com/libp2p/go-libp2p-testing v0.12.0/go.mod h1:KcGDRXyN7sQCllucn1cOOS+Dmm7ujhfEyXQL5lvkcPg= +github.com/libp2p/go-libp2p-tls v0.3.0 h1:8BgvUJiOTcj0Gp6XvEicF0rL5aUtRg/UzEdeZDmDlC8= +github.com/libp2p/go-libp2p-tls v0.3.0/go.mod h1:fwF5X6PWGxm6IDRwF3V8AVCCj/hOd5oFlg+wo2FxJDY= +github.com/libp2p/go-msgio v0.0.6/go.mod h1:4ecVB6d9f4BDSL5fqvPiC4A3KivjWn+Venn/1ALLMWA= github.com/libp2p/go-msgio v0.3.0 h1:mf3Z8B1xcFN314sWX+2vOTShIE0Mmn2TXn3YCUQGNj0= github.com/libp2p/go-msgio v0.3.0/go.mod h1:nyRM819GmVaF9LX3l03RMh10QdOroF++NBbxAb0mmDM= github.com/libp2p/go-nat v0.2.0 h1:Tyz+bUFAYqGyJ/ppPPymMGbIgNRH+WqC5QrT5fKrrGk= github.com/libp2p/go-nat v0.2.0/go.mod h1:3MJr+GRpRkyT65EpVPBstXLvOlAPzUVlG6Pwg9ohLJk= github.com/libp2p/go-netroute v0.2.1 h1:V8kVrpD8GK0Riv15/7VN6RbUQ3URNZVosw7H2v9tksU= github.com/libp2p/go-netroute v0.2.1/go.mod h1:hraioZr0fhBjG0ZRXJJ6Zj2IVEVNx6tDTFQfSmcq7mQ= +github.com/libp2p/go-openssl v0.0.7/go.mod h1:unDrJpgy3oFr+rqXsarWifmJuNnJR4chtO1HmaZjggc= +github.com/libp2p/go-openssl v0.1.0 h1:LBkKEcUv6vtZIQLVTegAil8jbNpJErQ9AnT+bWV+Ooo= +github.com/libp2p/go-openssl v0.1.0/go.mod h1:OiOxwPpL3n4xlenjx2h7AwSGaFSC/KZvf6gNdOBQMtc= github.com/libp2p/go-reuseport v0.4.0 h1:nR5KU7hD0WxXCJbmw7r2rhRYruNRl2koHw8fQscQm2s= github.com/libp2p/go-reuseport v0.4.0/go.mod h1:ZtI03j/wO5hZVDFo2jKywN6bYKWLOy8Se6DrI2E1cLU= github.com/libp2p/go-yamux/v4 v4.0.1 h1:FfDR4S1wj6Bw2Pqbc8Uz7pCxeRBPbwsBbEdfwiCypkQ= @@ -1042,6 +1055,8 @@ github.com/mattn/go-isatty v0.0.16/go.mod h1:kYGgaQfpe5nmfYZH+SKPsOc2e4SrIfOl2e/ github.com/mattn/go-isatty v0.0.19/go.mod h1:W+V8PltTTMOvKvAeJH7IuucS94S2C6jfK/D7dTCTo3Y= github.com/mattn/go-isatty v0.0.20 h1:xfD0iDuEKnDkl03q4limB+vH+GxLEtL/jb4xVJSWWEY= github.com/mattn/go-isatty v0.0.20/go.mod h1:W+V8PltTTMOvKvAeJH7IuucS94S2C6jfK/D7dTCTo3Y= +github.com/mattn/go-pointer v0.0.1 h1:n+XhsuGeVO6MEAp7xyEukFINEa+Quek5psIR/ylA6o0= +github.com/mattn/go-pointer v0.0.1/go.mod h1:2zXcozF6qYGgmsG+SeTZz3oAbFLdD3OWqnUbNvJZAlc= github.com/mattn/go-runewidth v0.0.2/go.mod h1:LwmH8dsx7+W8Uxz3IHJYH5QSwggIsqBzpuz5H//U1FU= github.com/mattn/go-runewidth v0.0.3/go.mod h1:LwmH8dsx7+W8Uxz3IHJYH5QSwggIsqBzpuz5H//U1FU= github.com/mattn/go-runewidth v0.0.9/go.mod h1:H031xJmbD/WCDINGzjvQ9THkh0rPKHF+m2gUSrubnMI= @@ -1078,6 +1093,7 @@ github.com/minio/blake2b-simd v0.0.0-20160723061019-3f5f724cb5b1/go.mod h1:pD8Rv github.com/minio/highwayhash v1.0.2 h1:Aak5U0nElisjDCfPSG79Tgzkn2gl66NxOMspRrKnA/g= github.com/minio/highwayhash v1.0.2/go.mod h1:BQskDq+xkJ12lmlUUi7U0M5Swg3EWR+dLTk+kldvVxY= github.com/minio/sha256-simd v0.1.1-0.20190913151208-6de447530771/go.mod h1:B5e1o+1/KgNmWrSQK08Y6Z1Vb5pwIktudl0J58iy0KM= +github.com/minio/sha256-simd v0.1.1/go.mod h1:B5e1o+1/KgNmWrSQK08Y6Z1Vb5pwIktudl0J58iy0KM= github.com/minio/sha256-simd v1.0.1 h1:6kaan5IFmwTNynnKKpDHe6FWHohJOHhCPchzK49dzMM= github.com/minio/sha256-simd v1.0.1/go.mod h1:Pz6AKMiUdngCLpeTL/RJY1M9rUuPMYujV5xJjtbRSN8= github.com/mitchellh/cli v1.0.0/go.mod h1:hNIlj7HEI86fIcpObd7a0FcrxTWetlwJDGcceTlRvqc= @@ -1104,34 +1120,45 @@ github.com/modern-go/reflect2 v1.0.2 h1:xBagoLtFs94CBntxluKeaWgTMpvLxC4ur3nMaC9G github.com/modern-go/reflect2 v1.0.2/go.mod h1:yWuevngMOJpCy52FWWMvUC8ws7m/LJsjYzDa0/r8luk= github.com/modocache/gover v0.0.0-20171022184752-b58185e213c5/go.mod h1:caMODM3PzxT8aQXRPkAt8xlV/e7d7w8GM5g0fa5F0D8= github.com/moul/http2curl v1.0.0/go.mod h1:8UbvGypXm98wA/IqH45anm5Y2Z6ep6O31QGOAZ3H0fQ= +github.com/mr-tron/base58 v1.1.0/go.mod h1:xcD2VGqlgYjBdcBLw+TuYLr8afG+Hj8g2eTVqeSzSU8= github.com/mr-tron/base58 v1.1.2/go.mod h1:BinMc/sQntlIE1frQmRFPUoPA1Zkr8VRgBdjWI2mNwc= +github.com/mr-tron/base58 v1.1.3/go.mod h1:BinMc/sQntlIE1frQmRFPUoPA1Zkr8VRgBdjWI2mNwc= github.com/mr-tron/base58 v1.2.0 h1:T/HDJBh4ZCPbU39/+c3rRvE0uKBQlU27+QI8LJ4t64o= github.com/mr-tron/base58 v1.2.0/go.mod h1:BinMc/sQntlIE1frQmRFPUoPA1Zkr8VRgBdjWI2mNwc= github.com/mschoch/smat v0.0.0-20160514031455-90eadee771ae/go.mod h1:qAyveg+e4CE+eKJXWVjKXM4ck2QobLqTDytGJbLLhJg= github.com/mtibben/percent v0.2.1 h1:5gssi8Nqo8QU/r2pynCm+hBQHpkB/uNK7BJCFogWdzs= github.com/mtibben/percent v0.2.1/go.mod h1:KG9uO+SZkUp+VkRHsCdYQV3XSZrrSpR3O9ibNBTZrns= +github.com/multiformats/go-base32 v0.0.3/go.mod h1:pLiuGC8y0QR3Ue4Zug5UzK9LjgbkL8NSQj0zQ5Nz/AA= github.com/multiformats/go-base32 v0.1.0 h1:pVx9xoSPqEIQG8o+UbAe7DNi51oej1NtK+aGkbLYxPE= github.com/multiformats/go-base32 v0.1.0/go.mod h1:Kj3tFY6zNr+ABYMqeUNeGvkIC/UYgtWibDcT0rExnbI= +github.com/multiformats/go-base36 v0.1.0/go.mod h1:kFGE83c6s80PklsHO9sRn2NCoffoRdUUOENyW/Vv6sM= github.com/multiformats/go-base36 v0.2.0 h1:lFsAbNOGeKtuKozrtBsAkSVhv1p9D0/qedU9rQyccr0= github.com/multiformats/go-base36 v0.2.0/go.mod h1:qvnKE++v+2MWCfePClUEjE78Z7P2a1UV0xHgWc0hkp4= github.com/multiformats/go-multiaddr v0.1.1/go.mod h1:aMKBKNEYmzmDmxfX88/vz+J5IU55txyt0p4aiWVohjo= github.com/multiformats/go-multiaddr v0.2.0/go.mod h1:0nO36NvPpyV4QzvTLi/lafl2y95ncPj0vFwVF6k6wJ4= +github.com/multiformats/go-multiaddr v0.2.2/go.mod h1:NtfXiOtHvghW9KojvtySjH5y0u0xW5UouOmQQrn6a3Y= +github.com/multiformats/go-multiaddr v0.4.1/go.mod h1:3afI9HfVW8csiF8UZqtpYRiDyew8pRX7qLIGHu9FLuM= github.com/multiformats/go-multiaddr v0.12.3 h1:hVBXvPRcKG0w80VinQ23P5t7czWgg65BmIvQKjDydU8= github.com/multiformats/go-multiaddr v0.12.3/go.mod h1:sBXrNzucqkFJhvKOiwwLyqamGa/P5EIXNPLovyhQCII= github.com/multiformats/go-multiaddr-dns v0.3.1 h1:QgQgR+LQVt3NPTjbrLLpsaT2ufAA2y0Mkk+QRVJbW3A= github.com/multiformats/go-multiaddr-dns v0.3.1/go.mod h1:G/245BRQ6FJGmryJCrOuTdB37AMA5AMOVuO6NY3JwTk= github.com/multiformats/go-multiaddr-fmt v0.1.0 h1:WLEFClPycPkp4fnIzoFoV9FVd49/eQsuaL3/CWe167E= github.com/multiformats/go-multiaddr-fmt v0.1.0/go.mod h1:hGtDIW4PU4BqJ50gW2quDuPVjyWNZxToGUh/HwTZYJo= +github.com/multiformats/go-multibase v0.0.3/go.mod h1:5+1R4eQrT3PkYZ24C3W2Ue2tPwIdYQD509ZjSb5y9Oc= github.com/multiformats/go-multibase v0.2.0 h1:isdYCVLvksgWlMW9OZRYJEa9pZETFivncJHmHnnd87g= github.com/multiformats/go-multibase v0.2.0/go.mod h1:bFBZX4lKCA/2lyOFSAoKH5SS6oPyjtnzK/XTFDPkNuk= github.com/multiformats/go-multicodec v0.9.0 h1:pb/dlPnzee/Sxv/j4PmkDRxCOi3hXTz3IbPKOXWJkmg= github.com/multiformats/go-multicodec v0.9.0/go.mod h1:L3QTQvMIaVBkXOXXtVmYE+LI16i14xuaojr/H7Ai54k= github.com/multiformats/go-multihash v0.0.8/go.mod h1:YSLudS+Pi8NHE7o6tb3D8vrpKa63epEDmG8nTduyAew= +github.com/multiformats/go-multihash v0.0.13/go.mod h1:VdAWLKTwram9oKAatUcLxBNUjdtcVwxObEQBtRfuyjc= +github.com/multiformats/go-multihash v0.0.14/go.mod h1:VdAWLKTwram9oKAatUcLxBNUjdtcVwxObEQBtRfuyjc= github.com/multiformats/go-multihash v0.2.3 h1:7Lyc8XfX/IY2jWb/gI7JP+o7JEq9hOa7BFvVU9RSh+U= github.com/multiformats/go-multihash v0.2.3/go.mod h1:dXgKXCXjBzdscBLk9JkjINiEsCKRVch90MdaGiKsvSM= github.com/multiformats/go-multistream v0.5.0 h1:5htLSLl7lvJk3xx3qT/8Zm9J4K8vEOf/QGkvOGQAyiE= github.com/multiformats/go-multistream v0.5.0/go.mod h1:n6tMZiwiP2wUsR8DgfDWw1dydlEqV3l6N3/GBsX6ILA= github.com/multiformats/go-varint v0.0.1/go.mod h1:3Ls8CIEsrijN6+B7PbrXRPxHRPuXSrVKRY101jdMZYE= +github.com/multiformats/go-varint v0.0.5/go.mod h1:3Ls8CIEsrijN6+B7PbrXRPxHRPuXSrVKRY101jdMZYE= +github.com/multiformats/go-varint v0.0.6/go.mod h1:3Ls8CIEsrijN6+B7PbrXRPxHRPuXSrVKRY101jdMZYE= github.com/multiformats/go-varint v0.0.7 h1:sWSGR+f/eu5ABZA2ZpYKBILXTTs9JWpdEM/nEGOHFS8= github.com/multiformats/go-varint v0.0.7/go.mod h1:r8PUYw/fD/SjBCiKOoDlGF6QawOELpZAu9eioSos/OU= github.com/mwitkow/go-conntrack v0.0.0-20161129095857-cc309e4a2223/go.mod h1:qRWi+5nqEBWmkhHvq77mSJWrCKwh8bxhgT7d/eI7P4U= @@ -1171,6 +1198,7 @@ github.com/olekukonko/tablewriter v0.0.5/go.mod h1:hPp6KlRPjbx+hW8ykQs1w3UBbZlj6 github.com/onsi/ginkgo v1.6.0/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE= github.com/onsi/ginkgo v1.7.0/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE= github.com/onsi/ginkgo v1.10.3/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE= +github.com/onsi/ginkgo v1.12.0/go.mod h1:oUhWkIvk5aDxtKvDDuw8gItl8pKl42LzjC9KZE0HfGg= github.com/onsi/ginkgo v1.12.1/go.mod h1:zj2OWP4+oCPe1qIXoGWkgMRwljMUYCdkwsT2108oapk= github.com/onsi/ginkgo v1.13.0/go.mod h1:+REjRxOmWfHCjfv9TTWB1jD1Frx4XydAD3zm1lskyM0= github.com/onsi/ginkgo v1.14.0/go.mod h1:iSB4RoI2tjJc9BBv4NKIKWKya62Rps+oPG/Lv9klQyY= @@ -1184,6 +1212,7 @@ github.com/onsi/ginkgo/v2 v2.13.2/go.mod h1:XStQ8QcGwLyF4HdfcZB8SFOS/MWCgDuXMSBe github.com/onsi/gomega v1.4.1/go.mod h1:C1qb7wdrVGGVU+Z6iS04AVkA3Q65CEZX59MT0QO5uiA= github.com/onsi/gomega v1.4.3/go.mod h1:ex+gbHU/CVuBBDIJjb2X0qEXbFg53c61hWP/1CpauHY= github.com/onsi/gomega v1.7.1/go.mod h1:XdKZgCCFLUoM/7CFJVPcG8C1xQ1AJ0vpAezJrB7JYyY= +github.com/onsi/gomega v1.9.0/go.mod h1:Ho0h+IUsWyvy1OpqCwxlQ/21gkhVunqlU8fDGcoTdcA= github.com/onsi/gomega v1.10.1/go.mod h1:iN09h71vgCQne3DLsj+A5owkum+a2tYe+TOCB1ybHNo= github.com/onsi/gomega v1.17.0/go.mod h1:HnhC7FXeEQY45zxNK3PPoIUhzk/80Xly9PcubAlGdZY= github.com/onsi/gomega v1.18.1/go.mod h1:0q+aL8jAiMXy9hbwj2mr5GziHiwhAIQpFmmtT5hitRs= @@ -1414,6 +1443,8 @@ github.com/soheilhy/cmux v0.1.4/go.mod h1:IM3LyeVVIOuxMH7sFAkER9+bJ4dT7Ms6E4xg4k github.com/sony/gobreaker v0.4.1/go.mod h1:ZKptC7FHNvhBz7dN2LGjPVBz2sZJmc0/PkyDJOjmxWY= github.com/sourcegraph/annotate v0.0.0-20160123013949-f4cad6c6324d/go.mod h1:UdhH50NIW0fCiwBSr0co2m7BnFLdv4fQTgdqdJTHFeE= github.com/sourcegraph/syntaxhighlight v0.0.0-20170531221838-bd320f5d308e/go.mod h1:HuIsMU8RRBOtsCgI77wP899iHVBQpCmg4ErYMZB+2IA= +github.com/spacemonkeygo/spacelog v0.0.0-20180420211403-2296661a0572 h1:RC6RW7j+1+HkWaX/Yh71Ee5ZHaHYt7ZP4sQgUrm6cDU= +github.com/spacemonkeygo/spacelog v0.0.0-20180420211403-2296661a0572/go.mod h1:w0SWMsp6j9O/dk4/ZpIhL+3CkG8ofA2vuv7k+ltqUMc= github.com/spaolacci/murmur3 v0.0.0-20180118202830-f09979ecbc72/go.mod h1:JwIasOWyU6f++ZhiEuf87xNszmSA2myDM2Kzu9HwQUA= github.com/spaolacci/murmur3 v1.1.0 h1:7c1g84S4BPRrfL5Xrdp6fOJ206sU9y293DDHaoy0bLI= github.com/spaolacci/murmur3 v1.1.0/go.mod h1:JwIasOWyU6f++ZhiEuf87xNszmSA2myDM2Kzu9HwQUA= @@ -1872,6 +1903,7 @@ golang.org/x/sys v0.0.0-20191005200804-aed5e4c7ecf9/go.mod h1:h1NjWce9XRLGQEsW7w golang.org/x/sys v0.0.0-20191026070338-33540a1f6037/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20191120155948-bd437916bb0e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20191204072324-ce4227a45e2e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20191206220618-eeba5f6aabab/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20191220142924-d4481acd189f/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20191228213918-04cbcbbfeed8/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200106162015-b016eb3dc98e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= diff --git a/ipfs/ipfs.go b/ipfs/ipfs.go index 818b3e3..be6594a 100644 --- a/ipfs/ipfs.go +++ b/ipfs/ipfs.go @@ -3,9 +3,11 @@ package ipfs import ( "context" "fmt" - "strings" - + "github.com/libp2p/go-libp2p" + tls "github.com/libp2p/go-libp2p-tls" "github.com/libp2p/go-libp2p/core/host" + quic "github.com/libp2p/go-libp2p/p2p/transport/quic" + "strings" "github.com/dgraph-io/badger/v4" ipfslite "github.com/hsanjuan/ipfs-lite" @@ -26,16 +28,22 @@ func MakeIPFS(ctx context.Context, db *badger.DB, port int, customDomain string) return nil, nil, err } + defaultPort, err := multiaddr.NewMultiaddr("/ip4/0.0.0.0/tcp/4001") + if err != nil { + return nil, nil, fmt.Errorf("failed to make ipv4 ipfs address | %w", err) + } + listen, err := multiaddr.NewMultiaddr(fmt.Sprintf("/ip4/0.0.0.0/tcp/%d", port)) if err != nil { return nil, nil, fmt.Errorf("failed to make ipv4 ipfs address | %w", err) } + listen6, err := multiaddr.NewMultiaddr(fmt.Sprintf("/ip6/::/tcp/%d", port)) if err != nil { return nil, nil, fmt.Errorf("failed to make ipv6 ipfs address | %w", err) } - m := []multiaddr.Multiaddr{listen, listen6} + m := []multiaddr.Multiaddr{listen, listen6, defaultPort} if !strings.Contains(customDomain, "example.com") && len(customDomain) > 2 { if !strings.HasPrefix(customDomain, "/") { @@ -48,13 +56,22 @@ func MakeIPFS(ctx context.Context, db *badger.DB, port int, customDomain string) m = append(m, domainListener) } + opts := libp2p.ChainOptions( + libp2p.Transport(quic.NewTransport), + libp2p.EnableNATService(), + libp2p.NATPortMap(), + libp2p.EnableRelay(), + libp2p.EnableAutoRelay(), + libp2p.Security(tls.ID, tls.New), + ) + h, dht, err := ipfslite.SetupLibp2p( ctx, priv, nil, m, ds, - ipfslite.Libp2pOptionsExtra..., + append(ipfslite.Libp2pOptionsExtra, opts)..., ) if err != nil { return nil, h, err From 6265f831b4ba4e1314d7c0abd7026d962b2eb465 Mon Sep 17 00:00:00 2001 From: marston Date: Wed, 11 Sep 2024 00:54:22 -0400 Subject: [PATCH 07/12] no more tls to build properly --- go.mod | 6 ------ go.sum | 32 -------------------------------- ipfs/ipfs.go | 2 -- 3 files changed, 40 deletions(-) diff --git a/go.mod b/go.mod index c21c439..d5502cf 100644 --- a/go.mod +++ b/go.mod @@ -20,7 +20,6 @@ require ( github.com/jackalLabs/canine-chain/v4 v4.0.3 github.com/json-iterator/go v1.1.12 github.com/libp2p/go-libp2p v0.32.2 - github.com/libp2p/go-libp2p-tls v0.3.0 github.com/multiformats/go-multiaddr v0.12.3 github.com/prometheus/client_golang v1.18.0 github.com/rs/cors v1.11.0 @@ -50,7 +49,6 @@ require ( github.com/benbjohnson/clock v1.3.5 // indirect github.com/beorn7/perks v1.0.1 // indirect github.com/bgentry/speakeasy v0.1.1-0.20220910012023-760eaf8b6816 // indirect - github.com/btcsuite/btcd v0.22.2 // indirect github.com/btcsuite/btcd/btcec/v2 v2.3.2 // indirect github.com/cenkalti/backoff/v4 v4.2.1 // indirect github.com/cespare/xxhash v1.1.0 // indirect @@ -166,7 +164,6 @@ require ( github.com/libp2p/go-cidranger v1.1.0 // indirect github.com/libp2p/go-flow-metrics v0.1.0 // indirect github.com/libp2p/go-libp2p-asn-util v0.4.1 // indirect - github.com/libp2p/go-libp2p-core v0.14.0 // indirect github.com/libp2p/go-libp2p-kad-dht v0.25.2 // indirect github.com/libp2p/go-libp2p-kbucket v0.6.3 // indirect github.com/libp2p/go-libp2p-record v0.2.0 // indirect @@ -174,7 +171,6 @@ require ( github.com/libp2p/go-msgio v0.3.0 // indirect github.com/libp2p/go-nat v0.2.0 // indirect github.com/libp2p/go-netroute v0.2.1 // indirect - github.com/libp2p/go-openssl v0.1.0 // indirect github.com/libp2p/go-reuseport v0.4.0 // indirect github.com/libp2p/go-yamux/v4 v4.0.1 // indirect github.com/linxGnu/grocksdb v1.7.10 // indirect @@ -183,7 +179,6 @@ require ( github.com/marten-seemann/tcp v0.0.0-20210406111302-dfbc87cc63fd // indirect github.com/mattn/go-colorable v0.1.13 // indirect github.com/mattn/go-isatty v0.0.20 // indirect - github.com/mattn/go-pointer v0.0.1 // indirect github.com/matttproud/golang_protobuf_extensions/v2 v2.0.0 // indirect github.com/miekg/dns v1.1.57 // indirect github.com/mikioh/tcpinfo v0.0.0-20190314235526-30a79bb1804b // indirect @@ -228,7 +223,6 @@ require ( github.com/regen-network/cosmos-proto v0.3.1 // indirect github.com/rogpeppe/go-internal v1.11.0 // indirect github.com/sasha-s/go-deadlock v0.3.1 // indirect - github.com/spacemonkeygo/spacelog v0.0.0-20180420211403-2296661a0572 // indirect github.com/spaolacci/murmur3 v1.1.0 // indirect github.com/spf13/afero v1.9.5 // indirect github.com/spf13/cast v1.5.1 // indirect diff --git a/go.sum b/go.sum index a13c7f1..d9f3bc6 100644 --- a/go.sum +++ b/go.sum @@ -192,7 +192,6 @@ github.com/btcsuite/btcd v0.20.1-beta/go.mod h1:wVuoA8VJLEcwgqHBwHmzLRazpKxTv13P github.com/btcsuite/btcd v0.21.0-beta.0.20201114000516-e9c7a5ac6401/go.mod h1:Sv4JPQ3/M+teHz9Bo5jBpkNcP0x6r7rdihlNL/7tTAs= github.com/btcsuite/btcd v0.22.1/go.mod h1:wqgTSL29+50LRkmOVknEdmt8ZojIzhuWvgu/iptuN7Y= github.com/btcsuite/btcd v0.22.2 h1:vBZ+lGGd1XubpOWO67ITJpAEsICWhA0YzqkcpkgNBfo= -github.com/btcsuite/btcd v0.22.2/go.mod h1:wqgTSL29+50LRkmOVknEdmt8ZojIzhuWvgu/iptuN7Y= github.com/btcsuite/btcd/btcec/v2 v2.1.2/go.mod h1:ctjw4H1kknNJmRN4iP1R7bTQ+v3GJkZBd6mui8ZsAZE= github.com/btcsuite/btcd/btcec/v2 v2.2.0/go.mod h1:U7MHm051Al6XmscBQ0BoNydpOTsFAn707034b5nY8zU= github.com/btcsuite/btcd/btcec/v2 v2.3.2 h1:5n0X6hX0Zk+6omWcihdYvdAlGf2DfasC0GMf7DClJ3U= @@ -808,7 +807,6 @@ github.com/ipfs/go-bitfield v1.1.0 h1:fh7FIo8bSwaJEh6DdTWbCeZ1eqOaOkKFI74SCnsWbG github.com/ipfs/go-bitfield v1.1.0/go.mod h1:paqf1wjq/D2BBmzfTVFlJQ9IlFOZpg422HL0HqsGWHU= github.com/ipfs/go-block-format v0.2.0 h1:ZqrkxBA2ICbDRbK8KJs/u0O3dlp6gmAuuXUJNiW1Ycs= github.com/ipfs/go-block-format v0.2.0/go.mod h1:+jpL11nFx5A/SPpsoBn6Bzkra/zaArfSmsknbPMYgzM= -github.com/ipfs/go-cid v0.0.7/go.mod h1:6Ux9z5e+HpkQdckYoX1PG/6xqKspzlEIR5SDmgqgC/I= github.com/ipfs/go-cid v0.4.1 h1:A/T3qGvxi4kpKWWcPC/PgbvDA2bjVLO7n4UeVwnbs/s= github.com/ipfs/go-cid v0.4.1/go.mod h1:uQHwDeX4c6CtyrFwdqyhpNcxVewur1M7l7fNU7LKwZk= github.com/ipfs/go-cidutil v0.1.0 h1:RW5hO7Vcf16dplUU60Hs0AKDkQAVPVplr7lk97CFL+Q= @@ -973,21 +971,16 @@ github.com/leodido/go-urn v1.2.1/go.mod h1:zt4jvISO2HfUBqxjfIshjdMTYS56ZS/qv49ic github.com/lib/pq v1.0.0/go.mod h1:5WUZQaWbwv1U+lTReE5YruASi9Al49XbQIvNi/34Woo= github.com/lib/pq v1.10.7 h1:p7ZhMD+KsSRozJr34udlUrhboJwWAgCg34+/ZZNvZZw= github.com/lib/pq v1.10.7/go.mod h1:AlVN5x4E4T544tWzH6hKfbfQvm3HdbOxrmggDNAPY9o= -github.com/libp2p/go-buffer-pool v0.0.2/go.mod h1:MvaB6xw5vOrDl8rYZGLFdKAuk/hRoRZd1Vi32+RXyFM= github.com/libp2p/go-buffer-pool v0.1.0 h1:oK4mSFcQz7cTQIfqbe4MIj9gLW+mnanjyFtc6cdF0Y8= github.com/libp2p/go-buffer-pool v0.1.0/go.mod h1:N+vh8gMqimBzdKkSMVuydVDq+UV5QTWy5HSiZacSbPg= github.com/libp2p/go-cidranger v1.1.0 h1:ewPN8EZ0dd1LSnrtuwd4709PXVcITVeuwbag38yPW7c= github.com/libp2p/go-cidranger v1.1.0/go.mod h1:KWZTfSr+r9qEo9OkI9/SIEeAtw+NNoU0dXIXt15Okic= -github.com/libp2p/go-flow-metrics v0.0.3/go.mod h1:HeoSNUrOJVK1jEpDqVEiUOIXqhbnS27omG0uWU5slZs= github.com/libp2p/go-flow-metrics v0.1.0 h1:0iPhMI8PskQwzh57jB9WxIuIOQ0r+15PChFGkx3Q3WM= github.com/libp2p/go-flow-metrics v0.1.0/go.mod h1:4Xi8MX8wj5aWNDAZttg6UPmc0ZrnFNsMtpsYUClFtro= github.com/libp2p/go-libp2p v0.32.2 h1:s8GYN4YJzgUoyeYNPdW7JZeZ5Ee31iNaIBfGYMAY4FQ= github.com/libp2p/go-libp2p v0.32.2/go.mod h1:E0LKe+diV/ZVJVnOJby8VC5xzHF0660osg71skcxJvk= github.com/libp2p/go-libp2p-asn-util v0.4.1 h1:xqL7++IKD9TBFMgnLPZR6/6iYhawHKHl950SO9L6n94= github.com/libp2p/go-libp2p-asn-util v0.4.1/go.mod h1:d/NI6XZ9qxw67b4e+NgpQexCIiFYJjErASrYW4PFDN8= -github.com/libp2p/go-libp2p-core v0.10.0/go.mod h1:ECdxehoYosLYHgDDFa2N4yE8Y7aQRAMf0sX9mf2sbGg= -github.com/libp2p/go-libp2p-core v0.14.0 h1:0kYSgiK/D7Eo28GTuRXo5YHsWwAisVpFCqCVPUd/vJs= -github.com/libp2p/go-libp2p-core v0.14.0/go.mod h1:tLasfcVdTXnixsLB0QYaT1syJOhsbrhG7q6pGrHtBg8= github.com/libp2p/go-libp2p-kad-dht v0.25.2 h1:FOIk9gHoe4YRWXTu8SY9Z1d0RILol0TrtApsMDPjAVQ= github.com/libp2p/go-libp2p-kad-dht v0.25.2/go.mod h1:6za56ncRHYXX4Nc2vn8z7CZK0P4QiMcrn77acKLM2Oo= github.com/libp2p/go-libp2p-kbucket v0.6.3 h1:p507271wWzpy2f1XxPzCQG9NiN6R6lHL9GiSErbQQo0= @@ -998,18 +991,12 @@ github.com/libp2p/go-libp2p-routing-helpers v0.7.3 h1:u1LGzAMVRK9Nqq5aYDVOiq/HaB github.com/libp2p/go-libp2p-routing-helpers v0.7.3/go.mod h1:cN4mJAD/7zfPKXBcs9ze31JGYAZgzdABEm+q/hkswb8= github.com/libp2p/go-libp2p-testing v0.12.0 h1:EPvBb4kKMWO29qP4mZGyhVzUyR25dvfUIK5WDu6iPUA= github.com/libp2p/go-libp2p-testing v0.12.0/go.mod h1:KcGDRXyN7sQCllucn1cOOS+Dmm7ujhfEyXQL5lvkcPg= -github.com/libp2p/go-libp2p-tls v0.3.0 h1:8BgvUJiOTcj0Gp6XvEicF0rL5aUtRg/UzEdeZDmDlC8= -github.com/libp2p/go-libp2p-tls v0.3.0/go.mod h1:fwF5X6PWGxm6IDRwF3V8AVCCj/hOd5oFlg+wo2FxJDY= -github.com/libp2p/go-msgio v0.0.6/go.mod h1:4ecVB6d9f4BDSL5fqvPiC4A3KivjWn+Venn/1ALLMWA= github.com/libp2p/go-msgio v0.3.0 h1:mf3Z8B1xcFN314sWX+2vOTShIE0Mmn2TXn3YCUQGNj0= github.com/libp2p/go-msgio v0.3.0/go.mod h1:nyRM819GmVaF9LX3l03RMh10QdOroF++NBbxAb0mmDM= github.com/libp2p/go-nat v0.2.0 h1:Tyz+bUFAYqGyJ/ppPPymMGbIgNRH+WqC5QrT5fKrrGk= github.com/libp2p/go-nat v0.2.0/go.mod h1:3MJr+GRpRkyT65EpVPBstXLvOlAPzUVlG6Pwg9ohLJk= github.com/libp2p/go-netroute v0.2.1 h1:V8kVrpD8GK0Riv15/7VN6RbUQ3URNZVosw7H2v9tksU= github.com/libp2p/go-netroute v0.2.1/go.mod h1:hraioZr0fhBjG0ZRXJJ6Zj2IVEVNx6tDTFQfSmcq7mQ= -github.com/libp2p/go-openssl v0.0.7/go.mod h1:unDrJpgy3oFr+rqXsarWifmJuNnJR4chtO1HmaZjggc= -github.com/libp2p/go-openssl v0.1.0 h1:LBkKEcUv6vtZIQLVTegAil8jbNpJErQ9AnT+bWV+Ooo= -github.com/libp2p/go-openssl v0.1.0/go.mod h1:OiOxwPpL3n4xlenjx2h7AwSGaFSC/KZvf6gNdOBQMtc= github.com/libp2p/go-reuseport v0.4.0 h1:nR5KU7hD0WxXCJbmw7r2rhRYruNRl2koHw8fQscQm2s= github.com/libp2p/go-reuseport v0.4.0/go.mod h1:ZtI03j/wO5hZVDFo2jKywN6bYKWLOy8Se6DrI2E1cLU= github.com/libp2p/go-yamux/v4 v4.0.1 h1:FfDR4S1wj6Bw2Pqbc8Uz7pCxeRBPbwsBbEdfwiCypkQ= @@ -1055,8 +1042,6 @@ github.com/mattn/go-isatty v0.0.16/go.mod h1:kYGgaQfpe5nmfYZH+SKPsOc2e4SrIfOl2e/ github.com/mattn/go-isatty v0.0.19/go.mod h1:W+V8PltTTMOvKvAeJH7IuucS94S2C6jfK/D7dTCTo3Y= github.com/mattn/go-isatty v0.0.20 h1:xfD0iDuEKnDkl03q4limB+vH+GxLEtL/jb4xVJSWWEY= github.com/mattn/go-isatty v0.0.20/go.mod h1:W+V8PltTTMOvKvAeJH7IuucS94S2C6jfK/D7dTCTo3Y= -github.com/mattn/go-pointer v0.0.1 h1:n+XhsuGeVO6MEAp7xyEukFINEa+Quek5psIR/ylA6o0= -github.com/mattn/go-pointer v0.0.1/go.mod h1:2zXcozF6qYGgmsG+SeTZz3oAbFLdD3OWqnUbNvJZAlc= github.com/mattn/go-runewidth v0.0.2/go.mod h1:LwmH8dsx7+W8Uxz3IHJYH5QSwggIsqBzpuz5H//U1FU= github.com/mattn/go-runewidth v0.0.3/go.mod h1:LwmH8dsx7+W8Uxz3IHJYH5QSwggIsqBzpuz5H//U1FU= github.com/mattn/go-runewidth v0.0.9/go.mod h1:H031xJmbD/WCDINGzjvQ9THkh0rPKHF+m2gUSrubnMI= @@ -1093,7 +1078,6 @@ github.com/minio/blake2b-simd v0.0.0-20160723061019-3f5f724cb5b1/go.mod h1:pD8Rv github.com/minio/highwayhash v1.0.2 h1:Aak5U0nElisjDCfPSG79Tgzkn2gl66NxOMspRrKnA/g= github.com/minio/highwayhash v1.0.2/go.mod h1:BQskDq+xkJ12lmlUUi7U0M5Swg3EWR+dLTk+kldvVxY= github.com/minio/sha256-simd v0.1.1-0.20190913151208-6de447530771/go.mod h1:B5e1o+1/KgNmWrSQK08Y6Z1Vb5pwIktudl0J58iy0KM= -github.com/minio/sha256-simd v0.1.1/go.mod h1:B5e1o+1/KgNmWrSQK08Y6Z1Vb5pwIktudl0J58iy0KM= github.com/minio/sha256-simd v1.0.1 h1:6kaan5IFmwTNynnKKpDHe6FWHohJOHhCPchzK49dzMM= github.com/minio/sha256-simd v1.0.1/go.mod h1:Pz6AKMiUdngCLpeTL/RJY1M9rUuPMYujV5xJjtbRSN8= github.com/mitchellh/cli v1.0.0/go.mod h1:hNIlj7HEI86fIcpObd7a0FcrxTWetlwJDGcceTlRvqc= @@ -1120,45 +1104,34 @@ github.com/modern-go/reflect2 v1.0.2 h1:xBagoLtFs94CBntxluKeaWgTMpvLxC4ur3nMaC9G github.com/modern-go/reflect2 v1.0.2/go.mod h1:yWuevngMOJpCy52FWWMvUC8ws7m/LJsjYzDa0/r8luk= github.com/modocache/gover v0.0.0-20171022184752-b58185e213c5/go.mod h1:caMODM3PzxT8aQXRPkAt8xlV/e7d7w8GM5g0fa5F0D8= github.com/moul/http2curl v1.0.0/go.mod h1:8UbvGypXm98wA/IqH45anm5Y2Z6ep6O31QGOAZ3H0fQ= -github.com/mr-tron/base58 v1.1.0/go.mod h1:xcD2VGqlgYjBdcBLw+TuYLr8afG+Hj8g2eTVqeSzSU8= github.com/mr-tron/base58 v1.1.2/go.mod h1:BinMc/sQntlIE1frQmRFPUoPA1Zkr8VRgBdjWI2mNwc= -github.com/mr-tron/base58 v1.1.3/go.mod h1:BinMc/sQntlIE1frQmRFPUoPA1Zkr8VRgBdjWI2mNwc= github.com/mr-tron/base58 v1.2.0 h1:T/HDJBh4ZCPbU39/+c3rRvE0uKBQlU27+QI8LJ4t64o= github.com/mr-tron/base58 v1.2.0/go.mod h1:BinMc/sQntlIE1frQmRFPUoPA1Zkr8VRgBdjWI2mNwc= github.com/mschoch/smat v0.0.0-20160514031455-90eadee771ae/go.mod h1:qAyveg+e4CE+eKJXWVjKXM4ck2QobLqTDytGJbLLhJg= github.com/mtibben/percent v0.2.1 h1:5gssi8Nqo8QU/r2pynCm+hBQHpkB/uNK7BJCFogWdzs= github.com/mtibben/percent v0.2.1/go.mod h1:KG9uO+SZkUp+VkRHsCdYQV3XSZrrSpR3O9ibNBTZrns= -github.com/multiformats/go-base32 v0.0.3/go.mod h1:pLiuGC8y0QR3Ue4Zug5UzK9LjgbkL8NSQj0zQ5Nz/AA= github.com/multiformats/go-base32 v0.1.0 h1:pVx9xoSPqEIQG8o+UbAe7DNi51oej1NtK+aGkbLYxPE= github.com/multiformats/go-base32 v0.1.0/go.mod h1:Kj3tFY6zNr+ABYMqeUNeGvkIC/UYgtWibDcT0rExnbI= -github.com/multiformats/go-base36 v0.1.0/go.mod h1:kFGE83c6s80PklsHO9sRn2NCoffoRdUUOENyW/Vv6sM= github.com/multiformats/go-base36 v0.2.0 h1:lFsAbNOGeKtuKozrtBsAkSVhv1p9D0/qedU9rQyccr0= github.com/multiformats/go-base36 v0.2.0/go.mod h1:qvnKE++v+2MWCfePClUEjE78Z7P2a1UV0xHgWc0hkp4= github.com/multiformats/go-multiaddr v0.1.1/go.mod h1:aMKBKNEYmzmDmxfX88/vz+J5IU55txyt0p4aiWVohjo= github.com/multiformats/go-multiaddr v0.2.0/go.mod h1:0nO36NvPpyV4QzvTLi/lafl2y95ncPj0vFwVF6k6wJ4= -github.com/multiformats/go-multiaddr v0.2.2/go.mod h1:NtfXiOtHvghW9KojvtySjH5y0u0xW5UouOmQQrn6a3Y= -github.com/multiformats/go-multiaddr v0.4.1/go.mod h1:3afI9HfVW8csiF8UZqtpYRiDyew8pRX7qLIGHu9FLuM= github.com/multiformats/go-multiaddr v0.12.3 h1:hVBXvPRcKG0w80VinQ23P5t7czWgg65BmIvQKjDydU8= github.com/multiformats/go-multiaddr v0.12.3/go.mod h1:sBXrNzucqkFJhvKOiwwLyqamGa/P5EIXNPLovyhQCII= github.com/multiformats/go-multiaddr-dns v0.3.1 h1:QgQgR+LQVt3NPTjbrLLpsaT2ufAA2y0Mkk+QRVJbW3A= github.com/multiformats/go-multiaddr-dns v0.3.1/go.mod h1:G/245BRQ6FJGmryJCrOuTdB37AMA5AMOVuO6NY3JwTk= github.com/multiformats/go-multiaddr-fmt v0.1.0 h1:WLEFClPycPkp4fnIzoFoV9FVd49/eQsuaL3/CWe167E= github.com/multiformats/go-multiaddr-fmt v0.1.0/go.mod h1:hGtDIW4PU4BqJ50gW2quDuPVjyWNZxToGUh/HwTZYJo= -github.com/multiformats/go-multibase v0.0.3/go.mod h1:5+1R4eQrT3PkYZ24C3W2Ue2tPwIdYQD509ZjSb5y9Oc= github.com/multiformats/go-multibase v0.2.0 h1:isdYCVLvksgWlMW9OZRYJEa9pZETFivncJHmHnnd87g= github.com/multiformats/go-multibase v0.2.0/go.mod h1:bFBZX4lKCA/2lyOFSAoKH5SS6oPyjtnzK/XTFDPkNuk= github.com/multiformats/go-multicodec v0.9.0 h1:pb/dlPnzee/Sxv/j4PmkDRxCOi3hXTz3IbPKOXWJkmg= github.com/multiformats/go-multicodec v0.9.0/go.mod h1:L3QTQvMIaVBkXOXXtVmYE+LI16i14xuaojr/H7Ai54k= github.com/multiformats/go-multihash v0.0.8/go.mod h1:YSLudS+Pi8NHE7o6tb3D8vrpKa63epEDmG8nTduyAew= -github.com/multiformats/go-multihash v0.0.13/go.mod h1:VdAWLKTwram9oKAatUcLxBNUjdtcVwxObEQBtRfuyjc= -github.com/multiformats/go-multihash v0.0.14/go.mod h1:VdAWLKTwram9oKAatUcLxBNUjdtcVwxObEQBtRfuyjc= github.com/multiformats/go-multihash v0.2.3 h1:7Lyc8XfX/IY2jWb/gI7JP+o7JEq9hOa7BFvVU9RSh+U= github.com/multiformats/go-multihash v0.2.3/go.mod h1:dXgKXCXjBzdscBLk9JkjINiEsCKRVch90MdaGiKsvSM= github.com/multiformats/go-multistream v0.5.0 h1:5htLSLl7lvJk3xx3qT/8Zm9J4K8vEOf/QGkvOGQAyiE= github.com/multiformats/go-multistream v0.5.0/go.mod h1:n6tMZiwiP2wUsR8DgfDWw1dydlEqV3l6N3/GBsX6ILA= github.com/multiformats/go-varint v0.0.1/go.mod h1:3Ls8CIEsrijN6+B7PbrXRPxHRPuXSrVKRY101jdMZYE= -github.com/multiformats/go-varint v0.0.5/go.mod h1:3Ls8CIEsrijN6+B7PbrXRPxHRPuXSrVKRY101jdMZYE= -github.com/multiformats/go-varint v0.0.6/go.mod h1:3Ls8CIEsrijN6+B7PbrXRPxHRPuXSrVKRY101jdMZYE= github.com/multiformats/go-varint v0.0.7 h1:sWSGR+f/eu5ABZA2ZpYKBILXTTs9JWpdEM/nEGOHFS8= github.com/multiformats/go-varint v0.0.7/go.mod h1:r8PUYw/fD/SjBCiKOoDlGF6QawOELpZAu9eioSos/OU= github.com/mwitkow/go-conntrack v0.0.0-20161129095857-cc309e4a2223/go.mod h1:qRWi+5nqEBWmkhHvq77mSJWrCKwh8bxhgT7d/eI7P4U= @@ -1198,7 +1171,6 @@ github.com/olekukonko/tablewriter v0.0.5/go.mod h1:hPp6KlRPjbx+hW8ykQs1w3UBbZlj6 github.com/onsi/ginkgo v1.6.0/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE= github.com/onsi/ginkgo v1.7.0/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE= github.com/onsi/ginkgo v1.10.3/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE= -github.com/onsi/ginkgo v1.12.0/go.mod h1:oUhWkIvk5aDxtKvDDuw8gItl8pKl42LzjC9KZE0HfGg= github.com/onsi/ginkgo v1.12.1/go.mod h1:zj2OWP4+oCPe1qIXoGWkgMRwljMUYCdkwsT2108oapk= github.com/onsi/ginkgo v1.13.0/go.mod h1:+REjRxOmWfHCjfv9TTWB1jD1Frx4XydAD3zm1lskyM0= github.com/onsi/ginkgo v1.14.0/go.mod h1:iSB4RoI2tjJc9BBv4NKIKWKya62Rps+oPG/Lv9klQyY= @@ -1212,7 +1184,6 @@ github.com/onsi/ginkgo/v2 v2.13.2/go.mod h1:XStQ8QcGwLyF4HdfcZB8SFOS/MWCgDuXMSBe github.com/onsi/gomega v1.4.1/go.mod h1:C1qb7wdrVGGVU+Z6iS04AVkA3Q65CEZX59MT0QO5uiA= github.com/onsi/gomega v1.4.3/go.mod h1:ex+gbHU/CVuBBDIJjb2X0qEXbFg53c61hWP/1CpauHY= github.com/onsi/gomega v1.7.1/go.mod h1:XdKZgCCFLUoM/7CFJVPcG8C1xQ1AJ0vpAezJrB7JYyY= -github.com/onsi/gomega v1.9.0/go.mod h1:Ho0h+IUsWyvy1OpqCwxlQ/21gkhVunqlU8fDGcoTdcA= github.com/onsi/gomega v1.10.1/go.mod h1:iN09h71vgCQne3DLsj+A5owkum+a2tYe+TOCB1ybHNo= github.com/onsi/gomega v1.17.0/go.mod h1:HnhC7FXeEQY45zxNK3PPoIUhzk/80Xly9PcubAlGdZY= github.com/onsi/gomega v1.18.1/go.mod h1:0q+aL8jAiMXy9hbwj2mr5GziHiwhAIQpFmmtT5hitRs= @@ -1443,8 +1414,6 @@ github.com/soheilhy/cmux v0.1.4/go.mod h1:IM3LyeVVIOuxMH7sFAkER9+bJ4dT7Ms6E4xg4k github.com/sony/gobreaker v0.4.1/go.mod h1:ZKptC7FHNvhBz7dN2LGjPVBz2sZJmc0/PkyDJOjmxWY= github.com/sourcegraph/annotate v0.0.0-20160123013949-f4cad6c6324d/go.mod h1:UdhH50NIW0fCiwBSr0co2m7BnFLdv4fQTgdqdJTHFeE= github.com/sourcegraph/syntaxhighlight v0.0.0-20170531221838-bd320f5d308e/go.mod h1:HuIsMU8RRBOtsCgI77wP899iHVBQpCmg4ErYMZB+2IA= -github.com/spacemonkeygo/spacelog v0.0.0-20180420211403-2296661a0572 h1:RC6RW7j+1+HkWaX/Yh71Ee5ZHaHYt7ZP4sQgUrm6cDU= -github.com/spacemonkeygo/spacelog v0.0.0-20180420211403-2296661a0572/go.mod h1:w0SWMsp6j9O/dk4/ZpIhL+3CkG8ofA2vuv7k+ltqUMc= github.com/spaolacci/murmur3 v0.0.0-20180118202830-f09979ecbc72/go.mod h1:JwIasOWyU6f++ZhiEuf87xNszmSA2myDM2Kzu9HwQUA= github.com/spaolacci/murmur3 v1.1.0 h1:7c1g84S4BPRrfL5Xrdp6fOJ206sU9y293DDHaoy0bLI= github.com/spaolacci/murmur3 v1.1.0/go.mod h1:JwIasOWyU6f++ZhiEuf87xNszmSA2myDM2Kzu9HwQUA= @@ -1903,7 +1872,6 @@ golang.org/x/sys v0.0.0-20191005200804-aed5e4c7ecf9/go.mod h1:h1NjWce9XRLGQEsW7w golang.org/x/sys v0.0.0-20191026070338-33540a1f6037/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20191120155948-bd437916bb0e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20191204072324-ce4227a45e2e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20191206220618-eeba5f6aabab/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20191220142924-d4481acd189f/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20191228213918-04cbcbbfeed8/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200106162015-b016eb3dc98e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= diff --git a/ipfs/ipfs.go b/ipfs/ipfs.go index be6594a..83df158 100644 --- a/ipfs/ipfs.go +++ b/ipfs/ipfs.go @@ -4,7 +4,6 @@ import ( "context" "fmt" "github.com/libp2p/go-libp2p" - tls "github.com/libp2p/go-libp2p-tls" "github.com/libp2p/go-libp2p/core/host" quic "github.com/libp2p/go-libp2p/p2p/transport/quic" "strings" @@ -62,7 +61,6 @@ func MakeIPFS(ctx context.Context, db *badger.DB, port int, customDomain string) libp2p.NATPortMap(), libp2p.EnableRelay(), libp2p.EnableAutoRelay(), - libp2p.Security(tls.ID, tls.New), ) h, dht, err := ipfslite.SetupLibp2p( From aba03edcf3fe3c5fe9267ce6c6e0db2a82c49dac Mon Sep 17 00:00:00 2001 From: marston Date: Wed, 11 Sep 2024 00:57:26 -0400 Subject: [PATCH 08/12] fixing some nats --- ipfs/ipfs.go | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/ipfs/ipfs.go b/ipfs/ipfs.go index 83df158..de88586 100644 --- a/ipfs/ipfs.go +++ b/ipfs/ipfs.go @@ -5,15 +5,15 @@ import ( "fmt" "github.com/libp2p/go-libp2p" "github.com/libp2p/go-libp2p/core/host" + libp2ptls "github.com/libp2p/go-libp2p/p2p/security/tls" quic "github.com/libp2p/go-libp2p/p2p/transport/quic" "strings" "github.com/dgraph-io/badger/v4" ipfslite "github.com/hsanjuan/ipfs-lite" + bds "github.com/ipfs/go-ds-badger2" "github.com/libp2p/go-libp2p/core/crypto" "github.com/multiformats/go-multiaddr" - - bds "github.com/ipfs/go-ds-badger2" ) func MakeIPFS(ctx context.Context, db *badger.DB, port int, customDomain string) (*ipfslite.Peer, host.Host, error) { @@ -59,8 +59,7 @@ func MakeIPFS(ctx context.Context, db *badger.DB, port int, customDomain string) libp2p.Transport(quic.NewTransport), libp2p.EnableNATService(), libp2p.NATPortMap(), - libp2p.EnableRelay(), - libp2p.EnableAutoRelay(), + libp2p.Security(libp2ptls.ID, libp2ptls.New), ) h, dht, err := ipfslite.SetupLibp2p( From 44687610e66ea73da7f1b29636bea576733aaefe Mon Sep 17 00:00:00 2001 From: marston Date: Wed, 11 Sep 2024 00:58:38 -0400 Subject: [PATCH 09/12] nat better? --- ipfs/ipfs.go | 1 - 1 file changed, 1 deletion(-) diff --git a/ipfs/ipfs.go b/ipfs/ipfs.go index de88586..c9cc4f8 100644 --- a/ipfs/ipfs.go +++ b/ipfs/ipfs.go @@ -57,7 +57,6 @@ func MakeIPFS(ctx context.Context, db *badger.DB, port int, customDomain string) opts := libp2p.ChainOptions( libp2p.Transport(quic.NewTransport), - libp2p.EnableNATService(), libp2p.NATPortMap(), libp2p.Security(libp2ptls.ID, libp2ptls.New), ) From 3caab811c84ac560e599cb1240e5c9e812c12dfc Mon Sep 17 00:00:00 2001 From: marston Date: Wed, 11 Sep 2024 00:59:30 -0400 Subject: [PATCH 10/12] nat better??? --- ipfs/ipfs.go | 1 - 1 file changed, 1 deletion(-) diff --git a/ipfs/ipfs.go b/ipfs/ipfs.go index c9cc4f8..4904010 100644 --- a/ipfs/ipfs.go +++ b/ipfs/ipfs.go @@ -57,7 +57,6 @@ func MakeIPFS(ctx context.Context, db *badger.DB, port int, customDomain string) opts := libp2p.ChainOptions( libp2p.Transport(quic.NewTransport), - libp2p.NATPortMap(), libp2p.Security(libp2ptls.ID, libp2ptls.New), ) From 45d36f09c55f5353eecf31dfb2274851495d0ea9 Mon Sep 17 00:00:00 2001 From: marston Date: Wed, 11 Sep 2024 01:01:27 -0400 Subject: [PATCH 11/12] quic removal? --- ipfs/ipfs.go | 2 -- 1 file changed, 2 deletions(-) diff --git a/ipfs/ipfs.go b/ipfs/ipfs.go index 4904010..c7f078e 100644 --- a/ipfs/ipfs.go +++ b/ipfs/ipfs.go @@ -6,7 +6,6 @@ import ( "github.com/libp2p/go-libp2p" "github.com/libp2p/go-libp2p/core/host" libp2ptls "github.com/libp2p/go-libp2p/p2p/security/tls" - quic "github.com/libp2p/go-libp2p/p2p/transport/quic" "strings" "github.com/dgraph-io/badger/v4" @@ -56,7 +55,6 @@ func MakeIPFS(ctx context.Context, db *badger.DB, port int, customDomain string) } opts := libp2p.ChainOptions( - libp2p.Transport(quic.NewTransport), libp2p.Security(libp2ptls.ID, libp2ptls.New), ) From 8bd852a88aa93fa87e55875bf047711a7000bf79 Mon Sep 17 00:00:00 2001 From: marston Date: Fri, 20 Sep 2024 11:19:52 -0400 Subject: [PATCH 12/12] fixing merge conflicts --- ipfs/ipfs.go | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/ipfs/ipfs.go b/ipfs/ipfs.go index 7399b6b..7433b62 100644 --- a/ipfs/ipfs.go +++ b/ipfs/ipfs.go @@ -3,17 +3,17 @@ package ipfs import ( "context" "fmt" + "strings" + "github.com/libp2p/go-libp2p" "github.com/libp2p/go-libp2p/core/host" libp2ptls "github.com/libp2p/go-libp2p/p2p/security/tls" - "strings" ipfslite "github.com/hsanjuan/ipfs-lite" - bds "github.com/ipfs/go-ds-badger2" + "github.com/ipfs/boxo/blockstore" + "github.com/ipfs/go-datastore" "github.com/libp2p/go-libp2p/core/crypto" "github.com/multiformats/go-multiaddr" - "github.com/ipfs/boxo/blockstore" - datastore "github.com/ipfs/go-datastore" ) func MakeIPFS(ctx context.Context, ds datastore.Batching, bs blockstore.Blockstore, port int, customDomain string) (*ipfslite.Peer, host.Host, error) {