bitcoinjs / regtest-server

A regtest server for bitcoinjs-lib testing
BSD 3-Clause "New" or "Revised" License
26 stars 24 forks source link

Bad request #11

Closed Czino closed 1 year ago

Czino commented 3 years ago

I have come across this issue that many integration tests in the bitcoinjs-lib repo are failing.

Receiving Bad Request for many of them

I am running the docker instance as docker run -d -p 8080:8080 regtest-server

And then tested individual endpoints.

Endpoints under /1/b/ seem to be working

$ curl --location --request GET 'http://localhost:8080/1/b/best'
0f9188f13cb7b2c71f2a335e3a4fc328bf5beb436012afca590b1a11466e2206

but /1/r/generate and /1/r/faucet don't

curl -s -w '%{http_code}\n' --location --request POST 'http://localhost:8080/1/r/generate?count=1&key=satoshi'
401
curl -s -w '%{http_code}\n' --location --request POST 'http://localhost:8080/1/r/faucet?address=bcrt1qzg8ylgwet75ldf6crl3wyem32qstctml63chnd&key=satoshi&value=100000
400
gudnuf commented 1 year ago

I'm having the same issues. @Czino did you ever figure this one out?

Czino commented 1 year ago

Hey @daGoodenough, I wish I would have followed up on this with a clear answer immediately

I am running actually this comment now which seems to make it all work docker run -d -p 8080:8080 junderw/bitcoinjs-regtest-server

🎋  docker run -d -p 8080:8080 junderw/bitcoinjs-regtest-server
1900bbedfba37df389cb94495e7a16e63e8fbdf0095560a592b42925bfdf7aff
🎋  curl --location --request GET 'http://localhost:8080/1/b/best'
20f0beb5ecadc5841f62e5c7b35d009754b151f5f158241bf8f6cff9a449bca9peach-server
🎋  curl -s -w '%{http_code}\n' --location --request POST 'http://localhost:8080/1/r/generate?count=1&key=satoshi'
["47f587713a3eaf6d02bc719e3431f4202736f8bcf945faee8a8fd9ca2f2a1561"] 200
🎋  curl -s -w '%{http_code}\n' --location --request POST 'http://localhost:8080/1/r/faucet?address=bcrt1qzg8ylgwet75ldf6crl3wyem32qstctml63chnd&key=satoshi&value=100000