Skip to content
Open
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
2 changes: 1 addition & 1 deletion cmd/dontguess/convention_supersede.go
Original file line number Diff line number Diff line change
Expand Up @@ -276,7 +276,7 @@ func sendSupersede(payload []byte, campfireID string, client *protocol.Client) (
// Uses CF_HOME env var or ~/.campfire as the campfire home directory.
func requireClient() (*protocol.Client, error) {
home := cfHome()
client, err := protocol.Init(home)
client, _, err := protocol.Init(home)
if err != nil {
return nil, fmt.Errorf("initializing campfire client from %s: %w", home, err)
}
Expand Down
2 changes: 1 addition & 1 deletion cmd/dontguess/convention_supersede_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,7 @@ type testAgentResult struct {
func testAgent(t *testing.T) *testAgentResult {
t.Helper()
cfHome := t.TempDir()
client, err := protocol.Init(cfHome)
client, _, err := protocol.Init(cfHome)
if err != nil {
t.Fatalf("protocol.Init for test agent: %v", err)
}
Expand Down
4 changes: 2 additions & 2 deletions cmd/dontguess/serve.go
Original file line number Diff line number Diff line change
Expand Up @@ -62,13 +62,13 @@ func runServe(_ *cobra.Command, _ []string) error {
// Build two clients via protocol.Init — both share the same identity and store file.
// ReadClient subscribes to the campfire; WriteClient sends operator messages.
// SDK sync-before-query handles filesystem transport sync automatically.
readClient, err := protocol.Init(cfHome)
readClient, _, err := protocol.Init(cfHome)
if err != nil {
return fmt.Errorf("protocol.Init (read client): %w", err)
}
defer readClient.Close() //nolint:errcheck

writeClient, err := protocol.Init(cfHome)
writeClient, _, err := protocol.Init(cfHome)
if err != nil {
return fmt.Errorf("protocol.Init (write client): %w", err)
}
Expand Down
2 changes: 1 addition & 1 deletion cmd/seller/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ func main() {
}

// Load or generate seller identity and open store via SDK.
client, err := protocol.Init(cfHome)
client, _, err := protocol.Init(cfHome)
if err != nil {
log.Fatalf("protocol.Init: %v", err)
}
Expand Down
4 changes: 3 additions & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,13 @@ module github.com/campfire-net/dontguess
go 1.25.0

require (
github.com/campfire-net/campfire v0.14.1
github.com/campfire-net/campfire v0.17.0
github.com/spf13/cobra v1.8.1
)

require (
filippo.io/edwards25519 v1.0.0-rc.1 // indirect
github.com/BurntSushi/toml v1.6.0 // indirect
github.com/dustin/go-humanize v1.0.1 // indirect
github.com/fxamacker/cbor/v2 v2.9.0 // indirect
github.com/google/uuid v1.6.0 // indirect
Expand All @@ -19,6 +20,7 @@ require (
github.com/spf13/pflag v1.0.5 // indirect
github.com/taurusgroup/frost-ed25519 v0.0.0-20210707140332-5abc84a4dba7 // indirect
github.com/x448/float16 v0.8.4 // indirect
golang.org/x/crypto v0.41.0 // indirect
golang.org/x/exp v0.0.0-20251023183803-a4bb9ffd2546 // indirect
golang.org/x/sys v0.37.0 // indirect
modernc.org/libc v1.67.6 // indirect
Expand Down
12 changes: 8 additions & 4 deletions go.sum
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
filippo.io/edwards25519 v1.0.0-rc.1 h1:m0VOOB23frXZvAOK44usCgLWvtsxIoMCTBGJZlpmGfU=
filippo.io/edwards25519 v1.0.0-rc.1/go.mod h1:N1IkdkCkiLB6tki+MYJoSx2JTY9NUlxZE7eHn5EwJns=
github.com/campfire-net/campfire v0.14.1 h1:WrhEbnnaHGgaDKr/UXPqJYOveemv5IFkjH3om+GQgAc=
github.com/campfire-net/campfire v0.14.1/go.mod h1:0zytAvc0ukNHXHzuR3iwNyMscd7w+ir4s05lBr61Hlo=
github.com/BurntSushi/toml v1.6.0 h1:dRaEfpa2VI55EwlIW72hMRHdWouJeRF7TPYhI+AUQjk=
github.com/BurntSushi/toml v1.6.0/go.mod h1:ukJfTF/6rtPPRCnwkur4qwRxa8vTRFBF0uk2lLoLwho=
github.com/campfire-net/campfire v0.17.0 h1:8itf6yw3/8S5JklsC3/YcL4XPFAu5hEOEPDdU3bzNvc=
github.com/campfire-net/campfire v0.17.0/go.mod h1:7yy08WJj1VQnA8tcxOnO9QDwmh5K032BtUW8GO9EFeA=
github.com/cpuguy83/go-md2man/v2 v2.0.4/go.mod h1:tgQtvFlXSQOSOSIRvRPT7W67SCa46tRHOmNcaadrF8o=
github.com/davecgh/go-spew v1.1.0 h1:ZDRjVQ15GmhC3fiQ8ni8+OwkZQO4DARzQgrnXU1Liz8=
github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
Expand Down Expand Up @@ -37,12 +39,14 @@ github.com/taurusgroup/frost-ed25519 v0.0.0-20210707140332-5abc84a4dba7 h1:hUvSA
github.com/taurusgroup/frost-ed25519 v0.0.0-20210707140332-5abc84a4dba7/go.mod h1:HvWEpeV7Nptyy1OAzxcb/DvYOhrFfzMUx0CFrzUgQbg=
github.com/x448/float16 v0.8.4 h1:qLwI1I70+NjRFUR3zs1JPUCgaCXSh3SW62uAKT1mSBM=
github.com/x448/float16 v0.8.4/go.mod h1:14CWIYCyZA/cWjXOioeEpHeN/83MdbZDRQHoFcYsOfg=
golang.org/x/crypto v0.41.0 h1:WKYxWedPGCTVVl5+WHSSrOBT0O8lx32+zxmHxijgXp4=
golang.org/x/crypto v0.41.0/go.mod h1:pO5AFd7FA68rFak7rOAGVuygIISepHftHnr8dr6+sUc=
golang.org/x/exp v0.0.0-20251023183803-a4bb9ffd2546 h1:mgKeJMpvi0yx/sU5GsxQ7p6s2wtOnGAHZWCHUM4KGzY=
golang.org/x/exp v0.0.0-20251023183803-a4bb9ffd2546/go.mod h1:j/pmGrbnkbPtQfxEe5D0VQhZC6qKbfKifgD0oM7sR70=
golang.org/x/mod v0.29.0 h1:HV8lRxZC4l2cr3Zq1LvtOsi/ThTgWnUk/y64QSs8GwA=
golang.org/x/mod v0.29.0/go.mod h1:NyhrlYXJ2H4eJiRy/WDBO6HMqZQ6q9nk4JzS3NuCK+w=
golang.org/x/sync v0.17.0 h1:l60nONMj9l5drqw6jlhIELNv9I0A4OFgRsG9k2oT9Ug=
golang.org/x/sync v0.17.0/go.mod h1:9KTHXmSnoGruLpwFjVSX0lNNA75CykiMECbovNTZqGI=
golang.org/x/sync v0.20.0 h1:e0PTpb7pjO8GAtTs2dQ6jYa5BWYlMuX047Dco/pItO4=
golang.org/x/sync v0.20.0/go.mod h1:9xrNwdLfx4jkKbNva9FpL6vEN7evnE43NNNJQ2LF3+0=
golang.org/x/sys v0.6.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.37.0 h1:fdNQudmxPjkdUTPnLn5mdQv7Zwvbvpaxqs831goi9kQ=
golang.org/x/sys v0.37.0/go.mod h1:OgkHotnGiDImocRcuBABYBEXf8A9a87e/uXjp9XT3ks=
Expand Down
2 changes: 1 addition & 1 deletion pkg/exchange/init.go
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,7 @@ func Init(opts InitOptions) (*Config, *protocol.Client, error) {
}

// Open or create identity and store via SDK.
client, err := protocol.Init(configDir)
client, _, err := protocol.Init(configDir)
if err != nil {
return nil, nil, fmt.Errorf("protocol.Init: %w", err)
}
Expand Down
6 changes: 3 additions & 3 deletions pkg/exchange/init_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,7 @@ func TestInit_ConventionDeclarationsPromoted(t *testing.T) {
})

// Use protocol.Init to open a second client and read messages via SDK.
verifyClient, err := protocol.Init(configDir)
verifyClient, _, err := protocol.Init(configDir)
if err != nil {
t.Fatalf("protocol.Init for verify: %v", err)
}
Expand Down Expand Up @@ -205,7 +205,7 @@ func TestInit_PutNotDoublePromoted(t *testing.T) {
ConventionDir: convDir,
})

verifyClient, err := protocol.Init(configDir)
verifyClient, _, err := protocol.Init(configDir)
if err != nil {
t.Fatalf("protocol.Init for verify: %v", err)
}
Expand Down Expand Up @@ -323,7 +323,7 @@ func TestInit_MembershipRecorded(t *testing.T) {
})

// Use protocol.Init to verify membership via the SDK.
verifyClient, err := protocol.Init(configDir)
verifyClient, _, err := protocol.Init(configDir)
if err != nil {
t.Fatalf("protocol.Init for verify: %v", err)
}
Expand Down
4 changes: 2 additions & 2 deletions pkg/exchange/views_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ func TestInit_CreatesNamedViews(t *testing.T) {
})

// Use protocol.Init to read messages via SDK.
verifyClient, err := protocol.Init(cfHome)
verifyClient, _, err := protocol.Init(cfHome)
if err != nil {
t.Fatalf("protocol.Init for verify: %v", err)
}
Expand Down Expand Up @@ -78,7 +78,7 @@ func TestEnsureViews_Idempotent(t *testing.T) {
})

// Use protocol.Init to get a client; EnsureViews reads via client.Read.
client, err := protocol.Init(cfHome)
client, _, err := protocol.Init(cfHome)
if err != nil {
t.Fatalf("protocol.Init: %v", err)
}
Expand Down
Loading