Open neginkheirmand opened 2 years ago
Can confirm this is a problem. We really want to use this for an important research project but we cannot seem to get the docker-compose project to function properly and are having exact same issues described by @neginkheirmand
Can the developers here give us some indication of what we are doing wrong or perhaps some direction to move forward with?
Thanks!
@neginkheirmand Would you be able to show me exactly how you changed from nightly to latest ( I assumed from yaml) so as to be able to check that peer nodes work (Quote from you: After this change the "sawtooth peer list" and the "curl http://sawtooth-rest-api-default-0:8008/peers" commands work properly.)
I haven't been able to get this to work even when changing all from nightly to latest. The error that I keep getting is:
curl: (7) Failed to connect to sawtooth-rest-api-default-0 port 8008: Connection refused
It is my first time venturing into blockchain/sawtooth and docker and I must say that it's very daunting. By the way, how did you know that it's docker-compose that's the problem and not sawtooth development itself? (must be dummy question and shows how ignorant I am) thanks
@jallphin you can re-produce the error after successfully starting following docker file.
version: "3.6"
volumes: contracts-shared: grid-shared: pbft-shared: gridd-alpha: templates-shared: cache-shared:
services:
sabre-cli: image: hyperledger/sawtooth-sabre-cli:latest volumes:
pbft-shared:/pbft-shared container_name: sabre-cli stop_signal: SIGKILL
tnt-contract-builder: image: piashtanjin/tnt-contract-builder:latest container_name: tnt-contract-builder volumes:
pbft-shared:/pbft-shared entrypoint: | bash -c " while true; do curl -s http://sawtooth-rest-api-default-0:8008/state | grep -q head; if [ $$? -eq 0 ]; then break; fi; sleep 0.5; done; sabre cr --create grid_track_and_trace --key /pbft-shared/validators/validator-0 --owner $$(cat /pbft-shared/validators/validator-0.pub) --url http://sawtooth-rest-api-default-0:8008 --wait 30 sabre upload --filename /tmp/track_and_trace.yaml --key /pbft-shared/validators/validator-0 --url http://sawtooth-rest-api-default-0:8008 --wait 30 sabre ns --create a43b46 --key /pbft-shared/validators/validator-0 --owner $$(cat /pbft-shared/validators/validator-0.pub) --url http://sawtooth-rest-api-default-0:8008 --wait 30 sabre perm a43b46 grid_track_and_trace --key /pbft-shared/validators/validator-0 --read --write --url http://sawtooth-rest-api-default-0:8008 --wait 30 sabre perm 621dee01 grid_track_and_trace --key /pbft-shared/validators/validator-0 --read --write --url http://sawtooth-rest-api-default-0:8008 --wait 30 sabre perm 621dee05 grid_track_and_trace --key /pbft-shared/validators/validator-0 --read --url http://sawtooth-rest-api-default-0:8008 --wait 30 echo '---------========= track and trace contract is loaded =========---------' "
schema-contract-builder: image: piashtanjin/schema-contract-builder:latest container_name: schema-contract-builder volumes:
pbft-shared:/pbft-shared entrypoint: | bash -c " while true; do curl -s http://sawtooth-rest-api-default-0:8008/state | grep -q head; if [ $$? -eq 0 ]; then break; fi; sleep 0.5; done; sabre cr --create grid_schema --key /pbft-shared/validators/validator-0 --owner $$(cat /pbft-shared/validators/validator-0.pub) --url http://sawtooth-rest-api-default-0:8008 --wait 30 sabre upload --filename /tmp/schema.yaml --key /pbft-shared/validators/validator-0 --url http://sawtooth-rest-api-default-0:8008 --wait 30 sabre ns --create 621dee01 --key /pbft-shared/validators/validator-0 --owner $$(cat /pbft-shared/validators/validator-0.pub) --url http://sawtooth-rest-api-default-0:8008 --wait 30 sabre perm 621dee01 grid_schema --key /pbft-shared/validators/validator-0 --read --write --url http://sawtooth-rest-api-default-0:8008 --wait 30 sabre perm 621dee05 grid_schema --key /pbft-shared/validators/validator-0 --read --url http://sawtooth-rest-api-default-0:8008 --wait 30 echo '---------========= grid schema contract is loaded =========---------' "
pike-contract-builder: image: piashtanjin/pike-contract-builder:latest container_name: pike-contract-builder volumes:
pbft-shared:/pbft-shared entrypoint: | bash -c " while true; do curl -s http://sawtooth-rest-api-default-0:8008/state | grep -q head; if [ $$? -eq 0 ]; then break; fi; sleep 0.5; done; sabre cr --create grid_pike --key /pbft-shared/validators/validator-0 --owner $$(cat /pbft-shared/validators/validator-0.pub) --url http://sawtooth-rest-api-default-0:8008 --wait 30 sabre upload --filename /tmp/pike.yaml --key /pbft-shared/validators/validator-0 --url http://sawtooth-rest-api-default-0:8008 --wait 30 sabre ns --create 621dee05 --key /pbft-shared/validators/validator-0 --owner $$(cat /pbft-shared/validators/validator-0.pub) --url http://sawtooth-rest-api-default-0:8008 --wait 30 sabre perm 621dee05 grid_pike --key /pbft-shared/validators/validator-0 --read --write --url http://sawtooth-rest-api-default-0:8008 --wait 30 echo '---------========= pike contract is loaded =========---------' "
product-contract-builder: image: piashtanjin/product-contract-builder:latest container_name: product-contract-builder volumes:
pbft-shared:/pbft-shared entrypoint: | bash -c " while true; do curl -s http://sawtooth-rest-api-default-0:8008/state | grep -q head; if [ $$? -eq 0 ]; then break; fi; sleep 0.5; done; sabre cr --create grid_product --key /pbft-shared/validators/validator-0 --owner $$(cat /pbft-shared/validators/validator-0.pub) --url http://sawtooth-rest-api-default-0:8008 --wait 30 sabre upload --filename /tmp/product.yaml --key /pbft-shared/validators/-0 --url http://sawtooth-rest-api-default-0:8008 --wait 30 sabre ns --create 621dee05 --key /pbft-shared/validators/validator-0 --owner $$(cat /pbft-shared/validators/validator-0.pub) --url http://sawtooth-rest-api-default-0:8008 --wait 30 sabre ns --create 621dee01 --key /pbft-shared/validators/validator-0 --owner $$(cat /pbft-shared/validators/validator-0.pub) --url http://sawtooth-rest-api-default-0:8008 --wait 30 sabre ns --create 621dee02 --key /pbft-shared/validators/validator-0 --owner $$(cat /pbft-shared/validators/validator-0.pub) --url http://sawtooth-rest-api-default-0:8008 --wait 30 sabre perm 621dee05 grid_product --key /pbft-shared/validators/validator-0 --read --write --url http://sawtooth-rest-api-default-0:8008 --wait 30 sabre perm 621dee01 grid_product --key /pbft-shared/validators/validator-0 --read --url http://sawtooth-rest-api-default-0:8008 --wait 30 sabre perm 621dee02 grid_product --key /pbft-shared/validators/validator-0 --read --write --url http://sawtooth-rest-api-default-0:8008 --wait 30 echo '---------========= grid_product contract is loaded =========---------' "
location-contract-builder: image: piashtanjin/location-contract-builder:latest container_name: location-contract-builder volumes:
pbft-shared:/pbft-shared entrypoint: | bash -c " while true; do curl -s http://sawtooth-rest-api-default-0:8008/state | grep -q head; if [ $$? -eq 0 ]; then break; fi; sleep 0.5; done; sabre cr --create grid_purchase_order --key /pbft-shared/validators/validator-0 --owner $$(cat /pbft-shared/validators/validator-0.pub) --url http://sawtooth-rest-api-default-0:8008 --wait 30 sabre upload --filename /tmp/purchase_order.yaml --key /pbft-shared/validators/validator-0 --url http://sawtooth-rest-api-default-0:8008 --wait 30 sabre ns --create 621dee06 --key /pbft-shared/validators/validator --owner $$(cat /pbft-shared/validators/validator-0.pub) --url http://sawtooth-rest-api-default-0:8008 --wait 30 sabre perm 621dee05 grid_purchase_order --key /pbft-shared/validators/validator-0 --read --url http://sawtooth-rest-api-default-0:8008 --wait 30 sabre perm 621dee06 grid_purchase_order --key /pbft-shared/validators/validator-0 --read --write --url http://sawtooth-rest-api-default-0:8008 --wait 30 echo '---------========= grid_purchase_order contract is loaded =========---------' "
validator-0: image: hyperledger/sawtooth-validator:nightly container_name: sawtooth-validator-default-0 expose:
validator-0 command: | bash -c " sawtooth-rest-api \ --connect tcp://validator-0:4004 \ --bind sawtooth-rest-api:8008 " stop_signal: SIGKILL
sawtooth-rest-api1: image: hyperledger/sawtooth-rest-api:nightly container_name: sawtooth-rest-api-1 expose:
validator-0 command: | bash -c " sawtooth-rest-api -v --connect tcp://validator-1:4004 --bind sawtooth-rest-api1:8008 " stop_signal: SIGKILL
sawtooth-rest-api2: image: hyperledger/sawtooth-rest-api:nightly container_name: sawtooth-rest-api-2 expose:
validator-0 command: | bash -c " sawtooth-rest-api -v --connect tcp://validator-3:4004 --bind sawtooth-rest-api3:8008 " stop_signal: SIGKILL
sawtooth-rest-api4: image: hyperledger/sawtooth-rest-api:nightly container_name: sawtooth-rest-api-4 expose:
validator-0 command: | bash -c " sawtooth-rest-api -v --connect tcp://validator-4:4004 --bind sawtooth-rest-api4:8008 " stop_signal: SIGKILL
sawtooth-settings-tp: image: hyperledger/sawtooth-settings-tp:latest container_name: sawtooth-settings-tp expose:
4004 command: settings-tp -v -C tcp://validator-0:4004 stop_signal: SIGKILL
sabre-tp: image: hyperledger/sawtooth-sabre-tp:0.8 container_name: sawtooth-sabre-tp depends_on:
validator-0 entrypoint: sawtooth-sabre -vv --connect tcp://validator-0:4004
sawtooth-client: image: hyperledger/sawtooth-shell:nightly container_name: sawtooth-shell volumes:
validator-0 command: | bash -c " sawtooth keygen && tail -f /dev/null " stop_signal: SIGKILL pbft-0: image: hyperledger/sawtooth-pbft-engine:nightly container_name: sawtooth-pbft-engine-default-0 command: pbft-engine -vv --connect tcp://validator-0:5050 stop_signal: SIGKILL
pbft-1: image: hyperledger/sawtooth-pbft-engine:nightly container_name: sawtooth-pbft-engine-default-1 command: pbft-engine -vv --connect tcp://validator-1:5050 stop_signal: SIGKILL
pbft-2: image: hyperledger/sawtooth-pbft-engine:nightly container_name: sawtooth-pbft-engine-default-2 command: pbft-engine -vv --connect tcp://validator-2:5050 stop_signal: SIGKILL
pbft-3: image: hyperledger/sawtooth-pbft-engine:nightly container_name: sawtooth-pbft-engine-default-3 command: pbft-engine -vv --connect tcp://validator-3:5050 stop_signal: SIGKILL
pbft-4: image: hyperledger/sawtooth-pbft-engine:nightly container_name: sawtooth-pbft-engine-default-4 command: pbft-engine -vv --connect tcp://validator-4:5050 stop_signal: SIGKILL `
I am getting the same error of peot and pbft engine and then connection refused when I used curl command.
I usually see exactly the same problem, with the exception that, just sometimes, I get COMMITTED from the link then the get
test passes. Perhaps there's a timing issue?
I have been following the documentation to deploy a sawtooth test network (using docker) but failed with both poet and pbft versions.
The nightly tag of docker is outdated and does not work with the docker-compose anymore, however I have been able to deploy the poet version by just changing the tag part of the images in docker-compose from nightly to latest. After this change the "sawtooth peer list" and the "curl http://sawtooth-rest-api-default-0:8008/peers" commands work properly. Yet when trying to set a key named MyKey to the value 999 according to this command, I run into other problems:
intkey set --url http://sawtooth-rest-api-default-0:8008 MyKey 999
I get the response: { "link": "http://sawtooth-rest-api-default-0:8008/batch_statuses?id=8a9cde13ada7bc4f06e6736acf54689515946d8865538544b6e71744a50f861d6621a9e5e94d073b495858116c7c7d5685c6341e65389af30d12bdea78d6b90c" }which may seem rational according to the documentation but when I try to run this command:
intkey show --url http://sawtooth-rest-api-default-1:8008 MyKey
I get the following response: Error: No such key: MyKeynow if I curl the specified link from the response of the intkey set command I get that the status is pending
curl "http://sawtooth-rest-api-default-0:8008/batch_statuses?id=8a9cde13ada7bc4f06e6736acf54689515946d8865538544b6e71744a50f861d6621a9e5e94d073b495858116c7c7d5685c6341e65389af30d12bdea78d6b90c"
the response: { "data": [ { "id": "8a9cde13ada7bc4f06e6736acf54689515946d8865538544b6e71744a50f861d6621a9e5e94d073b495858116c7c7d5685c6341e65389af30d12bdea78d6b90c", "invalid_transactions": [], "status": "PENDING" } ], "link": "http://sawtooth-rest-api-default-0:8008/batch_statuses?id=8a9cde13ada7bc4f06e6736acf54689515946d8865538544b6e71744a50f861d6621a9e5e94d073b495858116c7c7d5685c6341e65389af30d12bdea78d6b90c" }