Exemple #1
0
static void create_snapshot( const graphene::chain::database& db, const fc::path& dest )
{
   ilog("snapshot plugin: creating snapshot");
   fc::ofstream out;
   try
   {
      out.open( dest );
   }
   catch ( fc::exception& e )
   {
      wlog( "Failed to open snapshot destination: ${ex}", ("ex",e) );
      return;
   }
   for( uint32_t space_id = 0; space_id < 256; space_id++ )
      for( uint32_t type_id = 0; type_id < 256; type_id++ )
      {
         try
         {
            db.get_index( (uint8_t)space_id, (uint8_t)type_id );
         }
         catch (fc::assert_exception& e)
         {
            continue;
         }
         auto& index = db.get_index( (uint8_t)space_id, (uint8_t)type_id );
         index.inspect_all_objects( [&out]( const graphene::db::object& o ) {
            out << fc::json::to_string( o.to_variant() ) << '\n';
         });
      }
   out.close();
   ilog("snapshot plugin: created snapshot");
}
Exemple #2
0
void new_chain_banner( const graphene::chain::database& db )
{
   ilog("\n"
      "********************************\n"
      "*                              *\n"
      "*   ------- NEW CHAIN ------   *\n"
      "*   - Welcome to Graphene! -   *\n"
      "*   ------------------------   *\n"
      "*                              *\n"
      "********************************\n"
      "\n");
   if( db.get_slot_at_time( fc::time_point::now() ) > 200 )
   {
      wlog("Your genesis seems to have an old timestamp");
      wlog("Please consider using the --genesis-timestamp option to give your genesis a recent timestamp");
   }
}
Exemple #3
0
void new_chain_banner( const graphene::chain::database& db )
{
   std::cerr << "\n"
      "********************************\n"
      "*                              *\n"
      "*   ------- NEW CHAIN ------   *\n"
      "*   - Welcome to Graphene! -   *\n"
      "*   ------------------------   *\n"
      "*                              *\n"
      "********************************\n"
      "\n";
   if( db.get_slot_at_time( graphene::time::now() ) > 200 )
   {
      std::cerr << "Your genesis seems to have an old timestamp\n"
         "Please consider using the --genesis-timestamp option to give your genesis a recent timestamp\n"
         "\n"
         ;
   }
   return;
}