This repository contains the logic needed to execute a Group Token Provider (GTP) node of Ermes. It contains:
- Node config file
- HTTP gateway
- Redis connectivity
- Golang
- WasmEdge
- Redis
For this repository to work properly, you must also clone the Ermes common with this structure.
projects
└───ermes-central-repo
│ │ ...
│
└───ermes-common
│ ...
To deploy this node, follow the instructions in the Ermes deploy repository.
To run this node locally, you need to satisfy the requirements listed above. You can install them on your machine or use the provided DevContainer, which already satisfies all the requirements
The DevContainer can be opened either using GoLand or VSCode with the DevContainers extension
- Start docker
- Clone this repo
- Open the project. A popup should ask to reopen the project in the container. Click
reopen.
Alternatively you can also start the container by navigating to the devcontainer.json file and use the Services tab
to manage existing containers.
This DevContainer starts a Docker Compose. Apparently GoLand is not able yet to stop it when the IDE gets closed since the DevContainer support is still in Beta. You can stop the containers in the Docker Compose from the
Servicestab or directly either from terminal or Docker Desktop
- Start docker
- Clone this repo
- Open the project. A popup should ask to reopen the project in the container. Click
reopen
Alternatively you can also start the container navigating to the VSCode Command Palette by pressing ctrl + shift + P (
Or by selecting View -> Command Palette). At this point search and select the option:
Dev Containers: Reopen in Container.
There are some alternatives:
- Either in GoLand or VSCode, to start the node you can open the given devcontainer, and run the main function in
main.gofile in any way allowed by the IDE, or from the terminal by typinggo run main. - In GoLand, create a new
Go Buildrun configuration. Specify for this configuration:- Run kind: package
- Package path: ermes-central-repo
- Module: ermes-central-repo
- Run on: Click on
Manage targets..., and then set:- Server: Docker
- Configuration files: The path to the docker-compose.yml file in the project
- Service: Go
- Click on
Additional Settingsand setProject sources directoryto/workspaces/ermes-central-repo
- Ready to Go!
This project uses mockery to generate mocks for testing purposes. To install mockery run
go install github.com/vektra/mockery/[email protected]To generate the mocks open a terminal in the root folder of the project and run
$ mockeryYou can run tests with
$ go test ./...