Initial commit: waste-go skeleton

Ed25519/X25519/ChaCha20-Poly1305 crypto, peer handshake, mesh state,
IPC server, relay server, and NAT stub. Builds clean on Go 1.22+.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
Fredrik Johansson
2026-06-21 16:14:07 +02:00
commit b3a4af15ca
16 changed files with 1566 additions and 0 deletions

7
.vscode/extensions.json vendored Normal file
View File

@@ -0,0 +1,7 @@
{
"recommendations": [
"golang.go",
"usernamehw.errorlens",
"streetsidesoftware.code-spell-checker"
]
}

55
.vscode/launch.json vendored Normal file
View File

@@ -0,0 +1,55 @@
{
"version": "0.2.0",
"configurations": [
{
"name": "daemon (peer A)",
"type": "go",
"request": "launch",
"mode": "auto",
"program": "${workspaceFolder}/cmd/daemon",
"args": [
"-alias", "peer-a",
"-data-dir", "/tmp/waste-a",
"-peer-port", "17338",
"-ipc-port", "17337"
],
"env": { "WASTE_LOG": "debug" }
},
{
"name": "daemon (peer B)",
"type": "go",
"request": "launch",
"mode": "auto",
"program": "${workspaceFolder}/cmd/daemon",
"args": [
"-alias", "peer-b",
"-data-dir", "/tmp/waste-b",
"-peer-port", "17340",
"-ipc-port", "17341"
],
"env": { "WASTE_LOG": "debug" }
},
{
"name": "relay (local)",
"type": "go",
"request": "launch",
"mode": "auto",
"program": "${workspaceFolder}/cmd/relay",
"args": ["-bind", "127.0.0.1:17339"]
},
{
"name": "daemon (with relay)",
"type": "go",
"request": "launch",
"mode": "auto",
"program": "${workspaceFolder}/cmd/daemon",
"args": [
"-alias", "peer-a",
"-data-dir", "/tmp/waste-a",
"-peer-port", "17338",
"-ipc-port", "17337",
"-relay", "127.0.0.1:17339"
]
}
]
}

21
.vscode/settings.json vendored Normal file
View File

@@ -0,0 +1,21 @@
{
"go.useLanguageServer": true,
"go.lintTool": "golangci-lint",
"go.lintOnSave": "package",
"go.formatTool": "goimports",
"go.formatOnSave": true,
"editor.formatOnSave": true,
"[go]": {
"editor.defaultFormatter": "golang.go",
"editor.codeActionsOnSave": {
"source.organizeImports": "explicit"
}
},
"go.testFlags": ["-v", "-race"],
"files.watcherExclude": {
"**/bin/**": true
},
"search.exclude": {
"**/bin": true
}
}

46
.vscode/tasks.json vendored Normal file
View File

@@ -0,0 +1,46 @@
{
"version": "2.0.0",
"tasks": [
{
"label": "build all",
"type": "shell",
"command": "go build ./...",
"group": { "kind": "build", "isDefault": true },
"problemMatcher": ["$go"]
},
{
"label": "go mod tidy",
"type": "shell",
"command": "go mod tidy",
"problemMatcher": []
},
{
"label": "test all",
"type": "shell",
"command": "go test -race ./...",
"group": "test",
"problemMatcher": ["$go"]
},
{
"label": "run relay (local)",
"type": "shell",
"command": "go run ./cmd/relay -bind 127.0.0.1:17339",
"presentation": { "reveal": "always", "panel": "dedicated", "group": "runtime" },
"problemMatcher": []
},
{
"label": "run daemon (peer A)",
"type": "shell",
"command": "go run ./cmd/daemon -alias peer-a -data-dir /tmp/waste-a -peer-port 17338 -ipc-port 17337",
"presentation": { "reveal": "always", "panel": "dedicated", "group": "runtime" },
"problemMatcher": []
},
{
"label": "run daemon (peer B)",
"type": "shell",
"command": "go run ./cmd/daemon -alias peer-b -data-dir /tmp/waste-b -peer-port 17340 -ipc-port 17341",
"presentation": { "reveal": "always", "panel": "dedicated", "group": "runtime" },
"problemMatcher": []
}
]
}