koinos / koinos-chain

The chain microservice is responsible for the application of blocks, running of smart contracts, and applying transactions.
Other
15 stars 3 forks source link

Koinos Kernel Module (Syscall Override) #33

Closed sgerbino closed 4 years ago

sgerbino commented 4 years ago

As a blockchain developer, I would like to override system calls via in-band updates.

Register system call may look like this:

register_syscall( SYSCALL_PRINT, N("action") );

An example kernel module:

namespace koinos::kernel
{
   class module
   {
       void init() = 0;
   };
}

class my_module : public koinos::kernel::module
{
   void init()
   {
      register_syscall( SYSCALL_PRINT, N("print") );
   }

   [[koinos::action]]
   void print( std::string s )
   {
      _print( s );
   }
}
mvandeberg commented 4 years ago

This design has been usurped. Closing.