Skip to content

Commit

Permalink
chore: rework project structure (#255)
Browse files Browse the repository at this point in the history
Project structure has been completely reworked to follow DDD.
Program arguments and configuration files have changed, see the READMEs for more information.
  • Loading branch information
JeremyPansier committed May 17, 2024
1 parent 53c06bf commit f055313
Show file tree
Hide file tree
Showing 192 changed files with 8,244 additions and 8,307 deletions.
2 changes: 1 addition & 1 deletion .github/PULL_REQUEST_TEMPLATE.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,5 @@
- [ ] The code follows our code [conventions](https://github.com/my-cloud/ruthenium/blob/main/.github/CONTRIBUTING.md#go).
- [ ] Important principle changes have been documented in the [wiki](https://github.com/my-cloud/ruthenium/wiki).
- [ ] The new code is covered by unit tests with assertions.
- [ ] The behaviour [node](https://github.com/my-cloud/ruthenium/blob/main/src/node) and [UI](https://github.com/my-cloud/ruthenium/blob/main/src/ui) have been manually tested and is as expected.
- [ ] The behaviour [validator node](https://github.com/my-cloud/ruthenium/blob/main/validatornode) and [access node](https://github.com/my-cloud/ruthenium/blob/main/accessnode) have been manually tested and is as expected.
- [ ] The squash commit message follows our [conventions](https://github.com/my-cloud/ruthenium/blob/main/.github/CONTRIBUTING.md#git).
7 changes: 4 additions & 3 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
##IDEs
#JetBrain Goland
#JetBrains
.idea/**
#Microsoft VSCode
.vscode/**
#Microsoft VS
.vs/**

##Build
*.exe

##Settings
*/settings?.json
19 changes: 9 additions & 10 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,16 +1,15 @@
FROM golang:1.19 as builder
FROM golang:1.19 AS builder
WORKDIR /app
COPY ./src ./src
COPY ./config ./config
COPY ./validatornode ./validatornode
COPY ./accessnode ./accessnode
ADD go.mod .
ADD go.sum .

RUN CGO_ENABLED=0 go build -o node src/node/main.go
RUN CGO_ENABLED=0 go build -o ui src/ui/main.go
RUN CGO_ENABLED=0 go build -o validatornode validatornode/main.go
RUN CGO_ENABLED=0 go build -o accessnode accessnode/main.go

FROM gcr.io/distroless/static-debian11
FROM debian:11.9
USER nonroot
WORKDIR /app
COPY ./templates /app/templates
COPY --from=builder /app/config /app/config
COPY --from=builder /app/node /app
COPY --from=builder /app/ui /app
COPY --from=builder /app/validatornode /app
COPY --from=builder /app/accessnode /app
22 changes: 11 additions & 11 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ There are two ways to run a Ruthenium node. You can either use your own build fr
* If you are using Windows, you need to have [tdm-gcc](https://jmeubank.github.io/tdm-gcc/) installed.
* Option B (using docker image):
* You need to have [![Docker](https://img.shields.io/badge/docker-grey?logo=docker)](https://www.docker.com/) installed.
* Your firewall port 10600 must be open (please read "Program arguments" section of the [node](src/node/README.md#program-arguments) and [UI server](src/ui/README.md#program-arguments) documentation if you want to use another port than 10600).
* Your firewall port 10600 must be open (please read "Program arguments" section of the [validator node](validatornode/README.md#program-arguments) and [access node](accessnode/README.md#program-arguments) documentation if you want to use another port than 10600).
* To get an income or validate blocks ou need to be registered in the [Proof of Humanity](https://github.com/my-cloud/ruthenium/wiki/Whitepaper#proof-of-humanity) registry.

### Installation
Expand All @@ -39,29 +39,29 @@ There are two ways to run a Ruthenium node. You can either use your own build fr
### Launch
* Option A (using sources):
* Extract files from the sources archive
* At root level (ruthenium folder), run the [node](src/node/README.md):
* At root level (ruthenium folder), run the [validator node](validatornode/README.md):
```
go run src/node/main.go -private-key=<private key>
go run validatornode/main.go
```
* At root level (ruthenium folder), run the [UI server](src/ui/README.md):
* At root level (ruthenium folder), run the [access node](accessnode/README.md):
```
go run src/ui/main.go -host-ip=<your external IP address>
go run accessnode/main.go
```
* Option B (using docker image):
* Run the [node](src/node/README.md):
* Run the [validator node](validatornode/README.md):
```
sudo docker run -p 10600:10600 -ti ghcr.io/my-cloud/ruthenium:latest \app\node -private-key=<private key>
sudo docker run -p 10600:10600 -ti ghcr.io/my-cloud/ruthenium:latest \app\validatornode
```
* Run the [UI server](src/ui/README.md):
* Run the [access node](accessnode/README.md):
```
sudo docker run -p 8080:8080 -ti ghcr.io/my-cloud/ruthenium:latest \app\ui -host-ip=<your external IP address>
sudo docker run -p 8080:8080 -ti ghcr.io/my-cloud/ruthenium:latest \app\accessnode
```
* Using a web browser, go to:
* http://localhost:8080

## APIs
* [host node API](src/node/README.md#api)
* [UI server API](src/ui/README.md#api)
* [validator node API](validatornode/README.md#api)
* [access node API](accessnode/README.md#api)

## Contributing
[![Forks](https://img.shields.io/github/forks/my-cloud/ruthenium?logo=github)](https://github.com/my-cloud/ruthenium/fork)
Expand Down

0 comments on commit f055313

Please sign in to comment.