Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
27 changes: 27 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
# OpenComputeFramework

OpenComputeFramework is a distributed service registry and P2P network built with Go. It utilizes libp2p and IPFS technologies to provide a decentralized infrastructure for computing services.

## Features

- **P2P Networking**: Leverages libp2p for robust peer-to-peer communication.
- **Distributed Service Registry**: Allows nodes to register and discover services.
- **CRDT-based State Management**: Uses Conflict-free Replicated Data Types for eventual consistency.
- **Solana Integration**: Optional integration with Solana for token-gated access (verification).

## Documentation

Full documentation is available in the `docs/` directory. You can also view it by running the documentation server (if configured) or browsing the markdown files directly.

- [Installation](docs/docs/installation.md)
- [Configuration](docs/docs/configuration.md)
- [Usage](docs/docs/usage.md)
- [API Reference](docs/docs/api.md)

## quick start

```bash
cd src
make build
./build/ocfcore start
```
100 changes: 100 additions & 0 deletions docs/docs/api.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,100 @@
# API Reference

The OpenComputeFramework provides a RESTful API for interacting with the node. The API is available at `http://localhost:8092` by default.

## Health

### Check server health

`GET /v1/health`

Returns a simple health status check.

**Response:**

```json
{
"status": "ok"
}
```

## DNT (Distributed Node Table)

### Get node table

`GET /v1/dnt/table`

Retrieve the current distributed node table.

### List connected peers

`GET /v1/dnt/peers`

Get a list of all currently connected peers.

### List peers with status

`GET /v1/dnt/peers_status`

Get a list of all peers with their connection status.

### List bootstraps

`GET /v1/dnt/bootstraps`

Get a list of all connected bootstrap nodes.

### Get resource statistics

`GET /v1/dnt/stats`

Retrieve resource usage and connection statistics.

### Update local node

`POST /v1/dnt/_node`

Update the local node's information in the node table.

### Delete local node

`DELETE /v1/dnt/_node`

Remove the local node from the node table.

## P2P Proxy

### Forward request to peer

`METHOD /v1/p2p/{peerId}/{path}`

Forward an HTTP request to a specific peer in the P2P network.

* `peerId`: The ID of the target peer.
* `path`: The path to forward the request to.

Supported methods: `GET`, `POST`, `PATCH`.

## Service Proxy

### Forward request to global service

`METHOD /v1/service/{service}/{path}`

Forward an HTTP request to a globally registered service. The system will route the request to a node offering this service.

* `service`: The name of the service to forward to.
* `path`: The path to forward the request to.

Supported methods: `GET`, `POST`, `PATCH`.

### Forward request to service (Local/Direct)

`METHOD /v1/_service/{service}/{path}`

Forward an HTTP request to a registered service (potentially with different routing rules or intended for local consumption/debugging).

* `service`: The name of the service to forward to.
* `path`: The path to forward the request to.

Supported methods: `GET`, `POST`, `PATCH`.
55 changes: 0 additions & 55 deletions docs/docs/backend/api.md

This file was deleted.

37 changes: 0 additions & 37 deletions docs/docs/backend/architecture.md

This file was deleted.

37 changes: 0 additions & 37 deletions docs/docs/backend/configuration.md

This file was deleted.

32 changes: 0 additions & 32 deletions docs/docs/backend/index.md

This file was deleted.

27 changes: 0 additions & 27 deletions docs/docs/blockchain/contracts.md

This file was deleted.

26 changes: 0 additions & 26 deletions docs/docs/blockchain/index.md

This file was deleted.

25 changes: 0 additions & 25 deletions docs/docs/blockchain/tokenomics.md

This file was deleted.

Loading
Loading