solution: use port 2449 by default

This commit is contained in:
Igor Artamonov
2019-09-07 21:34:11 -04:00
parent 1ea6345cd6
commit 26d2b0a3a0
7 changed files with 22 additions and 22 deletions

View File

@@ -36,7 +36,7 @@ Create file `dshackle.yaml` with following content:
[source,yaml] [source,yaml]
---- ----
version: v1 version: v1
port: 9001 port: 2449
tls: tls:
enabled: false enabled: false
upstreams: upstreams:
@@ -45,7 +45,7 @@ upstreams:
Which sets the following: Which sets the following:
- application listen on 0.0.0.0:9001 - application listen on 0.0.0.0:2448
- TLS security is disabled (_don't use in production!_) - TLS security is disabled (_don't use in production!_)
- read upstreams configuration from file `upstreams.yaml` in the current directory - read upstreams configuration from file `upstreams.yaml` in the current directory
@@ -90,17 +90,17 @@ export INFURA_USER=...
.Run Dshackle .Run Dshackle
[source,bash] [source,bash]
---- ----
docker run -p 9001:9001 -v $(pwd):/config -w /config -e "INFURA_USER=$INFURA_USER" emeraldpay/dshackle docker run -p 2449:2449 -v $(pwd):/config -w /config -e "INFURA_USER=$INFURA_USER" emeraldpay/dshackle
---- ----
Now it listen on port 9001 at the localhost and can be connected from any gRPC compatible client. Now it listen on port 2449 at the localhost and can be connected from any gRPC compatible client.
Tools such as https://github.com/fullstorydev/grpcurl[gRPCurl] can automatically parse protobuf definitions and connect Tools such as https://github.com/fullstorydev/grpcurl[gRPCurl] can automatically parse protobuf definitions and connect
to it (actual Protobuf sources are located in a separate repository which you can find at https://github.com/emeraldpay/proto) to it (actual Protobuf sources are located in a separate repository which you can find at https://github.com/emeraldpay/proto)
.Connect and listen for new blocks on Ethereum Mainnet .Connect and listen for new blocks on Ethereum Mainnet
[source,bash] [source,bash]
---- ----
grpcurl -import-path ./proto/ -proto blockchain.proto -d "{\"type\": 100}" -plaintext 127.0.0.1:9001 io.emeraldpay.api.Blockchain/SubscribeHead grpcurl -import-path ./proto/ -proto blockchain.proto -d "{\"type\": 100}" -plaintext 127.0.0.1:2449 io.emeraldpay.api.Blockchain/SubscribeHead
---- ----
.Output would be like .Output would be like

View File

@@ -1,5 +1,5 @@
version: v1 version: v1
port: 9001 port: 2449
tls: tls:
enabled: false enabled: false
upstreams: upstreams:

View File

@@ -17,7 +17,7 @@ Create file `dshackle.yaml` with following content:
[source,yaml] [source,yaml]
---- ----
version: v1 version: v1
port: 9001 port: 2449
tls: tls:
enabled: false enabled: false
upstreams: upstreams:
@@ -26,7 +26,7 @@ upstreams:
This very basic config says that: This very basic config says that:
- application should listen on 0.0.0.0:9001 - application will listen for connections on 0.0.0.0:2449
- TLS security should be disabled (_never use in production!_) - TLS security should be disabled (_never use in production!_)
- read upstreams configuration from file `upstreams.yaml` in current directory - read upstreams configuration from file `upstreams.yaml` in current directory
@@ -71,13 +71,13 @@ export INFURA_USER=...
.Run Dshackle .Run Dshackle
[source,bash] [source,bash]
---- ----
docker run -p 9001:9001 -v $(pwd):/config -w /config -e "INFURA_USER=$INFURA_USER" emeraldpay/dshackle docker run -p 2449:2449 -v $(pwd):/config -w /config -e "INFURA_USER=$INFURA_USER" emeraldpay/dshackle
---- ----
.Connect and listen for new blocks on Ethereum Mainnet .Connect and listen for new blocks on Ethereum Mainnet
[source,bash] [source,bash]
---- ----
grpcurl -import-path ./proto/ -proto blockchain.proto -d "{\"type\": 100}" -plaintext 127.0.0.1:9001 io.emeraldpay.api.Blockchain/SubscribeHead grpcurl -import-path ./proto/ -proto blockchain.proto -d "{\"type\": 100}" -plaintext 127.0.0.1:2449 io.emeraldpay.api.Blockchain/SubscribeHead
---- ----
.Output would be like .Output would be like

View File

@@ -3,7 +3,7 @@
[source,yaml] [source,yaml]
---- ----
version: v1 version: v1
port: 9001 port: 2449
tls: tls:
enabled: true enabled: true
server: server:
@@ -18,7 +18,7 @@ upstreams:
Configures following: Configures following:
- server is listening on `0.0.0.0:9001` - server is listening on `0.0.0.0:2449`
- TLS is enabled - TLS is enabled
- server certificate in located at `server.crt` with key for it at `server.p8.key` - server certificate in located at `server.crt` with key for it at `server.p8.key`
- server requires a client authentication by TLS client certificate signed by `ca.crt` certificate - server requires a client authentication by TLS client certificate signed by `ca.crt` certificate

View File

@@ -6,7 +6,7 @@ Prepare configuration files `dshackle.yaml` and `upstreams.yaml` in the current
[source,bash] [source,bash]
---- ----
docker run -p 9001:9001 -v $(pwd):/config -w /config emeraldpay/dshackle docker run -p 2449:2449 -v $(pwd):/config -w /config emeraldpay/dshackle
---- ----
=== Install & Run manually === Install & Run manually

View File

@@ -40,7 +40,7 @@ Copy those files to directory with Dshackle and update configuration.
[source,yaml] [source,yaml]
---- ----
version: v1 version: v1
port: 9001 port: 2449
tls: tls:
enabled: true enabled: true
server: server:
@@ -51,7 +51,7 @@ tls:
.Verify that server uses the certificate .Verify that server uses the certificate
[source,bash] [source,bash]
---- ----
openssl s_client -alpn h2 -connect 127.0.0.1:9001 -CAfile out/ca.myhost.dev.crt openssl s_client -alpn h2 -connect 127.0.0.1:2449 -CAfile out/ca.myhost.dev.crt
---- ----
With the configuration above the server listen using TLS and the server identity can be verified by a client against public With the configuration above the server listen using TLS and the server identity can be verified by a client against public
@@ -93,7 +93,7 @@ Copy `client-ca.myhost.dev.crt` to directory with first Dshackle server.
[source,yaml] [source,yaml]
---- ----
version: v1 version: v1
port: 9001 port: 2449
tls: tls:
enabled: true enabled: true
server: server:
@@ -107,7 +107,7 @@ tls:
.Verify connection with client certificate .Verify connection with client certificate
[source,bash] [source,bash]
---- ----
openssl s_client -alpn h2 -connect 127.0.0.1:9001 -CAfile out/ca.myhost.dev.crt -cert out/client_1.crt -key out/client_1.key openssl s_client -alpn h2 -connect 127.0.0.1:2449 -CAfile out/ca.myhost.dev.crt -cert out/client_1.crt -key out/client_1.key
---- ----
Now you need to setup connection from another Dshackle server. I.e. the server we configured above is going be an Now you need to setup connection from another Dshackle server. I.e. the server we configured above is going be an
@@ -119,12 +119,12 @@ Setup another Dshackle server on the same machine:
[source,yaml] [source,yaml]
---- ----
version: v1 version: v1
port: 9002 port: 3449
tls: tls:
enabled: false enabled: false
---- ----
At this case we run another server on port 9002 in unsecure mode. But to connect to an upstream is still uses a TLS At this case we run another server on port 3449 in unsecure mode. But to connect to an upstream is still uses a TLS
certificate as described below certificate as described below
[source,yaml] [source,yaml]
@@ -137,12 +137,12 @@ upstreams:
connection: connection:
grpc: grpc:
host: 127.0.0.1 host: 127.0.0.1
port: 9001 port: 2449
tls: tls:
ca: ca.myhost.dev.crt ca: ca.myhost.dev.crt
certificate: client_1.crt certificate: client_1.crt
key: client_1.p8.key key: client_1.p8.key
---- ----
Now if you run second server it will connect to first server ("upstream") running on port 9001, will verify upstream Now if you run second server it will connect to first server ("upstream") running on port 2449, will verify upstream
with certificate `ca.myhost.dev.crt` and authenticate itself by using pair of `client_1.crt` and `client_1.p8.key` with certificate `ca.myhost.dev.crt` and authenticate itself by using pair of `client_1.crt` and `client_1.p8.key`

View File

@@ -44,7 +44,7 @@ open class GrpcServer(
fun start() { fun start() {
log.info("Starting GRPC Server...") log.info("Starting GRPC Server...")
log.debug("Running with DEBUG LOGGING") log.debug("Running with DEBUG LOGGING")
val port = env.getProperty("port", "8090").toInt() val port = env.getProperty("port", "2449").toInt()
log.info("Listening on 0.0.0.0:$port") log.info("Listening on 0.0.0.0:$port")
val serverBuilder = NettyServerBuilder.forPort(port) val serverBuilder = NettyServerBuilder.forPort(port)
rpcs.forEach { rpcs.forEach {