Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
…into main
  • Loading branch information
vciancio committed Mar 24, 2021
2 parents fac4b5f + 0c74dd6 commit 6d934c1
Showing 1 changed file with 50 additions and 38 deletions.
88 changes: 50 additions & 38 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,31 +1,75 @@
# golem-node-server

Some extra functionality built ontop of [aabrioux/golem-node](https://hub.docker.com/r/aabrioux/golem-node).

Contains a flask server with an API endpoint to query the current status of your node.

## Dashboard

There's a bare-bones dashboard which complements this container. See [vciancio/golem-dashboard](https://github.com/vciancio/golem-dashboard) for a container which hosts the ui to complement api.

## Setup
## WebServer API

~~~
GET /api/status
~~~

Response:
~~~
{
"info": {
"name": "node-name",
"network": "mainnet",
"processedLastHour": "0",
"processedTotal": "100",
"subnet": "public-beta",
"version": "0.6.1",
"wallet": "0x123456ff832..."
},
"hardware": {
"cpu": {
"percentUsage": 13.3,
},
"memory": {
"available": 32904065024,
"percent": 21.7,
"used": 7579193344
}
},
"timestamp": 1616311512
}
~~~


## Setup - Webserver Only
> The prerequisite is that you have python3 & pip3.
~~~
cd golem-node-server
pip3 install -r requirements.txt
cd app
python3 app.py
~~~

## Setup - Server+Golem/Yanga
Credit to [aabrioux/golem-node](https://hub.docker.com/r/aabrioux/golem-node) for setting up base Golem Dockerfile.

Unfortunately, as of now, Yagna v0.6.1, you can't just spin up the container right away. You have to hit the enter-key a couple of times setup the node.

~~~
// Ensures you've pulled the latest aabrioux/golem-node image. Important for Updating
docker pull aabrioux/golem-node:latest
docker build -t vciancio/golem-node-server:latest .
./init.sh /path/to/where/you/want/to/mount/volumes
~~~

After this, you can run your containers like normal.

~~~
docker run vciancio/golem-node-server:latest
docker run -p 5000:5000 vciancio/golem-node-server:latest
~~~

> Note default port is 5000
## Environment Variables
### Environment Variables
| Variable | Description | Default |
| -------- | ----------- | ------- |
|SETTINGS_NODE_NAME| Name of your Node | golem_node
Expand All @@ -39,43 +83,11 @@ docker run vciancio/golem-node-server:latest
|YA_PAYMENT_NETWORK| Network you're Using | mainnet
|YA_ACCOUNT| ETH wallet to store GLM payments in |

## Volumes to Mount
### Volumes to Mount

_**Recommended:**_ If you want to persist your configuration / stats about a container (total # of processed tasks, etc.), you can mount these paths to your local disk.

| Paths to Mount |
| -------------- |
| /root/.local/share/ya-provider:rw |
| /root/.local/share/yagna:rw |

## WebServer API

~~~
GET /api/status
~~~

Response:
~~~
{
"golem": {
"name": "node-name",
"network": "mainnet",
"processedLastHour": "0",
"processedTotal": "100",
"subnet": "public-beta",
"version": "0.6.1",
"wallet": "0x123456ff832..."
},
"hardware": {
"cpu": {
"percentUsage": 13.3,
},
"memory": {
"available": 32904065024,
"percent": 21.7,
"used": 7579193344
}
},
"timestamp": 1616311512
}
~~~

0 comments on commit 6d934c1

Please sign in to comment.