Skip to content
This repository has been archived by the owner on Jan 19, 2022. It is now read-only.

Commit

Permalink
Enable cors on tessera 3rd party (#27)
Browse files Browse the repository at this point in the history
* enable cors on tessera 3rd party API (needed for remix to connect for private key info).
the tessera API is available via NodePort: 
`curl http://{NODE_IP}:{NodePort}/partyinfo/keys`
* makes tessera 3rd party port configurable, default set to `9080`.
* update tessera version to newer version.
* fixes quorum p2p typos.
  • Loading branch information
apratt3377 authored May 15, 2020
1 parent 82766c3 commit 82f777f
Show file tree
Hide file tree
Showing 16 changed files with 44 additions and 15 deletions.
1 change: 1 addition & 0 deletions examples/config/qubernetes-custom-docker-repo.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ quorum:
# the docker repo that hold your quorum container
Docker_Repo: %%YOUR_CUSTOM_DOCKER_REPO%%
Port: 9001
3Party_Port: 9080
Tessera_Config_Dir: out/config
# persistent storage is handled by Persistent Volume Claims (PVC) https://kubernetes.io/docs/concepts/storage/persistent-volumes/
# test locally and on GCP
Expand Down
3 changes: 2 additions & 1 deletion examples/config/qubernetes-ingress.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,9 @@ quorum:
# (tessera|constellation)
Name: tessera
#Tm_Version: 0.9.2
Tm_Version: 0.10.0
Tm_Version: 0.10.2
Port: 9001
3Party_Port: 9080
Tessera_Config_Dir: out/config
# persistent storage is handled by Persistent Volume Claims (PVC) https://kubernetes.io/docs/concepts/storage/persistent-volumes/
# test locally and on GCP
Expand Down
1 change: 1 addition & 0 deletions examples/config/qubernetes-istanbul-7nodes.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ quorum:
# container images at https://hub.docker.com/u/quorumengineering/
# in that case.
Tm_Version: 0.3.2
3Party_Port: 9080
Port: 9001
# generic geth related options
geth:
Expand Down
3 changes: 2 additions & 1 deletion examples/config/qubernetes-istanbul-generate-8nodes.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,9 @@ quorum:
# container images at https://hub.docker.com/u/quorumengineering/
# (tessera|constellation)
Name: tessera
Tm_Version: 0.9.2
Tm_Version: 0.10.2
Port: 9001
3Party_Port: 9080
Tessera_Config_Dir: out/config
# persistent storage is handled by Persistent Volume Claims (PVC) https://kubernetes.io/docs/concepts/storage/persistent-volumes/
# test locally and on GCP
Expand Down
1 change: 1 addition & 0 deletions examples/config/qubernetes-network-policy.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ quorum:
Name: tessera
Tm_Version: 0.10.2
Port: 9001
3Party_Port: 9080
Tessera_Config_Dir: out/config
# persistent storage is handled by Persistent Volume Claims (PVC) https://kubernetes.io/docs/concepts/storage/persistent-volumes/
# test locally and on GCP
Expand Down
1 change: 1 addition & 0 deletions examples/config/qubernetes-pvc-annotations.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ quorum:
Name: tessera
Tm_Version: 0.10.2
Port: 9001
3Party_Port: 9080
Tessera_Config_Dir: out/config
# persistent storage is handled by Persistent Volume Claims (PVC) https://kubernetes.io/docs/concepts/storage/persistent-volumes/
storage:
Expand Down
1 change: 1 addition & 0 deletions examples/config/qubernetes-pvc-storageclass.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ quorum:
Name: tessera
Tm_Version: 0.10.2
Port: 9001
3Party_Port: 9080
Tessera_Config_Dir: out/config
# persistent storage is handled by Persistent Volume Claims (PVC) https://kubernetes.io/docs/concepts/storage/persistent-volumes/
storage:
Expand Down
1 change: 1 addition & 0 deletions examples/config/qubernetes-raft-generate-8nodes.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ quorum:
Name: tessera
Tm_Version: 0.9.2
Port: 9001
3Party_Port: 9080
Tessera_Config_Dir: out/config
# generic geth related options
geth:
Expand Down
1 change: 1 addition & 0 deletions examples/config/qubernetes-security-context.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ quorum:
Name: tessera
Tm_Version: 0.11
Port: 9001
3Party_Port: 9080
Tessera_Config_Dir: out/config
# persistent storage is handled by Persistent Volume Claims (PVC) https://kubernetes.io/docs/concepts/storage/persistent-volumes/
# test locally and on GCP
Expand Down
7 changes: 6 additions & 1 deletion qubernetes
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,11 @@ if @config["quorum"]["tm"]["Port"]
@Tm_Port = @config["quorum"]["tm"]["Port"]
end

@Tm_3Party_Port = 9080
if @config["quorum"]["tm"]["3Party_Port"]
@Tm_3Party_Port = @config["quorum"]["tm"]["3Party_Port"]
end

@Node_RPCPort = 8545
if @config["geth"] and @config["geth"]["Node_RPCPort"]
@Node_RPCPort = @config["geth"]["Node_RPCPort"]
Expand All @@ -73,7 +78,7 @@ end

@NodeP2P_ListenAddr = 30303
if @config["geth"] and @config["geth"]["NodeP2P_ListenAddr"]
@NodeP2P_ListenAdd = @config["geth"]["NodeP2P_ListenAddr"]
@NodeP2P_ListenAddr = @config["geth"]["NodeP2P_ListenAddr"]
end


Expand Down
3 changes: 2 additions & 1 deletion qubernetes.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,9 @@ quorum:
# (tessera|constellation)
Name: tessera
#Tm_Version: 0.9.2
Tm_Version: 0.10.0
Tm_Version: 0.10.2
Port: 9001
3Party_Port: 9080
Tessera_Config_Dir: out/config
# persistent storage is handled by Persistent Volume Claims (PVC) https://kubernetes.io/docs/concepts/storage/persistent-volumes/
# test locally and on GCP
Expand Down
7 changes: 6 additions & 1 deletion quorum-config
Original file line number Diff line number Diff line change
Expand Up @@ -54,14 +54,19 @@ end
if @config["quorum"]["tm"]["Port"]
@Tm_Port = @config["quorum"]["tm"]["Port"]
end
# Tm_3Party_Port used in tessera config templates
@Tm_3Party_Port = 9080
if @config["quorum"]["tm"]["3Party_Port"]
@Tm_3Party_Port = @config["quorum"]["tm"]["3Party_Port"]
end
# used by permissioned-nodes.json.erb to set enode URLs
@Raft_Port = 50401
if @config["quorum"]["quorum"]["Raft_Port"]
@Raft_Port = @config["quorum"]["quorum"]["Raft_Port"]
end
@NodeP2P_ListenAddr = 30303
if @config["geth"] and @config["geth"]["NodeP2P_ListenAddr"]
@NodeP2P_ListenAdd = @config["geth"]["NodeP2P_ListenAddr"]
@NodeP2P_ListenAddr = @config["geth"]["NodeP2P_ListenAddr"]
end

#####################################################
Expand Down
12 changes: 6 additions & 6 deletions templates/k8s/network-policy.yaml.erb
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@ spec:
matchLabels:
app: qubernetes
ports:
- port: <%= @TM_Port %>
- port: 9080
- port: <%= @Tm_Port %>
- port: <%= @Tm_3Party_Port %>
- port: <%= @Raft_Port %>
- port: <%= @Node_WSPort %>
- port: <%= @Node_RPCPort %>
Expand All @@ -28,8 +28,8 @@ spec:
matchLabels:
app: qubernetes
ports:
- port: <%= @TM_Port %>
- port: 9080
- port: <%= @Tm_Port %>
- port: <%= @Tm_3Party_Port %>
- port: <%= @Raft_Port %>
- port: <%= @Node_RPCPort %>
- port: <%= @Node_WSPort %>
Expand All @@ -55,6 +55,6 @@ spec:
app: qubernetes
ports:
- port: <%= @TM_Port %>
- port: 9080
- port: <%= @Node_RPCPort %>
- port: <%= @Tm_3Party_Port %>
- port: <%= @Node_RPCPort %>
- port: <%= @Node_WSPort %>
4 changes: 2 additions & 2 deletions templates/k8s/quorum-services.yaml.erb
Original file line number Diff line number Diff line change
Expand Up @@ -40,8 +40,8 @@ spec:
# default 8545
- name: tm-tessera-third-part
protocol: TCP
port: 9080
targetPort: 9080
port: <%= @Tm_3Party_Port %>
targetPort: <%= @Tm_3Party_Port %>
# default 8545
- name: rpc-listener
protocol: TCP
Expand Down
11 changes: 10 additions & 1 deletion templates/quorum/tessera-config-9.0.json.erb
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,16 @@ end
{
"app":"ThirdParty",
"enabled": true,
"serverAddress": "http://%THIS_SERVICE_HOST%:9080",
"serverAddress": "http://%THIS_SERVICE_HOST%:<%= @Tm_3Party_Port %>",
"cors": {
"allowedMethods": [
"GET",
"OPTIONS"
],
"allowedOrigins": [
"*"
]
},
"communicationType" : "REST"
},
{
Expand Down
2 changes: 1 addition & 1 deletion templates/quorum/tessera-config-enhanced.json.erb
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ end
"enabled": true,
"serverSocket":{
"type":"INET",
"port": 9080,
"port": <%= @Tm_3Party_Port %>,
"hostName": "http://%THIS_SERVICE_HOST%"
},
"communicationType" : "REST"
Expand Down

0 comments on commit 82f777f

Please sign in to comment.