Skip to content

Commit

Permalink
Bug fix (#7)
Browse files Browse the repository at this point in the history
  • Loading branch information
maxirmx authored Apr 16, 2024
1 parent 517aa2d commit f75286d
Show file tree
Hide file tree
Showing 22 changed files with 1,038 additions and 726 deletions.
28 changes: 24 additions & 4 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ jobs:
uses: actions/checkout@v4

- name: Log in to the Container registry
uses: docker/login-action@65b78e6e13532edd9afa3aa52ac7964289d1a9c1
uses: docker/login-action@v3
with:
registry: ghcr.io
username: maxirmx
Expand All @@ -38,14 +38,24 @@ jobs:
type=sha
- name: Build and push Docker image
uses: docker/build-push-action@3b5e8027fcad23fda98b2e3ac259d8d67585f671
uses: docker/build-push-action@v5
with:
context: .
file: dkgServiceNode/Dockerfile
push: true
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}

- name: Purge old versions
if: contains(github.ref, 'refs/tags/v')
continue-on-error: true
uses: actions/delete-package-versions@v4
with:
package-name: dkg-service-node
package-type: 'container'
min-versions-to-keep: 1
delete-only-untagged-versions: 'true'

release-dkg-node:
runs-on: ubuntu-latest
permissions:
Expand All @@ -59,7 +69,7 @@ jobs:
submodules: true

- name: Log in to the Container registry
uses: docker/login-action@65b78e6e13532edd9afa3aa52ac7964289d1a9c1
uses: docker/login-action@v3
with:
registry: ghcr.io
username: maxirmx
Expand All @@ -81,10 +91,20 @@ jobs:
type=sha
- name: Build and push Docker image
uses: docker/build-push-action@3b5e8027fcad23fda98b2e3ac259d8d67585f671
uses: docker/build-push-action@v5
with:
context: .
file: dkgNode/Dockerfile
push: true
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}

- name: Purge old versions
if: contains(github.ref, 'refs/tags/v')
continue-on-error: true
uses: actions/delete-package-versions@v4
with:
package-name: dkg-node
package-type: 'container'
min-versions-to-keep: 1
delete-only-untagged-versions: 'true'
19 changes: 17 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,2 +1,17 @@
# dkg-service-node
Dkg service node
# Dkg nodes

## Starting dkg node in docker container

__Parameters__
* ```<host>``` -- external address of the system where the node will run
* ```<port>``` -- public port dedicated for the node. Please note that there is current limitation that the port exposed from container shall be the same as public port.
* ```<name>``` -- node public name, optional, defaults to ```<host>:<port>```

__Command__
```
docker run --env=DKG_NODE_SERVER_GRPC_PORT=<port> --env=DKG_NODE_SERVER_GRPC_HOST=<host> \
--env=DKG_SERVICE_NODE_URL=http://dkg.samsonov.net:8080 --env=DKG_NODE_SERVER_NAME=<name> \
--env=PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin \
--env=DOTNET_RUNNING_IN_CONTAINER=true --env=DOTNET_VERSION=8.0.4 --env=ASPNET_VERSION=8.0.4 \
--workdir=/app -p <port>:<port> --runtime=runc -d ghcr.io/maxirmx/dkg-node:latest
```
5 changes: 4 additions & 1 deletion dkg-nodes.sln
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,10 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "dkgCommon", "dkgCommon\dkgC
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "dkgLibrary", "dkg\dkgLibrary\dkgLibrary.csproj", "{8C58697D-1A09-40EB-B840-CDB9BBE49FA4}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "dkgNodesTests", "dkgNodesTests\dkgNodesTests.csproj", "{598AFFF1-61B6-43FD-B170-9E44CC6D7EC4}"
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "dkgNodesTests", "dkgNodesTests\dkgNodesTests.csproj", "{598AFFF1-61B6-43FD-B170-9E44CC6D7EC4}"
ProjectSection(ProjectDependencies) = postProject
{64F90486-5C7C-4D4B-A1EE-00AAF380B5A7} = {64F90486-5C7C-4D4B-A1EE-00AAF380B5A7}
EndProjectSection
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Expand Down
6 changes: 4 additions & 2 deletions dkgCommon/Protos/DkgNode.proto
Original file line number Diff line number Diff line change
Expand Up @@ -47,15 +47,17 @@ message PublicKeyReply {
}

message ProcessDealRequest {
bytes data = 1;
int32 roundId = 1;
bytes data = 2;
}

message ProcessDealReply {
bytes data = 1;
}

message ProcessResponseRequest {
bytes data = 1;
int32 roundId = 1;
bytes data = 2;
}

message ProcessResponseReply {
Expand Down
1 change: 0 additions & 1 deletion dkgNode/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
FROM mcr.microsoft.com/dotnet/aspnet:8.0 AS base
USER app
WORKDIR /app
EXPOSE 5000

FROM mcr.microsoft.com/dotnet/sdk:8.0 AS build
ARG BUILD_CONFIGURATION=Release
Expand Down
2 changes: 1 addition & 1 deletion dkgNode/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@

var loggerFactory = app.Services.GetRequiredService<ILoggerFactory>();
var logger = loggerFactory.CreateLogger("DkgNode");
var server = new DkgNodeServer(config, serviceNodeUrl, logger);
var server = new DkgNodeService(config, serviceNodeUrl, logger);

var cts = new CancellationTokenSource();
AssemblyLoadContext.Default.Unloading += ctx =>
Expand Down
Loading

0 comments on commit f75286d

Please sign in to comment.