Set the environment:
export SYNAPSE_PRIVATE_KEY=0x...
# Optional. Defaults to the public Calibration RPC endpoint.
export SYNAPSE_RPC_URL=https://api.calibration.node.glif.io/rpc/v1
# Optional. Use calibration or mainnet. Empty means auto-detect from RPC.
export SYNAPSE_CHAIN=calibrationExamples default to allowing private / local network downloads so local proxy environments can run retrieval flows. The SDK's normal client default still rejects private-network downloads unless callers explicitly opt in.
Upload, download, and verify a small test payload:
go run ./examples/quickstartUpload a file instead:
go run ./examples/quickstart --file ./payload.binUpload a file and print the IDs and retrieval URLs needed by later workflows:
go run ./examples/upload-file --file ./payload.bin --copies 2Download and validate a piece:
go run ./examples/download-piece --piece-cid <piece-cid> --url <retrieval-url> --out payload.binList datasets and the current storage account view:
go run ./examples/list-datasets --managedDiscover active PDP providers:
go run ./examples/list-providers --piece-size 1048576Inspect Filecoin piece commitment information without RPC or a private key:
go run ./examples/piece-info --file ./payload.binThis prints PieceCIDv1, PieceCIDv2 when the payload is large enough, raw size, padded size, and the commitment root.
Full API documentation: https://pkg.go.dev/github.com/strahe/synapse-go.