Skip to content
@CogniAgentStorage

Cogni

Cogni is a decentralized platform for storing, sharing, and retrieving AI models, datasets, and files using IPFS (InterPlanetary File System).

Cogni is a decentralized platform for storing, sharing, and retrieving AI models, datasets, and files using IPFS (InterPlanetary File System). Built for scalability, immutability, and global collaboration, Cogni leverages the power of IPFS to ensure reliable, tamper-proof data storage.

This guide provides comprehensive instructions on how to set up Cogni’s IPFS node, configure it, and interact with it using the terminal.

Table of Contents

  1. About Cogni
  2. Installation Guide
  3. Basic IPFS Commands
  4. Advanced IPFS Commands
  5. Configuration Guide
  6. Setting Up a Custom Gateway
  7. Examples
  8. Useful Resources

About Cogni

Cogni is designed for AI developers, researchers, and innovators who need reliable, decentralized storage for their AI artifacts, including:

  • AI Models: Store and retrieve large pre-trained models for machine learning and AI applications.
  • Datasets: Host large datasets with content-based addressing for global accessibility.
  • Metadata: Ensure reproducibility by sharing experiment results, metadata, and model versions.

By leveraging IPFS, Cogni ensures:

  • Decentralization: No single point of failure.
  • Immutability: Files are identified by their content, ensuring they remain unchanged.
  • Global Collaboration: Anyone can retrieve and pin data using Cogni’s custom IPFS gateway.

Installation Guide

Windows Installation

  1. Download IPFS CLI:

    • Visit the Go-IPFS Releases page.
    • Download the latest version for Windows (go-ipfs_vX.XX.X_windows-amd64.zip).
    • Extract the ZIP file to a directory (e.g., C:\ipfs).
  2. Add IPFS to PATH:

    • Open Environment Variables and add the extracted IPFS folder (containing ipfs.exe) to the Path variable.
    • Open a new terminal and run:
      ipfs --version
      If it returns the version number, the installation was successful.
  3. Initialize IPFS:

    ipfs init
  4. Start the IPFS Daemon:

    ipfs daemon

Linux Installation

  1. Download the IPFS binary:

    wget https://dist.ipfs.io/go-ipfs/v0.40.0/go-ipfs_v0.40.0_linux-amd64.tar.gz
  2. Extract and install IPFS:

    tar -xvzf go-ipfs_v0.40.0_linux-amd64.tar.gz
    cd go-ipfs
    sudo bash install.sh
  3. Verify the installation:

    ipfs --version
  4. Initialize IPFS:

    ipfs init
  5. Start the IPFS daemon:

    ipfs daemon

macOS Installation

  1. Install IPFS using Homebrew:

    brew install ipfs
  2. Initialize IPFS:

    ipfs init
  3. Start the IPFS daemon:

    ipfs daemon

Basic IPFS Commands

Adding a File

ipfs add <file_name>

This will return a unique Content Identifier (CID) for the file. You can use this CID to retrieve the file later.

Retrieving a File

ipfs cat <CID>

This retrieves and displays the content of the file with the given CID.

Listing Files

ipfs ls <CID>

Lists the contents of a directory CID.


Advanced IPFS Commands

Pinning a File

Pinning ensures that a file remains available on your node and isn’t removed during garbage collection.

ipfs pin add <CID>

Unpinning a File

Unpinning a file allows it to be garbage collected.

ipfs pin rm <CID>

Checking Pinned Files

ipfs pin ls

Swarm Peers

View all connected peers in the IPFS network.

ipfs swarm peers

Swarm Addresses

Display your node’s network addresses.

ipfs id

Configuration Guide

Allow Remote API Access

By default, the IPFS API only listens on 127.0.0.1 (localhost). To allow remote access, modify the configuration file:

  1. Open the configuration file located at:

    ~/.ipfs/config
    
  2. Find the "API" section and update it:

    "API": "/ip4/0.0.0.0/tcp/5001"
  3. Restart the IPFS daemon:

    ipfs daemon

Setting Up a Custom Gateway

To set up a custom gateway for Cogni using your domain (e.g., ipfs.cogni.host), follow these steps:

  1. Set up Nginx as a reverse proxy:

    server {
        listen 80;
        server_name ipfs.cogni.host;
    
        location / {
            proxy_pass http://127.0.0.1:8080;
            proxy_set_header Host $host;
            proxy_set_header X-Real-IP $remote_addr;
        }
    }
  2. Enable HTTPS with Let’s Encrypt:

    sudo certbot --nginx -d ipfs.cogni.host

Examples

Uploading an AI Model

ipfs add ai_model.h5

This will return a CID, which can be shared globally for retrieving the model.

Retrieving the AI Model

ipfs cat <CID> > ai_model.h5

Pinning a Dataset

ipfs pin add <dataset_CID>

Useful Resources


Feel free to contribute by submitting issues or pull requests to improve this guide!


Popular repositories Loading

  1. .github .github Public

    1

  2. ipfs-docs ipfs-docs Public

    Forked from CogniLLM/ipfs-docs

    📚IPFS documentation platform

    Go

  3. nerdctl nerdctl Public

    Forked from CogniLLM/nerdctl

    contaiNERD CTL - Docker-compatible CLI for containerd, with support for Compose, Rootless, eStargz, OCIcrypt, IPFS, ...

    Go

  4. kubo kubo Public

    Forked from CogniLLM/kubo

    An IPFS implementation in Go

    Go

  5. ipfs-webui ipfs-webui Public

    Forked from CogniLLM/ipfs-webui

    A frontend for an IPFS Kubo and IPFS Desktop

    JavaScript

  6. WASM-IPFS-SentientNet WASM-IPFS-SentientNet Public

    Forked from CogniLLM/WASM-IPFS-SentientNet

    WASM-IPFS-SentientNet integrates WebAssembly computing, IPFS storage, and AI Agents into a serverless framework for decentralized applications.

    Go

Repositories

Showing 10 of 12 repositories

People

This organization has no public members. You must be a member to see who’s a part of this organization.

Top languages

Loading…

Most used topics

Loading…