add lcd to deployment

This commit is contained in:
rhuairahrighairigh 2018-06-07 14:38:08 +01:00
parent f557b77be8
commit f41d79cd60
6 changed files with 62 additions and 196 deletions

View File

@ -1,9 +1,12 @@
To initialise a network: To initialise a network:
- delete everything (including persistant volume claim) - delete everything (including persistant volume claim)
- deploy everything except the deployment - deploy everything except the deployments
- wait until the job has finished, then deploy the deployment - wait until the job has finished, then deploy deployment-d
- check job pod logs for the validator account backup phrase :\ - check job pod logs for the validator account backup phrase :(
- use `kubectl exec` on the deployment-d pod and use gaiacli to recover the validator
- do the same to add other keys and move tokens around
- start up lcd pod (looks like only one instance of gaiacli can access the keys DB)
Examples of using light client with the node: Examples of using light client with the node:

View File

@ -1,178 +0,0 @@
apiVersion: v1
kind: ConfigMap
metadata:
creationTimestamp: null
name: kava-config-map
data:
config.toml: |
# This is a TOML config file.
# For more information, see https://github.com/toml-lang/toml
##### main base config options #####
# TCP or UNIX socket address of the ABCI application,
# or the name of an ABCI application compiled in with the Tendermint binary
proxy_app = "tcp://127.0.0.1:46658"
# A custom human readable name for this node
moniker = "node1"
# If this node is many blocks behind the tip of the chain, FastSync
# allows them to catchup quickly by downloading blocks in parallel
# and verifying their commits
fast_sync = true
# Database backend: leveldb | memdb
db_backend = "leveldb"
# Database directory
db_path = "data"
# Output level for logging, including package level options
log_level = "main:info,state:info,*:error"
##### additional base config options #####
# Path to the JSON file containing the initial validator set and other meta data
genesis_file = "config/genesis.json"
# Path to the JSON file containing the private key to use as a validator in the consensus protocol
priv_validator_file = "config/priv_validator.json"
# Path to the JSON file containing the private key to use for node authentication in the p2p protocol
node_key_file = "config/node_key.json"
# Mechanism to connect to the ABCI application: socket | grpc
abci = "socket"
# TCP or UNIX socket address for the profiling server to listen on
prof_laddr = ""
# If true, query the ABCI app on connecting to a new peer
# so the app can decide if we should keep the connection or not
filter_peers = false
##### advanced configuration options #####
##### rpc server configuration options #####
[rpc]
# TCP or UNIX socket address for the RPC server to listen on
laddr = "tcp://0.0.0.0:46657"
# TCP or UNIX socket address for the gRPC server to listen on
# NOTE: This server only supports /broadcast_tx_commit
grpc_laddr = ""
# Activate unsafe RPC commands like /dial_seeds and /unsafe_flush_mempool
unsafe = false
##### peer to peer configuration options #####
[p2p]
# Address to listen for incoming connections
laddr = "tcp://0.0.0.0:46656"
# Comma separated list of seed nodes to connect to
seeds = ""
# Comma separated list of nodes to keep persistent connections to
# Do not add private peers to this list if you don't want them advertised
persistent_peers = ""
# Path to address book
addr_book_file = "config/addrbook.json"
# Set true for strict address routability rules
addr_book_strict = true
# Time to wait before flushing messages out on the connection, in ms
flush_throttle_timeout = 100
# Maximum number of peers to connect to
max_num_peers = 50
# Maximum size of a message packet payload, in bytes
max_packet_msg_payload_size = 1024
# Rate at which packets can be sent, in bytes/second
send_rate = 512000
# Rate at which packets can be received, in bytes/second
recv_rate = 512000
# Set true to enable the peer-exchange reactor
pex = true
# Seed mode, in which node constantly crawls the network and looks for
# peers. If another node asks it for addresses, it responds and disconnects.
#
# Does not work if the peer-exchange reactor is disabled.
seed_mode = false
# Authenticated encryption
auth_enc = true
# Comma separated list of peer IDs to keep private (will not be gossiped to other peers)
private_peer_ids = ""
##### mempool configuration options #####
[mempool]
recheck = true
recheck_empty = true
broadcast = true
wal_dir = "data/mempool.wal"
##### consensus configuration options #####
[consensus]
wal_file = "data/cs.wal/wal"
# All timeouts are in milliseconds
timeout_propose = 3000
timeout_propose_delta = 500
timeout_prevote = 1000
timeout_prevote_delta = 500
timeout_precommit = 1000
timeout_precommit_delta = 500
timeout_commit = 1000
# Make progress as soon as we have all the precommits (as if TimeoutCommit = 0)
skip_timeout_commit = false
# BlockSize
max_block_size_txs = 10000
max_block_size_bytes = 1
# EmptyBlocks mode and possible interval between empty blocks in seconds
create_empty_blocks = false
create_empty_blocks_interval = 0
# Reactor sleep duration parameters are in milliseconds
peer_gossip_sleep_duration = 100
peer_query_maj23_sleep_duration = 2000
##### transactions indexer configuration options #####
[tx_index]
# What indexer to use for transactions
#
# Options:
# 1) "null" (default)
# 2) "kv" - the simplest possible indexer, backed by key-value storage (defaults to levelDB; see DBBackend).
indexer = "kv"
# Comma-separated list of tags to index (by default the only tag is tx hash)
#
# It's recommended to index only a subset of tags due to possible memory
# bloat. This is, of course, depends on the indexer's DB and the volume of
# transactions.
index_tags = ""
# When set to true, tells indexer to index all tags. Note this may be not
# desirable (see the comment above). IndexTags has a precedence over
# IndexAllTags (i.e. when given both, IndexTags will be indexed).
index_all_tags = false

View File

@ -1,18 +1,18 @@
apiVersion: apps/v1beta2 apiVersion: apps/v1beta2
kind: Deployment kind: Deployment
metadata: metadata:
name: kava-deployment name: kava-d-deployment
labels: labels:
app: kava app: kava
spec: spec:
replicas: 1 replicas: 1
selector: selector:
matchLabels: matchLabels:
app: kava app: kava-d
template: template:
metadata: metadata:
labels: labels:
app: kava app: kava-d
spec: spec:
containers: containers:
- name: gaiad - name: gaiad
@ -26,8 +26,6 @@ spec:
mountPath: /root/.gaiad mountPath: /root/.gaiad
- name: kava-persistent-storage-gaiacli - name: kava-persistent-storage-gaiacli
mountPath: /root/.gaiacli mountPath: /root/.gaiacli
- name: kava-config-map-volume
mountPath: /root/gaia/.gaiad/config
volumes: volumes:
- name: kava-persistent-storage-gaiad - name: kava-persistent-storage-gaiad
persistentVolumeClaim: persistentVolumeClaim:
@ -35,7 +33,3 @@ spec:
- name: kava-persistent-storage-gaiacli - name: kava-persistent-storage-gaiacli
persistentVolumeClaim: persistentVolumeClaim:
claimName: kava-pvc-gaiacli claimName: kava-pvc-gaiacli
- name: kava-config-map-volume
configMap:
name: kava-config-map

View File

@ -0,0 +1,34 @@
apiVersion: apps/v1beta2
kind: Deployment
metadata:
name: kava-lcd-deployment
labels:
app: kava
spec:
replicas: 1
selector:
matchLabels:
app: kava-lcd
template:
metadata:
labels:
app: kava-lcd
spec:
containers:
- name: gaiacli-lcd
image: kava/cosmos-sdk:ilp-demo
command: ["gaiacli", "rest-server", "--chain-id=kava", "--node=kava-d-service:46657", "--laddr=tcp://0.0.0.0:1317"]
ports:
- containerPort: 1317
volumeMounts:
- name: kava-persistent-storage-gaiad
mountPath: /root/.gaiad
- name: kava-persistent-storage-gaiacli
mountPath: /root/.gaiacli
volumes:
- name: kava-persistent-storage-gaiad
persistentVolumeClaim:
claimName: kava-pvc-gaiad
- name: kava-persistent-storage-gaiacli
persistentVolumeClaim:
claimName: kava-pvc-gaiacli

View File

@ -2,6 +2,8 @@ apiVersion: batch/v1
kind: Job kind: Job
metadata: metadata:
name: start-new-chain-job name: start-new-chain-job
labels:
app: kava
spec: spec:
template: template:
spec: spec:
@ -14,8 +16,6 @@ spec:
mountPath: /root/.gaiad mountPath: /root/.gaiad
- name: kava-persistent-storage-gaiacli - name: kava-persistent-storage-gaiacli
mountPath: /root/.gaiacli mountPath: /root/.gaiacli
- name: kava-config-map-volume
mountPath: /root/gaia/.gaiad/config
restartPolicy: Never restartPolicy: Never
volumes: volumes:
- name: kava-persistent-storage-gaiad - name: kava-persistent-storage-gaiad
@ -24,6 +24,3 @@ spec:
- name: kava-persistent-storage-gaiacli - name: kava-persistent-storage-gaiacli
persistentVolumeClaim: persistentVolumeClaim:
claimName: kava-pvc-gaiacli claimName: kava-pvc-gaiacli
- name: kava-config-map-volume
configMap:
name: kava-config-map

View File

@ -1,7 +1,7 @@
apiVersion: v1 apiVersion: v1
kind: Service kind: Service
metadata: metadata:
name: kava-service name: kava-d-service
labels: labels:
app: kava app: kava
spec: spec:
@ -16,4 +16,20 @@ spec:
protocol: TCP protocol: TCP
targetPort: 46656 targetPort: 46656
selector: selector:
app: kava-d
---
apiVersion: v1
kind: Service
metadata:
name: kava-lcd-service
labels:
app: kava app: kava
spec:
type: LoadBalancer
ports:
- name: rest-server
port: 1317
protocol: TCP
targetPort: 1317
selector:
app: kava-lcd