Skip to content

Commit

Permalink
Merge branch 'development' into dev_add_discount_contracts
Browse files Browse the repository at this point in the history
  • Loading branch information
amiraabouhadid committed Sep 21, 2024
2 parents 618ace6 + cc0b65f commit 8da4c15
Show file tree
Hide file tree
Showing 38 changed files with 176 additions and 59 deletions.
2 changes: 1 addition & 1 deletion CODEOWNERS
Validating CODEOWNERS rules …
Original file line number Diff line number Diff line change
@@ -1 +1 @@
* @AhmedHanafy725 @zaelgohary @maayarosama @MohamedElmdary @Mahmoud-Emad @amiraabouhadid @AlaaElattar @0oM4R @mohamedamer453 @samaradel
* @AhmedHanafy725 @zaelgohary @maayarosama @MohamedElmdary @Mahmoud-Emad @amiraabouhadid @AlaaElattar @0oM4R @samaradel
2 changes: 1 addition & 1 deletion packages/grid_client/docs/network/wireguard_network.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ The target is to make a private Mesh connection between the nodes so they can re

## Configuration

This configuration is set on each node using [network workload](../src/zos/znet.ts)
This configuration is set on each node using [network workload](../../src/zos/znet.ts)

- `ip_range`: an ip range to be used for this network, it needs to be private ip range, normally a /16 subnet is used (e.g. `10.20.0.0/16`)
- `subnet`: a subnet to be used for this network, it should be a subnet of the entire network ip range, normally a /24 subnet is used for the node (e.g. `10.20.1.0/24`)
Expand Down
2 changes: 1 addition & 1 deletion packages/grid_client/scripts/add_node_to_network.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ async function main() {
name: "wedtest",
ipRange: "10.249.0.0/16",
nodeId: 14,
mycelium: false,
mycelium: true,
};
// if the network is not created, it will create one and add this node to it.
await addNode(grid3, node);
Expand Down
2 changes: 1 addition & 1 deletion packages/grid_client/scripts/applications/algorand.ts
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ async function main() {
planetary: true,
public_ip: false,
public_ip6: false,
mycelium: false,
mycelium: true,
cpu: instanceCapacity.cru,
memory: 1024 * instanceCapacity.mru,
rootfs_size: 0,
Expand Down
2 changes: 1 addition & 1 deletion packages/grid_client/scripts/applications/casperlabs.ts
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ async function main() {
planetary: true,
public_ip: false,
public_ip6: false,
mycelium: false,
mycelium: true,
cpu: instanceCapacity.cru,
memory: 1024 * instanceCapacity.mru,
rootfs_size: 0,
Expand Down
2 changes: 1 addition & 1 deletion packages/grid_client/scripts/applications/discourse.ts
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ async function main() {
planetary: true,
public_ip: false,
public_ip6: false,
mycelium: false,
mycelium: true,
cpu: instanceCapacity.cru,
memory: 1024 * instanceCapacity.mru,
rootfs_size: 0,
Expand Down
2 changes: 1 addition & 1 deletion packages/grid_client/scripts/applications/funkwhale.ts
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ async function main() {
planetary: true,
public_ip: false,
public_ip6: false,
mycelium: false,
mycelium: true,
cpu: instanceCapacity.cru,
memory: 1024 * instanceCapacity.mru,
rootfs_size: 0,
Expand Down
2 changes: 1 addition & 1 deletion packages/grid_client/scripts/applications/mattermost.ts
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ async function main() {
planetary: true,
public_ip: false,
public_ip6: false,
mycelium: false,
mycelium: true,
cpu: instanceCapacity.cru,
memory: 1024 * instanceCapacity.mru,
rootfs_size: 0,
Expand Down
2 changes: 1 addition & 1 deletion packages/grid_client/scripts/applications/nextcloud.ts
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ async function main() {
planetary: true,
public_ip: false,
public_ip6: false,
mycelium: false,
mycelium: true,
cpu: instanceCapacity.cru,
memory: 1024 * instanceCapacity.mru,
rootfs_size: 0,
Expand Down
2 changes: 1 addition & 1 deletion packages/grid_client/scripts/applications/nodepilot.ts
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ async function main() {
planetary: false,
public_ip: true,
public_ip6: true,
mycelium: false,
mycelium: true,
cpu: instanceCapacity.cru,
memory: 1024 * instanceCapacity.mru,
rootfs_size: 2,
Expand Down
2 changes: 1 addition & 1 deletion packages/grid_client/scripts/applications/peertube.ts
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ async function main() {
planetary: true,
public_ip: false,
public_ip6: false,
mycelium: false,
mycelium: true,
cpu: instanceCapacity.cru,
memory: 1024 * instanceCapacity.mru,
rootfs_size: 0,
Expand Down
2 changes: 1 addition & 1 deletion packages/grid_client/scripts/applications/presearch.ts
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ async function main() {
planetary: true,
public_ip: false,
public_ip6: false,
mycelium: false,
mycelium: true,
cpu: instanceCapacity.cru,
memory: 1024 * instanceCapacity.mru,
rootfs_size: 0,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ async function main() {
planetary: true,
public_ip: false,
public_ip6: false,
mycelium: false,
mycelium: true,
cpu: instanceCapacity.cru,
memory: 1024 * instanceCapacity.mru,
rootfs_size: 0,
Expand Down
2 changes: 1 addition & 1 deletion packages/grid_client/scripts/applications/subsquid.ts
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ async function main() {
planetary: true,
public_ip: false,
public_ip6: false,
mycelium: false,
mycelium: true,
cpu: instanceCapacity.cru,
memory: 1024 * instanceCapacity.mru,
rootfs_size: 0,
Expand Down
2 changes: 1 addition & 1 deletion packages/grid_client/scripts/applications/taiga.ts
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ async function main() {
planetary: true,
public_ip: false,
public_ip6: false,
mycelium: false,
mycelium: true,
cpu: instanceCapacity.cru,
memory: 1024 * instanceCapacity.mru,
rootfs_size: 0,
Expand Down
2 changes: 1 addition & 1 deletion packages/grid_client/scripts/applications/umbrel.ts
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ async function main() {
planetary: true,
public_ip: false,
public_ip6: false,
mycelium: false,
mycelium: true,
cpu: instanceCapacity.cru,
memory: 1024 * instanceCapacity.mru,
rootfs_size: 0,
Expand Down
2 changes: 1 addition & 1 deletion packages/grid_client/scripts/applications/wordpress.ts
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ async function main() {
planetary: true,
public_ip: false,
public_ip6: false,
mycelium: false,
mycelium: true,
cpu: instanceCapacity.cru,
memory: 1024 * instanceCapacity.mru,
rootfs_size: 0,
Expand Down
2 changes: 1 addition & 1 deletion packages/grid_client/scripts/dynamic_single_vm.ts
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ async function main() {
public_ip: false,
public_ip6: false,
planetary: true,
mycelium: false,
mycelium: true,
cpu: 1,
memory: 1024,
rootfs_size: 0,
Expand Down
4 changes: 2 additions & 2 deletions packages/grid_client/scripts/multiple_vms.ts
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ async function main() {
public_ip: false,
public_ip6: false,
planetary: true,
mycelium: false,
mycelium: true,
cpu: 1,
memory: 1024,
rootfs_size: 0,
Expand All @@ -86,7 +86,7 @@ async function main() {
public_ip: false,
public_ip6: false,
planetary: true,
mycelium: false,
mycelium: true,
cpu: 1,
memory: 1024,
rootfs_size: 0,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ async function main() {
public_ip: true,
public_ip6: false,
planetary: false,
mycelium: false,
mycelium: true,
cpu: 4,
memory: 1024 * 4,
rootfs_size: 0,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ async function main() {
public_ip: true,
public_ip6: false,
planetary: false,
mycelium: false,
mycelium: true,
cpu: 4,
memory: 1024 * 4,
rootfs_size: 0,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ async function main() {
public_ip: false,
public_ip6: false,
planetary: true,
mycelium: false,
mycelium: true,
},
],
workers: [
Expand All @@ -76,7 +76,7 @@ async function main() {
public_ip: false,
public_ip6: false,
planetary: true,
mycelium: false,
mycelium: true,
},
],
metadata: "",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ async function main() {
public_ip: false,
public_ip6: false,
planetary: true,
mycelium: false,
mycelium: true,
qsfs_disks: [
{
qsfs_zdbs_name: qsfs_name,
Expand All @@ -123,7 +123,7 @@ async function main() {
public_ip: false,
public_ip6: false,
planetary: true,
mycelium: false,
mycelium: true,
},
],
metadata: "",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ async function main() {
public_ip: false,
public_ip6: false,
planetary: true,
mycelium: false,
mycelium: true,
};

//Add Worker
Expand Down
2 changes: 1 addition & 1 deletion packages/grid_client/scripts/single_vm.ts
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ async function main() {
public_ip: false,
public_ip6: false,
planetary: true,
mycelium: false,
mycelium: true,
cpu: 1,
memory: 1024 * 2,
rootfs_size: 0,
Expand Down
2 changes: 1 addition & 1 deletion packages/grid_client/scripts/vm_with_gpu.ts
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ async function main() {
public_ip: false,
public_ip6: false,
planetary: true,
mycelium: false,
mycelium: true,
cpu: 8,
memory: 1024 * 16,
rootfs_size: 0,
Expand Down
2 changes: 1 addition & 1 deletion packages/grid_client/scripts/vm_with_qsfs.ts
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@ async function main() {
public_ip: false,
public_ip6: false,
planetary: true,
mycelium: false,
mycelium: true,
cpu: 1,
memory: 1024,
rootfs_size: 0,
Expand Down
2 changes: 1 addition & 1 deletion packages/grid_client/scripts/wireguard_vm.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ function createMachineModel(node: number) {
node_id: node,
public_ip: false,
planetary: true,
mycelium: false,
mycelium: true,
cpu: 1,
memory: 1024 * 2,
rootfs_size: 0,
Expand Down
15 changes: 0 additions & 15 deletions packages/gridproxy_client/src/modules/contracts.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,35 +2,20 @@ import { ContractsBuilder, ContractsQuery, ContractState, ContractType } from ".
import { resolvePaginator } from "../utils";
import { AbstractClient } from "./abstract_client";

export enum Discount {
Default = "Default",
None = "none",
Bronze = "Bronze",
Silver = "Silver",
Gold = "Gold",
}

export interface ContractDetails {
nodeId: number;
deployment_data?: string;
deployment_hash?: string;
number_of_public_ips?: number;
}

export interface ContractBilling {
amountBilled: number;
discountReceived: Discount;
timestamp: number;
}

export interface Contract {
contract_id: number;
twin_id: number;
state: ContractState;
created_at: number;
type: ContractType;
details: ContractDetails;
billing: Array<ContractBilling>;
}

export class ContractsClient extends AbstractClient<ContractsBuilder, ContractsQuery> {
Expand Down
2 changes: 1 addition & 1 deletion packages/playground/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
"get-ip-range": "^4.0.1",
"highlight.js": "^11.7.0",
"ip": "^2.0.1",
"jspdf": "^2.5.1",
"jspdf": "^2.5.2",
"jspdf-autotable": "^3.8.2",
"lodash": "^4.17.21",
"logger-interceptor": "1.0.0",
Expand Down
15 changes: 14 additions & 1 deletion packages/playground/src/App.vue
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,12 @@
<span v-bind="props">
{{ item.title }}
</span>
<v-badge
dot
inline
color="primary"
v-if="item.releaseDate && isReleasedOverMon(item.releaseDate, new Date())"
></v-badge>
</template>
</v-tooltip>
</v-list-item-title>
Expand Down Expand Up @@ -88,6 +94,12 @@
<span v-bind="props">
{{ item.title }}
</span>
<v-badge
dot
inline
color="primary"
v-if="item.releaseDate && isReleasedOverMon(item.releaseDate, new Date())"
></v-badge>
</template>
</v-tooltip>
</v-list-item-title>
Expand Down Expand Up @@ -251,6 +263,7 @@ import { useRoute, useRouter } from "vue-router";
import { useTheme } from "vuetify";
import TfLogger from "@/components/logger.vue";
import { isReleasedOverMon } from "@/utils/date";
import { LocalStorageSettingsKey } from "@/utils/settings";
import { useProfileManager } from "./stores/profile_manager";
Expand Down Expand Up @@ -561,7 +574,6 @@ import TfRouterView from "./components/TfRouterView.vue";
import TfSwapPrice from "./components/TfSwapPrice.vue";
import { useGrid } from "./stores";
import ProfileManager from "./weblets/profile_manager.vue";
interface AppRoute {
title: string;
items: AppRouteItem[];
Expand All @@ -575,6 +587,7 @@ interface AppRouteItem {
url?: string;
icon?: string;
tooltip?: string;
releaseDate?: Date;
}
export default {
Expand Down
Loading

0 comments on commit 8da4c15

Please sign in to comment.