Exemple #1
0
        public Node()
        {
#if DEBUG
            Logging.warn("Testing language files");
            SpixiLocalization.testLanguageFiles("en-us");
#endif

            Logging.info("Initing node constructor");

            Instance = this;

            IxianHandler.init(Config.version, this, Config.networkType);

            // Prepare the wallet
            walletStorage = new WalletStorage(Path.Combine(Config.spixiUserFolder, Config.walletFile));

            PeerStorage.init(Config.spixiUserFolder);

            // Init TIV
            tiv = new TransactionInclusion();

            Logging.info("Initing local storage");

            // Prepare the local storage
            localStorage = new SPIXI.Storage.LocalStorage(Config.spixiUserFolder);

            customAppManager = new CustomAppManager(Config.spixiUserFolder);

            FriendList.init(Config.spixiUserFolder);

            Logging.info("Node init done");
        }
Exemple #2
0
        public Node()
        {
            Instance = this;

            CoreConfig.productVersion = Config.version;
            IxianHandler.setHandler(this);

            CoreConfig.isTestNet = Config.isTestNet;

            // Initialize the crypto manager
            CryptoManager.initLib();

            // Prepare the wallet
            walletStorage = new WalletStorage(Path.Combine(Config.spixiUserFolder, Config.walletFile));

            string peers_filename = "peers.ixi";

            if (CoreConfig.isTestNet)
            {
                peers_filename = "testnet-peers.ixi";
            }

            PeerStorage.init(Config.spixiUserFolder, peers_filename);

            ulong block_height = 1;

            byte[] block_checksum = null;

            if (!walletStorage.walletExists())
            {
                block_height   = Config.bakedBlockHeight;
                block_checksum = Config.bakedBlockChecksum;
            }

            string headers_path = "";

            if (!Config.isTestNet)
            {
                headers_path = Path.Combine(Config.spixiUserFolder, "headers");
            }
            else
            {
                // Temporary hack for our beta testers, remove before release
                string tmp_path = Path.Combine(Config.spixiUserFolder, "headers");
                BlockHeaderStorage.init(tmp_path);
                BlockHeaderStorage.deleteCache();
                BlockHeaderStorage.stop();
                // End of hack

                headers_path = Path.Combine(Config.spixiUserFolder, "testnet-headers");
            }
            // Init TIV
            tiv = new TransactionInclusion(headers_path, block_height, block_checksum);

            // Prepare the local storage
            localStorage = new SPIXI.Storage.LocalStorage(Config.spixiUserFolder);

            customAppManager = new CustomAppManager(Config.spixiUserFolder);
        }
Exemple #3
0
        public Node()
        {
            Instance = this;

            CoreConfig.productVersion = Config.version;
            IxianHandler.setHandler(this);

            CoreConfig.isTestNet = Config.isTestNet;

            // Prepare the wallet
            walletStorage = new WalletStorage(Path.Combine(Config.spixiUserFolder, Config.walletFile));

            string peers_filename = "peers.ixi";

            if (CoreConfig.isTestNet)
            {
                peers_filename = "testnet-peers.ixi";
            }

            PeerStorage.init(Config.spixiUserFolder, peers_filename);

            ulong block_height = 1;

            byte[] block_checksum = null;

            string headers_path;

            if (Config.isTestNet)
            {
                headers_path = Path.Combine(Config.spixiUserFolder, "testnet-headers");
            }
            else
            {
                headers_path = Path.Combine(Config.spixiUserFolder, "headers");
                if (!walletStorage.walletExists())
                {
                    block_height   = Config.bakedBlockHeight;
                    block_checksum = Config.bakedBlockChecksum;
                }
                else
                {
                    block_height   = Config.bakedRecoveryBlockHeight;
                    block_checksum = Config.bakedRecoveryBlockChecksum;
                }
            }
            // Init TIV
            tiv = new TransactionInclusion(headers_path, block_height, block_checksum);

            // Prepare the local storage
            localStorage = new SPIXI.Storage.LocalStorage(Config.spixiUserFolder);

            customAppManager = new CustomAppManager(Config.spixiUserFolder);
        }
Exemple #4
0
        public Node()
        {
#if DEBUG
            Logging.warn("Testing language files");
            Lang.SpixiLocalization.testLanguageFiles("en-us");
#endif


            Logging.info("Initing node constructor");

            Instance = this;

            CoreConfig.simultaneousConnectedNeighbors = 6;

            IxianHandler.init(Config.version, this, Config.networkType);

            PeerStorage.init(Config.spixiUserFolder);

            // Init TIV
            tiv = new TransactionInclusion();

            Logging.info("Initing local storage");

            // Prepare the local storage
            localStorage = new SPIXI.Storage.LocalStorage(Config.spixiUserFolder);

            customAppManager = new CustomAppManager(Config.spixiUserFolder);

            FriendList.init(Config.spixiUserFolder);

            Logging.info("Node init done");

            string backup_file_name = Path.Combine(Config.spixiUserFolder, "spixi.account.backup.ixi");
            if (File.Exists(backup_file_name))
            {
                File.Delete(backup_file_name);
            }
        }