Skip to content

Commit

Permalink
feat(bigdipper): add Big Dipper config
Browse files Browse the repository at this point in the history
  • Loading branch information
michaelfig committed Feb 5, 2020
1 parent f5b0e14 commit f98ff43
Show file tree
Hide file tree
Showing 7 changed files with 169 additions and 0 deletions.
7 changes: 7 additions & 0 deletions packages/deployment/bigdipper/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
TODO: Write better instructions

```sh
git clone https://github.com/agoric-labs/big_dipper
cd big_dipper
./build.sh
```
20 changes: 20 additions & 0 deletions packages/deployment/bigdipper/ag-bigdipper.service
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
[Unit]
Description=Big Dipper Agoric Explorer
Requires=network-online.target
After=network-online.target

[Service]
Environment=BIND_IP=127.0.0.1
Environment=PORT=5000
Environment=ROOT_URL=https://explorer-testnet.agoric.com/
WorkingDirectory=/home/bigdipper
Restart=on-failure
User=bigdipper
Group=bigdipper
PermissionsStartOnly=true
ExecStart=/home/bigdipper/ag-bigdipper.sh
ExecReload=/bin/kill -HUP $MAINPID
KillSignal=SIGTERM

[Install]
WantedBy=multi-user.target
20 changes: 20 additions & 0 deletions packages/deployment/bigdipper/ag-bigdipper.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
#! /bin/bash
# bigdipper.sh - Run Agoric Big Dipper Explorer
set -e
ncf=`curl -Ss https://testnet.agoric.com/network-config`
l=`echo "$ncf" | jq '.rpcAddrs | length'`
eval rp=`echo "$ncf" | jq ".rpcAddrs[$(( RANDOM % l ))]"`
eval cn=`echo "$ncf" | jq '.chainName'`

case $cn in
testnet-1.16.8) db=meteor ;;
*) db=`echo "$cn" | sed -e 's/\./-/g'` ;;
esac

export MONGO_URL=mongodb://localhost:27017/"$db"

test -d "portal-$cn" && ln -sfT "portal-$cn" portal
cd portal
export METEOR_SETTINGS=`sed -e "s/@CHAIN_NAME@/$cn/; s/@RPC@/$rp/" settings.json`
exec /usr/bin/node main.js
exit $?
17 changes: 17 additions & 0 deletions packages/deployment/bigdipper/ag-lcd.service
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
[Unit]
Description=Agoric Light Client Daemon
Requires=network-online.target
After=network-online.target

[Service]
WorkingDirectory=/home/bigdipper
Restart=on-failure
User=bigdipper
Group=bigdipper
PermissionsStartOnly=true
ExecStart=/home/bigdipper/ag-lcd.sh
ExecReload=/bin/kill -HUP $MAINPID
KillSignal=SIGTERM

[Install]
WantedBy=multi-user.target
10 changes: 10 additions & 0 deletions packages/deployment/bigdipper/ag-lcd.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
#! /bin/bash
# ag-lcd.sh - run an Agoric Light Client Daemon
set -e
PATH=$PATH:/usr/local/bin
ncf=`curl -Ss https://testnet.agoric.com/network-config`
l=`echo "$ncf" | jq '.rpcAddrs | length'`
eval rp=`echo "$ncf" | jq ".rpcAddrs[$(( RANDOM % l ))]"`
eval cn=`echo "$ncf" | jq '.chainName'`
exec ag-cosmos-helper rest-server --node="tcp://$rp" --chain-id="$cn"
exit $?
52 changes: 52 additions & 0 deletions packages/deployment/bigdipper/bigdipper.nginx
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
# this section is needed to proxy web-socket connections
map $http_upgrade $connection_upgrade {
default upgrade;
'' close;
}
# HTTP
server {
listen 80;
return 301 https://$host$request_uri;
}
server {
# listen 80 default_server;
# listen [::]:80 default_server ipv6only=on;
listen 443;
server_name _; # explorer.testnet.agoric.com;

ssl on;
ssl_certificate /etc/ssl/explorer.testnet.agoric.com.pem;
ssl_certificate_key /etc/ssl/explorer.testnet.agoric.com.key;
ssl_session_cache builtin:1000 shared:SSL:10m;
ssl_protocols TLSv1 TLSv1.1 TLSv1.2 TLSv1.3;
ssl_ciphers HIGH:!aNULL:!eNULL:!EXPORT:!CAMELLIA:!DES:!MD5:!PSK:!RC4;
ssl_prefer_server_ciphers on;


location = /favicon.ico {
root /home/bigdipper/portal/programs/web.browser/app;
access_log off;
}

location ~* "^/[a-z0-9]{40}\.(css|js)$" {
#gzip_static on;
root /home/bigdipper/portal/programs/web.browser;
access_log off;
}

location ~ "^/packages" {
root /home/bigdipper/portal/programs/web.browser;
access_log off;
}

# pass requests to Meteor
location / {
proxy_pass http://127.0.0.1:5000;
proxy_http_version 1.1;
proxy_ssl_server_name on;
proxy_set_header Upgrade $http_upgrade; #for websockets
proxy_set_header Connection $connection_upgrade;
proxy_set_header X-Forwarded-For $remote_addr;
proxy_set_header Host $host;
}
}
43 changes: 43 additions & 0 deletions packages/deployment/bigdipper/settings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
{
"public":{
"chainName": "Agoric Testnet",
"chainId": "@CHAIN_NAME@",
"gtm": "{Add your Google Tag Manager ID here}",
"slashingWindow": 10000,
"uptimeWindow": 250,
"initialPageSize": 30,
"bech32PrefixAccAddr": "cosmos",
"bech32PrefixAccPub": "cosmospub",
"bech32PrefixValAddr": "cosmosvaloper",
"bech32PrefixValPub": "cosmosvaloperpub",
"bech32PrefixConsAddr": "cosmosvalcons",
"bech32PrefixConsPub": "cosmosvalconspub",
"stakingDenom": "stake",
"stakingDenomPlural": "stakes",
"mintingDenom": null,
"stakingFraction": 1000000,
"powerReduction": 0,
"gasPrice": 0.00,
"coingeckoId": null
},
"genesisFile": "https://testnet.agoric.com/genesis.json",
"remote":{
"rpc":"http://@RPC@",
"lcd":"http://127.0.0.1:1317"
},
"debug": {
"startTimer": true,
"readGenesis": true
},
"params":{
"startHeight": 0,
"defaultBlockTime": 5000,
"blockInterval": 15000,
"consensusInterval": 1000,
"statusInterval":7500,
"signingInfoInterval": 1800000,
"proposalInterval": -1,
"missedBlocksInterval": 60000,
"delegationInterval": 900000
}
}

0 comments on commit f98ff43

Please sign in to comment.