@ipfs.get
Fetch content from IPFS and return it as text.
Returns: any
Syntax
Section titled “Syntax”@ipfs.get(cid)Arguments
Section titled “Arguments”| Name | Type | Description |
|---|---|---|
cid |
string |
Content identifier to fetch |
Content pinned with @ipfs is stored JSON-quoted; @ipfs.get unwraps it, so @ipfs.get(@ipfs("hello")) returns hello.
The terminal editor uses this helper automatically: pasting a hex string larger than 64 bytes pins it to IPFS and replaces it with an @ipfs.get call. Paste with Ctrl+Shift+V (Cmd+Shift+V on Mac) to keep the raw hex instead.
Examples
Section titled “Examples”# Deploy a contract whose creation bytecode is pinned on IPFSdeploy $token @ipfs.get("QmPK1s3pNYLi9ERiq3BDxKa4XosgWwFRQUydHUtz4YgpqB") --constructor constructor(string,string) --constructor-args ["My Token" "TKN"]# Round-trip text through IPFSset $cid @ipfs("hello world")set $content @ipfs.get($cid)See Also
Section titled “See Also”- @ipfs — upload content to IPFS and return the CID