Code Monkey home page Code Monkey logo

node-docker-image's Introduction

Waves Node in Docker

[WARNING] Deprecation

This image is deprecated, we highly recommend to use wavesplatform/wavesnode image instead.

About Waves

Waves is a decentralized platform that allows any user to issue, transfer, swap and trade custom blockchain tokens on an integrated peer-to-peer exchange. You can find more information about Waves at wavesplatform.com and in the official documentation.

About the image

This Docker image contains scripts and configs to run Waves Node from version 0.13.0 for TESTNET, MAINNET or CUSTOM networks. The image is focused on fast and convenient deployment of Waves Node.

Container downloads .jar file and configuration files from the releases section and runs it.

Running the image

It is highly recommended to read more about Waves Node configuration before running the container.

The simplest way to run a container:

docker run -it wavesplatform/node

Note: We recommend to start a container like below for MAINNET:

docker run -p 6869:6869 -p 6868:6868 -e WAVES_NETWORK=MAINNET -e WAVES_LOG_LEVEL=DEBUG -e WAVES_HEAP_SIZE=2g -v YOUR_LOCAL_PATH_HERE:/waves wavesplatform/node    

For TESTNET:

docker run -p 6869:6869 -p 6863:6863 -e WAVES_NETWORK=TESTNET -e WAVES_LOG_LEVEL=DEBUG -e WAVES_HEAP_SIZE=2g -v YOUR_LOCAL_PATH_HERE:/waves wavesplatform/node    

You can run container with predefined environment variables:

Env variable Description
WAVES_WALLET_SEED Plain text seed for node wallet. Container converts it to base58.
WAVES_WALLET_SEED_BASE58 Base58 encoded seed.
WAVES_WALLET_PASSWORD Password for wallet file.
WAVES_VERSION Node version. Default value is latest. You can find the list of available versions here.
WAVES_NETWORK Available values are MAINNET and TESTNET.
WAVES_LOG_LEVEL Node logging level, available values: OFF, ERROR, WARN, INFO, DEBUG, TRACE. More details about logging are available here.
WAVES_HEAP_SIZE Java Heap Size limit in -X Command-line Options notation (-Xms=[your value]). More details here
WAVES_CONFIG_FILE Path to your Waves Configuration file.
WAVES_DECLARED_ADDRESS String with IP address and port to send as external address during handshake. Could be set automatically if UPnP is enabled. If declared-address is set, which is the common scenario for nodes running in the cloud, the node will just listen to incoming connections on bind-address:port and broadcast its declared-address to its peers.
WAVES_AUTODETECT_ADDRESS Set yes if you want to get your public address and set value declared-address with it.
WAVES_AUTODETECT_ADDRESS_PORT WAVES_AUTODETECT_ADDRESS can get only an IP address of the node, but not port number, so define your real port number with this variable.

Note: All variables are optional.

If you want to pass configuration file to the node, it should be in mounted volume with path configs/local.conf file.

Note: Environment variables override values in the configuration file.

Configuration

The image supports config customization with env variables. Depending on env values the image generates local.conf file and stores it in /waves/configs directory. The simple rule of how to set a value in the configuration file: 0. Determine the path to variable in configuration file (complete configuration file)

  1. Join all section names with two underscores(__).
  2. Replace all dashes with one underscore (_).
  3. Capitalize the final string.

For instance, if you want to set the value of waves.rest-api.enable, pass an environment variable WAVES__REST_API__ENABLE=no;

node-docker-image's People

Contributors

kardanovir avatar msmolyakov avatar sergelogvinov avatar stuffy-idler avatar

Stargazers

 avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

node-docker-image's Issues

Unable to assign config values that expect a List

Describe the bug
Defining a node configuration list/array value from the environment variables fails on launch

To Reproduce
Steps to reproduce the behavior:

  1. Define WAVES__FEATURES__SUPPORTED to be [1,2] in the environment variables
  2. Run container...
  3. See error

Expected behavior
waves.features.supported should have an array value of [1,2] in local.conf

Error Log

Exception in thread "main" com.typesafe.config.ConfigException$WrongType: /waves/configs/local.conf: 12: waves.features.supported has type STRING rather than LIST

Additional context
This is non-critical, since most of the configuration items that actually need redefining are handled with strings.

Trouble setting api-key-hash

Hello Waves Team,

I am having trouble setting the api-key-hash.
I tried setting Waves-Testnet node using docker image. Though it was successful, I can't find a way how to overwrite the default api-key-hash.

What I did:
docker cp ~/my-config-file waves-node:/waves/configs/local.conf

Result:
Although the contents got copied, the api-key still remains "ridethewaves!"

Contents of ~/my-config-file:

# Waves node settings
waves {
  directory = "/waves"
  data-directory = "/waves/data"

  # Wallet settings
  wallet {
    # Password to protect wallet file
    password = "password"

    # Wallet seed as BASE58 string
    seed = "h7KnZpw9j9VZ4z3LKmsbZ3yw8rP3zXoEEU6cbRKzCP8MdC1zy2U2AJRPQhs3krqSodvzEix3kmKopFeyPpCn4w4BaW9MVr4PASShxiuin9jyzGmMsUwXXMaUjGL1RfTzS3e"  
  }

  # Network settings
  network {
    declared-address = "127.0.0.1"
  }

  # Blockchain settings
  blockchain.type = TESTNET

  # Node's REST API settings
  rest-api {
    # Enable/disable node's REST API
    enable = yes

    # Network address to bind to
    bind-address = "127.0.0.1"

    # Port to listen to REST API requests
    port = 6869

    # Hash of API key string
    api-key-hash = "api-key-hash"   
  }
}

where, i generated api-key-hash using utils/hash/secure

Thanks for any help.

Problem in setting Waves Testnet node using docker image

Hello Waves Team,

I tried setting node for waves, but i am having an issue, i once ran this command :
docker run -p 6869:6869 -p 6863:6863 -e WAVES_NETWORK=TESTNET -e WAVES_LOG_LEVEL=DEBUG -e WAVES_HEAP_SIZE=2g -v waves:/waves wavesplatform/node

and then stopped it by running this command : docker stop <container_id>

I then restarted it by running : docker restart <container_id>
but the container exists with this response:

Traceback (most recent call last):
  File "/usr/local/lib/python3.6/dist-packages/urllib3/connectionpool.py", line 600, in urlopen
    chunked=chunked)
  File "/usr/local/lib/python3.6/dist-packages/urllib3/connectionpool.py", line 384, in _make_request
    six.raise_from(e, None)
  File "<string>", line 2, in raise_from
  File "/usr/local/lib/python3.6/dist-packages/urllib3/connectionpool.py", line 380, in _make_request
    httplib_response = conn.getresponse()
  File "/usr/lib/python3.6/http/client.py", line 1331, in getresponse
    response.begin()
  File "/usr/lib/python3.6/http/client.py", line 297, in begin
    version, status, reason = self._read_status()
  File "/usr/lib/python3.6/http/client.py", line 258, in _read_status
    line = str(self.fp.readline(_MAXLINE + 1), "iso-8859-1")
  File "/usr/lib/python3.6/socket.py", line 586, in readinto
    return self._sock.recv_into(b)
ConnectionResetError: [Errno 104] Connection reset by peer

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/usr/local/lib/python3.6/dist-packages/requests/adapters.py", line 445, in send
    timeout=timeout
  File "/usr/local/lib/python3.6/dist-packages/urllib3/connectionpool.py", line 638, in urlopen
    _stacktrace=sys.exc_info()[2])
  File "/usr/local/lib/python3.6/dist-packages/urllib3/util/retry.py", line 367, in increment
    raise six.reraise(type(error), error, _stacktrace)
  File "/usr/local/lib/python3.6/dist-packages/urllib3/packages/six.py", line 685, in reraise
    raise value.with_traceback(tb)
  File "/usr/local/lib/python3.6/dist-packages/urllib3/connectionpool.py", line 600, in urlopen
    chunked=chunked)
  File "/usr/local/lib/python3.6/dist-packages/urllib3/connectionpool.py", line 384, in _make_request
    six.raise_from(e, None)
  File "<string>", line 2, in raise_from
  File "/usr/local/lib/python3.6/dist-packages/urllib3/connectionpool.py", line 380, in _make_request
    httplib_response = conn.getresponse()
  File "/usr/lib/python3.6/http/client.py", line 1331, in getresponse
    response.begin()
  File "/usr/lib/python3.6/http/client.py", line 297, in begin
    version, status, reason = self._read_status()
  File "/usr/lib/python3.6/http/client.py", line 258, in _read_status
    line = str(self.fp.readline(_MAXLINE + 1), "iso-8859-1")
  File "/usr/lib/python3.6/socket.py", line 586, in readinto
    return self._sock.recv_into(b)
urllib3.exceptions.ProtocolError: ('Connection aborted.', ConnectionResetError(104, 'Connection reset by peer'))

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/waves-node/starter.py", line 172, in <module>
    WAVES_DECLARED_ADDRESS = get_external_ip() + ':' + get_port_number(NETWORK)
  File "/waves-node/starter.py", line 109, in get_external_ip
    plain_response = requests.get('http://ipinfo.io/ip').text.rstrip("\n\r")
  File "/usr/local/lib/python3.6/dist-packages/requests/api.py", line 72, in get
    return request('get', url, params=params, **kwargs)
  File "/usr/local/lib/python3.6/dist-packages/requests/api.py", line 58, in request
    return session.request(method=method, url=url, **kwargs)
  File "/usr/local/lib/python3.6/dist-packages/requests/sessions.py", line 512, in request
    resp = self.send(prep, **send_kwargs)
  File "/usr/local/lib/python3.6/dist-packages/requests/sessions.py", line 622, in send
    r = adapter.send(request, **kwargs)
  File "/usr/local/lib/python3.6/dist-packages/requests/adapters.py", line 495, in send
    raise ConnectionError(err, request=request)
requests.exceptions.ConnectionError: ('Connection aborted.', ConnectionResetError(104, 'Connection reset by peer'))
Node is starting...
Error: Invalid or corrupt jarfile /waves-node/waves-all-latest.jar
Latest version for TESTNET is:  Version 0.15.0 (Testnet Only)
Version: latest(0.15.0)```

Thanks for any help :)

Accessing Swagger UI causes crash

This might be a bug more suited for wavesplatform/Waves but I've only experienced this behavior while running this docker image...

Describe the bug
Navigating to the root API endpoint from a browser (which redirects to Waves REST API Swagger UI) will cause the node to crash.

To Reproduce
Steps to reproduce the behavior:

  1. Run docker image with REST API fully enabled
  2. From a browser navigate to the root of the API (i.e. localhost:6869)
  3. It should redirect to Swagger UI, then crash the node
  4. See error

Expected behavior
Swagger UI works as intended, or give an option to completely disable the serving of this feature.

Error Log

Uncaught error from thread [wavesplatform-akka.actor.default-dispatcher-7]: javax/xml/bind/annotation/XmlRootElement, shutting down JVM since 'akka.jvm-exit-on-fatal-error' is enabled for for ActorSystem[wavesplatform]
java.lang.NoClassDefFoundError: javax/xml/bind/annotation/XmlRootElement
	at io.swagger.jackson.ModelResolver.resolve(ModelResolver.java:270)
	at io.swagger.jackson.ModelResolver.resolve(ModelResolver.java:185)
	at io.swagger.scala.converter.SwaggerScalaModelConverter.resolve(SwaggerScalaModelConverter.scala:86)

Additional context
Attempted on local docker daemon and remote kubernetes cluster, same result...
However, I have not tested the most recent version of Waves Node to determine if this bug is isolated to this image.

Possible quick solution to introduce stability is to disable akka.jvm-exit-on-fatal-error

Waves node cannot start

The node do not start.
Python script cannot download config file.

# docker run --rm -ti wavesplatform/node

Latest version for TESTNET is:  Version 0.17.2 (Testnet)
Version: latest(0.17.2)
Traceback (most recent call last):
  File "/waves-node/starter.py", line 182, in <module>
    urllib.request.urlretrieve(url, file_path)
  File "/usr/lib/python3.7/urllib/request.py", line 247, in urlretrieve
    with contextlib.closing(urlopen(url, data)) as fp:
  File "/usr/lib/python3.7/urllib/request.py", line 222, in urlopen
    return opener.open(url, data, timeout)
  File "/usr/lib/python3.7/urllib/request.py", line 531, in open
    response = meth(req, response)
  File "/usr/lib/python3.7/urllib/request.py", line 641, in http_response
    'http', request, response, code, msg, hdrs)
  File "/usr/lib/python3.7/urllib/request.py", line 569, in error
    return self._call_chain(*args)
  File "/usr/lib/python3.7/urllib/request.py", line 503, in _call_chain
    result = func(*args)
  File "/usr/lib/python3.7/urllib/request.py", line 649, in http_error_default
    raise HTTPError(req.full_url, code, msg, hdrs, fp)
urllib.error.HTTPError: HTTP Error 404: Not Found
Node is starting...
Error: Unable to access jarfile /waves-node/waves-all-latest.jar

Github config url has changed. https://raw.githubusercontent.com/wavesplatform/Waves/v0.17.2/waves-testnet.conf -> https://raw.githubusercontent.com/wavesplatform/Waves/v0.17.2/node/waves-testnet.conf

solution in PR #5

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.