Esempio n. 1
0
        public CliHelper(string rpcUrl)
        {
            _keyStore           = new AElfKeyStore(ApplicationHelpers.GetDefaultDataDir());
            _accountManager     = new AccountManager(_keyStore);
            _transactionManager = new TransactionManager(_keyStore);
            _requestManager     = new RpcRequestManager(rpcUrl);
            _loadedModules      = new Dictionary <string, Module>();

            CommandList = new List <CommandInfo>();
        }
Esempio n. 2
0
        public static void InitCliCommand(string rpcUrl)
        {
            ScreenManager screenManager = new ScreenManager();
            CommandParser parser        = new CommandParser();

            AElfKeyStore   kstore  = new AElfKeyStore(ApplicationHelpers.GetDefaultDataDir());
            AccountManager manager = new AccountManager(kstore, screenManager);

            CliInstance = new AElfCliProgram(screenManager, parser, manager, rpcUrl);
            // Register local commands
            RegisterAccountCommands(CliInstance);
            RegisterNetworkCommands(CliInstance);

            CliInstance.RegisterCommand(new GetIncrementCmd());
            CliInstance.RegisterCommand(new SendTransactionCmd());
            CliInstance.RegisterCommand(new LoadContractAbiCmd());
            CliInstance.RegisterCommand(new DeployContractCommand());
            CliInstance.RegisterCommand(new GetTxResultCmd());
            CliInstance.RegisterCommand(new GetGenesisContractAddressCmd());
            CliInstance.RegisterCommand(new GetDeserializedResultCmd());
            CliInstance.RegisterCommand(new GetBlockHeightCmd());
        }
Esempio n. 3
0
 public SmartContractReader()
 {
     _dataDirectory = ApplicationHelpers.GetDefaultDataDir();
 }