I am trying to build an application with LucidOcean C# API, in the command line the mulitichain node is active.
I am not sure if I am doing it in the right way, I create a C# applicationi and try to connect to this multichain node by using methods from API.
Here is my code,
MultiChainConnection connection = new MultiChainConnection()
{
Hostname = "127.0.0.1",
Port = 4336,
Username = "multichainrpc",
Password = "password",
ChainName = "chain1",
BurnAddress = "1XXXXXXXZXXXXXXXZMXXXXXXXqXXXXXXbYgmzH",
RootNodeAddress = "1TXfbuQzKGpDbTsAEAxdi7ZK5aUYTEVicUKWYT"
};
_Client = new MultiChainClient(connection);
...
...
public JsonRpcResponse<List<string>> GetAddressesAsync()
{
JsonRpcResponse<List<string>> response = null;
Task.Run(async () =>
{
response = await _Client.Wallet.GetAddressesAsync();
}).GetAwaiter().GetResult();
ResponseLogger<List<string>>.Log(response);
return response;
}
...
...
First question is, am I doing it in a right way?
2nd, How do I know if RPC is connected to the node?
3rd, how to solve "Unexpected character encountered while parsing value: <. Path '', line 0, position 0."
Thanks a lot if anybody could help me a little.