Just wanted to check if this issue is resolved? if not, please share the exact error message. You can try doing the telnet to these ports from the local.
Hi @jwiley : I have uploaded the logs on sharepoint and shared the link over email with you. You should have received email from sconnors
at deloitte
dot com
. Your email id jwiley
at hiro
dot so
has been provided access to access the link.
Please check and confirm once you get to see it.
@vishalgupta96 sorry for the delayed response, I was off the internet for the past week.
I do see the emails you mentioned, I’ll take a look in a bit (hopefully they still are working) and get back to you.
If the links are no longer valid, i’ll let you know and we can try again now that i’m available.
@vishalgupta96 can you share the configs you’re using that produced this logfile?
obviously remove any burnchain password if needed - you can send them to my email like you did with the logs. txt attachment is fine for these, they should be small.
I’d also like to see the .env
file, or env vars you’re using for the API.
hi @jwiley, i have sent you the config file. However i could not find .env file. We have used the environment variables, you mentioned in above command , copying below:
docker run -d --rm
–name stacks-blockchain
–net=stacks-blockchain
-e RUST_BACKTRACE=full
-e STACKS_LOG_DEBUG=1
-v $(pwd)/persistent-data/stacks-blockchain:/root/stacks-node/data
-v $(pwd)/config:/src/stacks-node
-p 20443:20443
-p 20444:20444
blockstack/stacks-blockchain
/bin/stacks-node start --config /src/stacks-node/Config.toml
@vishalgupta96
based on the logs and the envvars you shared over email - it looks like the API env vars are simply incorrect for this type of setup.
To use your previous docker command, you’d have to run the other containers on the same network stacks-blockchain
- for a total of 3 containers.
- stacks-blockchain
- stacks-blockchain-api
- postgres
I’d encourage you to use that .env
file in the doc, or at least adjust the env vars as follows:
NODE_ENV=production
GIT_TAG=master
PG_HOST=postgres
PG_PORT=5432
PG_USER=postgres
PG_PASSWORD=postgres
PG_DATABASE=postgres
STACKS_CHAIN_ID=0x00000001
V2_POX_MIN_AMOUNT_USTX=90000000260
STACKS_CORE_EVENT_PORT=3700
STACKS_CORE_EVENT_HOST=0.0.0.0
STACKS_BLOCKCHAIN_API_PORT=3999
STACKS_BLOCKCHAIN_API_HOST=0.0.0.0
STACKS_BLOCKCHAIN_API_DB=pg
STACKS_CORE_RPC_HOST=stacks-blockchain
STACKS_CORE_RPC_PORT=20443
BNS_IMPORT_DIR=/bns-data
important to note here the following env vars:
STACKS_CORE_RPC_HOST=stacks-blockchain
- this value has to match the name of the stacks-blockchain container
PG_HOST=postgres
- this value has to match the name of the postgres container
BNS_IMPORT_DIR=/bns-data
- this variable is entirely optional, if you enable it though the startup of the API will take quite a bit longer.
for the postgres user/pass - adjust as you need to, these are defaults for the postgres image mentioned in the doc above https://github.com/blockstack/stacks-blockchain-api/blob/master/running_an_api.md#postgres
docker run -d --rm \
--name stacks-blockchain-api \
--net=stacks-blockchain \
--env-file $(pwd)/.env \
-v $(pwd)/bns:/bns-data \
-p 3700:3700 \
-p 3999:3999 \
blockstack/stacks-blockchain-api
notice the env-file
option above - this is what you might be missing in your setup. 127.0.0.1
is the default.
One more thing to add - it’s better at this point to delete any data dirs you have in $(pwd)/persistent-data/stacks-blockchain
.
Hello jWiley, I’ve taken over from Vishal on this. And I’ve set up the 3 containers (postgres, stacks-blockchain-api, and stacks-blockchain).
This query runs fine curl -sL localhost:20443/v2/info
This one is still problematic curl -sL localhost:3999/v2/info
failing with same error: curl: (56) Recv failure: Connection reset by peer
I’ve confirmed that my env-file is consistent with your above suggestions and the instructions here.
Was there anything else in the logs that could be the issue? Thanks - also since this thread has been going on for about a year, not sure if it would be easier to hop on a call to discuss any other solutions.
I don’t doubt that your .env file is correct - but based on what was shared with me, the env vars are not being used by the API container - that’s the root of the problem here.
I’m open to call - send me a note to the email a few comments above and we can work out a time.