Language
TypeScript
Created
10/04/2018
Last updated
09/26/2024
autowiki
Software Version
u-0.0.1Basic
Generated from
Commit
ccb510
Generated on
09/27/2024

cyb-ts
[Edit section]
[Copy link]

• • •
Architecture Diagram for cyb-ts
Architecture Diagram for cyb-ts

The cyb-ts repository implements a decentralized application for the Cyber network, providing a user interface and functionality for interacting with the blockchain, managing IPFS content, and facilitating various decentralized features. It serves as a client-side application that allows users to interact with the Cyber network, create and manage cyberlinks, handle transactions, and participate in network governance.

The application is built using React and TypeScript, with Redux for state management. The core functionality is divided into several key areas:

  1. User Interface: The application provides a comprehensive set of reusable UI components in the …/components directory. These components include basic elements like buttons and inputs, as well as more complex components for data visualization and specialized content display. The main application pages and containers are implemented in the …/pages and …/containers directories, providing functionality for features such as the Brain visualization, Hub management, and Portal interface.

  2. Blockchain Interaction: The application interacts with the Cyber blockchain through services implemented in the …/neuron and …/lcd directories. These services handle tasks such as sending transactions, querying blockchain data, and managing user accounts. The blockchain interaction flow typically involves:

    • Constructing transaction messages using the Soft3MessageFactory class
    • Sending transactions to the blockchain using the appropriate service methods
    • Querying blockchain data using the LCD (Light Client Daemon) API
  3. IPFS Integration: The application integrates with IPFS for decentralized content storage and retrieval. The IPFS functionality is implemented in the …/ipfs directory, providing methods for adding content to IPFS, retrieving content, and managing IPFS nodes. The IPFS integration process typically includes:

  4. Cyberlinks: A core feature of the application is the ability to create and visualize cyberlinks, which are connections between particles (content) on the Cyber network. The cyberlink functionality is implemented in the …/cyberlinks directory. The process of creating and visualizing cyberlinks typically involves:

    • Creating cyberlinks using the appropriate blockchain transaction
    • Fetching cyberlink data using utility functions like getLink, getFromLink, and getToLink
    • Visualizing cyberlinks using the CyberlinksGraph component
  5. State Management: The application uses Redux for state management, with the core Redux functionality implemented in the …/redux directory. The state management system includes:

    • Feature slices for managing different aspects of the application state (e.g., current account, IBC denominations, liquidity pools)
    • Custom Redux hooks (useAppDispatch and useAppSelector) for interacting with the Redux store
    • Asynchronous state management using Redux Thunk

The application also includes several other important features, such as the Adviser for interactive content display, the Scripting Engine for executing Rune scripts, and the Queue Management system for prioritizing IPFS content fetching tasks. These features are implemented in their respective directories within …/features and …/services.

Key design choices in the application include:

  • Modular architecture with clear separation of concerns between UI components, services, and state management
  • Use of React hooks and functional components for improved performance and code readability
  • Integration of IPFS for decentralized content storage and retrieval
  • Custom implementation of blockchain interaction services to support the specific requirements of the Cyber network

For more detailed information on specific components and features, refer to the relevant sections in this wiki, such as User Interface Components, Core Features, and Backend Services.

User Interface Components
[Edit section]
[Copy link]

References: src/components, src/layouts

• • •
Architecture Diagram for User Interface Components
Architecture Diagram for User Interface Components

The …/components directory contains a collection of reusable React components that form the foundation of the application's user interface. These components are designed to be modular, customizable, and easily integrated into various parts of the application.

Read more

Core UI Components
[Edit section]
[Copy link]

References: src/components/Button, src/components/Input, src/components/MainContainer, src/components/LinearGradientContainer

• • •
Architecture Diagram for Core UI Components
Architecture Diagram for Core UI Components

The Button component in …/Button provides a customizable button with optional image support. The ButtonImgText component extends this functionality, allowing for an image to be displayed alongside the button text.

Read more

Data Visualization Components
[Edit section]
[Copy link]

References: src/components/Table, src/components/DonutChart, src/components/SearchItem

• • •
Architecture Diagram for Data Visualization Components
Architecture Diagram for Data Visualization Components

The Table component in …/Table.tsx provides a reusable table with sorting functionality. Key features include:

Read more

Specialized Display Components
[Edit section]
[Copy link]

References: src/components/contentIpfs, src/components/TableTxsInfinite, src/components/particle

The ContentIpfs component in …/contentIpfs.tsx handles rendering various types of IPFS content. It determines the appropriate rendering method based on the content type:

Read more

Application Pages and Containers
[Edit section]
[Copy link]

References: src/pages, src/containers

• • •
Architecture Diagram for Application Pages and Containers
Architecture Diagram for Application Pages and Containers

The application's structure is built around several key pages and containers, each handling specific functionality:

Read more

Brain Visualization
[Edit section]
[Copy link]

References: src/pages/Brain

• • •
Architecture Diagram for Brain Visualization
Architecture Diagram for Brain Visualization

The Brain page displays a graph visualization of the user's cyberlinks using the CyberlinksGraphContainer component. This component is responsible for rendering the interactive graph, allowing users to explore their cyberlink connections visually.

Read more

Hub Management
[Edit section]
[Copy link]

References: src/pages/Hub

• • •
Architecture Diagram for Hub Management
Architecture Diagram for Hub Management

The Hub page displays tables for channels, networks, and tokens. The main components are:

Read more

Key and Account Management
[Edit section]
[Copy link]

References: src/pages/Keys

• • •
Architecture Diagram for Key and Account Management
Architecture Diagram for Key and Account Management

The Keys page manages user accounts and keys through several interconnected components:

Read more

Portal Interface
[Edit section]
[Copy link]

References: src/pages/Portal

• • •
Architecture Diagram for Portal Interface
Architecture Diagram for Portal Interface

The Portal interface is implemented in the …/Map directory, providing a map-like visualization with interactive links and icons. Key components include:

Read more

Settings and Configuration
[Edit section]
[Copy link]

References: src/pages/Settings

• • •
Architecture Diagram for Settings and Configuration
Architecture Diagram for Settings and Configuration

The settings and configuration options are primarily managed through components in the …/Settings directory. The Settings component in …/Settings.tsx defines the main routing structure for the settings page, rendering the Layout component as the main container and setting up nested routes for specific settings sections like IPFS, Keys, and Audio.

Read more

Social Media Integration
[Edit section]
[Copy link]

References: src/pages/Social

• • •
Architecture Diagram for Social Media Integration
Architecture Diagram for Social Media Integration

The Social component in …/Social.tsx serves as the main container for social media and community-related features. It renders instances of Discord, Twitter, Telegram, and GitHub components, along with additional hub links and email contact information.

Read more

Oracle Functionality
[Edit section]
[Copy link]

References: src/pages/oracle

• • •
Architecture Diagram for Oracle Functionality
Architecture Diagram for Oracle Functionality

The Oracle functionality is implemented across two main components: the Learn page and the Oracle landing page.

Read more

Robot Features
[Edit section]
[Copy link]

References: src/pages/robot

• • •
Architecture Diagram for Robot Features
Architecture Diagram for Robot Features

The Robot Features are implemented primarily in the …/robot directory. The main components include:

Read more

Teleport Feature
[Edit section]
[Copy link]

References: src/pages/teleport

• • •
Architecture Diagram for Teleport Feature
Architecture Diagram for Teleport Feature

The Teleport feature enables users to transfer assets between different blockchain networks using the Inter-Blockchain Communication (IBC) protocol. The main components are:

Read more

WASM Integration
[Edit section]
[Copy link]

References: src/containers/wasm

• • •
Architecture Diagram for WASM Integration
Architecture Diagram for WASM Integration

The WASM integration in the Cyb-TS application is primarily handled in the …/wasm directory. This functionality allows users to interact with WebAssembly codes and contracts on the blockchain.

Read more

Governance System
[Edit section]
[Copy link]

References: src/containers/governance

• • •
Architecture Diagram for Governance System
Architecture Diagram for Governance System

The governance system is implemented primarily in the …/governance directory. Key components include:

Read more

Energy Management
[Edit section]
[Copy link]

References: src/containers/energy

• • •
Architecture Diagram for Energy Management
Architecture Diagram for Energy Management

The RoutedEnergy component in …/index.tsx manages energy-related functionality. It fetches and displays information about energy slots, income, and outcome using hooks like useGetSlots and useGetSourceRoutes.

Read more

IPFS Content Handling
[Edit section]
[Copy link]

References: src/containers/ipfs

• • •
Architecture Diagram for IPFS Content Handling
Architecture Diagram for IPFS Content Handling

The Ipfs component in …/ipfs.tsx manages IPFS content handling:

Read more

Core Features
[Edit section]
[Copy link]

References: src/features, src/services

• • •
Architecture Diagram for Core Features
Architecture Diagram for Core Features

The application's core features revolve around blockchain interactions, IPFS integration, and cyberlinks management. These features are implemented across various modules:

Read more

IPFS Integration
[Edit section]
[Copy link]

References: src/features/ipfs, src/services/ipfs

• • •
Architecture Diagram for IPFS Integration
Architecture Diagram for IPFS Integration

The IPFS integration in the Cyber ecosystem is implemented through three main node types: HeliaNode, JsIpfsNode, and KuboNode, each providing different approaches to interacting with the IPFS network. These implementations are located in …/impl.

Read more

Blockchain Interactions
[Edit section]
[Copy link]

References: src/services/neuron, src/features/staking

• • •
Architecture Diagram for Blockchain Interactions
Architecture Diagram for Blockchain Interactions

The neuronApi module in …/neuronApi.ts provides core functionality for interacting with the Cyber blockchain:

Read more

Studio Feature
[Edit section]
[Copy link]

References: src/features/studio, src/features/studio/Studio.tsx, src/features/studio/StudioWrapper.tsx, src/features/studio/ActionBar.tsx, src/features/studio/Studio.module.scss

• • •
Architecture Diagram for Studio Feature
Architecture Diagram for Studio Feature

The Studio feature serves as the creative hub within the CYB-TS application, where users can craft and manage markdown content, orchestrate keywords, and construct cyberlinks. Central to this feature is the Studio component, which integrates various sub-components to offer a seamless content creation and management experience.

Read more

Studio Editor Components
[Edit section]
[Copy link]

References: src/features/studio/components/Editor/MilkdownEditor.tsx, src/features/studio/components/Editor/feature/feature.ts, src/features/studio/components/Editor/plugins/cybSyntax/pluginCybSyntax.ts

The MilkdownEditor component in …/MilkdownEditor.tsx integrates the Milkdown library to provide a Markdown editor within the Studio feature. It is designed to allow users to edit and update Markdown content, with an update method exposed through a React ref for programmatic content updates. The component accepts content, onChange, and milkdownRef props to handle initial content, content changes, and external control of the editor, respectively.

Read more

Studio Context Management
[Edit section]
[Copy link]

References: src/features/studio/studio.context.tsx

• • •
Architecture Diagram for Studio Context Management
Architecture Diagram for Studio Context Management

The file …/studio.context.tsx introduces a React context that is essential for the studio feature, focusing on the management of markdown content, keywords, and cyberlink transactions. It encapsulates several state variables and functions that are crucial for the studio's functionality:

Read more

Studio Utility Functions
[Edit section]
[Copy link]

References: src/features/studio/utils/utils.ts

• • •
Architecture Diagram for Studio Utility Functions
Architecture Diagram for Studio Utility Functions

Within the Studio feature of the Cyber network's decentralized application, a set of utility functions in …/utils.ts plays a crucial role in managing cyberlinks and keywords. These functions are essential for ensuring the integrity and usability of the cyberlink structures within the network.

Read more

Cybernet
[Edit section]
[Copy link]

References: src/features/cybernet

The Cybernet application is implemented in …/cybernet, with the main UI components located in …/ui. The application manages subnets and delegation through several key components:

Read more

Sense
[Edit section]
[Copy link]

References: src/features/sense

• • •
Architecture Diagram for Sense
Architecture Diagram for Sense

The SenseItem type represents individual sense items, containing properties like id, transactionHash, type, meta, timestamp, memo, and from. The formatApiData() function transforms API response data into the SenseItem format.

Read more

IBC History
[Edit section]
[Copy link]

References: src/features/ibc-history

• • •
Architecture Diagram for IBC History
Architecture Diagram for IBC History

The HistoryContext and HistoryContextProvider in …/historyContext.tsx manage the IBC transaction history. Key functionalities include:

Read more

Scripting Engine
[Edit section]
[Copy link]

References: src/services/scripting

• • •
Architecture Diagram for Scripting Engine
Architecture Diagram for Scripting Engine

The Rune scripting engine, implemented in …/engine.ts, provides core functionality for executing Rune scripts and interacting with the OpenAI API. Key components include:

Read more

Queue Management
[Edit section]
[Copy link]

References: src/services/QueueManager

• • •
Architecture Diagram for Queue Management
Architecture Diagram for Queue Management

The QueueManager class manages a queue of IPFS content fetching tasks, prioritizing and executing them based on various factors. Key features include:

Read more

Time History
[Edit section]
[Copy link]

References: src/features/TimeHistory

• • •
Architecture Diagram for Time History
Architecture Diagram for Time History

The Time History feature tracks and displays the user's recent actions and their timestamps. The core functionality is implemented in …/TimeHistory.tsx:

Read more

Adviser
[Edit section]
[Copy link]

References: src/features/adviser

• • •
Architecture Diagram for Adviser
Architecture Diagram for Adviser

The Adviser component provides an interactive and customizable content display with audio narration capabilities. Key features include:

Read more

State Management
[Edit section]
[Copy link]

References: src/redux, src/hooks

• • •
Architecture Diagram for State Management
Architecture Diagram for State Management

The Redux-based state management system in the application is implemented using the @reduxjs/toolkit library. The state is organized into several slices, each managing a specific aspect of the application's data.

Read more

Redux Store Configuration
[Edit section]
[Copy link]

References: src/redux/store.ts

• • •
Architecture Diagram for Redux Store Configuration
Architecture Diagram for Redux Store Configuration

The Redux store is configured using configureStore from @reduxjs/toolkit. Key aspects:

Read more

Redux Slices and Reducers
[Edit section]
[Copy link]

References: src/redux/features, src/redux/reducers

• • •
Architecture Diagram for Redux Slices and Reducers
Architecture Diagram for Redux Slices and Reducers

Redux slices and reducers manage different aspects of the application state:

Read more

Custom Redux Hooks
[Edit section]
[Copy link]

References: src/redux/hooks.ts

• • •
Architecture Diagram for Custom Redux Hooks
Architecture Diagram for Custom Redux Hooks

Two custom React Redux hooks are defined in …/hooks.ts:

Read more

Asynchronous State Management
[Edit section]
[Copy link]

References: src/redux/features, src/redux/actions

• • •
Architecture Diagram for Asynchronous State Management
Architecture Diagram for Asynchronous State Management

Asynchronous state management in the Redux store is primarily handled through thunk actions and side effects in the feature slices. The pocket slice in …/pocket.ts demonstrates this approach:

Read more

Backend Services
[Edit section]
[Copy link]

References: src/services

The backend services of the application are primarily implemented in the …/services directory, which contains various subdirectories for specific functionalities.

Read more

Database Management
[Edit section]
[Copy link]

References: src/services/CozoDb

• • •
Architecture Diagram for Database Management
Architecture Diagram for Database Management

The createCozoDb() function in …/cozoDb.ts initializes and manages a CozoDb instance, providing methods for database operations:

Read more

Blockchain Interaction
[Edit section]
[Copy link]

References: src/services/backend/services, src/services/lcd, src/services/neuron

• • •
Architecture Diagram for Blockchain Interaction
Architecture Diagram for Blockchain Interaction

The DbApiWrapper class in …/DbApi.ts serves as the primary interface for blockchain interactions. It provides methods for managing transactions, cyberlinks, and other blockchain-related data:

Read more

IPFS Integration
[Edit section]
[Copy link]

References: src/services/ipfs

• • •
Architecture Diagram for IPFS Integration
Architecture Diagram for IPFS Integration

The IPFS integration in the Cyber project is implemented through three main node types: HeliaNode, JsIpfsNode, and KuboNode, all of which implement the IpfsNode interface. These classes are defined in …/impl.

Read more

Community Management
[Edit section]
[Copy link]

References: src/services/community

• • •
Architecture Diagram for Community Management
Architecture Diagram for Community Management

The community management functionality is implemented in the …/community directory. Two main functions handle the core operations:

Read more

Relayer Service
[Edit section]
[Copy link]

References: src/services/relayer

• • •
Architecture Diagram for Relayer Service
Architecture Diagram for Relayer Service

The IBC relayer service is implemented in the …/relayer directory, with the main functionality provided by the relay function in …/relay.ts. This function sets up and manages the relaying process between two blockchain networks using the IBC protocol. Key components include:

Read more

Service Worker
[Edit section]
[Copy link]

References: src/services/service-worker

The service worker, implemented in …/service-worker.ts, provides caching and offline functionality for the Cyb.ai application. Key features include:

Read more

Utility Functions
[Edit section]
[Copy link]

References: src/utils, src/hooks

The …/utils directory contains a collection of utility functions and helpers used throughout the application. These utilities cover a wide range of functionality, including blockchain network detection, address validation, and data conversion.

Read more

Date and Time Handling
[Edit section]
[Copy link]

References: src/utils/date.ts

• • •
Architecture Diagram for Date and Time Handling
Architecture Diagram for Date and Time Handling

The …/date.ts file provides utility functions for date and time handling:

Read more

Asynchronous Operations
[Edit section]
[Copy link]

References: src/utils/async

• • •
Architecture Diagram for Asynchronous Operations
Architecture Diagram for Asynchronous Operations

The …/async directory provides utilities for efficient asynchronous data processing and error handling. Key functionalities include:

Read more

IPFS Integration
[Edit section]
[Copy link]

References: src/utils/ipfs

• • •
Architecture Diagram for IPFS Integration
Architecture Diagram for IPFS Integration

The …/helpers.ts file provides utility functions for interacting with the IPFS network:

Read more

Application Menu Generation
[Edit section]
[Copy link]

References: src/utils/appsMenu

• • •
Architecture Diagram for Application Menu Generation
Architecture Diagram for Application Menu Generation

The getMenuItems() function in …/appsMenu.ts generates the main application menu for the Cybernet application. It returns an array of menu item objects, each representing a different application or feature within the platform.

Read more

Search and Data Retrieval
[Edit section]
[Copy link]

References: src/utils/search

The …/utils.ts file contains utility functions for performing searches and retrieving data from the Cyber network. Key functionalities include:

Read more

Logging and Error Handling
[Edit section]
[Copy link]

References: src/utils/logging

• • •
Architecture Diagram for Logging and Error Handling
Architecture Diagram for Logging and Error Handling

The custom logging system in …/logging provides error interception and cross-window communication features. Key components include:

Read more

Miscellaneous Utilities
[Edit section]
[Copy link]

References: src/utils/utils.ts

The utils.ts file contains various utility functions for common tasks:

Read more