github.com/TrueBlocks/trueblocks-core/src/apps/chifra@v0.0.0-20241022031540-b362680128f7/main.go (about) 1 /*------------------------------------------------------------------------------------------- 2 * qblocks - fast, easily-accessible, fully-decentralized data from blockchains 3 * copyright (c) 2016, 2021 TrueBlocks, LLC (http://trueblocks.io) 4 * 5 * This program is free software: you may redistribute it and/or modify it under the terms 6 * of the GNU General Public License as published by the Free Software Foundation, either 7 * version 3 of the License, or (at your option) any later version. This program is 8 * distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even 9 * the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 10 * General Public License for more details. You should have received a copy of the GNU General 11 * Public License along with this program. If not, see http://www.gnu.org/licenses/. 12 *-------------------------------------------------------------------------------------------*/ 13 14 package main 15 16 import ( 17 "github.com/TrueBlocks/trueblocks-core/src/apps/chifra/cmd" 18 "github.com/TrueBlocks/trueblocks-core/src/apps/chifra/pkg/debug" 19 ) 20 21 func main() { 22 defer Cleanup() 23 // pprofFile, pprofErr := os.OpenFile("cpu.pprof", O_RDWR|O_CREATE|O_TRUNC, 0666) 24 // if pprofErr != nil { 25 // logger.Fatal(pprofErr) 26 // } 27 // pprof.StartCPUProfile(pprofFile) 28 // defer pprof.StopCPUProfile() 29 30 if cmd.Initialize() { 31 cmd.Execute() 32 } 33 } 34 35 // Cleanup gets called before main exits. 36 func Cleanup() { 37 debug.CloseDebugger() 38 }