Skip to content

Commit

Permalink
added a trace streamer for fun. Should probably remove
Browse files Browse the repository at this point in the history
  • Loading branch information
Michael Sofaer authored and Michael Sofaer committed Aug 11, 2022
2 parents c8af237 + 5949994 commit a687e4e
Show file tree
Hide file tree
Showing 5 changed files with 15 additions and 5 deletions.
1 change: 1 addition & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -39,3 +39,4 @@ EXPOSE 9090
RUN mkdir -p /tmp/trace
RUN mkfifo /tmp/trace/trace.fifo
CMD ["/start.sh"]

4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,9 @@ This repository contains:
### Docker build
Add your favorite peers to scripts/peers.sh and then you can run
```
docker build .
docker run <hash>
docker-compose up -- build
```
You can use -d if you want it in the background
Should be fun!

### Outdated stuff
Expand Down
2 changes: 2 additions & 0 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@ services:
container_name: pylonsnode
build:
context: .
args:
- BINARY_VERSION=v1.0.0-rc2
ports:
- "26657:26657"
- "1317:1317"
Expand Down
11 changes: 9 additions & 2 deletions scripts/start.sh
Original file line number Diff line number Diff line change
@@ -1,8 +1,15 @@
#! /bin/bash
echo "HELLO"
source ./state_sync_vars.sh
source ./peers.sh
echo "trust_height: $BLOCK_HEIGHT"
echo "trust_hash: $TRUST_HASH"
echo "rpc servers: $PYLONSD_STATESYNC_RPC_SERVERS"
echo "peers: $PYLONSD_P2P_PEERS"
exec pylonsd start --trace-store /tmp/trace/trace.fifo
echo "peers: $PYLONSD_P2P_PERSISTENT_PEERS"

# enable rest server and swagger
toml set --toml-path $HOME/.pylons/config/app.toml api.swagger true
toml set --toml-path $HOME/.pylons/config/app.toml api.enable true

# explicitly set rpc to 0.0.0.0 so that docker expose port would work
exec pylonsd start --rpc.laddr tcp://0.0.0.0:26657 --trace-store /tmp/trace/trace.fifo
2 changes: 1 addition & 1 deletion scripts/state_sync_vars.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ set -e
# Get "trust_hash" and "trust_height".
INTERVAL=1000
LATEST_HEIGHT=$(curl -s https://rpc-pylons-ia.notional.ventures/status | jq -r .result.sync_info.latest_block_height)
BLOCK_HEIGHT=$(($LATEST_HEIGHT-$INTERVAL))
BLOCK_HEIGHT=$(($LATEST_HEIGHT-$INTERVAL))
TRUST_HASH=$(curl -s "https://rpc-pylons-ia.notional.ventures/block?height=$BLOCK_HEIGHT" | jq -r .result.block_id.hash)

# Print out block and transaction hash from which to sync state.
Expand Down

0 comments on commit a687e4e

Please sign in to comment.