コード例 #1
0
    // Use this for initialization
    async void Start()
    {
        LndHelper.SetupEnvironmentVariables();
        if (readConfig)
        {
            config = LndHelper.ReadConfigFile(Application.dataPath + "/Resources/" + confname);
        }
        else
        {
            config = new LndConfig {
                Hostname = hostname, Port = port, MacaroonFile = macaroonFile, TlsFile = certFile
            };
        }
        if (config.Neutrino)
        {
            var neutrino = gameObject.AddComponent <NeutrinoTest>() as NeutrinoTest;
            neutrino.StartLnd(config);
            NeutrinoUnlock();
        }
        else
        {
            cert = File.ReadAllText(Application.dataPath + "/Resources/" + config.TlsFile);

            mac = LndHelper.ToHex(File.ReadAllBytes(Application.dataPath + "/Resources/" + config.MacaroonFile));
            await ConnectToLndWithMacaroon(config.Hostname + ":" + config.Port, cert, mac);

            OnInvoiceSettled += new InvoiceSettledEventHandler(ChangeWeather);

            SubscribeInvoices();

            var getInfo = await GetInfo();

            pubkey = getInfo.IdentityPubkey;
        }
    }
コード例 #2
0
    async void Start()
    {
        if (readConfig)
        {
            config = readConfigFile(Application.dataPath + "/Resources/donnertanks.conf");
            Debug.Log(config.WebServerPort);
        }
        else
        {
            config = new DonnerTanksConfig {
                Hostname = hostname, Port = port, MacaroonFile = macaroonFile, TlsFile = certFile
            };
        }
        LndHelper.SetupEnvironmentVariables();

        cert = File.ReadAllText(Application.dataPath + "/Resources/" + config.TlsFile);

        mac = LndHelper.ToHex(File.ReadAllBytes(Application.dataPath + "/Resources/" + config.MacaroonFile));

        //await ConnectToLnd(hostname + ":" + port, cert);
        await ConnectToLndWithMacaroon(hostname + ":" + port, cert, mac);

        OnInvoiceSettled += new InvoiceSettledEventHandler(ReadInvoice);
        SubscribeInvoices();
        var getInfo = await GetInfo();

        pubkey = getInfo.IdentityPubkey;
        webServer.StartServer(config.WebServerIp, config.WebServerPort);
    }
コード例 #3
0
    // Use this for initialization
    async void Start()
    {
        if (readConfig)
        {
            config = LndHelper.ReadConfigFile(Application.dataPath + "/Resources/donner.conf");
        }
        else
        {
            config = new LndConfig {
                Hostname = hostname, Port = port, MacaroonFile = macaroonFile, TlsFile = certFile
            };
        }
        LndHelper.SetupEnvironmentVariables();
        cert = File.ReadAllText(Application.dataPath + "/Resources/" + config.TlsFile);

        mac = LndHelper.ToHex(File.ReadAllBytes(Application.dataPath + "/Resources/" + config.MacaroonFile));


        await ConnectToLndWithMacaroon(config.Hostname + ":" + config.Port, cert, mac);

        OnInvoiceSettled += new InvoiceSettledEventHandler(ChangeWeather);

        SubscribeInvoices();

        var getInfo = await GetInfo();

        pubkey = getInfo.IdentityPubkey;
    }