Skip to content

Commit

Permalink
chore: updated docs
Browse files Browse the repository at this point in the history
  • Loading branch information
scalalang2 committed Dec 17, 2022
1 parent 047f78e commit 0edfbbf
Show file tree
Hide file tree
Showing 5 changed files with 18 additions and 10 deletions.
7 changes: 5 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,11 @@ Cosmfaucet is a self-hosted faucet service for cosmos based blockchain.
* Multi-chain support

### End-to-end Test Environment
Please check on `e2e/docker-compose.yml` file in this project.
It launches `a local testnet` and `the faucet server`.
To launch a e2e environment, please follow below steps.

1. Visit to the [e2e](./e2e) directory.
2. Run `docker-compose up` to launch 2 chains, a relayer and `the faucet service`.
3. Visit to the [http://localhost:8080](http://localhost:8080) with your browser.

#### Run faucet server manually
```bash
Expand Down
7 changes: 5 additions & 2 deletions core/app.go
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,6 @@ func NewApp(config *RootConfig) (*App, error) {
return nil, err
}
app.logger = logger
defer logger.Sync()

// connects to all chains
wd, err := os.Getwd()
Expand Down Expand Up @@ -218,6 +217,10 @@ func (a *App) serveFrontend(mux *runtime.ServeMux) error {
}

func (a *App) Stop() {
defer a.cancelFunc()
a.logger.Info("shutting down the application")
a.cancelFunc()
err := a.logger.Sync()
if err != nil {
a.logger.Panic("logging synchronization failed", zap.Error(err))
}
}
10 changes: 6 additions & 4 deletions e2e/docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -45,17 +45,19 @@ services:
- /bin/sh
- -c
- |
RELAYER_HOME=/home/relayer/.relayer/config
while ! nc -z testchain-1 26657; do sleep 1; done
while ! nc -z testchain-2 26657; do sleep 1; done
# sleep enough for at least two blocks to be issued.
sleep 30;
mkdir -p /home/relayer/.relayer/config
cp -r /home/relayer/tmp/* /home/relayer/.relayer/config/
mkdir -p $RELAYER_HOME
cp -r /home/relayer/tmp/* $RELAYER_HOME/
chmod u+x /home/relayer/.relayer/config/start.sh
/home/relayer/.relayer/config/start.sh
chmod u+x $RELAYER_HOME/start.sh
$RELAYER_HOME/start.sh
faucet:
depends_on:
- testchain-1
Expand Down
2 changes: 1 addition & 1 deletion frontend/build/index.html
Original file line number Diff line number Diff line change
@@ -1 +1 @@
<!doctype html><html lang="en"><head><meta charset="utf-8"/><link rel="icon" href="/favicon.ico"/><meta name="viewport" content="width=device-width,initial-scale=1"/><meta name="theme-color" content="#000000"/><meta name="description" content="Web site created using create-react-app"/><link rel="apple-touch-icon" href="/logo192.png"/><link rel="manifest" href="/manifest.json"/><title>React App</title><script defer="defer" src="/static/js/main.e25b2e8b.js"></script><link href="/static/css/main.daad8c12.css" rel="stylesheet"></head><body><noscript>You need to enable JavaScript to run this app.</noscript><div id="root"></div></body></html>
<!doctype html><html lang="en"><head><meta charset="utf-8"/><link rel="icon" href="/favicon.ico"/><meta name="viewport" content="width=device-width,initial-scale=1"/><meta name="theme-color" content="#000000"/><meta name="description" content="Web site created using create-react-app"/><link rel="apple-touch-icon" href="/logo192.png"/><link rel="manifest" href="/manifest.json"/><title>Cosmfaucet : Multi-chain faucet server for cosmos based blockchain.</title><script defer="defer" src="/static/js/main.e25b2e8b.js"></script><link href="/static/css/main.daad8c12.css" rel="stylesheet"></head><body><noscript>You need to enable JavaScript to run this app.</noscript><div id="root"></div></body></html>
2 changes: 1 addition & 1 deletion frontend/public/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
work correctly both with client-side routing and a non-root public URL.
Learn how to configure a non-root public URL by running `npm run build`.
-->
<title>React App</title>
<title>Cosmfaucet : Multi-chain faucet server for cosmos based blockchain.</title>
</head>
<body>
<noscript>You need to enable JavaScript to run this app.</noscript>
Expand Down

0 comments on commit 0edfbbf

Please sign in to comment.