Skip to content

A C# library for blockchain RPC - focusing on MultiChain

License

Notifications You must be signed in to change notification settings

cleancoindev/multichain-1

 
 

Repository files navigation

LucidOcean.MultiChain Assembly

The library is an unofficial wrapper for multichain_cli JSON RPC. Refer to https://www.multichain.com/developers/json-rpc-api/ for more information on each JSON RPC call and how it is used.

Follow these instructions to create your own chain. https://www.multichain.com/developers/creating-connecting/

The Source is in Visual Studio 2017. The compiled Assemblies is targeting netstandard_2_0 and 4.5.1 NUGET: https://www.nuget.org/packages/LucidOcean.MultiChain/0.0.0.9

This library divides the calls into

  • MultiChainClient.Address
  • MultiChainClient.Asset
  • MultiChainClient.Block
  • MultiChainClient.Peer
  • MultiChainClient.Permission
  • MultiChainClient.Transaction
  • MultiChainClient.Utility
  • MultiChainClient.Wallet
  • MultiChainClient.Stream

example usage:

MultiChainConnection connection = new MultiChainConnection()
            {
                Hostname = "IP",
                Port = 100,
                Username = "multichainrpc",
                Password = "password",
                ChainName = "chain1",
                BurnAddress = "address",
                RootNodeAddress = "address"
            };
            
MultiChainClient _Client = new MultiChainClient(connection);
response = _Client.Wallet.GetNewAddress();

There are sync and async versions.

Issue and Send an Asset

MultiChainConnection connection = new MultiChainConnection()
            {
                Hostname = "IP",
                Port = 100,
                Username = "multichainrpc",
                Password = "password",
                ChainName = "chain1",
                BurnAddress = "address",
                RootNodeAddress = "address"
            };
            
MultiChainClient _Client = new MultiChainClient(connection);
JsonRpcResponse<string> response = _Client.Asset.Issue(issueAddress, assetName, quantity, units);
_Client.Asset.Send(toAddress, assetName, amount);

//Use SendAssetFrom to specify an address FROM and and address To

Using List

    _Client.Asset.ListAssetsAsync(assetName,true);

Issue and Subscribe

    var response = _Client.Asset.Issue(fromAddress, new { name = assetName, open = true }, 10, 1, asset);
    _Client.Asset.Subscribe(response.Result, true);

MultiChain Explorer

- MultiChain explorer running on C# ASP.NET MVC 5.2.3
- Change connection details in LucidOcean.MultiChain.Explorer.Data.ExplorerSettings to connect the explorer to your node.  
    * This works the same as seen in example of issue and sending of an asset.    

About

A C# library for blockchain RPC - focusing on MultiChain

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • C# 57.9%
  • JavaScript 37.6%
  • HTML 4.4%
  • Other 0.1%