Skip to content

Latest commit

 

History

History
44 lines (33 loc) · 895 Bytes

README.md

File metadata and controls

44 lines (33 loc) · 895 Bytes

cached-proxy

Endpoints

/ipfs/:hash

Returns a IPFS file and caches it for a month in a memory storage.

/:blockchain

MAkes a blockchain call through an internal list of nodes.

Examples

Fetch latest block from BSC chain.

curl -X POST 'http://localhost:8080/binance' \
    -H "Content-Type: application/json" \
    --data '{
    "jsonrpc": "2.0",
    "method": "eth_getBlockByNumber",
    "params": ["latest", true],
    "id": 1
}'
curl -X POST 'https://proxy.unifiprotocol.com/ontology?net=testnet' \
    -H "Content-Type: application/json" \
    --data '{
    "jsonrpc": "2.0",
    "method": "eth_getBlockByNumber",
    "params": ["latest", true],
    "id": 1
}'

Fetch a JSON from IPFS

curl -X POST 'http://localhost:8080/ipfs/QmNrMRrLrjijX7agXL5xAokMLATSLTELnSYSERL9MczXxa' \
    -H "Content-Type: application/json"