Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

rename from did-dht-method to did-dht #223

Merged
merged 2 commits into from
May 17, 2024
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
6 changes: 3 additions & 3 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ There are many ways to be an open source contributor, and we're here to help you

* Propose ideas in our
[discord](https://discord.gg/tbd)
* Raise an issue or feature request in our [issue tracker](https://github.com/TBD54566975/did-dht-method/issues)
* Raise an issue or feature request in our [issue tracker](https://github.com/TBD54566975/did-dht/issues)
* Help another contributor with one of their questions, or a code review
* Suggest improvements to our Getting Started documentation by supplying a Pull Request
* Evangelize our work together in conferences, podcasts, and social media spaces.
Expand Down Expand Up @@ -87,7 +87,7 @@ $> mage test
### Issues

Anyone from the community is welcome (and encouraged!) to raise issues via
[GitHub Issues](https://github.com/TBD54566975/did-dht-method/issues).
[GitHub Issues](https://github.com/TBD54566975/did-dht/issues).
### Discussions

Design discussions and proposals take place in our [discord](https://discord.gg/tbd).
Expand All @@ -96,7 +96,7 @@ We advocate an asynchronous, written debate model - so write up your thoughts an

### Continuous Integration

Build and Test cycles are run on every commit to every branch on [GitHub Actions](https://github.com/TBD54566975/did-dht-method/actions).
Build and Test cycles are run on every commit to every branch on [GitHub Actions](https://github.com/TBD54566975/did-dht/actions).

## Contribution

Expand Down
18 changes: 9 additions & 9 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
[![godoc did-dht-method](https://img.shields.io/badge/godoc-did_dht_method-blue)](https://github.com/TBD54566975/did-dht-method/impl)
[![godoc did-dht](https://img.shields.io/badge/godoc-did_dht-blue)](https://github.com/TBD54566975/did-dht/impl)
[![go version 1.22.3](https://img.shields.io/badge/go_version-1.22.3-brightgreen)](https://go.dev/)
[![license Apache 2](https://img.shields.io/badge/license-Apache%202-black)](https://github.com/TBD54566975/did-dht-method/blob/main/LICENSE)
[![issues](https://img.shields.io/github/issues/TBD54566975/did-dht-method)](https://github.com/TBD54566975/did-dht-method/issues)
![GitHub Actions Workflow Status](https://img.shields.io/github/actions/workflow/status/tbd54566975/did-dht-method/ci.yml)
[![license Apache 2](https://img.shields.io/badge/license-Apache%202-black)](https://github.com/TBD54566975/did-dht/blob/main/LICENSE)
[![issues](https://img.shields.io/github/issues/TBD54566975/did-dht)](https://github.com/TBD54566975/did-dht/issues)
![GitHub Actions Workflow Status](https://img.shields.io/github/actions/workflow/status/TBD54566975/did-dht/ci.yml)

# did-dht-method
# did-dht

The `did:dht` method. Home to the [DID DHT Method Specification](https://did-dht.com), and a reference implementation of a
gateway server in Go.
The `did:dht` method. Home to the [DID DHT Method Specification](https://did-dht.com), and a reference
implementation of a gateway server in Go.

## Build & Run

Expand Down Expand Up @@ -55,12 +55,12 @@ docker run \

| Language | Client | Server | Link |
| ---------- | ------ | ------ | ---- |
| Go | Yes | Yes | [did-dht-method](./impl), [web5-go](https://github.com/TBD54566975/web5-go/tree/main/dids/diddht) |
| Go | Yes | Yes | [did-dht](./impl), [web5-go](https://github.com/TBD54566975/web5-go/tree/main/dids/diddht) |
| Typescript | Yes | No | [web5-js](https://github.com/TBD54566975/web5-js/blob/main/packages/dids/src/methods/did-dht.ts) |
| Kotlin | Yes | No | [web5-kt](https://github.com/TBD54566975/web5-kt/tree/main/dids/src/main/kotlin/web5/sdk/dids/methods/dht) |
| Swift | Yes | No | [web5-swift](https://github.com/TBD54566975/web5-swift/blob/main/Sources/Web5/Dids/Methods/DIDDHT.swift) |
| Dart | Yes | No | [web5-dart](https://github.com/TBD54566975/web5-dart/tree/main/packages/web5/lib/src/dids/did_dht) |
| Rust | Yes | No | Coming soon! |
| Rust | Yes | No | [web5-rs](https://github.com/TBD54566975/web5-rs/tree/main/crates/dids/src/methods/dht) |

## Project Resources

Expand Down
2 changes: 1 addition & 1 deletion impl/build/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ ARG VERSION
ENV VERSION=$VERSION

# Build using the environment variable
RUN go build -ldflags="-X github.com/TBD54566975/did-dht-method/config.Version=$VERSION" -tags jwx_es256k -o /did-dht ./cmd
RUN go build -ldflags="-X github.com/TBD54566975/did-dht/config.Version=$VERSION" -tags jwx_es256k -o /did-dht ./cmd

EXPOSE 8305
EXPOSE 6881/udp
Expand Down
10 changes: 5 additions & 5 deletions impl/cmd/cli/identity.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,11 @@ import (
"github.com/sirupsen/logrus"
"github.com/spf13/cobra"

"github.com/TBD54566975/did-dht-method/config"
"github.com/TBD54566975/did-dht-method/internal"
"github.com/TBD54566975/did-dht-method/internal/cli"
"github.com/TBD54566975/did-dht-method/internal/util"
"github.com/TBD54566975/did-dht-method/pkg/dht"
"github.com/TBD54566975/did-dht/config"
"github.com/TBD54566975/did-dht/internal"
"github.com/TBD54566975/did-dht/internal/cli"
"github.com/TBD54566975/did-dht/internal/util"
"github.com/TBD54566975/did-dht/pkg/dht"
)

func init() {
Expand Down
12 changes: 6 additions & 6 deletions impl/cmd/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,19 +11,19 @@ import (
"github.com/pkg/errors"
"github.com/sirupsen/logrus"

"github.com/TBD54566975/did-dht-method/config"
int "github.com/TBD54566975/did-dht-method/internal/util"
"github.com/TBD54566975/did-dht-method/pkg/dht"
"github.com/TBD54566975/did-dht-method/pkg/server"
"github.com/TBD54566975/did-dht-method/pkg/telemetry"
"github.com/TBD54566975/did-dht/config"
int "github.com/TBD54566975/did-dht/internal/util"
"github.com/TBD54566975/did-dht/pkg/dht"
"github.com/TBD54566975/did-dht/pkg/server"
"github.com/TBD54566975/did-dht/pkg/telemetry"
)

// main godoc
//
// @title The DID DHT Service
// @description The DID DHT Service
// @contact.name TBD
// @contact.url https://github.com/TBD54566975/did-dht-method
// @contact.url https://github.com/TBD54566975/did-dht
// @contact.email [email protected]
// @license.name Apache 2.0
// @license.url http://www.apache.org/licenses/LICENSE-2.0.html
Expand Down
4 changes: 2 additions & 2 deletions impl/concurrencytest/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@ import (

"github.com/sirupsen/logrus"

"github.com/TBD54566975/did-dht-method/internal/did"
"github.com/TBD54566975/did-dht-method/pkg/dht"
"github.com/TBD54566975/did-dht/internal/did"
"github.com/TBD54566975/did-dht/pkg/dht"
)

var (
Expand Down
2 changes: 1 addition & 1 deletion impl/docs/swagger.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ info:
contact:
email: [email protected]
name: TBD
url: https://github.com/TBD54566975/did-dht-method
url: https://github.com/TBD54566975/did-dht
description: The DID DHT Service
license:
name: Apache 2.0
Expand Down
2 changes: 1 addition & 1 deletion impl/go.mod
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
module github.com/TBD54566975/did-dht-method
module github.com/TBD54566975/did-dht

go 1.22

Expand Down
4 changes: 2 additions & 2 deletions impl/integrationtest/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@ import (

"github.com/sirupsen/logrus"

"github.com/TBD54566975/did-dht-method/internal/did"
"github.com/TBD54566975/did-dht-method/pkg/dht"
"github.com/TBD54566975/did-dht/internal/did"
"github.com/TBD54566975/did-dht/pkg/dht"
)

var (
Expand Down
2 changes: 1 addition & 1 deletion impl/internal/cli/store.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import (
"github.com/TBD54566975/ssi-sdk/util"
"github.com/goccy/go-json"

"github.com/TBD54566975/did-dht-method/internal"
"github.com/TBD54566975/did-dht/internal"
)

const (
Expand Down
2 changes: 1 addition & 1 deletion impl/internal/dht/getput.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ import (
"github.com/anacrolix/dht/v2/krpc"
"github.com/anacrolix/dht/v2/traversal"

"github.com/TBD54566975/did-dht-method/pkg/telemetry"
"github.com/TBD54566975/did-dht/pkg/telemetry"
)

// Copied from https://github.com/anacrolix/dht/blob/master/exts/getput/getput.go and modified
Expand Down
2 changes: 1 addition & 1 deletion impl/internal/did/client_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import (
"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require"

"github.com/TBD54566975/did-dht-method/pkg/dht"
"github.com/TBD54566975/did-dht/pkg/dht"
)

func TestClient(t *testing.T) {
Expand Down
2 changes: 1 addition & 1 deletion impl/magefile.go
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ func Build() error {
println("error getting current version: ", err.Error())
}

return sh.Run(Go, "build", fmt.Sprintf("-ldflags=-X github.com/TBD54566975/did-dht-method/config.Version=%s", version), "-tags", "jwx_es256k", "./...")
return sh.Run(Go, "build", fmt.Sprintf("-ldflags=-X github.com/TBD54566975/did-dht/config.Version=%s", version), "-tags", "jwx_es256k", "./...")
}

// Clean deletes any build artifacts.
Expand Down
6 changes: 3 additions & 3 deletions impl/pkg/dht/dht.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,9 @@ import (
"github.com/stretchr/testify/require"
"golang.org/x/time/rate"

dhtint "github.com/TBD54566975/did-dht-method/internal/dht"
"github.com/TBD54566975/did-dht-method/internal/util"
"github.com/TBD54566975/did-dht-method/pkg/telemetry"
dhtint "github.com/TBD54566975/did-dht/internal/dht"
"github.com/TBD54566975/did-dht/internal/util"
"github.com/TBD54566975/did-dht/pkg/telemetry"
)

// DHT is a wrapper around anacrolix/dht that implements the BEP-44 DHT protocol.
Expand Down
4 changes: 2 additions & 2 deletions impl/pkg/dht/dht_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@ import (
"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require"

"github.com/TBD54566975/did-dht-method/internal/util"
dhtclient "github.com/TBD54566975/did-dht-method/pkg/dht"
"github.com/TBD54566975/did-dht/internal/util"
dhtclient "github.com/TBD54566975/did-dht/pkg/dht"
)

func TestGetPutDHT(t *testing.T) {
Expand Down
2 changes: 1 addition & 1 deletion impl/pkg/dht/dns.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import (
"github.com/anacrolix/torrent/bencode"
"github.com/miekg/dns"

"github.com/TBD54566975/did-dht-method/internal/dht"
"github.com/TBD54566975/did-dht/internal/dht"
)

// CreateDNSPublishRequest creates a put request for the given records. Requires a public/private keypair and
Expand Down
4 changes: 2 additions & 2 deletions impl/pkg/dht/dns_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@ import (
"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require"

"github.com/TBD54566975/did-dht-method/internal/did"
"github.com/TBD54566975/did-dht-method/internal/util"
"github.com/TBD54566975/did-dht/internal/did"
"github.com/TBD54566975/did-dht/internal/util"
)

func TestGetPutDNSDHT(t *testing.T) {
Expand Down
4 changes: 2 additions & 2 deletions impl/pkg/dht/record_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@ import (
"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require"

"github.com/TBD54566975/did-dht-method/internal/did"
"github.com/TBD54566975/did-dht-method/pkg/dht"
"github.com/TBD54566975/did-dht/internal/did"
"github.com/TBD54566975/did-dht/pkg/dht"
)

func TestNewRecord(t *testing.T) {
Expand Down
8 changes: 4 additions & 4 deletions impl/pkg/server/dht.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,10 @@ import (

"github.com/gin-gonic/gin"

"github.com/TBD54566975/did-dht-method/internal/util"
"github.com/TBD54566975/did-dht-method/pkg/dht"
"github.com/TBD54566975/did-dht-method/pkg/service"
"github.com/TBD54566975/did-dht-method/pkg/telemetry"
"github.com/TBD54566975/did-dht/internal/util"
"github.com/TBD54566975/did-dht/pkg/dht"
"github.com/TBD54566975/did-dht/pkg/service"
"github.com/TBD54566975/did-dht/pkg/telemetry"
)

// DHTRouter is the router for the DHT API
Expand Down
10 changes: 5 additions & 5 deletions impl/pkg/server/dht_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,11 @@ import (
"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require"

"github.com/TBD54566975/did-dht-method/config"
"github.com/TBD54566975/did-dht-method/internal/did"
"github.com/TBD54566975/did-dht-method/pkg/dht"
"github.com/TBD54566975/did-dht-method/pkg/service"
"github.com/TBD54566975/did-dht-method/pkg/storage"
"github.com/TBD54566975/did-dht/config"
"github.com/TBD54566975/did-dht/internal/did"
"github.com/TBD54566975/did-dht/pkg/dht"
"github.com/TBD54566975/did-dht/pkg/service"
"github.com/TBD54566975/did-dht/pkg/storage"
)

func TestDHTRouter(t *testing.T) {
Expand Down
2 changes: 1 addition & 1 deletion impl/pkg/server/health.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import (

"github.com/gin-gonic/gin"

"github.com/TBD54566975/did-dht-method/pkg/telemetry"
"github.com/TBD54566975/did-dht/pkg/telemetry"
)

type GetHealthCheckResponse struct {
Expand Down
8 changes: 4 additions & 4 deletions impl/pkg/server/server.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,10 @@ import (
ginswagger "github.com/swaggo/gin-swagger"
"go.opentelemetry.io/contrib/instrumentation/github.com/gin-gonic/gin/otelgin"

"github.com/TBD54566975/did-dht-method/config"
"github.com/TBD54566975/did-dht-method/pkg/dht"
"github.com/TBD54566975/did-dht-method/pkg/service"
"github.com/TBD54566975/did-dht-method/pkg/storage"
"github.com/TBD54566975/did-dht/config"
"github.com/TBD54566975/did-dht/pkg/dht"
"github.com/TBD54566975/did-dht/pkg/service"
"github.com/TBD54566975/did-dht/pkg/storage"
)

const (
Expand Down
4 changes: 2 additions & 2 deletions impl/pkg/server/server_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@ import (
"github.com/gin-gonic/gin"
"github.com/stretchr/testify/assert"

"github.com/TBD54566975/did-dht-method/config"
"github.com/TBD54566975/did-dht-method/pkg/dht"
"github.com/TBD54566975/did-dht/config"
"github.com/TBD54566975/did-dht/pkg/dht"
)

const (
Expand Down
12 changes: 6 additions & 6 deletions impl/pkg/service/dht.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,13 +12,13 @@ import (
"github.com/pkg/errors"
"github.com/sirupsen/logrus"

"github.com/TBD54566975/did-dht-method/internal/util"
"github.com/TBD54566975/did-dht/internal/util"

"github.com/TBD54566975/did-dht-method/config"
dhtint "github.com/TBD54566975/did-dht-method/internal/dht"
"github.com/TBD54566975/did-dht-method/pkg/dht"
"github.com/TBD54566975/did-dht-method/pkg/storage"
"github.com/TBD54566975/did-dht-method/pkg/telemetry"
"github.com/TBD54566975/did-dht/config"
dhtint "github.com/TBD54566975/did-dht/internal/dht"
"github.com/TBD54566975/did-dht/pkg/dht"
"github.com/TBD54566975/did-dht/pkg/storage"
"github.com/TBD54566975/did-dht/pkg/telemetry"
)

const recordSizeLimitBytes = 1000
Expand Down
8 changes: 4 additions & 4 deletions impl/pkg/service/dht_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,10 @@ import (
"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require"

"github.com/TBD54566975/did-dht-method/config"
"github.com/TBD54566975/did-dht-method/internal/did"
"github.com/TBD54566975/did-dht-method/pkg/dht"
"github.com/TBD54566975/did-dht-method/pkg/storage"
"github.com/TBD54566975/did-dht/config"
"github.com/TBD54566975/did-dht/internal/did"
"github.com/TBD54566975/did-dht/pkg/dht"
"github.com/TBD54566975/did-dht/pkg/storage"
)

func TestDHTService(t *testing.T) {
Expand Down
4 changes: 2 additions & 2 deletions impl/pkg/storage/db/bolt/bolt.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@ import (
"github.com/sirupsen/logrus"
bolt "go.etcd.io/bbolt"

"github.com/TBD54566975/did-dht-method/pkg/dht"
"github.com/TBD54566975/did-dht-method/pkg/telemetry"
"github.com/TBD54566975/did-dht/pkg/dht"
"github.com/TBD54566975/did-dht/pkg/telemetry"
)

const (
Expand Down
4 changes: 2 additions & 2 deletions impl/pkg/storage/db/bolt/bolt_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@ import (
"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require"

"github.com/TBD54566975/did-dht-method/internal/did"
"github.com/TBD54566975/did-dht-method/pkg/dht"
"github.com/TBD54566975/did-dht/internal/did"
"github.com/TBD54566975/did-dht/pkg/dht"
)

func TestBoltDB_ReadWrite(t *testing.T) {
Expand Down
2 changes: 1 addition & 1 deletion impl/pkg/storage/db/bolt/dht.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import (

"github.com/TBD54566975/ssi-sdk/util"

"github.com/TBD54566975/did-dht-method/pkg/dht"
"github.com/TBD54566975/did-dht/pkg/dht"
)

var (
Expand Down
4 changes: 2 additions & 2 deletions impl/pkg/storage/db/postgres/postgres.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@ import (
"github.com/sirupsen/logrus"
"github.com/tv42/zbase32"

"github.com/TBD54566975/did-dht-method/pkg/dht"
"github.com/TBD54566975/did-dht-method/pkg/telemetry"
"github.com/TBD54566975/did-dht/pkg/dht"
"github.com/TBD54566975/did-dht/pkg/telemetry"
)

//go:embed migrations
Expand Down
Loading
Loading