Skip to content

Commit

Permalink
Merge branch 'dev' into staging
Browse files Browse the repository at this point in the history
  • Loading branch information
lucksus committed Aug 9, 2024
2 parents 16f18ce + e9c3595 commit d3a8a68
Show file tree
Hide file tree
Showing 109 changed files with 2,983 additions and 2,273 deletions.
6 changes: 6 additions & 0 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,9 @@ jobs:
keys:
- rust-cache-{{ checksum "Cargo.lock" }}-v2
- rust-cache-
- run:
name: cargo fmt --check
command: cargo fmt --check
- run:
name: Install dependencies
command: pnpm install --no-frozen-lockfile
Expand All @@ -73,6 +76,9 @@ jobs:
paths:
- ./target/release/ad4m
- ./target/release/ad4m-executor
- run:
name: cargo clippy
command: cargo clippy --all --exclude ad4m-launcher
- run:
name: Remove pnpm patches
command: node removePnpm.js
Expand Down
8 changes: 4 additions & 4 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

9 changes: 9 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -126,6 +126,15 @@ pnpm run package-ad4m

(Note that the last step of this might/will fail if you don't have the code signing keys. You can ignore that last error and find bundles in `target/release`.)

## Development
### Setup Git Hooks

After cloning the repository, run the following script to set up Git hooks:

```sh
./setup-hooks.sh
```

## Testing

Full test run of all packages:
Expand Down
2 changes: 1 addition & 1 deletion ad4m-hooks/helpers/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@coasys/hooks-helpers",
"version": "0.10.0-rc6",
"version": "0.10.0-rc7",
"description": "",
"main": "./src/index.ts",
"module": "./src/index.ts",
Expand Down
2 changes: 1 addition & 1 deletion ad4m-hooks/react/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@coasys/ad4m-react-hooks",
"version": "0.10.0-rc6",
"version": "0.10.0-rc7",
"description": "",
"main": "./src/index.ts",
"module": "./src/index.ts",
Expand Down
2 changes: 1 addition & 1 deletion ad4m-hooks/vue/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@coasys/ad4m-vue-hooks",
"version": "0.10.0-rc6",
"version": "0.10.0-rc7",
"description": "",
"main": "./src/index.ts",
"module": "./src/index.ts",
Expand Down
2 changes: 1 addition & 1 deletion bootstrap-languages/agent-language/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -44,5 +44,5 @@
"md5": "^2.3.0",
"postcss": "^8.2.1"
},
"version": "0.10.0-rc6"
"version": "0.10.0-rc7"
}
2 changes: 1 addition & 1 deletion bootstrap-languages/centralized-file-storage/adapter.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ class PutAdapter implements PublicSharing {
}

async createPublic(fileData: FileData): Promise<Address> {
console.log("createPublic fileData", fileData)
//console.log("createPublic fileData", fileData)
try {
// Just in case...
if(typeof fileData === "string"){
Expand Down
12 changes: 6 additions & 6 deletions bootstrap-languages/centralized-p-diff-sync/linksAdapter.ts
Original file line number Diff line number Diff line change
Expand Up @@ -141,13 +141,13 @@ export class LinkAdapter implements LinkSyncAdapter {
console.error("Got status", result.status);
result = null;
}
console.log("Current revision returned with result");
//console.log("Current revision returned with result");
} catch (e) {
console.log("Error in currentRevision call", e);
result = null;
}

console.log("Current revision got result", result);
//console.log("Current revision got result", result);

if (result) {
//@ts-ignore
Expand All @@ -171,8 +171,8 @@ export class LinkAdapter implements LinkSyncAdapter {
//const release = await this.generalMutex.acquire();
//console.log("PerspectiveDiffSync.sync(); Got lock");
try {
console.log("Sending the sync event to server");
console.log(this.me);
//console.log("Sending the sync event to server");
//console.log(this.me);
this.socketClient.emit("sync", {
linkLanguageUUID: this.languageUid,
did: this.me,
Expand Down Expand Up @@ -241,8 +241,8 @@ export class LinkAdapter implements LinkSyncAdapter {
const signal = await this.emitCommit(preppedDiff);

if (signal.status === "Ok") {
console.log("Got some result from commit");
console.dir(signal);
//console.log("Got some result from commit");
//console.dir(signal);
//Update our local timestamp to match the server
this.myCurrentTime = signal.serverRecordTimestamp;
this.updateServerSyncState();
Expand Down
24 changes: 12 additions & 12 deletions bootstrap-languages/centralized-p-diff-sync/telepresenceAdapter.ts
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,8 @@ export class TelepresenceAdapterImplementation implements TelepresenceAdapter {
console.log("setOnlineStatus: success");
console.log(res.data);
} else {
console.log("setOnlineStatus: failed");
console.log(res.data);
//console.log("setOnlineStatus: failed");
//console.log(res.data);
}
return null;
}
Expand All @@ -47,12 +47,12 @@ export class TelepresenceAdapterImplementation implements TelepresenceAdapter {
}
});
if (result.status === 200) {
console.log("getOnlineAgents: success");
console.dir(result.data);
//("getOnlineAgents: success");
//console.dir(result.data);
return result.data;
} else {
console.log("getOnlineAgents: failed");
console.dir(result.data);
//console.log("getOnlineAgents: failed");
//console.dir(result.data);
return [];
}
}
Expand All @@ -63,8 +63,8 @@ export class TelepresenceAdapterImplementation implements TelepresenceAdapter {
console.log("sendSignal: failed");
console.dir(err);
} else {
console.log("sendSignal: success");
console.dir(signal);
//console.log("sendSignal: success");
//console.dir(signal);
}
});
return {};
Expand All @@ -75,10 +75,10 @@ export class TelepresenceAdapterImplementation implements TelepresenceAdapter {
if (err) {
console.log("sendBroadcast: failed");
console.dir(err);
} else {
console.log("sendBroadcast: success");
console.dir(signal);
}
}// else {
// console.log("sendBroadcast: success");
// console.dir(signal);
//}
});

return {};
Expand Down
2 changes: 1 addition & 1 deletion bootstrap-languages/direct-message-language/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -35,5 +35,5 @@
"dependencies": {
"@types/node": "^18.0.0"
},
"version": "0.10.0-rc6"
"version": "0.10.0-rc7"
}
2 changes: 1 addition & 1 deletion bootstrap-languages/neighbourhood-language/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,5 +8,5 @@
},
"author": "joshuadparkin@gmail.com",
"license": "ISC",
"version": "0.10.0-rc6"
"version": "0.10.0-rc7"
}
2 changes: 1 addition & 1 deletion bootstrap-languages/p-diff-sync/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -38,5 +38,5 @@
"devDependencies": {
"run-script-os": "^1.1.6"
},
"version": "0.10.0-rc6"
"version": "0.10.0-rc7"
}
2 changes: 1 addition & 1 deletion bootstrap-languages/perspective-language/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -30,5 +30,5 @@
"typescript": "^4.5.5",
"uint8arrays": "^3.0.0"
},
"version": "0.10.0-rc6"
"version": "0.10.0-rc7"
}
6 changes: 3 additions & 3 deletions cli/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
[package]
name = "ad4m"

version = "0.10.0-rc6"
version = "0.10.0-rc7"

edition = "2021"
authors = ["Nicolas Luck <nicolas.luck@coasys.org>"]
Expand All @@ -24,8 +24,8 @@ path = "src/ad4m_executor.rs"
[dependencies]


ad4m-client = { path = "../rust-client", version="0.10.0-rc6"}
ad4m-executor = { path = "../rust-executor", version="0.10.0-rc6" }
ad4m-client = { path = "../rust-client", version="0.10.0-rc7"}
ad4m-executor = { path = "../rust-executor", version="0.10.0-rc7" }
anyhow = "1.0.65"
clap = { version = "4.0.8", features = ["derive"] }
futures = "0.3"
Expand Down
8 changes: 4 additions & 4 deletions cli/mainnet_seed.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,11 @@
"did:key:z6MkvPpWxwXAnLtMcoc9sX7GEoJ96oNnQ3VcQJRLspNJfpE7"
],
"knownLinkLanguages": [
"QmzSYwdmbV634WugVhR7C3KA54nTpESF4G2qAdTXrXdegH6swev",
"QmzSYwdj4dhQTunSupwq83huSW8f4NN4hNCC7cMVAsMH8ovp5gt",
"QmzSYwdnHrRH8MmuPWKKrDvFoVyW5CophNpT1ipQUCcenPVTQnd"
"QmzSYwdaffT3TFfFGcm434TNVRiUkvWGg6bPwD1nPyWauqQ38nS",
"QmzSYwdfXkWGxkc1WPDA7wQeBBhkhXMqPQPkQ4ghtxtUQrGfBJY",
"QmzSYwdk4k5u3ZBSd7EGFRydobVLAfzMbWBpUWdG8hRHcvbdKFN"
],
"directMessageLanguage": "QmzSYwdZGDDBu2ybmXPUX8Ws4YZecFCUSM7zhkxwbybZXppy6ii",
"directMessageLanguage": "QmzSYwdoNf6uDVbDJWVbaYyf8oyn9QkF5oWFGMidWpaKH2UwaUb",
"agentLanguage": "QmzSYwdYQdQSxpsTWVACmXvDwK7uRaaUAfr2JCH5tGydcwFprkA",
"perspectiveLanguage": "QmzSYwddxFCzVD63LgR8MTBaUEcwf9jhB3XjLbYBp2q8V1MqVtS",
"neighbourhoodLanguage": "QmzSYwdo2a6E4XghRHrN5eCReyYRDeRE8VnRbvqgoWZsr9B4pxV",
Expand Down
4 changes: 2 additions & 2 deletions cli/src/ad4m.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,11 @@ extern crate anyhow;
extern crate chrono;
extern crate clap;
extern crate dirs;
extern crate kitsune_p2p_types;
extern crate rand;
extern crate regex;
extern crate rustyline;
extern crate tokio;
extern crate kitsune_p2p_types;

mod formatting;
mod startup;
Expand Down Expand Up @@ -111,7 +111,7 @@ enum Domain {
command: ExpressionFunctions,
},
/// Print the executor log
Log
Log,
}

async fn get_ad4m_client(args: &ClapApp) -> Result<Ad4mClient> {
Expand Down
22 changes: 12 additions & 10 deletions cli/src/ad4m_executor.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,11 @@ extern crate anyhow;
extern crate chrono;
extern crate clap;
extern crate dirs;
extern crate kitsune_p2p_types;
extern crate rand;
extern crate regex;
extern crate rustyline;
extern crate tokio;
extern crate kitsune_p2p_types;

mod formatting;
mod startup;
Expand Down Expand Up @@ -128,7 +128,7 @@ enum Domain {
#[arg(short, long, action)]
log_holochain_metrics: Option<bool>,
},
RunLocalHcServices {}
RunLocalHcServices {},
}

#[tokio::main(flavor = "multi_thread")]
Expand Down Expand Up @@ -180,7 +180,7 @@ async fn main() -> Result<()> {
let tls = if tls_cert_file.is_some() && tls_cert_file.is_some() {
Some(TlsConfig {
cert_file_path: tls_cert_file.unwrap(),
key_file_path: tls_key_file.unwrap()
key_file_path: tls_key_file.unwrap(),
})
} else {
if tls_cert_file.is_some() || tls_key_file.is_some() {
Expand Down Expand Up @@ -208,19 +208,21 @@ async fn main() -> Result<()> {
localhost,
auto_permit_cap_requests: Some(true),
tls,
log_holochain_metrics
}).await;
}).await;

log_holochain_metrics,
})
.await;
})
.await;

let _ = ctrlc::set_handler(move || {
println!("Received CTRL-C! Exiting...");
exit(0);
});

use tokio::time::sleep;
use std::time::Duration;
use std::process::exit;
use ctrlc;
use std::process::exit;
use std::time::Duration;
use tokio::time::sleep;

loop {
sleep(Duration::from_secs(2)).await;
Expand Down
Loading

0 comments on commit d3a8a68

Please sign in to comment.