IPFS and Milkomeda API
In addition to the Cardano ecosystem, Blockfrost also offers entry points to other ecosystems:
Network | Endpoint |
---|---|
InterPlanetary File System (IPFS) | https://ipfs.blockfrost.io/api/v0/ |
Milkomeda mainnet | https://milkomeda-mainnet.blockfrost.io/api/v0/ |
Milkomeda testnet | https://milkomeda-testnet.blockfrost.io/api/v0/ |
IPFS
IPFS, or InterPlanetary File System, is a distributed, peer-to-peer protocol designed for efficient and secure sharing of files and data across a global network. Is it commonly utilized for storing digital content externally from the main chain.
- curl
- JavaScript
- Other languages
export BLOCKFROST_PROJECT_ID_IPFS=ipfs_YOUR_PROJECT_ID
curl "https://ipfs.blockfrost.io/api/v0/ipfs/add" \
-X POST \
-H "project_id: $BLOCKFROST_PROJECT_ID_IPFS" \
-F "file=@./static/img/logo.svg"
import { BlockFrostIPFS } from "@blockfrost/blockfrost-js";
const IPFS = new Blockfrost.BlockFrostIPFS({
projectId: "YOUR IPFS KEY HERE",
});
async function runExample() {
try {
const added = await IPFS.add(`${__dirname}/static/img/logo.svg`);
console.log("added", added);
const pinned = await IPFS.pin(added.ipfs_hash);
console.log("pinned", pinned);
} catch (err) {
console.log("error", err);
}
}
runExample();
There are over over 15 different SDKs available for a variety of programming languages.
When executed correctly, you will receive a response in JSON format, resembling the following:
{
"name": "logo.svg",
"ipfs_hash": "QmUCXMTcvuJpwHF3gABRr69ceQR2uEG2Fsik9CyWh8MUoQ",
"size": "5617"
}
To learn more how to use IPFS with Blockfrost, have a look at the official Blockfrost documentation
Milkomeda
Milkomeda is a protocol that brings EVM capabilities to non-EVM blockchains. As development progresses, Milkomeda will expand to offer L2 solutions (rollups) for several major blockchains including Cardano, Solana, and Algorand.
export BLOCKFROST_PROJECT_ID_MILKOMEDA_MAINNET=ipfs_YOUR_PROJECT_ID
curl "https://milkomeda-mainnet.blockfrost.io/api/v0/" \
-X POST \
-H "project_id: $BLOCKFROST_PROJECT_ID_MILKOMEDA_MAINNET" \
-d '{"jsonrpc": "2.0", "id": 1, "method": "eth_blockNumber", "params": []}'
When executed correctly, you will receive a response in JSON format, resembling the following:
{
"jsonrpc": "2.0",
"id": 1,
"result": "0xa06919"
}
To learn more about how to use different JSON-RPC API calls or to setup the Metamask wallet, have a look at the official Blockfrost documentation.