Fix naming

This commit is contained in:
altafan
2023-10-30 15:14:43 +01:00
parent 0055fbb7d0
commit aed92bfd7d
9 changed files with 104 additions and 59 deletions

View File

@@ -1,6 +1,6 @@
builds:
- id: "arkd"
main: ./cmd/arkd
- id: "coordinatord"
main: ./cmd/coordinatord
ldflags:
- -s -X 'main.version={{.Version}}' -X 'main.commit={{.Commit}}' -X 'main.date={{.Date}}'
goos:
@@ -9,7 +9,7 @@ builds:
goarch:
- amd64
- arm64
binary: arkd
binary: coordinatord
## flag the semver v**.**.**-<tag>.* as pre-release on Github
release:
@@ -25,11 +25,11 @@ changelog:
use: github-native
archives:
- id: arkd
- id: coordinatord
format: binary
builds:
- arkd
name_template: "arkd-v{{ .Version }}-{{ .Os }}-{{ .Arch }}"
- coordinatord
name_template: "coordinatord-v{{ .Version }}-{{ .Os }}-{{ .Arch }}"
dockers:
###########################
@@ -38,12 +38,12 @@ dockers:
#amd64
- image_templates:
- "ghcr.io/ark-network/arkd:{{ .Tag }}-amd64"
- "ghcr.io/ark-network/coordinatord:{{ .Tag }}-amd64"
# push always either release or prerelease with a docker tag with the semver only
skip_push: "false"
use: buildx
ids:
- arkd
- coordinatord
dockerfile: goreleaser.Dockerfile
# GOOS of the built binaries/packages that should be used.
goos: linux
@@ -54,19 +54,19 @@ dockers:
- "--platform=linux/amd64"
- "--pull"
- "--label=org.opencontainers.image.created={{.Date}}"
- "--label=org.opencontainers.image.title=arkd"
- "--label=org.opencontainers.image.title=coordinatord"
- "--label=org.opencontainers.image.revision={{.FullCommit}}"
- "--label=org.opencontainers.image.version={{.Version}}"
- "--build-arg=VERSION={{.Version}}"
- "--build-arg=COMMIT={{.Commit}}"
- "--build-arg=DATE={{.Date}}"
- image_templates:
- "ghcr.io/ark-network/arkd:{{ .Tag }}-arm64v8"
- "ghcr.io/ark-network/coordinatord:{{ .Tag }}-arm64v8"
# push always either release or prerelease with a docker tag with the semver only
skip_push: "false"
use: buildx
ids:
- arkd
- coordinatord
dockerfile: goreleaser.Dockerfile
# GOOS of the built binaries/packages that should be used.
goos: linux
@@ -77,7 +77,7 @@ dockers:
- "--platform=linux/arm64/v8"
- "--pull"
- "--label=org.opencontainers.image.created={{.Date}}"
- "--label=org.opencontainers.image.title=arkd"
- "--label=org.opencontainers.image.title=coordinatord"
- "--label=org.opencontainers.image.revision={{.FullCommit}}"
- "--label=org.opencontainers.image.version={{.Version}}"
- "--build-arg=VERSION={{.Version}}"
@@ -85,15 +85,15 @@ dockers:
- "--build-arg=DATE={{.Date}}"
docker_manifests:
- name_template: ghcr.io/ark-network/arkd:{{ .Tag }}
- name_template: ghcr.io/ark-network/coordinatord:{{ .Tag }}
image_templates:
- ghcr.io/ark-network/arkd:{{ .Tag }}-amd64
- ghcr.io/ark-network/arkd:{{ .Tag }}-arm64v8
- ghcr.io/ark-network/coordinatord:{{ .Tag }}-amd64
- ghcr.io/ark-network/coordinatord:{{ .Tag }}-arm64v8
skip_push: "false"
- name_template: ghcr.io/ark-network/arkd:latest
- name_template: ghcr.io/ark-network/coordinatord:latest
image_templates:
- ghcr.io/ark-network/arkd:{{ .Tag }}-amd64
- ghcr.io/ark-network/arkd:{{ .Tag }}-arm64v8
- ghcr.io/ark-network/coordinatord:{{ .Tag }}-amd64
- ghcr.io/ark-network/coordinatord:{{ .Tag }}-arm64v8
skip_push: auto

View File

@@ -11,9 +11,9 @@ WORKDIR /app
COPY . .
RUN GOOS=${TARGETOS} GOARCH=${TARGETARCH} go build -ldflags="-X 'main.Version=${COMMIT}' -X 'main.Commit=${COMMIT}' -X 'main.Date=${COMMIT}'" -o bin/arkd cmd/arkd/main.go
RUN GOOS=${TARGETOS} GOARCH=${TARGETARCH} go build -ldflags="-X 'main.Version=${COMMIT}' -X 'main.Commit=${COMMIT}' -X 'main.Date=${COMMIT}'" -o bin/coordinatord cmd/coordinatord/main.go
# Second image, running the arkd executable
# Second image, running the coordinatord executable
FROM debian:buster-slim
# $USER name, and data $DIR to be used in the 'final' image
@@ -31,11 +31,11 @@ RUN adduser --disabled-password \
"$USER"
USER $USER
# Prevents 'VOLUME $DIR/.arkd/' being created as owned by 'root'
RUN mkdir -p "$DIR/.arkd/"
# Prevents 'VOLUME $DIR/.coordinatord/' being created as owned by 'root'
RUN mkdir -p "$DIR/.coordinatord/"
# Expose volume containing all 'arkd' data
VOLUME $DIR/.arkd/
# Expose volume containing all 'coordinatord' data
VOLUME $DIR/.coordinatord/
ENTRYPOINT [ "arkd" ]
ENTRYPOINT [ "coordinatord" ]

View File

@@ -2,7 +2,7 @@
## build: build for all platforms
build:
@echo "Building arkd binary..."
@echo "Building coordinatord binary..."
@bash ./scripts/build
## clean: cleans the binary
@@ -32,8 +32,8 @@ lint:
## run: run in dev mode
run: clean
@echo "Running arkd in dev mode..."
@go run ./cmd/arkd
@echo "Running coordinatord in dev mode..."
@go run ./cmd/coordinatord
## test: runs unit and component tests
test:

View File

@@ -1,23 +0,0 @@
syntax = "proto3";
package arkd.v1;
import "google/api/annotations.proto";
// TODO: Edit this proto to something more meaningful for your application.
service Service {
rpc GetVersion(GetVersionRequest) returns (GetVersionResponse) {
option (google.api.http) = {
post: "/v1/hello"
body: "*"
};
}
}
message GetVersionRequest {
string name = 1;
}
message GetVersionResponse {
string message = 1;
}

View File

@@ -1,5 +1,5 @@
version: v1
name: buf.build/ark-network/ark
name: buf.build/ark-network/coordinator
deps:
- buf.build/googleapis/googleapis
breaking:

View File

@@ -0,0 +1,68 @@
syntax = "proto3";
package coordinator.v1;
import "google/api/annotations.proto";
service CoordinatorService {
rpc RegisterPayment(RegisterPaymentRequest) returns (RegisterPaymentResponse) {
option (google.api.http) = {
post: "/v1/payment/register"
body: "*"
};
};
rpc FinalizePayment(FinalizePaymentRequest) returns (FinalizePaymentResponse) {
option (google.api.http) = {
post: "/v1/payment/finalize"
body: "*"
};
};
rpc ListPoolTransactions(ListPoolTransactionsRequest) returns (ListPoolTransactionsResponse) {
option (google.api.http) = {
post: "/v1/pools"
body: "*"
};
};
rpc GetPoolTransaction(GetPoolTransactionRequest) returns (GetPoolTransactionResponse) {
option (google.api.http) = {
get: "/v1/pool/{txid}"
};
};
}
message RegisterPaymentRequest {
repeated Input inputs = 1;
repeated Output outputs = 2;
}
message RegisterPaymentResponse {
string vtx = 1;
}
message FinalizePaymentRequest {
string signed_vtx = 1;
}
message FinalizePaymentResponse {}
message ListPoolTransactionsRequest {
int64 start = 1;
int64 end = 2;
}
message ListPoolTransactionsResponse {
repeated string txs = 1;
}
message GetPoolTransactionRequest {
string txid = 1;
}
message GetPoolTransactionResponse {
string txhex = 1;
}
message Input {
string txid = 1;
uint32 vout = 2;
}
message Output {
string pubkey = 1;
uint64 amount = 2;
}

View File

@@ -9,7 +9,7 @@ COPY . .
RUN set -ex \
&& if [ "${TARGETPLATFORM}" = "linux/amd64" ]; then export TARGETPLATFORM=amd64; fi \
&& if [ "${TARGETPLATFORM}" = "linux/arm64" ]; then export TARGETPLATFORM=arm64; fi \
&& mv "arkd-linux-$TARGETPLATFORM" /usr/local/bin/arkd
&& mv "coordinatord-linux-$TARGETPLATFORM" /usr/local/bin/coordinatord
# $USER name, and data $DIR to be used in the 'final' image
@@ -25,11 +25,11 @@ RUN adduser --disabled-password \
"$USER"
USER $USER
# Prevents 'VOLUME $DIR/.arkd/' being created as owned by 'root'
RUN mkdir -p "$DIR/.arkd/"
# Prevents 'VOLUME $DIR/.coordinatord/' being created as owned by 'root'
RUN mkdir -p "$DIR/.coordinatord/"
# Expose volume containing all arkd data
VOLUME $DIR/.arkd/
# Expose volume containing all coordinatord data
VOLUME $DIR/.coordinatord/
ENTRYPOINT [ "arkd" ]
ENTRYPOINT [ "coordinatord" ]

View File

@@ -13,6 +13,6 @@ ARCH=$(eval "go env GOARCH")
pushd $PARENT_PATH
mkdir -p build
GO111MODULE=on go build -ldflags="-s -w" -o build/arkd-$OS-$ARCH cmd/arkd/main.go
GO111MODULE=on go build -ldflags="-s -w" -o build/coordinatord-$OS-$ARCH cmd/coordinatord/main.go
popd