Skip to content

Commit

Permalink
Fix naming
Browse files Browse the repository at this point in the history
  • Loading branch information
altafan committed Oct 30, 2023
1 parent 0055fbb commit aed92bf
Show file tree
Hide file tree
Showing 9 changed files with 104 additions and 59 deletions.
36 changes: 18 additions & 18 deletions .goreleaser.yaml
Original file line number Diff line number Diff line change
@@ -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:
Expand All @@ -9,7 +9,7 @@ builds:
goarch:
- amd64
- arm64
binary: arkd
binary: coordinatord

## flag the semver v**.**.**-<tag>.* as pre-release on Github
release:
Expand All @@ -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:
###########################
Expand All @@ -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
Expand All @@ -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
Expand All @@ -77,23 +77,23 @@ 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}}"
- "--build-arg=COMMIT={{.Commit}}"
- "--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

14 changes: 7 additions & 7 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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" ]

6 changes: 3 additions & 3 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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:
Expand Down
23 changes: 0 additions & 23 deletions api-spec/protobuf/arkd/v1/service.proto

This file was deleted.

2 changes: 1 addition & 1 deletion api-spec/protobuf/buf.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
version: v1
name: buf.build/ark-network/ark
name: buf.build/ark-network/coordinator
deps:
- buf.build/googleapis/googleapis
breaking:
Expand Down
68 changes: 68 additions & 0 deletions api-spec/protobuf/coordinator/v1/service.proto
Original file line number Diff line number Diff line change
@@ -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;
}
File renamed without changes.
12 changes: 6 additions & 6 deletions goreleaser.Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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" ]

2 changes: 1 addition & 1 deletion scripts/build
Original file line number Diff line number Diff line change
Expand Up @@ -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

0 comments on commit aed92bf

Please sign in to comment.