Archived
2
0
This repository has been archived on 2023-03-02. You can view files and clone it, but cannot push or open issues or pull requests.
Go to file
2023-03-02 15:28:43 +01:00
helpers Initial commit 2023-03-02 15:28:43 +01:00
models Initial commit 2023-03-02 15:28:43 +01:00
utils Initial commit 2023-03-02 15:28:43 +01:00
.dockerignore Initial commit 2023-03-02 15:28:43 +01:00
.gitignore Initial commit 2023-03-02 15:28:43 +01:00
.mega-linter.yml Initial commit 2023-03-02 15:28:43 +01:00
docker-compose.yml Initial commit 2023-03-02 15:28:43 +01:00
Dockerfile Initial commit 2023-03-02 15:28:43 +01:00
go.mod Initial commit 2023-03-02 15:28:43 +01:00
go.sum Initial commit 2023-03-02 15:28:43 +01:00
main.go Initial commit 2023-03-02 15:28:43 +01:00
Makefile Initial commit 2023-03-02 15:28:43 +01:00
README.md Initial commit 2023-03-02 15:28:43 +01:00
run.sh Initial commit 2023-03-02 15:28:43 +01:00
test.txt Initial commit 2023-03-02 15:28:43 +01:00

KermaGo

Prerequisites

GNU Make and docker/Go installed on the machine

Config via environment variables

Name Description Default value
KERMA_DEBUG Run in debug mode false
KERMA_IP_ADDR Public IP Address to return to other nodes (if node behind port-forwarding) 3.126.74.45
KERMA_PORT Port to listen on 18018
KERMA_CONN_TIMEOUT Connection timeout 10
KERMA_INITIAL_PEER_LIST Comma-separated string of initial peers to connect to ""
KERMA_STORE_BASE_DIR Base directory to store data. The docker container will mount this under ./data in the current directory /var/local/badkerma
KERMA_PEER_LIST_STORE Filename of the peer list peers.json
KERMA_BLOCK_STORE Filename of the blockchain blocks.json
KERMA_TRANSACTION_STORE Filename of the transactions transactions.json
KERMA_PRIVATE_KEY_FILE Filename of the private key file private.pem

You can create a .env file and docker will read the variables from there.

NOTE: You need to set KERMA_INITIAL_PEER_LIST to a valid node address when running the node for the first time or after you have cleaned the persistent store. Thereafter, the node gossips a known node list and keeps it up-to-date.

Run it locally

make run

Compile it locally

make build

Test it locally

make test

You can also test with netcat. Start the program and run:

cat test.txt | nc localhost 18018 -p 50001

Run in debug mode locally

make debug

Build the docker image

DOCKER_REGISTRY=localhost make docker-build

Run docker container in debug mode

DOCKER_REGISTRY=localhost make docker-debug

Run docker container in background

DOCKER_REGISTRY=localhost make docker-run

Stop running docker container

make docker-stop