Skip to content

Instantly share code, notes, and snippets.

@sullof
Last active January 10, 2019 20:14
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save sullof/31b9c238d42c8b032a9adc3059211a89 to your computer and use it in GitHub Desktop.
Save sullof/31b9c238d42c8b032a9adc3059211a89 to your computer and use it in GitHub Desktop.
A gist to run Eventron — an alternative to Tron Quickstart
version: '3'
services:
proxy:
image: trontools/tron-proxy
container_name: tron-proxy
ports:
- 9091:9091
networks:
tron:
aliases:
- proxy.tron
environment:
- showQueryString=true
- showBody=true
- formatJson=true
# - accounts=20
# - defaultBalance=100000
# - useDefaultPrivateKey=true
# - mnemonic="some mnemonic phrase"
# - seed=ushwe63hgeWUS
# - hdPath=m/44'/60'/0'/0
java.tron:
image: trontools/tron-private
container_name: tron-private
expose:
- 18190
- 18191
networks:
tron:
aliases:
- java.tron
# If you uncomment any of the following env variables,
# be sure that you remove the current tron-private container,
# before running again `docker-compose up`.
environment:
- allowTvmTransferTrc10=1
- allowSameTokenName=1
# - allowDelegateResource=1
events:
image: trontools/tron-events
container_name: tron-events
expose:
- 8060
ports:
- 8061:8060
networks:
tron:
aliases:
- events.tron
environment:
- PGPASSWORD=pgpass
- PGDATABASE=events
- PGUSER=postgres
redis:
image: redis
container_name: tron-redis
expose:
- 6379
ports:
- 6380:6379
networks:
tron:
aliases:
- redis.tron
postgres:
image: postgres
container_name: tron-postgres
expose:
- 5432
ports:
- 5433:5432
networks:
tron:
aliases:
- postgres.tron
environment:
- POSTGRES_PASSWORD=pgpass
- POSTGRES_USER=postgres
- POSTGRES_DB=events
networks:
tron:
### Usage
1. Create `docker-compose.yaml` and `up.sh` on your computer
2. Make `up.sh` executable (`chmod +x up.sh`)
3. Run `./up.sh`
You can force pre-approval of proposals commenting/uncommenting variables in the section
```
environment:
- allowTvmTransferTrc10=1
# - allowSameTokenName=1
# - allowDelegateResource=1
```
To restart Eventron, Ctrl-c the docker-compose process and run `up.sh` again.
Any feedback is very appreciated.
#!/usr/bin/env bash
function isUp {
PS=$(docker inspect --format="{{ .Name }}" $(docker ps -q --no-trunc) | sed "s,/,,g")
IS=not-running
for c in $PS
do
if [[ "$c" == "$1" ]]; then
IS=running
fi
done
if [[ $IS == "not-running" ]]; then
PSA=$(docker inspect --format="{{ .Name }}" $(docker ps -aq --no-trunc) | sed "s,/,,g")
for c in $PSA
do
if [[ "$c" == "$1" ]]; then
IS=stopped
fi
done
fi
echo $IS
}
images=(
"tron-private"
"tron-events"
"tron-proxy"
"tron-redis"
"tron-postgres"
)
for image in "${images[@]}"
do
echo $(isUp $image)
if [[ $(isUp $image) != "not-running" ]]; then
docker rm -f $image
fi
done
docker-compose up
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment