stacks-network / stacks-blockchain-docker

Stacks-blockchain with API using docker compose
GNU General Public License v3.0
27 stars 37 forks source link

Error requesting tokens from faucet for private-testnet #71

Closed wileyj closed 2 years ago

wileyj commented 2 years ago

Not sure if keeping this network option around is still useful, but there is a problem requesting tokens from the API faucet currently. Seems to be a configuration issue, but i'm not sure where to look @kantai . any help to unblock this, or if you think this network should be removed from the repo, just as well.

For what it's worth, I also reproduced this error using the branch where this network was first introduced.

$ stx make_keychain -t | jq . > cli_keychain.json

$ cat ./cli_keychain.json | jq -r .keyInfo.address
STJ4FGSFP22JVDBYX9V3TGMJ5EDHVMVT2G0BMDJH

$ curl -sL "localhost:3999/v2/accounts/$(cat ./cli_keychain.json | jq -r .keyInfo.address)?proof=0" | jq -r .balance
0x00000000000000000000000000000000

$ curl -sL -X POST "localhost:3999/extended/v1/faucets/stx?address=$(cat ./cli_keychain.json | jq -r .keyInfo.address)" | jq .
{
"error": "Error: Response 400: Bad Request fetching http://stacks-blockchain:20443/v2/transactions - {\"error\":\"transaction rejected\",\"reason\":\"NotEnoughFunds\",\"reason_data\":{\"actual\":\"0x00000000000000000000000000000000\",\"expected\":\"0x0000000000000000000000001dcd65b4\"},\"txid\":\"cc042f4c36430bdda4d766efddda0338b5ead4627a92bc9d063be9657aa5eb8c\"}",
"stack": "Error: Response 400: Bad Request fetching http://stacks-blockchain:20443/v2/transactions - {\"error\":\"transaction rejected\",\"reason\":\"NotEnoughFunds\",\"reason_data\":{\"actual\":\"0x00000000000000000000000000000000\",\"expected\":\"0x0000000000000000000000001dcd65b4\"},\"txid\":\"cc042f4c36430bdda4d766efddda0338b5ead4627a92bc9d063be9657aa5eb8c\"}\n at StacksCoreRpcClient.fetchText (/app/src/core-rpc/client.ts:133:13)\n at runMicrotasks (<anonymous>)\n at processTicksAndRejections (node:internal/process/task_queues:96:5)\n at StacksCoreRpcClient.fetchJson (/app/src/core-rpc/client.ts:112:26)\n at StacksCoreRpcClient.sendTransaction (/app/src/core-rpc/client.ts:201:20)\n at /app/src/api/routes/faucets.ts:231:27\n at run (/app/node_modules/p-queue/dist/index.js:163:29)",
"errorTag": "394ee7b2-cd0f-408d-89f2-f8b15a907662"
}

$ curl -sL -X POST "https://stacks-node-api.testnet.stacks.co/extended/v1/faucets/stx?address=$(cat ./cli_keychain.json | jq -r .keyInfo.address)" | jq .
{
"success": true,
"txId": "0xec4592fb7a036be7550f5dbf92da041cf6c1750ddbafc489ec6084bed3c3be54",
"txRaw": "80800000000400af3f91f38aa21ade7e9f95efdbc4201eeb4cf0f800000000000039e300000000000000b400013ede9389ee1fa55b609dd29de48488b11bd484820308f2d92de45a322f1414eb1bb07f30ac5b376dc6e6a6995c6b3458f582843a85b77d40e8dd4645279aa53f03020000000000051a2447c32fb0852db57eea763d42922b9b1dd37a14000000001dcd650046617563657400000000000000000000000000000000000000000000000000000000"
}

https://explorer.stacks.co/txid/0xec4592fb7a036be7550f5dbf92da041cf6c1750ddbafc489ec6084bed3c3be54?chain=testnet

$ curl -sL "https://stacks-node-api.testnet.stacks.co/v2/accounts/$(cat ./cli_keychain.json | jq -r .keyInfo.address)?proof=0" | jq -r .balance
0x00000000000000000000000000000000
kantai commented 2 years ago

I suspect it's not worth keeping around-- I think in many cases, developers can using something like Clarinet devnet instead of these private-testnet scripts.

wileyj commented 2 years ago

good enough for me, thanks!