GithubHelp home page GithubHelp logo

gladiusio / gladius-node Goto Github PK

View Code? Open in Web Editor NEW
36.0 36.0 14.0 48.63 MB

All services to run a Gladius Node

License: GNU General Public License v3.0

Go 31.69% Makefile 7.56% Shell 26.85% Dockerfile 1.67% Ruby 2.53% Python 29.70%

gladius-node's People

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

gladius-node's Issues

Container created with docker-compose never gets out of pending state for pool application

A week ago I have created a container with the docker-compose present in the 'ops' folder. Unfortunately the pool application is not being approved. This issue has persisted for a couple of weeks now (even before the latest release).

  1. The container is running.
  2. The container's IP address are exposed to the outside.
  3. <pu.bl.ic.ip>:8080 gives the 'unsupported path' message.

Attached screenshots illustrate my point.
screenshot1
screenshot2
screenshot3

gladius-controld is incompatible with an empty gladius-controld.toml configuration file

  • OS: Debian Linux
  • Gladius Version: 0.6.1

Whats happening:
When starting gladius-controld with an empty gladius-controld.toml file in the gladius root dir the controld service exits with an error message due to missing configuration options:

$ gladius-controld
2018/09/02 13:33:53 [DEBUG] Using dynamic bind port 35907
2018/09/02 13:33:53 Config.Name field is required.

This configuration was created by the pre 0.6.x installer scripts. If I update from pre 0.6.x I have to manually remove the file.

What do you expect:
gladius-controld finds the empty config file - sees that no configuration is given and loads its defined defaults. This behaviour is already implemented in gladius-networkd.

Further information:
none

docker-compose setup is broken with 0.6.x

OS: Linux Debian (docker)
Gladius Release: 0.6.1

Whats happening:
Running gladius with the docker-compose file (make docker_compose) does not work.

First - execute the docker_compose command

$ make docker_compose
...
docker-compose -p gladius -f ops/docker-compose.yml up -d
Creating controld ... done
Creating networkd ... done

After the command completed only the networkd container is running:

$ docker ps -a
CONTAINER ID        IMAGE                      COMMAND              CREATED              STATUS                          PORTS                                                      NAMES
cc946a21c63f        gladius_gladius-controld   "gladius-controld"   About a minute ago   Exited (1) About a minute ago                                                              controld
ecbc5a9bf4bc        gladius_gladius-networkd   "gladius-networkd"   About a minute ago   Up About a minute               0.0.0.0:5000->5000/tcp, 3001/tcp, 0.0.0.0:8080->8080/tcp   networkd

The controld daemon exited due to a configuration error (see issue #76 ):

$ docker logs controld
2018/09/02 13:49:58 [DEBUG] Using dynamic bind port 38797
2018/09/02 13:49:58 Config.Name field is required.

To fix this the dockerfile needs to be changed and the empty configuration files need to be removed:
https://github.com/gladiusio/gladius-node/blob/master/ops/Dockerfile#L17-L18

But wait there is more ;-)

With the empty configuration files removed both containers start but the networkd container cant connect to the controld container - the defaults point to 127.0.0.1 which is not working in this setup because we are running both processes in different containers.

$ docker logs networkd
time="2018-09-02T13:54:02Z" level=info msg="Loading config"
2018/09/02 13:54:02 Cannot find config file: Config File "gladius-networkd" Not Found in "[/ /gladius]". Using defaults
time="2018-09-02T13:54:02Z" level=info msg="Starting content server on port: 8080"
2018/09/02 13:54:02 error: Config File "gladius-networkd" Not Found in "[/ /gladius]"
time="2018-09-02T13:54:02Z" level=warning msg="Error updating disk content" err="Couldn't sign message with contorld, wallet could be locked"
time="2018-09-02T13:54:02Z" level=info msg="Started HTTP server."
time="2018-09-02T13:54:04Z" level=warning msg="Problem getting needed content list from control daemon" err="Post http://localhost:3001/api/p2p/state/content_diff: dial tcp 127.0.0.1:3001: connect: connection refused"

To fix this an environment variable needs to be added to the networkd configuration to the docker-compose file https://github.com/gladiusio/gladius-node/blob/master/ops/docker-compose.yml#L21

environment:
      CONTENTD_CONTROLDHOSTNAME: controld

What do you expect:
I can run the networkd and gladius container with the docker-compose command and use it for local testing or beta tests.

Further information:
Nothing

Feature request: Automatic port forwarding option

Is your feature request related to a problem? Please describe.
There are lots of situations/setups where users do not have access to the router e.g. in public networks or student dorms.

Describe the solution you'd like
The node manager should have a feature to establish port forwarding automatically.

Describe alternatives you've considered
Don't know any solution that doesn't require manual configuration which is not very convenient. For mass-adaption, the setup should be granny-friendly.

Make dependencies error

When I Do the command: make dependencies
The Ubuntu command line say: " Dep ensure
Warning: the following project(s) have [[constraint]] stanzas in Gopkg.toml:

โœ— github.com/powerman/rpc-codec

However, these projects are not direct dependencies of the current project:
they are not imported in any .go files, nor are they in the 'required' list in
Gopkg.toml. Dep only applies [[constraint]] rules to direct dependencies, so
these rules will have no effect.

Either import/require packages from these projects so that they become direct
dependencies, or convert each [[constraint]] to an [[override]] to enforce rules
on these projects, if they happen to be transitive dependencies."

Seems https://github.com/powerman/rpc-codec is down so it's block my installation.

Timeout exceeded while creating GPG keys on raspberry pi

The 2nd create process exceeds the 10 seconds timeout limit. The create command fails with the following error message and the node is not fully initialized:

$ gladius create
[Gladius] What is your name? Sebastian Hutter
[Gladius] What is your email? [email protected]
[Gladius] Please type your wallet passphrase:  ********
Post http://localhost:3001/api/keystore/pgp/create: net/http: request canceled (Client.Timeout exceeded while awaiting headers):client.Do/utils.SendRequest/keystore.CreatePGP

I assume this happens because the pi is not powerfull enough to create the PGP key and respond to the api request of the cli in just 10 seconds.

The keys are created successfully in the end:

$ sudo ls -l /root/.config/gladius/keys
total 8
-rw------- 1 root root 3456 Jul 22 06:09 private.asc
-rw-r--r-- 1 root root 1691 Jul 22 06:09 public.asc

The simplest solution to this issue is to make the 10s timeout configurable with an environment variable.
This would enable to overwrite the timeout value during command execution:

# run with 10 second timeout
$ gladius create

# run with 30 second timeout
GLADIUS_TIMEOUT=30 gladius create

The necessary code changes are required in the utils.go file
https://github.com/gladiusio/gladius-cli/blob/master/utils/utils.go#L52-L54

Example fix (untested)

// For control over HTTP client headers,
// redirect policy, and other settings,
// create an HTTP client

// get the gladius timeout value, if not specified set it to 10
// Attention: need to add strconv package !
timeout, exists := os.LookupEnv('GLADIUS_TIMEOUT')
if !exists {
    timeout = '10'
}

var client = &http.Client{
	Timeout: time.Second * strconv.Atoi(timeout),
}

Gladius Network (Edge) Daemon Service won't start - Error 1607: The process terminated unexpectedly (Behavior & Fix)

Details
Gladius Node 0.4.0
Windows 10 64-bit

Issue
Hi

I picked up a weird issue with the installation and starting of the Gladius Network (Edge) Daemon service.

After installation, the networkd service would not be started, giving the following error when attempting to manually start it:
photo_2018-07-18_15-31-03

Behavior and Fix
Upon investigation, I found that the service was pointing to the wrong path. For example, service would point to C:\Users{username1}.gladius, but should be pointing to C:\Users{username2}.gladius.

Editing the ImagePath of the registry entry for the service -HKLM:\SYSTEM\Services\CurrentControlSet001\GladiusNetworkDaemon - fixed this issue.

This is strange behavior as when you start the installation of the gladius node software, it installs it under the currently logged in user, and creates a user folder under C:\Users\ if there isn't one for currently logged in user. But somehow the networkd service points to a 'false'/'old' directory.

And when you run gladius create, it creates the wallet and keys under the C:\Users{username1}.gladius directory, and the content folder and TOML files are created in C:\Users{username2}.gladius.

Correct Behavior
What I think the installation should be doing is checking whether the current user account is the correct one, and use this as the path for the service before starting the service.

Work on information available for miners running the node

Currently, there is no information available on many of the statistical parameter necessary to see the performance of the node by the miners.

Some of the parameters that should be available to miners of the nodes:

  • Uptime of the node (How long the nodes have been running?)
  • GLA Earned by the node
  • Network usage (Available bandwidth by the node and bandwidth used by the network)
  • Network profile of the node and pool address
  • Wallet information (Ledger report and Wallet address etc.)
  • Total active nodes in the network
  • DDoS attacks prevented by the node (participation in the prevention of DDoS)
  • CDN data shared
  • Storage consumed by the node
  • Overall Network bandwidth available (Network Performance)
  • Actual / Projected earnings of tokens (Cash Flow)

These are the some of the parameters that could be incorporated in the node, to evaluate the performance of the node and network. Feel free to add more metrics.

email verification for new pool applications

email verification for new pool applications when typing in email for gladius create commands on edge node setup. Application should send verification email with some authenticator token. User adds the token to the prompt and email is verified as legitimate. User can proceed to finish pool application.

Error updating this node's public IP in network state // gladius-networkd

Hi,

from the "journalctl -u GladiusNetworkDaemon.service" log comes the following warning/error response
level=warning msg="Error posting heartbeat" err="Couldn't push message" Sep 03 08:16:08 raspberrypi gladius-networkd[350]: time="2018-09-03T08:16:08Z" level=error msg="Error updating this node's public IP in network state" detected_ip=x.x.x.x.x err="Couldn't push message"

  • wallet unlocked via gladius check
  • port 7946 and 8080 are open and forwarded
  • gladius running on a 192.168.x.x address
  • gladius node status looking good

Wrong version is displayed with `gladius version`

  • OS: Debian Linux
  • Gladius Version: 0.6.1

Whats happening:
When I run gladius version the wrong version numbers are displayed:

$ gladius version
CLI: 0.5.5
CONTROLD: 0.5.3
NETWORKD: 0.5.2

What do you expect:
I expect that the correct version numbers are displayed when executing the version command.

Further Information:
The versions are hardcoded in gladius-cli/commands/nodeCommands.go:

func version(cmd *cobra.Command, args []string) {
	terminal.Println(ansi.Color("CLI:", "83+hb"), ansi.Color("0.5.5", "255+hb"))
	terminal.Println(ansi.Color("CONTROLD:", "83+hb"), ansi.Color("0.5.3", "255+hb"))
	terminal.Println(ansi.Color("NETWORKD:", "83+hb"), ansi.Color("0.5.2", "255+hb"))
}

Instead of hardcoding the values the version command should get the versions from the gladius binaries directly if this is possible we need to expect that networkd/controld etc are not running when the version command is executed

more or less no traffic either up or down

  • node running fine for 20 hours with accepted state
  • port 7946/8080 udp and tcp are beeing forwarded
  • picture from my iptables/router ipv4, no ipv6 support from my isp
    ppp-subnet
  • not a single package on 7946
  • 71 packages (3416 bytes) on 8080 tcp

journalctl -u GladiusNodeControlDaemon.service showing several
[ERR] memberlist: Failed to send gossip to
messages with ipv6 entries

version: 0.6.0
os: Linux raspberrypi 4.14.62-v7+ #1134 SMP Tue Aug 14 17:10:10 BST 2018 armv7l GNU/Linux

Could not create Node for account

HI
Try to star node on Win7

C:\Program Files (x86)\Gladius Node>gladius create
[Gladius] What is your name? Pist****
[Gladius] What is your email? pist*****@gmail.com
[Gladius] Please type your wallet passphrase: ********
Could not create Node for account:utils.ControlDaemonHandler/node.CreateNode

Ropsten dont want to send 1 eth to my wallet:
https://ropsten.etherscan.io/address/0xD05B4B8E4e13C671cf930ca6408E267B62D63068

And I have a mix of upper and lower cases in the account address...!

Unable to setup node on Windows 7 - 64 bit

  1. Installed App succesfully
  2. Created wallet
  3. Added Ether from Faucet.
  4. On doing gladius create, after entering name, email and wallet password, it drops to command prompt. No errors.

Can't find log files to trouble shoot. No verbose option to get error.

Tested the following

  1. Deleted wallet and keys folder, assuming that special character * in the wallet password might be causing the issue. Didn't work
  2. Reinstalled app. Didn't work

can't log in

i closed the app when i tried to get back on the app and enter my passphrase it doesn't let me and just stays in this frozen state

i tried uninstalled app etc. and nothing

upgrade idea .. integrate console output into GUI

For example the old bitcoin QT Client, offers via menue the use of the console mode. For Gladius integrate the output of networkd and controld, so that it is way more easy to find problems under a running node. Could also add the gladius.exe commands. Would also help the stable product not just for beta testing.

GladiusNetwordDaemon | GladiusNodeControlDaemon services not starting automatically upon reboot. Multiple OS's.

  • OS: Windows 10, Linux Ubuntu 16.04.3 LTS
  • Gladius Version: 0.6.1

What is happening on Windows 10:
After a fresh install and application to pool (pending or accepted), once your node is rebooted, the GladiusNodeControlDaemon doesn't auto start. When you access your Node Manager, it doesn't see your account and asks to create a new account:

gladiusnodecontroldaemon

Once you manually start the GladiusNodeControlDaemon, you're able to access your account.

Expected Behavior:
As in 0.4.0 and 0.5.0, the services did auto start. Since upgrading to 0.6 and 0.6.1 it no longer does.


What is happening on Ubuntu 16.04.3 LTS:
Installation goes smoothly:

gladiusinstallation

Services installed and running:

gladiusservicesinstalledandrunning

Application to pool successful and check is pending:

gladiusapplyandcheck

After node reboots:

afterrebootoffreshinstallation

The services seem to become 'masked' after a reboot. Unmasking the services completely removes them from /etc/systemd/system/. Re-installing and starting the services works, but then the account is not accessible/visible (even while the wallet folder and wallet file are in the .config/gladius folder):

accountnotfound

Expected Behavior:
The services should be disabled/masked after a reboot and should auto start.

Taskbar icon not present in proper way

Hi,

after a super user friendly installation on Windows 10, I observed that if the UI is reduced to icon and the software is running in background the icon in the task-bar doesn't appear even if the program is really working in background.

As per attached image self explaing.

photoUNITO-UNDERSCORE!2018-08-18!UNITO-UNDERSCORE!23-25-46!

No pools in the gladius node manager marketplace

Hi,

I have recently installed the last beta version of gladius node manager on Windows 7 but in the marketplace list I can't see any pool. I also opened tcp ports 8080 and 7946 but it did not solved my issue. Perhaps do I have to open also udp ports? Or is it a bug? Thank you in advance for your replies...

Allow different versions to be download over the linux installer

OS: Debian Linux
Gladius Version: 0.6.1

Currently the linux installer script always donwloads and installs the latest gladius-node version.

curl -s https://raw.githubusercontent.com/gladiusio/gladius-node/master/installers/install.sh | sudo bash

(linux installer script execution)

For debugging purposes and to enable installation of older versions for regression testing etc. the installer script should allow to download older versions.

The simplest way to enable this, which I can think of, is to check if the TAG var is already set.
The smallest change to enable this is to change when we execute the function 'getTag':
(https://github.com/gladiusio/gladius-node/blob/master/installers/install.sh#L169)

# OLD
getLatest

# NEW
[ -z "$TAG" ] && getLatest

Controld not starting due no private IP adress found

Gladius-controld cannot start on Ubuntu VPS with 2 Venets and IP adresses,

panic: Failed to get final advertise address: No private IP address found, and explicit IP not provided

goroutine 1 [running]:
github.com/gladiusio/gladius-node/vendor/github.com/gladiusio/gladius-controld/pkg/p2p/peer.New(0xc42000e0b8, 0xc93d60)
/ext-go/3/src/github.com/gladiusio/gladius-node/vendor/github.com/gladiusio/gladius-controld/pkg/p2p/peer/peer.go:43 +0x3e7
github.com/gladiusio/gladius-node/vendor/github.com/gladiusio/gladius-controld/pkg/routing.AppendP2PEndPoints(0xc42036a9a0, 0xc42000e0b8, 0xc42039a000, 0x0)
/ext-go/3/src/github.com/gladiusio/gladius-node/vendor/github.com/gladiusio/gladius-controld/pkg/routing/routing.go:55 +0x40
github.com/gladiusio/gladius-node/vendor/github.com/gladiusio/gladius-controld/pkg/config.NodeRouter(0x0)
/ext-go/3/src/github.com/gladiusio/gladius-node/vendor/github.com/gladiusio/gladius-controld/pkg/config/config.go:193 +0x4c
github.com/gladiusio/gladius-node/vendor/github.com/gladiusio/gladius-controld/controld.InitializeNodeManager()
/ext-go/3/src/github.com/gladiusio/gladius-node/vendor/github.com/gladiusio/gladius-controld/controld/controld.go:67 +0xa0
main.main()
/ext-go/3/src/github.com/gladiusio/gladius-node/cmd/gladius-controld/main.go:8 +0x20

Marketplace --> Application Information (Empty Fields)

I'm assuming this section is 'supposed' to read data from a previous version installation and populate it in there. As of now, the fields are just empty. Application to a pool can only succeed when the information has AGAIN been entered.

image

upgrade information related to port-forwarding and in general

To enhance the experience or lets say to make it more easy of running a node add the following.

  • for gladius GUI and gladius non GUI
  • add some list with status indicators (green/red) for
    -> port 7946 active and reachable from the outside/not
    -> port 8080 active and reachable from the outside/not
  • maybe as an addition, if not already there in some way
    -> wallet locked/unlocked status
    -> approval pending/ok status

Linux Installer : install path

It could be usefull to have the possibility to change the install path on linux

For instance :

Gladius will be installed on /usr/local/bin. Please confirm [Y/n] : N
Please enter install path : /some/where
Path /some/where is valid !
Installing...

Feature Request: Login using the KYC approved Gladius accounts created during ICO

Instead of entering name and email address at the start of gladius node manager and essentially creating a new account (and then creating a new ethereum account), it would ask you to enter username and password, and these would be the same as the KYC approved account login we have made during the ICO. This way, each account is verified, secure, and connected to a real user instead of bots. This also allows for a single user to login to multiple devices.

Once logged in, we would have another option to either import our own private key/json file and open an existing ethereum account, or create a new one. if we decide to create a new one, we can find where its private key/json file is stored because we should have full control of our own wallets. And these wallets can be changed at any time once logged in, so no ethereum account is permanently bound to a specific user, it is only linked whilst active on the gladius node.

Feature request: Time schedule and bandwidth limitation

Add a time schedule option to the node manager to determine specific time frames when the node starts and ends running automatically. This is useful when there are bandwidth limitations for certain hours and a user wants to run the node during the "Happy Hour" only.

Describe the solution you'd like
Automatic start and stop time for the node by hour and minute as well as a bandwidth limitation option, thus a fully schedulable node where I can adjust bandwidth limitation as well as on/off status for all times exact to the minute.

Describe alternatives you've considered
Manual start and stop which is pretty inconvenient as it requires permanent user interaction.

gladius-controld and gladius-networkd prints error message instead of warning message with missing configuration file

  • OS: Debian Linux
  • Gladius Version: 0.6.1

Whats happening:
When gladius-controld and gladius-networkd starts and it cant't find any gladius-[controld|netword].toml configuration file the process prints an error message but continues to work normally.

$ gladius-controld
2018/09/02 13:39:32 Cannot find config file: Config File "gladius-controld" Not Found in "[/gladius]". Using defaults
2018/09/02 13:39:32

Unable to find gladius-controld.toml in project root, or default directories below.
2018/09/02 13:39:32

Using Default Node Manager Configuration
2018/09/02 13:39:32 error: Config File "gladius-controld" Not Found in "[/gladius]"
Starting API at http://localhost:3001
$ exec gladius-networkd
INFO[0000] Loading config
2018/09/02 13:41:11 Cannot find config file: Config File "gladius-networkd" Not Found in "[/ /gladius]". Using defaults
INFO[0000] Starting content server on port: 8080
2018/09/02 13:41:11 error: Config File "gladius-networkd" Not Found in "[/ /gladius]"
WARN[0000] Error updating disk content                   err="Couldn't sign message with contorld, wallet could be locked"
INFO[0000] Started HTTP server.

What do you expect:
The process should print a warning message and not an error message. The

Further information:
none

Add cli command to unlock wallet

OS: Debian Linux
Gladius Version: 0.6.1

Whats happening:
After restarting controld the wallet is locked and must be unlocked.
The networkd daemon is unable to sign messages becasuse the wallet is locked:

WARN[0000] Error updating disk content                   err="Couldn't sign message with contorld, wallet could be locked"

To unlock the wallet I have to execute a curl command:

curl -XPOST localhost:3001/api/keystore/account/open -d '{"passphrase": "123456"}'

What do you expect:
I expected to have a simply cli command to unlock the wallet instead of having to execute the curl command.
Something like:

gladius wallet unlock

(or so ;-) )

In addition, it would be cool if the controld service would look for the wallet key in some file on the system (configurable via config settings) - so we could implement some auto - unlocking of the wallet.

Further information:
Nothing

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.