swarm-cli
swarm-cli copied to clipboard
Feed upload fails if Debug API is not set
This causes a problem when trying to upload gateway nodes (e.g. nodes which does not expose their Debug API).
It seems that it queries the /health
and /stamp
endpoints at the beginning and to print the stamp status at the end which is not strictly necessary in the case of a gateway. It would be better to detect the availability of these endpoints but not fail if they are not available (effectively make them optional).
Relevant logs:
% swarm-cli feed upload . --bee-api-url http://localhost:1633 --bee-debug-api-url http://localhost:1635 --curl
curl "http://localhost:1635/health" -H "accept: application/json, text/plain, */*" -H "user-agent: bee-js/2.1.0"
curl "http://localhost:1635/stamps" -H "accept: application/json, text/plain, */*" -H "user-agent: bee-js/2.1.0"
curl "http://localhost:1635/health" -H "accept: application/json, text/plain, */*" -H "user-agent: bee-js/2.1.0"
Setting --index-document to index.html
curl -X POST "http://localhost:1633/bzz" -H "accept: application/json, text/plain, */*" -H "content-type: application/x-tar" -H "swarm-collection: true" -H "swarm-index-document: index.html" -H "swarm-postage-batch-id: 41443f8ddf60bf66f7ae2cbd432843413ef259d9d45aeb681b6567b8a1cbe2ac" -H "user-agent: bee-js/2.1.0" --data <buffer>
Swarm hash: bd45668f1c4f6d6d391f619797976596ec1c6f7548b14a5d4a1da05973966e60
URL: http://localhost:1633/bzz/bd45668f1c4f6d6d391f619797976596ec1c6f7548b14a5d4a1da05973966e60/
curl "http://localhost:1633/feeds/64a7fbb845fd71a4efa89217044856760035822f/0000000000000000000000000000000000000000000000000000000000000000?type=sequence" -H "accept: application/json, text/plain, */*" -H "user-agent: bee-js/2.1.0"
curl -X POST "http://localhost:1633/soc/64a7fbb845fd71a4efa89217044856760035822f/daa77426c30c02a43d9fba4e841a6556c524d47030762eb14dc4af897e605d9b?sig=803f53d877989ec40bc0269e131981369cb80499d7bc2a87321b68245cf5e8e3242c7d7b2abdc0e1b0d8c2cdfe4bea0e02482a35a5d625d59731e0f18c092f5c1b" -H "accept: application/json, text/plain, */*" -H "content-type: application/octet-stream" -H "swarm-postage-batch-id: 41443f8ddf60bf66f7ae2cbd432843413ef259d9d45aeb681b6567b8a1cbe2ac" -H "user-agent: bee-js/2.1.0"
curl -X POST "http://localhost:1633/feeds/64a7fbb845fd71a4efa89217044856760035822f/0000000000000000000000000000000000000000000000000000000000000000?type=sequence" -H "accept: application/json, text/plain, */*" -H "swarm-postage-batch-id: 41443f8ddf60bf66f7ae2cbd432843413ef259d9d45aeb681b6567b8a1cbe2ac" -H "user-agent: bee-js/2.1.0"
Feed Manifest URL: http://localhost:1633/bzz/f6787a764a8ce30397e76041c3c3908e76930a7a51a098d43ce7946795a04f6a/
curl "http://localhost:1635/stamps/41443f8ddf60bf66f7ae2cbd432843413ef259d9d45aeb681b6567b8a1cbe2ac" -H "accept: application/json, text/plain, */*" -H "user-agent: bee-js/2.1.0"
Stamp ID: 41443f8ddf60bf66f7ae2cbd432843413ef259d9d45aeb681b6567b8a1cbe2ac
Usage: 1%
TTL: unknown