Skip to content

Commit

Permalink
fix test workflow command and make commands
Browse files Browse the repository at this point in the history
  • Loading branch information
erhant committed Oct 8, 2024
1 parent f4d2312 commit 2930830
Show file tree
Hide file tree
Showing 4 changed files with 36 additions and 9 deletions.
8 changes: 4 additions & 4 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
name: tests

on:
# push:
# branches:
# - master
push:
branches:
- master
workflow_dispatch:

jobs:
Expand All @@ -18,4 +18,4 @@ jobs:
uses: actions-rust-lang/setup-rust-toolchain@v1

- name: Run tests
run: cargo test
run: cargo test --workspace
5 changes: 2 additions & 3 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -36,13 +36,12 @@ profile-mem:
###############################################################################
.PHONY: test # | Run tests
test:
cargo test
cargo test --workspace

###############################################################################
.PHONY: lint # | Run linter (clippy)
lint:
cargo clippy
cargo clippy
cargo clippy --workspace

.PHONY: format # | Run formatter (cargo fmt)
format:
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ Compute nodes can technically do any arbitrary task, from computing the square r

- **Ping/Pong**: Dria Admin Node broadcasts **ping** messages at a set interval, it is a required duty of the compute node to respond with a **pong** to these so that they can be included in the list of available nodes for task assignment. These tasks will respect the type of model provided within the pong message, e.g. if a task requires `gpt-4o` and you are running `phi3`, you won't be selected for that task.

- **Workflows**: Each task is given in the form of a workflow, based on [Ollama Workflows](https://github.com/andthattoo/ollama-workflows) (see repository for more information). In simple terms, each workflow defines the agentic behavior of an LLM, all captured in a single JSON file, and can represent things ranging from simple LLM generations to iterative web searching.
- **Workflows**: Each task is given in the form of a workflow, based on [Ollama Workflows](https://github.com/andthattoo/ollama-workflows). In simple terms, each workflow defines the agentic behavior of an LLM, all captured in a single JSON file, and can represent things ranging from simple LLM generations to iterative web searching.

## Node Running

Expand Down
30 changes: 29 additions & 1 deletion p2p/README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
# DKN Peer-to-Peer Client

Dria Knowledge Network is a peer-to-peer network, built over libp2p. This crate is a wrapper client to easily interact with DKN.

## Installation

Add the package via `git` within your Cargo dependencies:
Expand All @@ -10,4 +12,30 @@ dkn-p2p = { git = "https://github.com/firstbatchxyz/dkn-compute-node" }

## Usage

TODO: !!!
You can create the client as follows:

```rs
use dkn_p2p::DriaP2PClient;

// your wallet, or something random maybe
let keypair = Keypair::generate_secp256k1();

// your listen address
let addr = Multiaddr::from_str("/ip4/0.0.0.0/tcp/4001")?;

// static bootstrap & relay addresses
let bootstraps = vec![Multiaddr::from_str(
"some-multiaddrs-here"
)?];
let relays = vec![Multiaddr::from_str(
"some-multiaddrs-here"
)?];

// protocol version number, usually derived as `{major}.{minor}`
let version = "0.2";

// create the client!
let mut client = DriaP2PClient::new(keypair, addr, &bootstraps, &relays, "0.2")?;
```

Then, you can use its underlying functions, such as `subscribe`, `process_events` and `unsubscribe`. In particular, `process_events` handles all p2p events and returns a GossipSub message when it is received.

0 comments on commit 2930830

Please sign in to comment.