Git Product home page Git Product logo

abcf's People

Contributors

malefooo avatar tiannian avatar tommady avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

abcf's Issues

For version 0.1

Currently, we need some work.

Need todo

Complete storage layer bs3.

Complete function of abcf.


Make framework stable

Future work

  • Function: wasm module.
  • Examples and Demos, see #27 .

Issues

  • #10
  • #11
  • Fix no store delacre.
  • Fix generic support on store.

Design Document

https://www.notion.so/findora/Modularization-in-Design-263050607c5d4db2b93d0bf8e9109541

For Version 0.2

Add optimizations for abcf.

TODO

  • #30
  • Auto declare storage.
  • Define merkle algo for special field.
  • add module call macros.
  • Impl manager's new in trait without in bare code.
  • Add Call in macros.
  • Extend CallEntry as inner EventBus.
  • Add multi-thread support.
  • Add returnable support for module call.

New Module trait.

Define new trait named Module

pub trait Context {
  type Store: bs3::Store;
  type Digest: digest::Digest;

  // Trigger event;
  fn emmit(&mut self, event: impl Event);
  // Spwan a new async work.
  fn spwan<R>(&mut self, handler: impl core::future::Future<Output = R>) -> R;
  // Get block info.
  fn block(&self) -> &Block;
  // Get Consensus info.
  fn consensus(&self) -> &Consensus;
  // Get Governance info.
  fn governance(&self) -> &Governance;
}

pub trait ContextMut: Context {
  fn consensus_mut(&mut self) -> &mut Consensus;
  fn governance_mut(&mut self) -> &mut Governance;
}

When you declare a module:

#[abcf::module]
pub struct MockModule<C: Context> {
  ctx: C,

  #[metadata(
    name = "mock",
    version = 0,
    impl_version,
    target_height = 0,
  )]
  metadata: abcf::Metadata,

  #[storage(merkle="AppendOnlyMerkle")]
  storage_value: Value<u32, C>,

  #[dependence]
  utxo: UtxoModule<C>,
}

When you create a module, please use code like this:

let backend = SledBackend::open_db("target/data/mock");

let mut mock = MockModule::new::<_, Sha3_256>(&backend);

mock.genesis_storage_value(Value::new(123));

let mockv1 = MockModuleV1::new<_, Sha3_256>(&backend);

Enhancement: add log in abci

Convert the ABCI interface result in Result. And use Result to generate the error log.

Due to the ABCI application will process data in any type, so we need to remove JSON dependence in ABCI.

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.