Giter Club home page Giter Club logo

coris-v2's People

Contributors

dependabot[bot] avatar ikpia avatar jim380 avatar uwezukwechibuzor avatar

Stargazers

 avatar

Watchers

 avatar

coris-v2's Issues

Refactor Routes/Chains/mainnet/* in backend

check if it is possible to refactor some codes here
// Define a function to handle API requests

async function fetchAndProcessData(endpoint, res) {
  try {
    const response = await fetch(`${API}${endpoint}`);
    if (response.status !== 200 || !response) {
      throw new Error("Error Querying Chain API");
    }
    const data = await response.json();
    res.json(data);
  } catch (error) {
    res.status(500).json({ message: error.message });
  }
}

// Define the routes using the common function
app.get("/akash/all_validators", async (req, res) => {
  await fetchAndProcessData(endPoints.allChainValidators, res);
});

app.get("/akash/active_validators", async (req, res) => {
  await fetchAndProcessData(endPoints.activeChainValidators, res);
});

app.get("/agoric/all_validators", async (req, res) => {
  await fetchAndProcessData(endPoints.allChainValidators, res);
});

app.get("/agoric/active_validators", async (req, res) => {
  await fetchAndProcessData(endPoints.activeChainValidators, res);
});

include status of eth Txs

use web3.eth.getTransactionReceipt(txHash)

{
  transactionHash: '0x2dca16ef33066a2f2d8b63d234ce53f1e0b7b3eb9ba6127064459ba9d1b36626',
  blockHash: '0xd51fe0fe4cf4f37efaba12a360ef1ba0dc34027e30da331caedcf91eb9916337',
  blockNumber: 18262399n,
  logs: [],
  effectiveGasPrice: 17573426039n,
  cumulativeGasUsed: 23510246n,
  from: '0xad416b3a48208c78a20c617435286ea1a603cd2e',
  gasUsed: 184720n,
  logsBloom: '0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000',
  status: 0n,
  to: '0x3fc91a3afd70395cd496c647d5a6cc9d4b2b7fad',
  transactionIndex: 173n,
  type: 2n
}
{
  transactionHash: '0x2078861bafe5472eaf586af3353a484fbfa30c74800a4d7f59b29c44293c2d38',
  blockHash: '0xd51fe0fe4cf4f37efaba12a360ef1ba0dc34027e30da331caedcf91eb9916337',
  blockNumber: 18262399n,
  logs: [
    {
      transactionHash: '0x2078861bafe5472eaf586af3353a484fbfa30c74800a4d7f59b29c44293c2d38',
      address: '0x388c818ca8b9251b393131c08a736a67ccb19297',
      blockHash: '0xd51fe0fe4cf4f37efaba12a360ef1ba0dc34027e30da331caedcf91eb9916337',
      blockNumber: 18262399n,
      data: '0x00000000000000000000000000000000000000000000000004da144532ef1ef8',
      logIndex: 535n,
      removed: false,
      topics: [Array],
      transactionIndex: 174n
    }
  ],
  effectiveGasPrice: 12593957616n,
  cumulativeGasUsed: 23532357n,
  from: '0x4838b106fce9647bdf1e7877bf73ce8b0bad5f97',
  gasUsed: 22111n,
  logsBloom: '0x00000000000000000000000000000000000100004000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000008000000000000000000000000000000000000000000000000000000000000000000000000000000000000200000000000000000000000000000000000000000000000000000000000000080000000000000000000000000000000000000000000000000000000000000000000000000800000000000000000000000000000000000000000000000000000000000',
  status: 1n,
  to: '0x388c818ca8b9251b393131c08a736a67ccb19297',
  transactionIndex: 174n,
  type: 2n
}

Redis implementation on the backend Routes/APIs

Implementing Redis in the backend offers several advantages and use cases due to its fast, in-memory data storage and its ability to handle various types of data structures. Redis, which stands for Remote Dictionary Server, is an open-source, in-memory data store that can function as a cache, message broker, and more. Here are some reasons why Redis is commonly used in backend implementations:

In-Memory Data Store: Redis stores data in memory, which allows for extremely fast read and write operations. This makes Redis an excellent choice for use cases where low-latency access to data is critical, such as real-time applications or caching.

Caching: One of the most common use cases for Redis is caching. By storing frequently accessed data in Redis, backend applications can quickly retrieve this data without having to perform expensive database queries or computations repeatedly. This significantly improves the performance and responsiveness of the application.

Session Store: Redis can be used to store session data for web applications. Storing sessions in Redis ensures that user data is efficiently managed and persisted across multiple requests, even in a distributed environment.

Pub/Sub Messaging: Redis supports publish/subscribe (pub/sub) messaging, making it an ideal choice for building real-time applications that require event-based communication between components. Publishers can send messages to specific channels, and subscribers can listen to these channels for updates.

Queues and Task Management: Redis provides data structures like lists, sets, and sorted sets, which can be used as queues to manage tasks and process background jobs efficiently. It is often used in task queues to distribute and process tasks among multiple workers.

Leaderboards and Counting: Redis's sorted sets allow for the creation of leaderboards or maintaining counts for different elements. It's efficient for applications that need real-time analytics or maintain rankings based on scores.

GeoSpatial Data: Redis supports geospatial indexing, enabling efficient storage and querying of geospatial data. This makes it useful for location-based applications like ride-sharing, delivery services, and mapping.

Atomic Operations: Redis supports atomic operations on its data structures, ensuring data consistency and making it suitable for use cases that require multi-step operations to be executed atomically.

Persistence Options: Redis can be configured to provide persistence by periodically saving data to disk or writing every command to disk. This allows data to be recovered even after server restarts.

Scalability: Redis can be deployed in a clustered setup, providing high availability and scalability for demanding applications

major tasks

Display chart on the home page
Add Acount details page
Add Transactions Page
Blocks Detail page
Responsive Design&Mobile screen

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.