diff --git a/.github/workflows/drivechain-server.yml b/.github/workflows/bitwindowd.yml similarity index 79% rename from .github/workflows/drivechain-server.yml rename to .github/workflows/bitwindowd.yml index 742607ab..60da58ce 100644 --- a/.github/workflows/drivechain-server.yml +++ b/.github/workflows/bitwindowd.yml @@ -4,12 +4,12 @@ on: pull_request: branches: [master] paths: - - 'drivechain-server/**' + - 'servers/**' - '.github/workflows/**' defaults: run: - working-directory: drivechain-server + working-directory: servers/bitwindow jobs: lint: @@ -19,7 +19,7 @@ jobs: - uses: bufbuild/buf-setup-action@v1.36.0 - uses: bufbuild/buf-lint-action@v1.1.1 with: - input: drivechain-server + input: servers/bitwindow - name: verify Proto files are formatted correctly run: buf format --exit-code proto @@ -37,7 +37,7 @@ jobs: - name: golangci-lint uses: golangci/golangci-lint-action@v6 with: - working-directory: drivechain-server + working-directory: servers/bitwindow version: latest go-build: @@ -48,7 +48,7 @@ jobs: runs-on: ${{ matrix.os }} defaults: run: - working-directory: drivechain-server + working-directory: servers/bitwindow steps: - uses: extractions/setup-just@v1 - uses: actions/checkout@v4 @@ -68,15 +68,15 @@ jobs: - uses: actions/upload-artifact@v4 with: name: bdk-cli${{ runner.os == 'Windows' && '.exe' || '' }}-${{ runner.os }} - path: drivechain-server/bin + path: servers/bitwindow/bin if-no-files-found: error - - name: Build drivechain-server + - name: Build bitwindowd run: | just build-go - mv bin/drivechain-server bin/drivechain-server-${{ runner.os }} + mv bin/bitwindowd bin/bitwindowd-${{ runner.os }} - uses: actions/upload-artifact@v4 with: - name: drivechain-server-${{ runner.os }} - path: drivechain-server/bin + name: bitwindowd-${{ runner.os }} + path: servers/bitwindow/bin if-no-files-found: error diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 677cc7b1..e228c9d9 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -4,7 +4,7 @@ on: push: branches: [master] paths: - - 'drivechain-server/**' + - 'servers/**' - 'clients/scripts/**' - 'clients/bitwindow/**' - 'clients/sidesail/**' @@ -12,7 +12,7 @@ on: pull_request: branches: [master] paths: - - 'drivechain-server/**' + - 'servers/**' - 'clients/scripts/**' - 'clients/bitwindow/**' - 'clients/sidesail/**' @@ -73,7 +73,7 @@ jobs: - uses: actions/checkout@v4 - uses: subosito/flutter-action@v2 - uses: extractions/setup-just@v1 - # Setup go for building drivechain-server + # Setup go for building bitwindowd - uses: actions/setup-go@v5 with: go-version: "1.23" diff --git a/.github/workflows/faucet-backend.yml b/.github/workflows/faucetd.yml similarity index 85% rename from .github/workflows/faucet-backend.yml rename to .github/workflows/faucetd.yml index eee6a225..c22b90ec 100644 --- a/.github/workflows/faucet-backend.yml +++ b/.github/workflows/faucetd.yml @@ -4,12 +4,12 @@ on: pull_request: branches: [master] paths: - - 'faucet-backend/**' + - 'servers/faucet/**' - '.github/workflows/**' defaults: run: - working-directory: faucet-backend + working-directory: servers/faucet jobs: go-lint: @@ -25,7 +25,7 @@ jobs: - name: golangci-lint uses: golangci/golangci-lint-action@v6 with: - working-directory: faucet-backend + working-directory: servers/faucet version: latest go-build: diff --git a/.vscode/launch.json b/.vscode/launch.json index de4d91b9..4c56857f 100644 --- a/.vscode/launch.json +++ b/.vscode/launch.json @@ -11,9 +11,9 @@ "type": "dart", "toolArgs": [ "--dart-define", - "DRIVECHAIN_HOST=localhost", + "BITWINDOWD_HOST=localhost", "--dart-define", - "DRIVECHAIN_PORT=8080" + "BITWINDOWD_PORT=8080" ] }, { @@ -24,9 +24,9 @@ "flutterMode": "profile", "toolArgs": [ "--dart-define", - "DRIVECHAIN_HOST=localhost", + "BITWINDOWD_HOST=localhost", "--dart-define", - "DRIVECHAIN_PORT=8080" + "BITWINDOWD_PORT=8080" ] }, { @@ -37,9 +37,9 @@ "flutterMode": "release", "toolArgs": [ "--dart-define", - "DRIVECHAIN_HOST=localhost", + "BITWINDOWD_HOST=localhost", "--dart-define", - "DRIVECHAIN_PORT=8080" + "BITWINDOWD_PORT=8080" ] }, { diff --git a/README.md b/README.md index 1f7d3162..84fda253 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,9 @@ A collection of various Drivechain-related applications. -- [SideSail](packages/sidesail/README.md) -- [Faucet frontend](packages/faucet/README.md) -- [Faucet backend](faucet-backend/README.md) -- [Drivechain server](drivechain-server/README.md) +- [SideSail](clients/sidesail/README.md) + +- [Faucet frontend](clients/faucet/README.md) +- [Faucet server](servers/faucet/README.md) + +- [Bitwindow frontend](clients/bitwindow/README.md) +- [Bitwindow server](servers/bitwindow/README.md) diff --git a/clients/bitwindow/Justfile b/clients/bitwindow/Justfile index 1d7ab1ec..820fd0aa 100644 --- a/clients/bitwindow/Justfile +++ b/clients/bitwindow/Justfile @@ -2,7 +2,7 @@ format: find . -name "*.dart" -not -path "./lib/gen/*" | xargs dart format -l 120 gen: - buf generate ../../drivechain-server + buf generate ../../bitwindow gen-enforcer: buf generate --template buf.gen.yaml https://github.com/LayerTwo-Labs/cusf_sidechain_proto.git diff --git a/clients/bitwindow/README.md b/clients/bitwindow/README.md index f861a8de..02042cfc 100644 --- a/clients/bitwindow/README.md +++ b/clients/bitwindow/README.md @@ -7,14 +7,14 @@ This package contains a frontend for interacting with a Drivechain-enabled layer To get the app(s) up and running, make sure you have the following dependencies: * The [Flutter SDK](https://flutter.dev) -* An instance of [drivechain-server](../../drivechain-server) running -* The `DRIVECHAIN_HOST` and `DRIVECHAIN_PORT` environment variable pointing to the above instance +* An instance of [bitwindowd](../../servers/bitwindow) running +* The `BITWINDOWD_HOST` and `BITWINDOWD_PORT` environment variable pointing to the above instance * A BIP 300/301 enabled node running Running the app is as simple as the following command: ```bash -flutter run --dart-define DRIVECHAIN_HOST=localhost --dart-define DRIVECHAIN_PORT=8080 +flutter run --dart-define BITWINDOWD_HOST=localhost --dart-define BITWINDOWD_PORT=8080 ``` The project is set up with launch configurations for Visual Studio Code as well. \ No newline at end of file diff --git a/clients/bitwindow/lib/main.dart b/clients/bitwindow/lib/main.dart index 563fbd92..e6d6b384 100644 --- a/clients/bitwindow/lib/main.dart +++ b/clients/bitwindow/lib/main.dart @@ -32,7 +32,7 @@ void main() async { const windowOptions = WindowOptions( minimumSize: Size(600, 700), titleBarStyle: TitleBarStyle.normal, - title: 'Drivechain (Bitcoin Core)', + title: 'Bitcoin Core + CUSF BIP 300/301 Activator', ); unawaited( @@ -126,7 +126,7 @@ Future initDependencies(Logger log, File logFile) async { host: env(Environment.drivechainHost), port: env(Environment.drivechainPort), conf: mainchainConf, - binary: 'drivechain-server', + binary: 'bitwindowd', logPath: serverLogFile, ), ); diff --git a/clients/bitwindow/scripts/download-binaries.sh b/clients/bitwindow/scripts/download-binaries.sh index 5430fdf4..0719328f 100755 --- a/clients/bitwindow/scripts/download-binaries.sh +++ b/clients/bitwindow/scripts/download-binaries.sh @@ -116,24 +116,24 @@ fi echo Going back to $old_cwd cd $old_cwd -cd ../../drivechain-server +cd ../../servers/bitwindow server_cwd=$(pwd) -# Build bdk-cli and drivechain-server -echo "Building bdk-cli and drivechain-server in $server_cwd" +# Build bdk-cli and bitwindowd +echo "Building bdk-cli and bitwindowd in $server_cwd" # Build bdk-cli echo "Building bdk-cli" just build-bdk-cli -# Build drivechain-server -echo "Building drivechain-server" +# Build bitwindowd +echo "Building bitwindowd" just build-go # Move the necessary binaries to the assets directory -mv bin/drivechain-server $assets_dir/ +mv bin/bitwindowd $assets_dir/ -echo "drivechain-server with embedded bdk-cli have been built and moved to $assets_dir" +echo "bitwindowd with embedded bdk-cli have been built and moved to $assets_dir" echo Going back to $old_cwd cd $old_cwd \ No newline at end of file diff --git a/drivechain-server/bdk/bin/.gitkeep b/drivechain-server/bdk/bin/.gitkeep deleted file mode 100644 index e69de29b..00000000 diff --git a/faucet-backend/.gitignore b/faucet-backend/.gitignore deleted file mode 100644 index 0c222e90..00000000 --- a/faucet-backend/.gitignore +++ /dev/null @@ -1 +0,0 @@ -faucet-backend diff --git a/faucet-backend/Dockerfile b/faucet-backend/Dockerfile deleted file mode 100644 index e42fdcef..00000000 --- a/faucet-backend/Dockerfile +++ /dev/null @@ -1,15 +0,0 @@ -FROM golang:alpine AS builder - -WORKDIR /build - -ADD . . - -RUN go build -v -o ./faucet-backend . - -FROM alpine AS final - -RUN apk add curl - -COPY --from=builder /build/faucet-backend /usr/bin/ - -CMD ["faucet-backend"] \ No newline at end of file diff --git a/scripts/deploy-faucet.sh b/scripts/deploy-faucet.sh index 4a8d3db8..510f52ab 100755 --- a/scripts/deploy-faucet.sh +++ b/scripts/deploy-faucet.sh @@ -1,10 +1,10 @@ #!/usr/bin/env bash -set -e +set -e -cd faucet-backend/ -docker build -t faucet-backend . -cd ../ +cd servers/faucet/ +docker build -t faucet . +cd ../../ docker compose --file docker-compose.faucet.yml up -d --force-recreate cd ./clients/faucet @@ -15,4 +15,4 @@ flutter build web --profile --dart-define=Dart2jsOptimization=O0 --output=./buil # Clean old stuff sudo rm -rf /var/www/drivechain-live/* # Move over new stuff -sudo cp -r ./build/web/* /var/www/drivechain-live/ \ No newline at end of file +sudo cp -r ./build/web/* /var/www/drivechain-live/ diff --git a/drivechain-server/.gitignore b/servers/bitwindow/.gitignore similarity index 53% rename from drivechain-server/.gitignore rename to servers/bitwindow/.gitignore index 90e45223..dd2f18b8 100644 --- a/drivechain-server/.gitignore +++ b/servers/bitwindow/.gitignore @@ -1,4 +1,4 @@ -drivechain-server +bitwindowd bin/ .crates* /*.mdb diff --git a/drivechain-server/Justfile b/servers/bitwindow/Justfile similarity index 98% rename from drivechain-server/Justfile rename to servers/bitwindow/Justfile index 435227a5..81d739ec 100644 --- a/drivechain-server/Justfile +++ b/servers/bitwindow/Justfile @@ -1,5 +1,5 @@ build-go: - go build -o ./bin/drivechain-server . + go build -o ./bin/bitwindowd . build: build-bdk-cli build-enforcer build-go diff --git a/drivechain-server/README.md b/servers/bitwindow/README.md similarity index 99% rename from drivechain-server/README.md rename to servers/bitwindow/README.md index ff08ba83..77aded47 100644 --- a/drivechain-server/README.md +++ b/servers/bitwindow/README.md @@ -40,7 +40,7 @@ $ ./enforcer/bin/bip300301_enforcer \ # # The same Electrum server also powers the mempool instance # at https://drivechain.ngu-tek.no. -$ ./bin/drivechain-server \ +$ ./bin/bitwindowd \ --electrum.host=drivechain.live:50001 \ --electrum.no-ssl \ --bitcoincore.rpcuser=user \ diff --git a/drivechain-server/api/bitcoind/bitcoind.go b/servers/bitwindow/api/bitcoind/bitcoind.go similarity index 97% rename from drivechain-server/api/bitcoind/bitcoind.go rename to servers/bitwindow/api/bitcoind/bitcoind.go index 43268a3a..1973d249 100644 --- a/drivechain-server/api/bitcoind/bitcoind.go +++ b/servers/bitwindow/api/bitcoind/bitcoind.go @@ -7,8 +7,8 @@ import ( "slices" "connectrpc.com/connect" - pb "github.com/LayerTwo-Labs/sidesail/drivechain-server/gen/bitcoind/v1" - rpc "github.com/LayerTwo-Labs/sidesail/drivechain-server/gen/bitcoind/v1/bitcoindv1connect" + pb "github.com/LayerTwo-Labs/sidesail/servers/bitwindow/gen/bitcoind/v1" + rpc "github.com/LayerTwo-Labs/sidesail/servers/bitwindow/gen/bitcoind/v1/bitcoindv1connect" corepb "github.com/barebitcoin/btc-buf/gen/bitcoin/bitcoind/v1alpha" coreproxy "github.com/barebitcoin/btc-buf/server" "github.com/btcsuite/btcd/btcutil" diff --git a/drivechain-server/api/drivechain/drivechain.go b/servers/bitwindow/api/drivechain/drivechain.go similarity index 92% rename from drivechain-server/api/drivechain/drivechain.go rename to servers/bitwindow/api/drivechain/drivechain.go index b29f79df..b5304cd1 100644 --- a/drivechain-server/api/drivechain/drivechain.go +++ b/servers/bitwindow/api/drivechain/drivechain.go @@ -4,10 +4,10 @@ import ( "context" "connectrpc.com/connect" - validatorpb "github.com/LayerTwo-Labs/sidesail/drivechain-server/gen/cusf/mainchain/v1" - validatorrpc "github.com/LayerTwo-Labs/sidesail/drivechain-server/gen/cusf/mainchain/v1/mainchainv1connect" - pb "github.com/LayerTwo-Labs/sidesail/drivechain-server/gen/drivechain/v1" - rpc "github.com/LayerTwo-Labs/sidesail/drivechain-server/gen/drivechain/v1/drivechainv1connect" + validatorpb "github.com/LayerTwo-Labs/sidesail/servers/bitwindow/gen/cusf/mainchain/v1" + validatorrpc "github.com/LayerTwo-Labs/sidesail/servers/bitwindow/gen/cusf/mainchain/v1/mainchainv1connect" + pb "github.com/LayerTwo-Labs/sidesail/servers/bitwindow/gen/drivechain/v1" + rpc "github.com/LayerTwo-Labs/sidesail/servers/bitwindow/gen/drivechain/v1/drivechainv1connect" coreproxy "github.com/barebitcoin/btc-buf/server" "github.com/btcsuite/btcd/chaincfg/chainhash" "github.com/rs/zerolog" diff --git a/drivechain-server/api/wallet/wallet.go b/servers/bitwindow/api/wallet/wallet.go similarity index 96% rename from drivechain-server/api/wallet/wallet.go rename to servers/bitwindow/api/wallet/wallet.go index 1e196c7d..c6d56132 100644 --- a/drivechain-server/api/wallet/wallet.go +++ b/servers/bitwindow/api/wallet/wallet.go @@ -9,13 +9,13 @@ import ( "time" "connectrpc.com/connect" - "github.com/LayerTwo-Labs/sidesail/drivechain-server/bdk" - "github.com/LayerTwo-Labs/sidesail/drivechain-server/drivechain" - validatorrpc "github.com/LayerTwo-Labs/sidesail/drivechain-server/gen/cusf/mainchain/v1/mainchainv1connect" - drivechainpb "github.com/LayerTwo-Labs/sidesail/drivechain-server/gen/drivechain/v1" - drivechainrpc "github.com/LayerTwo-Labs/sidesail/drivechain-server/gen/drivechain/v1/drivechainv1connect" - pb "github.com/LayerTwo-Labs/sidesail/drivechain-server/gen/wallet/v1" - rpc "github.com/LayerTwo-Labs/sidesail/drivechain-server/gen/wallet/v1/walletv1connect" + "github.com/LayerTwo-Labs/sidesail/servers/bitwindow/bdk" + "github.com/LayerTwo-Labs/sidesail/servers/bitwindow/drivechain" + validatorrpc "github.com/LayerTwo-Labs/sidesail/servers/bitwindow/gen/cusf/mainchain/v1/mainchainv1connect" + drivechainpb "github.com/LayerTwo-Labs/sidesail/servers/bitwindow/gen/drivechain/v1" + drivechainrpc "github.com/LayerTwo-Labs/sidesail/servers/bitwindow/gen/drivechain/v1/drivechainv1connect" + pb "github.com/LayerTwo-Labs/sidesail/servers/bitwindow/gen/wallet/v1" + rpc "github.com/LayerTwo-Labs/sidesail/servers/bitwindow/gen/wallet/v1/walletv1connect" corepb "github.com/barebitcoin/btc-buf/gen/bitcoin/bitcoind/v1alpha" coreproxy "github.com/barebitcoin/btc-buf/server" "github.com/btcsuite/btcd/btcutil" diff --git a/drivechain-server/bdk/bdk.go b/servers/bitwindow/bdk/bdk.go similarity index 99% rename from drivechain-server/bdk/bdk.go rename to servers/bitwindow/bdk/bdk.go index d8b5e089..ce445c0b 100644 --- a/drivechain-server/bdk/bdk.go +++ b/servers/bitwindow/bdk/bdk.go @@ -17,7 +17,7 @@ import ( "sync" "time" - "github.com/LayerTwo-Labs/sidesail/drivechain-server/dir" + "github.com/LayerTwo-Labs/sidesail/servers/bitwindow/dir" "github.com/btcsuite/btcd/btcutil" "github.com/btcsuite/btcd/chaincfg/chainhash" "github.com/btcsuite/btcd/wire" diff --git a/drivechain-server/buf.gen.yaml b/servers/bitwindow/buf.gen.yaml similarity index 88% rename from drivechain-server/buf.gen.yaml rename to servers/bitwindow/buf.gen.yaml index 6e4fc1d0..5dba3649 100644 --- a/drivechain-server/buf.gen.yaml +++ b/servers/bitwindow/buf.gen.yaml @@ -4,7 +4,7 @@ managed: enabled: true override: - file_option: go_package_prefix - value: github.com/LayerTwo-Labs/sidesail/drivechain-server/gen + value: github.com/LayerTwo-Labs/sidesail/servers/bitwindow/gen plugins: # Base types for Go. Generates message and enum types. diff --git a/drivechain-server/buf.yaml b/servers/bitwindow/buf.yaml similarity index 85% rename from drivechain-server/buf.yaml rename to servers/bitwindow/buf.yaml index 56dbebd4..f655120c 100644 --- a/drivechain-server/buf.yaml +++ b/servers/bitwindow/buf.yaml @@ -13,4 +13,4 @@ breaking: modules: - path: proto - name: buf.build/layertwo-labs/drivechain-server \ No newline at end of file + name: buf.build/layertwo-labs/bitwindowd \ No newline at end of file diff --git a/drivechain-server/config.go b/servers/bitwindow/config.go similarity index 100% rename from drivechain-server/config.go rename to servers/bitwindow/config.go diff --git a/drivechain-server/dial/dial.go b/servers/bitwindow/dial/dial.go similarity index 94% rename from drivechain-server/dial/dial.go rename to servers/bitwindow/dial/dial.go index ebfb336b..9811f7ea 100644 --- a/drivechain-server/dial/dial.go +++ b/servers/bitwindow/dial/dial.go @@ -10,8 +10,8 @@ import ( "time" "connectrpc.com/connect" - pb "github.com/LayerTwo-Labs/sidesail/drivechain-server/gen/cusf/mainchain/v1" - rpc "github.com/LayerTwo-Labs/sidesail/drivechain-server/gen/cusf/mainchain/v1/mainchainv1connect" + pb "github.com/LayerTwo-Labs/sidesail/servers/bitwindow/gen/cusf/mainchain/v1" + rpc "github.com/LayerTwo-Labs/sidesail/servers/bitwindow/gen/cusf/mainchain/v1/mainchainv1connect" "github.com/btcsuite/btcd/chaincfg/chainhash" "github.com/rs/zerolog" "golang.org/x/net/http2" diff --git a/drivechain-server/dir/dir.go b/servers/bitwindow/dir/dir.go similarity index 100% rename from drivechain-server/dir/dir.go rename to servers/bitwindow/dir/dir.go diff --git a/drivechain-server/drivechain/script.go b/servers/bitwindow/drivechain/script.go similarity index 100% rename from drivechain-server/drivechain/script.go rename to servers/bitwindow/drivechain/script.go diff --git a/drivechain-server/drivechain/utils.go b/servers/bitwindow/drivechain/utils.go similarity index 100% rename from drivechain-server/drivechain/utils.go rename to servers/bitwindow/drivechain/utils.go diff --git a/drivechain-server/gen/bitcoind/v1/bitcoind.pb.go b/servers/bitwindow/gen/bitcoind/v1/bitcoind.pb.go similarity index 100% rename from drivechain-server/gen/bitcoind/v1/bitcoind.pb.go rename to servers/bitwindow/gen/bitcoind/v1/bitcoind.pb.go diff --git a/drivechain-server/gen/bitcoind/v1/bitcoindv1connect/bitcoind.connect.go b/servers/bitwindow/gen/bitcoind/v1/bitcoindv1connect/bitcoind.connect.go similarity index 99% rename from drivechain-server/gen/bitcoind/v1/bitcoindv1connect/bitcoind.connect.go rename to servers/bitwindow/gen/bitcoind/v1/bitcoindv1connect/bitcoind.connect.go index 5d4dd605..2a463f78 100644 --- a/drivechain-server/gen/bitcoind/v1/bitcoindv1connect/bitcoind.connect.go +++ b/servers/bitwindow/gen/bitcoind/v1/bitcoindv1connect/bitcoind.connect.go @@ -8,7 +8,7 @@ import ( connect "connectrpc.com/connect" context "context" errors "errors" - v1 "github.com/LayerTwo-Labs/sidesail/drivechain-server/gen/bitcoind/v1" + v1 "github.com/LayerTwo-Labs/sidesail/servers/bitwindow/gen/bitcoind/v1" emptypb "google.golang.org/protobuf/types/known/emptypb" http "net/http" strings "strings" diff --git a/drivechain-server/gen/cusf/mainchain/v1/common.pb.go b/servers/bitwindow/gen/cusf/mainchain/v1/common.pb.go similarity index 100% rename from drivechain-server/gen/cusf/mainchain/v1/common.pb.go rename to servers/bitwindow/gen/cusf/mainchain/v1/common.pb.go diff --git a/drivechain-server/gen/cusf/mainchain/v1/mainchainv1connect/validator.connect.go b/servers/bitwindow/gen/cusf/mainchain/v1/mainchainv1connect/validator.connect.go similarity index 99% rename from drivechain-server/gen/cusf/mainchain/v1/mainchainv1connect/validator.connect.go rename to servers/bitwindow/gen/cusf/mainchain/v1/mainchainv1connect/validator.connect.go index 3510fd9d..f27eba45 100644 --- a/drivechain-server/gen/cusf/mainchain/v1/mainchainv1connect/validator.connect.go +++ b/servers/bitwindow/gen/cusf/mainchain/v1/mainchainv1connect/validator.connect.go @@ -10,7 +10,7 @@ import ( connect "connectrpc.com/connect" context "context" errors "errors" - v1 "github.com/LayerTwo-Labs/sidesail/drivechain-server/gen/cusf/mainchain/v1" + v1 "github.com/LayerTwo-Labs/sidesail/servers/bitwindow/gen/cusf/mainchain/v1" http "net/http" strings "strings" ) diff --git a/drivechain-server/gen/cusf/mainchain/v1/mainchainv1connect/wallet.connect.go b/servers/bitwindow/gen/cusf/mainchain/v1/mainchainv1connect/wallet.connect.go similarity index 99% rename from drivechain-server/gen/cusf/mainchain/v1/mainchainv1connect/wallet.connect.go rename to servers/bitwindow/gen/cusf/mainchain/v1/mainchainv1connect/wallet.connect.go index 80065026..d8e7c16a 100644 --- a/drivechain-server/gen/cusf/mainchain/v1/mainchainv1connect/wallet.connect.go +++ b/servers/bitwindow/gen/cusf/mainchain/v1/mainchainv1connect/wallet.connect.go @@ -10,7 +10,7 @@ import ( connect "connectrpc.com/connect" context "context" errors "errors" - v1 "github.com/LayerTwo-Labs/sidesail/drivechain-server/gen/cusf/mainchain/v1" + v1 "github.com/LayerTwo-Labs/sidesail/servers/bitwindow/gen/cusf/mainchain/v1" http "net/http" strings "strings" ) diff --git a/drivechain-server/gen/cusf/mainchain/v1/validator.pb.go b/servers/bitwindow/gen/cusf/mainchain/v1/validator.pb.go similarity index 100% rename from drivechain-server/gen/cusf/mainchain/v1/validator.pb.go rename to servers/bitwindow/gen/cusf/mainchain/v1/validator.pb.go diff --git a/drivechain-server/gen/cusf/mainchain/v1/wallet.pb.go b/servers/bitwindow/gen/cusf/mainchain/v1/wallet.pb.go similarity index 100% rename from drivechain-server/gen/cusf/mainchain/v1/wallet.pb.go rename to servers/bitwindow/gen/cusf/mainchain/v1/wallet.pb.go diff --git a/drivechain-server/gen/cusf/sidechain/v1/sidechain.pb.go b/servers/bitwindow/gen/cusf/sidechain/v1/sidechain.pb.go similarity index 100% rename from drivechain-server/gen/cusf/sidechain/v1/sidechain.pb.go rename to servers/bitwindow/gen/cusf/sidechain/v1/sidechain.pb.go diff --git a/drivechain-server/gen/cusf/sidechain/v1/sidechainv1connect/sidechain.connect.go b/servers/bitwindow/gen/cusf/sidechain/v1/sidechainv1connect/sidechain.connect.go similarity index 99% rename from drivechain-server/gen/cusf/sidechain/v1/sidechainv1connect/sidechain.connect.go rename to servers/bitwindow/gen/cusf/sidechain/v1/sidechainv1connect/sidechain.connect.go index 9c73950a..e02d7344 100644 --- a/drivechain-server/gen/cusf/sidechain/v1/sidechainv1connect/sidechain.connect.go +++ b/servers/bitwindow/gen/cusf/sidechain/v1/sidechainv1connect/sidechain.connect.go @@ -10,7 +10,7 @@ import ( connect "connectrpc.com/connect" context "context" errors "errors" - v1 "github.com/LayerTwo-Labs/sidesail/drivechain-server/gen/cusf/sidechain/v1" + v1 "github.com/LayerTwo-Labs/sidesail/servers/bitwindow/gen/cusf/sidechain/v1" http "net/http" strings "strings" ) diff --git a/drivechain-server/gen/drivechain/v1/drivechain.pb.go b/servers/bitwindow/gen/drivechain/v1/drivechain.pb.go similarity index 100% rename from drivechain-server/gen/drivechain/v1/drivechain.pb.go rename to servers/bitwindow/gen/drivechain/v1/drivechain.pb.go diff --git a/drivechain-server/gen/drivechain/v1/drivechainv1connect/drivechain.connect.go b/servers/bitwindow/gen/drivechain/v1/drivechainv1connect/drivechain.connect.go similarity index 99% rename from drivechain-server/gen/drivechain/v1/drivechainv1connect/drivechain.connect.go rename to servers/bitwindow/gen/drivechain/v1/drivechainv1connect/drivechain.connect.go index 9b8cc4ba..911cec4b 100644 --- a/drivechain-server/gen/drivechain/v1/drivechainv1connect/drivechain.connect.go +++ b/servers/bitwindow/gen/drivechain/v1/drivechainv1connect/drivechain.connect.go @@ -8,7 +8,7 @@ import ( connect "connectrpc.com/connect" context "context" errors "errors" - v1 "github.com/LayerTwo-Labs/sidesail/drivechain-server/gen/drivechain/v1" + v1 "github.com/LayerTwo-Labs/sidesail/servers/bitwindow/gen/drivechain/v1" http "net/http" strings "strings" ) diff --git a/drivechain-server/gen/wallet/v1/wallet.pb.go b/servers/bitwindow/gen/wallet/v1/wallet.pb.go similarity index 100% rename from drivechain-server/gen/wallet/v1/wallet.pb.go rename to servers/bitwindow/gen/wallet/v1/wallet.pb.go diff --git a/drivechain-server/gen/wallet/v1/walletv1connect/wallet.connect.go b/servers/bitwindow/gen/wallet/v1/walletv1connect/wallet.connect.go similarity index 99% rename from drivechain-server/gen/wallet/v1/walletv1connect/wallet.connect.go rename to servers/bitwindow/gen/wallet/v1/walletv1connect/wallet.connect.go index e3bd7afe..53769f49 100644 --- a/drivechain-server/gen/wallet/v1/walletv1connect/wallet.connect.go +++ b/servers/bitwindow/gen/wallet/v1/walletv1connect/wallet.connect.go @@ -8,7 +8,7 @@ import ( connect "connectrpc.com/connect" context "context" errors "errors" - v1 "github.com/LayerTwo-Labs/sidesail/drivechain-server/gen/wallet/v1" + v1 "github.com/LayerTwo-Labs/sidesail/servers/bitwindow/gen/wallet/v1" emptypb "google.golang.org/protobuf/types/known/emptypb" http "net/http" strings "strings" diff --git a/drivechain-server/go.mod b/servers/bitwindow/go.mod similarity index 96% rename from drivechain-server/go.mod rename to servers/bitwindow/go.mod index 7ec6c0d9..6b3c12fb 100644 --- a/drivechain-server/go.mod +++ b/servers/bitwindow/go.mod @@ -1,4 +1,4 @@ -module github.com/LayerTwo-Labs/sidesail/drivechain-server +module github.com/LayerTwo-Labs/sidesail/servers/bitwindow go 1.23 diff --git a/drivechain-server/go.sum b/servers/bitwindow/go.sum similarity index 100% rename from drivechain-server/go.sum rename to servers/bitwindow/go.sum diff --git a/drivechain-server/main.go b/servers/bitwindow/main.go similarity index 92% rename from drivechain-server/main.go rename to servers/bitwindow/main.go index 8db58ab7..93b6bb1b 100644 --- a/drivechain-server/main.go +++ b/servers/bitwindow/main.go @@ -9,10 +9,10 @@ import ( "time" "connectrpc.com/connect" - "github.com/LayerTwo-Labs/sidesail/drivechain-server/bdk" - "github.com/LayerTwo-Labs/sidesail/drivechain-server/dial" - "github.com/LayerTwo-Labs/sidesail/drivechain-server/dir" - "github.com/LayerTwo-Labs/sidesail/drivechain-server/server" + "github.com/LayerTwo-Labs/sidesail/servers/bitwindow/bdk" + "github.com/LayerTwo-Labs/sidesail/servers/bitwindow/dial" + "github.com/LayerTwo-Labs/sidesail/servers/bitwindow/dir" + "github.com/LayerTwo-Labs/sidesail/servers/bitwindow/server" pb "github.com/barebitcoin/btc-buf/gen/bitcoin/bitcoind/v1alpha" coreproxy "github.com/barebitcoin/btc-buf/server" "github.com/jessevdk/go-flags" @@ -52,8 +52,8 @@ func realMain(ctx context.Context) error { return err } - const appName = "drivechain-server" - datadir, err := dir.GetDataDir(appName) + const binaryName = "bitwindowd" + datadir, err := dir.GetDataDir(binaryName) if err != nil { zerolog.Ctx(ctx).Error().Err(err).Msg("get data dir") return err diff --git a/drivechain-server/proto/bitcoind/v1/bitcoind.proto b/servers/bitwindow/proto/bitcoind/v1/bitcoind.proto similarity index 100% rename from drivechain-server/proto/bitcoind/v1/bitcoind.proto rename to servers/bitwindow/proto/bitcoind/v1/bitcoind.proto diff --git a/drivechain-server/proto/drivechain/v1/drivechain.proto b/servers/bitwindow/proto/drivechain/v1/drivechain.proto similarity index 100% rename from drivechain-server/proto/drivechain/v1/drivechain.proto rename to servers/bitwindow/proto/drivechain/v1/drivechain.proto diff --git a/drivechain-server/proto/wallet/v1/wallet.proto b/servers/bitwindow/proto/wallet/v1/wallet.proto similarity index 100% rename from drivechain-server/proto/wallet/v1/wallet.proto rename to servers/bitwindow/proto/wallet/v1/wallet.proto diff --git a/drivechain-server/server/server.go b/servers/bitwindow/server/server.go similarity index 87% rename from drivechain-server/server/server.go rename to servers/bitwindow/server/server.go index 7737650f..d447aadb 100644 --- a/drivechain-server/server/server.go +++ b/servers/bitwindow/server/server.go @@ -13,14 +13,14 @@ import ( "connectrpc.com/connect" "connectrpc.com/grpcreflect" - api_bitcoind "github.com/LayerTwo-Labs/sidesail/drivechain-server/api/bitcoind" - api_drivechain "github.com/LayerTwo-Labs/sidesail/drivechain-server/api/drivechain" - api_wallet "github.com/LayerTwo-Labs/sidesail/drivechain-server/api/wallet" - "github.com/LayerTwo-Labs/sidesail/drivechain-server/bdk" - "github.com/LayerTwo-Labs/sidesail/drivechain-server/gen/bitcoind/v1/bitcoindv1connect" - validatorrpc "github.com/LayerTwo-Labs/sidesail/drivechain-server/gen/cusf/mainchain/v1/mainchainv1connect" - "github.com/LayerTwo-Labs/sidesail/drivechain-server/gen/drivechain/v1/drivechainv1connect" - "github.com/LayerTwo-Labs/sidesail/drivechain-server/gen/wallet/v1/walletv1connect" + api_bitcoind "github.com/LayerTwo-Labs/sidesail/servers/bitwindow/api/bitcoind" + api_drivechain "github.com/LayerTwo-Labs/sidesail/servers/bitwindow/api/drivechain" + api_wallet "github.com/LayerTwo-Labs/sidesail/servers/bitwindow/api/wallet" + "github.com/LayerTwo-Labs/sidesail/servers/bitwindow/bdk" + "github.com/LayerTwo-Labs/sidesail/servers/bitwindow/gen/bitcoind/v1/bitcoindv1connect" + validatorrpc "github.com/LayerTwo-Labs/sidesail/servers/bitwindow/gen/cusf/mainchain/v1/mainchainv1connect" + "github.com/LayerTwo-Labs/sidesail/servers/bitwindow/gen/drivechain/v1/drivechainv1connect" + "github.com/LayerTwo-Labs/sidesail/servers/bitwindow/gen/wallet/v1/walletv1connect" "github.com/barebitcoin/btc-buf/server" "github.com/rs/zerolog" "github.com/samber/lo" diff --git a/faucet-backend/.dockerignore b/servers/faucet/.dockerignore similarity index 100% rename from faucet-backend/.dockerignore rename to servers/faucet/.dockerignore diff --git a/servers/faucet/.gitignore b/servers/faucet/.gitignore new file mode 100644 index 00000000..613b85bc --- /dev/null +++ b/servers/faucet/.gitignore @@ -0,0 +1 @@ +faucetd diff --git a/servers/faucet/Dockerfile b/servers/faucet/Dockerfile new file mode 100644 index 00000000..b6a2e801 --- /dev/null +++ b/servers/faucet/Dockerfile @@ -0,0 +1,15 @@ +FROM golang:alpine AS builder + +WORKDIR /build + +ADD . . + +RUN go build -v -o ./faucetd . + +FROM alpine AS final + +RUN apk add curl + +COPY --from=builder /build/faucetd /usr/bin/ + +CMD ["faucetd"] \ No newline at end of file diff --git a/faucet-backend/Justfile b/servers/faucet/Justfile similarity index 66% rename from faucet-backend/Justfile rename to servers/faucet/Justfile index 9ca36ba8..7153a1bf 100644 --- a/faucet-backend/Justfile +++ b/servers/faucet/Justfile @@ -1,5 +1,5 @@ build: - go build -o faucet-backend . + go build -o faucetd . lint: golangci-lint run ./... diff --git a/faucet-backend/README.md b/servers/faucet/README.md similarity index 85% rename from faucet-backend/README.md rename to servers/faucet/README.md index 50e162e8..2df8aa11 100644 --- a/faucet-backend/README.md +++ b/servers/faucet/README.md @@ -1,4 +1,4 @@ -# `faucet-backend` +# `faucetd` A simple Go-based REST API that powers the Drivechain faucet at [drivechain.live](https://drivechain.live). diff --git a/faucet-backend/api/faucet/api_faucet.go b/servers/faucet/api/faucet/api_faucet.go similarity index 96% rename from faucet-backend/api/faucet/api_faucet.go rename to servers/faucet/api/faucet/api_faucet.go index a919b889..c51897ee 100644 --- a/faucet-backend/api/faucet/api_faucet.go +++ b/servers/faucet/api/faucet/api_faucet.go @@ -9,9 +9,9 @@ import ( "time" "connectrpc.com/connect" - faucetv1 "github.com/LayerTwo-Labs/sidesail/faucet-backend/gen/faucet/v1" - "github.com/LayerTwo-Labs/sidesail/faucet-backend/gen/faucet/v1/faucetv1connect" - faucet_ip "github.com/LayerTwo-Labs/sidesail/faucet-backend/ip" + faucetv1 "github.com/LayerTwo-Labs/sidesail/servers/faucet/gen/faucet/v1" + "github.com/LayerTwo-Labs/sidesail/servers/faucet/gen/faucet/v1/faucetv1connect" + faucet_ip "github.com/LayerTwo-Labs/sidesail/servers/faucet/ip" bitcoindv1alpha "github.com/barebitcoin/btc-buf/gen/bitcoin/bitcoind/v1alpha" coreproxy "github.com/barebitcoin/btc-buf/server" "github.com/btcsuite/btcd/btcutil" diff --git a/faucet-backend/api/faucet/validation/validation.go b/servers/faucet/api/faucet/validation/validation.go similarity index 100% rename from faucet-backend/api/faucet/validation/validation.go rename to servers/faucet/api/faucet/validation/validation.go diff --git a/faucet-backend/buf.gen.yaml b/servers/faucet/buf.gen.yaml similarity index 91% rename from faucet-backend/buf.gen.yaml rename to servers/faucet/buf.gen.yaml index ce634893..967b431c 100644 --- a/faucet-backend/buf.gen.yaml +++ b/servers/faucet/buf.gen.yaml @@ -8,7 +8,7 @@ managed: override: - file_option: go_package_prefix - value: github.com/LayerTwo-Labs/sidesail/faucet-backend/gen + value: github.com/LayerTwo-Labs/sidesail/servers/faucet/gen - file_option: go_package_prefix module: buf.build/bitcoin/bitcoind value: "github.com/barebitcoin/btc-buf/gen" diff --git a/faucet-backend/buf.lock b/servers/faucet/buf.lock similarity index 100% rename from faucet-backend/buf.lock rename to servers/faucet/buf.lock diff --git a/faucet-backend/buf.yaml b/servers/faucet/buf.yaml similarity index 88% rename from faucet-backend/buf.yaml rename to servers/faucet/buf.yaml index e4599f54..87938cce 100644 --- a/faucet-backend/buf.yaml +++ b/servers/faucet/buf.yaml @@ -2,7 +2,7 @@ version: v2 modules: - path: proto - name: buf.build/layertwo-labs/faucet-backend + name: buf.build/layertwo-labs/faucetd deps: - buf.build/bitcoin/bitcoind - buf.build/bufbuild/protovalidate diff --git a/faucet-backend/config.go b/servers/faucet/config.go similarity index 100% rename from faucet-backend/config.go rename to servers/faucet/config.go diff --git a/servers/faucet/faucet-backend b/servers/faucet/faucet-backend new file mode 100755 index 00000000..d300e96d Binary files /dev/null and b/servers/faucet/faucet-backend differ diff --git a/faucet-backend/gen/faucet/v1/faucet.pb.go b/servers/faucet/gen/faucet/v1/faucet.pb.go similarity index 100% rename from faucet-backend/gen/faucet/v1/faucet.pb.go rename to servers/faucet/gen/faucet/v1/faucet.pb.go diff --git a/faucet-backend/gen/faucet/v1/faucetv1connect/faucet.connect.go b/servers/faucet/gen/faucet/v1/faucetv1connect/faucet.connect.go similarity index 99% rename from faucet-backend/gen/faucet/v1/faucetv1connect/faucet.connect.go rename to servers/faucet/gen/faucet/v1/faucetv1connect/faucet.connect.go index 5e2d0551..bcff7c42 100644 --- a/faucet-backend/gen/faucet/v1/faucetv1connect/faucet.connect.go +++ b/servers/faucet/gen/faucet/v1/faucetv1connect/faucet.connect.go @@ -8,7 +8,7 @@ import ( connect "connectrpc.com/connect" context "context" errors "errors" - v1 "github.com/LayerTwo-Labs/sidesail/faucet-backend/gen/faucet/v1" + v1 "github.com/LayerTwo-Labs/sidesail/servers/faucet/gen/faucet/v1" http "net/http" strings "strings" ) diff --git a/faucet-backend/go.mod b/servers/faucet/go.mod similarity index 97% rename from faucet-backend/go.mod rename to servers/faucet/go.mod index 6fe7252c..90c69b0b 100644 --- a/faucet-backend/go.mod +++ b/servers/faucet/go.mod @@ -1,4 +1,4 @@ -module github.com/LayerTwo-Labs/sidesail/faucet-backend +module github.com/LayerTwo-Labs/sidesail/servers/faucet go 1.23 diff --git a/faucet-backend/go.sum b/servers/faucet/go.sum similarity index 100% rename from faucet-backend/go.sum rename to servers/faucet/go.sum diff --git a/faucet-backend/ip/faucet_ip.go b/servers/faucet/ip/faucet_ip.go similarity index 100% rename from faucet-backend/ip/faucet_ip.go rename to servers/faucet/ip/faucet_ip.go diff --git a/faucet-backend/main.go b/servers/faucet/main.go similarity index 96% rename from faucet-backend/main.go rename to servers/faucet/main.go index 8a5425a7..4040de16 100644 --- a/faucet-backend/main.go +++ b/servers/faucet/main.go @@ -6,7 +6,7 @@ import ( "os/signal" "time" - "github.com/LayerTwo-Labs/sidesail/faucet-backend/server" + "github.com/LayerTwo-Labs/sidesail/servers/faucet/server" coreproxy "github.com/barebitcoin/btc-buf/server" "github.com/jessevdk/go-flags" "github.com/rs/zerolog" diff --git a/faucet-backend/proto/faucet/v1/faucet.proto b/servers/faucet/proto/faucet/v1/faucet.proto similarity index 100% rename from faucet-backend/proto/faucet/v1/faucet.proto rename to servers/faucet/proto/faucet/v1/faucet.proto diff --git a/faucet-backend/server/server.go b/servers/faucet/server/server.go similarity index 95% rename from faucet-backend/server/server.go rename to servers/faucet/server/server.go index 1cd74439..0628c416 100644 --- a/faucet-backend/server/server.go +++ b/servers/faucet/server/server.go @@ -14,10 +14,10 @@ import ( "connectrpc.com/connect" "connectrpc.com/grpcreflect" - api_faucet "github.com/LayerTwo-Labs/sidesail/faucet-backend/api/faucet" - "github.com/LayerTwo-Labs/sidesail/faucet-backend/api/faucet/validation" - "github.com/LayerTwo-Labs/sidesail/faucet-backend/gen/faucet/v1/faucetv1connect" - faucet_ip "github.com/LayerTwo-Labs/sidesail/faucet-backend/ip" + api_faucet "github.com/LayerTwo-Labs/sidesail/servers/faucet/api/faucet" + "github.com/LayerTwo-Labs/sidesail/servers/faucet/api/faucet/validation" + "github.com/LayerTwo-Labs/sidesail/servers/faucet/gen/faucet/v1/faucetv1connect" + faucet_ip "github.com/LayerTwo-Labs/sidesail/servers/faucet/ip" coreproxy "github.com/barebitcoin/btc-buf/server" "github.com/rs/cors" "github.com/rs/zerolog"