Contract state monitoring and rollback infrastructure. (#61)

This commit is contained in:
Ravin Perera
2019-11-25 19:30:15 +05:30
committed by GitHub
parent bebdace519
commit 0dde10c306
32 changed files with 3222 additions and 230 deletions

View File

@@ -11,6 +11,7 @@
#include "usr/usr.hpp"
#include "p2p/p2p.hpp"
#include "cons/cons.hpp"
#include "statefs/state_common.hpp"
/**
* Parses CLI args and extracts hot pocket command and parameters given.
@@ -35,7 +36,7 @@ int parse_cmd(int argc, char **argv)
{
// We inform the conf subsystem to populate the contract directory context values
// based on the directory argument from the command line.
conf::set_contract_dir_paths(argv[2]);
conf::set_contract_dir_paths(argv[0], argv[2]);
return 0;
}
@@ -114,7 +115,7 @@ void std_terminate() noexcept
int main(int argc, char **argv)
{
//seed rand
srand(time(0));
srand(time(0));
// Register exception handler for std exceptions.
std::set_terminate(&std_terminate);
@@ -172,6 +173,8 @@ int main(int argc, char **argv)
if (p2p::init() != 0 || usr::init() != 0 || cons::init() != 0)
return -1;
statefs::init(conf::ctx.statehistdir);
// After initializing primary subsystems, register the SIGINT handler.
signal(SIGINT, signal_handler);