Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
# go-libdht

[![ProbeLab](https://img.shields.io/badge/made%20by-ProbeLab-blue.svg)](https://probelab.io)
[![GoDoc](https://pkg.go.dev/badge/github.com/probe-lab/go-libdht)](https://pkg.go.dev/github.com/probe-lab/go-libdht)
[![Build status](https://img.shields.io/github/actions/workflow/status/probe-lab/go-libdht/go-test.yml?branch=main)](https://github.com/probe-lab/go-libdht/actions)
[![GoDoc](https://pkg.go.dev/badge/github.com/ipfs/go-libdht)](https://pkg.go.dev/github.com/ipfs/go-libdht)
[![Build status](https://img.shields.io/github/actions/workflow/status/ipfs/go-libdht/go-test.yml?branch=main)](https://github.com/ipfs/go-libdht/actions)

`go-libdht` is a generic toolbox designed for the implementation and experimentation of Distributed Hash Tables (DHT) in Go. It establishes foundational types and interfaces applicable across a broad spectrum of DHTs, especially those sharing a similar topology. By offering reusable components like keys and routing tables, `go-libdht` streamlines the DHT implementation process. Using `go-libdht`, developers can seamlessly craft their own DHTs using the provided modular components.

Expand Down
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
module github.com/probe-lab/go-libdht
module github.com/ipfs/go-libdht

go 1.23

Expand Down
6 changes: 3 additions & 3 deletions kad/kadtest/ids.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@ package kadtest
import (
"crypto/sha256"

"github.com/probe-lab/go-libdht/kad"
"github.com/probe-lab/go-libdht/kad/key"
"github.com/probe-lab/go-libdht/kad/key/bit256"
"github.com/ipfs/go-libdht/kad"
"github.com/ipfs/go-libdht/kad/key"
"github.com/ipfs/go-libdht/kad/key/bit256"
)

// ID is a concrete implementation of the NodeID interface.
Expand Down
2 changes: 1 addition & 1 deletion kad/kadtest/key.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ package kadtest
import (
"fmt"

"github.com/probe-lab/go-libdht/kad"
"github.com/ipfs/go-libdht/kad"
)

const bitPanicMsg = "bit index out of range"
Expand Down
2 changes: 1 addition & 1 deletion kad/kadtest/key_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ package kadtest
import (
"testing"

"github.com/probe-lab/go-libdht/kad/key/test"
"github.com/ipfs/go-libdht/kad/key/test"
)

func TestKey32(t *testing.T) {
Expand Down
2 changes: 1 addition & 1 deletion kad/kadtest/rand.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import (
"math/rand"
"strconv"

"github.com/probe-lab/go-libdht/kad/key/bit256"
"github.com/ipfs/go-libdht/kad/key/bit256"
)

var rng = rand.New(rand.NewSource(299792458))
Expand Down
4 changes: 2 additions & 2 deletions kad/key/bit256/key.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@ import (
"encoding/hex"
"math"

"github.com/probe-lab/go-libdht/kad"
"github.com/probe-lab/go-libdht/kad/key"
"github.com/ipfs/go-libdht/kad"
"github.com/ipfs/go-libdht/kad/key"
)

// KeyLen is the length of a 256-bit key in bytes.
Expand Down
2 changes: 1 addition & 1 deletion kad/key/bit256/key_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ package bit256
import (
"testing"

"github.com/probe-lab/go-libdht/kad/key/test"
"github.com/ipfs/go-libdht/kad/key/test"
)

func TestKey(t *testing.T) {
Expand Down
4 changes: 2 additions & 2 deletions kad/key/bitstr/key.go
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
package bitstr

import (
"github.com/probe-lab/go-libdht/kad"
"github.com/probe-lab/go-libdht/kad/key"
"github.com/ipfs/go-libdht/kad"
"github.com/ipfs/go-libdht/kad/key"
)

// Key is a binary key represented by a string of 1's and 0's
Expand Down
2 changes: 1 addition & 1 deletion kad/key/bitstr/key_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ package bitstr
import (
"testing"

"github.com/probe-lab/go-libdht/kad/key/test"
"github.com/ipfs/go-libdht/kad/key/test"
)

// TestBitStrKey7 tests a strange 7-bit Kademlia key
Expand Down
4 changes: 2 additions & 2 deletions kad/key/test/keytest.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@ import (
"strconv"
"testing"

"github.com/probe-lab/go-libdht/kad"
"github.com/probe-lab/go-libdht/kad/key"
"github.com/ipfs/go-libdht/kad"
"github.com/ipfs/go-libdht/kad/key"

"github.com/stretchr/testify/require"
)
Expand Down
6 changes: 3 additions & 3 deletions kad/key/test/util_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@ import (
"strings"
"testing"

"github.com/probe-lab/go-libdht/kad/key"
"github.com/probe-lab/go-libdht/kad/key/bit256"
"github.com/probe-lab/go-libdht/kad/key/bitstr"
"github.com/ipfs/go-libdht/kad/key"
"github.com/ipfs/go-libdht/kad/key/bit256"
"github.com/ipfs/go-libdht/kad/key/bitstr"
"github.com/stretchr/testify/require"
)

Expand Down
2 changes: 1 addition & 1 deletion kad/key/util.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import (
"sort"
"strings"

"github.com/probe-lab/go-libdht/kad"
"github.com/ipfs/go-libdht/kad"
)

// ErrInvalidDataLength is the error returned when attempting to construct a key from binary data of the wrong length.
Expand Down
4 changes: 2 additions & 2 deletions kad/trie/trie.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ package trie
import (
"slices"

"github.com/probe-lab/go-libdht/kad"
"github.com/probe-lab/go-libdht/kad/key"
"github.com/ipfs/go-libdht/kad"
"github.com/ipfs/go-libdht/kad/key"
)

// Trie is a trie for equal-length bit vectors, which stores values only in the leaves.
Expand Down
6 changes: 3 additions & 3 deletions kad/trie/trie_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@ import (
"math/rand"
"testing"

"github.com/probe-lab/go-libdht/kad"
"github.com/probe-lab/go-libdht/kad/kadtest"
"github.com/probe-lab/go-libdht/kad/key"
"github.com/ipfs/go-libdht/kad"
"github.com/ipfs/go-libdht/kad/kadtest"
"github.com/ipfs/go-libdht/kad/key"

"github.com/stretchr/testify/require"
)
Expand Down
2 changes: 1 addition & 1 deletion kad/triert/config.go
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package triert

import (
"github.com/probe-lab/go-libdht/kad"
"github.com/ipfs/go-libdht/kad"
)

// Config holds configuration options for a TrieRT.
Expand Down
2 changes: 1 addition & 1 deletion kad/triert/filter.go
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package triert

import "github.com/probe-lab/go-libdht/kad"
import "github.com/ipfs/go-libdht/kad"

// KeyFilterFunc is a function that is applied before a key is added to the table.
// Return false to prevent the key from being added.
Expand Down
2 changes: 1 addition & 1 deletion kad/triert/filter_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import (
"fmt"
"testing"

"github.com/probe-lab/go-libdht/kad/kadtest"
"github.com/ipfs/go-libdht/kad/kadtest"
"github.com/stretchr/testify/require"
)

Expand Down
8 changes: 4 additions & 4 deletions kad/triert/table.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,10 @@ import (
"sync"
"sync/atomic"

"github.com/probe-lab/go-libdht/kad"
"github.com/probe-lab/go-libdht/kad/kadtest"
"github.com/probe-lab/go-libdht/kad/key/bit256"
"github.com/probe-lab/go-libdht/kad/trie"
"github.com/ipfs/go-libdht/kad"
"github.com/ipfs/go-libdht/kad/kadtest"
"github.com/ipfs/go-libdht/kad/key/bit256"
"github.com/ipfs/go-libdht/kad/trie"
)

// TrieRT is a routing table backed by a XOR Trie which offers good scalablity and performance
Expand Down
6 changes: 3 additions & 3 deletions kad/triert/table_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@ import (
"sync"
"testing"

"github.com/probe-lab/go-libdht/kad"
"github.com/probe-lab/go-libdht/kad/kadtest"
"github.com/probe-lab/go-libdht/kad/key"
"github.com/ipfs/go-libdht/kad"
"github.com/ipfs/go-libdht/kad/kadtest"
"github.com/ipfs/go-libdht/kad/key"
"github.com/stretchr/testify/require"
)

Expand Down