Skip to content

Commit 2930830

Browse files
committed
fix test workflow command and make commands
1 parent f4d2312 commit 2930830

File tree

4 files changed

+36
-9
lines changed

4 files changed

+36
-9
lines changed

.github/workflows/tests.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
name: tests
22

33
on:
4-
# push:
5-
# branches:
6-
# - master
4+
push:
5+
branches:
6+
- master
77
workflow_dispatch:
88

99
jobs:
@@ -18,4 +18,4 @@ jobs:
1818
uses: actions-rust-lang/setup-rust-toolchain@v1
1919

2020
- name: Run tests
21-
run: cargo test
21+
run: cargo test --workspace

Makefile

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -36,13 +36,12 @@ profile-mem:
3636
###############################################################################
3737
.PHONY: test # | Run tests
3838
test:
39-
cargo test
39+
cargo test --workspace
4040

4141
###############################################################################
4242
.PHONY: lint # | Run linter (clippy)
4343
lint:
44-
cargo clippy
45-
cargo clippy
44+
cargo clippy --workspace
4645

4746
.PHONY: format # | Run formatter (cargo fmt)
4847
format:

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ Compute nodes can technically do any arbitrary task, from computing the square r
3636

3737
- **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.
3838

39-
- **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.
39+
- **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.
4040

4141
## Node Running
4242

p2p/README.md

Lines changed: 29 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
# DKN Peer-to-Peer Client
22

3+
Dria Knowledge Network is a peer-to-peer network, built over libp2p. This crate is a wrapper client to easily interact with DKN.
4+
35
## Installation
46

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

1113
## Usage
1214

13-
TODO: !!!
15+
You can create the client as follows:
16+
17+
```rs
18+
use dkn_p2p::DriaP2PClient;
19+
20+
// your wallet, or something random maybe
21+
let keypair = Keypair::generate_secp256k1();
22+
23+
// your listen address
24+
let addr = Multiaddr::from_str("/ip4/0.0.0.0/tcp/4001")?;
25+
26+
// static bootstrap & relay addresses
27+
let bootstraps = vec![Multiaddr::from_str(
28+
"some-multiaddrs-here"
29+
)?];
30+
let relays = vec![Multiaddr::from_str(
31+
"some-multiaddrs-here"
32+
)?];
33+
34+
// protocol version number, usually derived as `{major}.{minor}`
35+
let version = "0.2";
36+
37+
// create the client!
38+
let mut client = DriaP2PClient::new(keypair, addr, &bootstraps, &relays, "0.2")?;
39+
```
40+
41+
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 commit comments

Comments
 (0)