├── public ├── robots.txt ├── nkn.png ├── gundb.png ├── nostr.png ├── favicon.ico ├── torrent.png ├── vercel.svg └── next.svg ├── .eslintrc.json ├── bun.lockb ├── jest.config.js ├── src ├── components │ ├── demo │ │ └── p2p │ │ │ ├── types.ts │ │ │ ├── useGun.ts │ │ │ ├── useNKN.ts │ │ │ ├── useTrystero.ts │ │ │ └── useWaku.ts │ ├── ui │ │ ├── collapsible.tsx │ │ ├── label.tsx │ │ ├── textarea.tsx │ │ ├── separator.tsx │ │ ├── input.tsx │ │ ├── progress.tsx │ │ ├── toaster.tsx │ │ ├── checkbox.tsx │ │ ├── tooltip.tsx │ │ ├── switch.tsx │ │ ├── badge.tsx │ │ ├── popover.tsx │ │ ├── avatar.tsx │ │ ├── button.tsx │ │ ├── tabs.tsx │ │ ├── card.tsx │ │ ├── table.tsx │ │ ├── dialog.tsx │ │ ├── use-toast.ts │ │ ├── toast.tsx │ │ ├── command.tsx │ │ └── select.tsx │ ├── dashboard │ │ ├── logsPackets.tsx │ │ ├── stats.tsx │ │ ├── llmWorkers.tsx │ │ ├── dashboard.tsx │ │ ├── chainidentities.tsx │ │ ├── logs.tsx │ │ ├── scaleWorkers.tsx │ │ └── navbar.tsx │ └── RakisTestModal.tsx ├── lib │ └── utils.ts ├── rakis-core │ ├── synthient-chain │ │ ├── llm │ │ │ ├── mlc-worker.ts │ │ │ └── types.ts │ │ ├── utils │ │ │ ├── deferredpromise.ts │ │ │ ├── utils.ts │ │ │ └── logger.ts │ │ ├── p2p-networks │ │ │ ├── p2pnetwork-types.ts │ │ │ ├── p2p-config.ts │ │ │ ├── networkfactory.ts │ │ │ ├── pewpewdb.ts │ │ │ ├── trystero.ts │ │ │ └── nkn.ts │ │ ├── identity.ts │ │ ├── embeddings │ │ │ ├── types.ts │ │ │ └── embedding-worker.ts │ │ ├── db │ │ │ └── entities.ts │ │ └── thedomain │ │ │ └── connectors.ts │ └── blockchains │ │ └── wagmi-config.ts ├── app │ ├── demos │ │ └── ai │ │ │ ├── colors.ts │ │ │ └── embedding-chart.tsx │ ├── layout.tsx │ └── globals.css └── hooks │ ├── useStats.tsx │ ├── usePackets.tsx │ └── useTheDomain.ts ├── postcss.config.mjs ├── components.json ├── .gitignore ├── licensing ├── summary.txt └── quickcheck.txt ├── next.config.mjs ├── tsconfig.json ├── tailwind.config.ts ├── todos └── todo-extractor.ts ├── chain-contracts └── evm │ ├── BadUserContract.sol │ ├── UserContract.sol │ └── SimpleStoryNFT.sol ├── package.json └── README.md /public/robots.txt: -------------------------------------------------------------------------------- 1 | User-agent: * 2 | Disallow: / -------------------------------------------------------------------------------- /.eslintrc.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "next/core-web-vitals" 3 | } 4 | -------------------------------------------------------------------------------- /bun.lockb: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hrishioa/rakis/HEAD/bun.lockb -------------------------------------------------------------------------------- /jest.config.js: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | testEnvironment: "jsdom", 3 | }; 4 | -------------------------------------------------------------------------------- /public/nkn.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hrishioa/rakis/HEAD/public/nkn.png -------------------------------------------------------------------------------- /public/gundb.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hrishioa/rakis/HEAD/public/gundb.png -------------------------------------------------------------------------------- /public/nostr.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hrishioa/rakis/HEAD/public/nostr.png -------------------------------------------------------------------------------- /public/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hrishioa/rakis/HEAD/public/favicon.ico -------------------------------------------------------------------------------- /public/torrent.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hrishioa/rakis/HEAD/public/torrent.png -------------------------------------------------------------------------------- /src/components/demo/p2p/types.ts: -------------------------------------------------------------------------------- 1 | type TestMessage = { 2 | timestamp: number; 3 | sender: string; 4 | message: string; 5 | }; 6 | -------------------------------------------------------------------------------- /postcss.config.mjs: -------------------------------------------------------------------------------- 1 | /** @type {import('postcss-load-config').Config} */ 2 | const config = { 3 | plugins: { 4 | tailwindcss: {}, 5 | }, 6 | }; 7 | 8 | export default config; 9 | -------------------------------------------------------------------------------- /src/lib/utils.ts: -------------------------------------------------------------------------------- 1 | import { type ClassValue, clsx } from "clsx" 2 | import { twMerge } from "tailwind-merge" 3 | 4 | export function cn(...inputs: ClassValue[]) { 5 | return twMerge(clsx(inputs)) 6 | } 7 | -------------------------------------------------------------------------------- /src/rakis-core/synthient-chain/llm/mlc-worker.ts: -------------------------------------------------------------------------------- 1 | import { MLCEngineWorkerHandler, MLCEngine } from "@mlc-ai/web-llm"; 2 | 3 | // Hookup an engine to a worker handler 4 | const engine = new MLCEngine(); 5 | const handler = new MLCEngineWorkerHandler(engine); 6 | self.onmessage = (msg: MessageEvent) => { 7 | handler.onmessage(msg); 8 | }; 9 | -------------------------------------------------------------------------------- /src/rakis-core/synthient-chain/utils/deferredpromise.ts: -------------------------------------------------------------------------------- 1 | export class DeferredPromise { 2 | promise: Promise; 3 | resolve!: (value: T | PromiseLike) => void; 4 | reject!: (reason?: any) => void; 5 | 6 | constructor() { 7 | this.promise = new Promise((resolve, reject) => { 8 | this.resolve = resolve; 9 | this.reject = reject; 10 | }); 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /src/components/ui/collapsible.tsx: -------------------------------------------------------------------------------- 1 | "use client" 2 | 3 | import * as CollapsiblePrimitive from "@radix-ui/react-collapsible" 4 | 5 | const Collapsible = CollapsiblePrimitive.Root 6 | 7 | const CollapsibleTrigger = CollapsiblePrimitive.CollapsibleTrigger 8 | 9 | const CollapsibleContent = CollapsiblePrimitive.CollapsibleContent 10 | 11 | export { Collapsible, CollapsibleTrigger, CollapsibleContent } 12 | -------------------------------------------------------------------------------- /components.json: -------------------------------------------------------------------------------- 1 | { 2 | "$schema": "https://ui.shadcn.com/schema.json", 3 | "style": "new-york", 4 | "rsc": true, 5 | "tsx": true, 6 | "tailwind": { 7 | "config": "tailwind.config.ts", 8 | "css": "src/app/globals.css", 9 | "baseColor": "zinc", 10 | "cssVariables": true, 11 | "prefix": "" 12 | }, 13 | "aliases": { 14 | "components": "@/components", 15 | "utils": "@/lib/utils" 16 | } 17 | } -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | # See https://help.github.com/articles/ignoring-files/ for more about ignoring files. 2 | 3 | # dependencies 4 | /node_modules 5 | /.pnp 6 | .pnp.js 7 | .yarn/install-state.gz 8 | 9 | # testing 10 | /coverage 11 | 12 | # next.js 13 | /.next/ 14 | /out/ 15 | 16 | # production 17 | /build 18 | 19 | # misc 20 | .DS_Store 21 | *.pem 22 | 23 | # debug 24 | npm-debug.log* 25 | yarn-debug.log* 26 | yarn-error.log* 27 | 28 | # local env files 29 | .env*.local 30 | 31 | # vercel 32 | .vercel 33 | 34 | # typescript 35 | *.tsbuildinfo 36 | next-env.d.ts 37 | 38 | .vscode 39 | 40 | dist 41 | -------------------------------------------------------------------------------- /public/vercel.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /src/components/ui/label.tsx: -------------------------------------------------------------------------------- 1 | "use client" 2 | 3 | import * as React from "react" 4 | import * as LabelPrimitive from "@radix-ui/react-label" 5 | import { cva, type VariantProps } from "class-variance-authority" 6 | 7 | import { cn } from "@/lib/utils" 8 | 9 | const labelVariants = cva( 10 | "text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70" 11 | ) 12 | 13 | const Label = React.forwardRef< 14 | React.ElementRef, 15 | React.ComponentPropsWithoutRef & 16 | VariantProps 17 | >(({ className, ...props }, ref) => ( 18 | 23 | )) 24 | Label.displayName = LabelPrimitive.Root.displayName 25 | 26 | export { Label } 27 | -------------------------------------------------------------------------------- /src/components/ui/textarea.tsx: -------------------------------------------------------------------------------- 1 | import * as React from "react" 2 | 3 | import { cn } from "@/lib/utils" 4 | 5 | export interface TextareaProps 6 | extends React.TextareaHTMLAttributes {} 7 | 8 | const Textarea = React.forwardRef( 9 | ({ className, ...props }, ref) => { 10 | return ( 11 |