2

What are the recommended steps that should be taken to get a stellar testnet node using the quickstart docker reset on the new testnet?

Currently it is still using the old network by the looks of it, and the only information I can find is related to packages (https://github.com/stellar/packages#testnet-reset) and the commands do not apply to those of us using the Docker container. A set of similar commands to use with the docker would be great.

How can I get my stellar-core, horizon and postgres database working now that the Testnet has been reset?

I am running the quickstart container with a volume mounted on an Amazon EC2 instance with Amazon Linux 2.

The network was reset yesterday and is scheduled to happen 4 times a year so information on how to deal with this inevitable situation is greatly appreciated.

1
  • 1
    Can you share more about the errors you're seeing?
    – Tom Q.
    Commented Apr 25, 2019 at 17:26

1 Answer 1

3

a) I guess the easiest way should be to run your testnet node in a non persistent ephemeral mode and simply restart the container.

b) You could as well open a shell into your container and manually recreate everything similar to the package way.

# open container shell
docker ps
docker exec -it [CONTAINER ID] /bin/bash

# stop core + horizon
supervisorctl stop stellar-core
supervisorctl stop horizon

# recreate databases
sudo -u postgres psql -c 'DROP DATABASE core' postgres
sudo -u postgres psql -c 'DROP DATABASE horizon' postgres
sudo -u postgres psql -c 'CREATE DATABASE core' postgres
sudo -u postgres psql -c 'CREATE DATABASE horizon' postgres

# remove buckets dir contents
rm -rf /opt/stellar/core/buckets/*

# init db schemes
/opt/stellar/horizon/bin/horizon db init
stellar-core --conf /opt/stellar/core/etc/stellar-core.cfg  new-db

# optional set "PREFERRED_PEERS_ONLY=true" to only connect to SDF nodes and thus mitigate stale SCP message issues
# vi /opt/stellar/core/etc/stellar-core.cfg

# start core + horizon
supervisorctl start stellar-core
supervisorctl start horizon

# check core status
curl localhost:11626/info
# check horizon status
curl localhost:8000

# optional unset "PREFERRED_PEERS_ONLY=true" once you are synced
# vi /opt/stellar/core/etc/stellar-core.cfg
# supervisorctl restart stellar-core
1
  • Hi sui, When I try to run the commands to drop the databases I get errors like ERROR: database "core" is being accessed by other users DETAIL: There is 1 other session using the database.. Any idea how to fix this? I'm not sure exactly how to check what other user is accessing the database and stopping them. Thanks for any help. Commented Jun 19, 2019 at 13:39

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.