0

I am a beginner with EOSIO. I may make a mistake in code. I installed eos-sharp in the visual studio using the NuGet package. My code is as below:

using EosSharp;
using EosSharp.Core;
using EosSharp.Core.Providers;
using System.Windows.Forms;

namespace eostest
{
    public partial class Form1 : Form
    {
        Eos eos = new Eos(new EosConfigurator()
        {
            HttpEndpoint = "https://127.0.0.1:8888",
            ChainId = "cf057bbfb72640471fd910bcb67639c22df9f92470936cddc1ade0e2f2e7dc4f",
            ExpireSeconds = 60,
            SignProvider = new DefaultSignProvider("myprivatekey")
        });

        public Form1()
        {
            InitializeComponent();
            getinfo();
        }

        public async void getinfo()
        {
            var result = await eos.GetInfo();
        }
    }
}

Nodeos is running on the localhost. I confirmed by using http://localhost:8888/v1/chain/get_info which shows output. When I run this program, nothing happens. After 1:40 minutes it throws an exception as below:

This exception was originally thrown at this call stack: System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(System.Threading.Tasks.Task) System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(System.Threading.Tasks.Task) System.Runtime.CompilerServices.TaskAwaiter.GetResult() EosSharp.HttpHandler.SendAsync(System.Net.Http.HttpRequestMessage) in HttpHelper.cs System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(System.Threading.Tasks.Task) System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(System.Threading.Tasks.Task) System.Runtime.CompilerServices.TaskAwaiter.GetResult() EosSharp.HttpHandler.GetJsonAsync(string) in HttpHelper.cs System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(System.Threading.Tasks.Task) System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(System.Threading.Tasks.Task) ... [Call Stack Truncated]

How would I confirm whether the parameters are correct and the chain is connected or not? Any help would be appreciated.

0

I solved this with a minor change. My bad! I just changed

HttpEndpoint = "https://127.0.0.1:8888",

to

HttpEndpoint = "http://127.0.0.1:8888",

and it worked. Everything is running fine now.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.