Skip to content

RoseLeBlood/libnode

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

40 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

libnode

Namespace: ASF.Node

A generic node system for C# under LGPL for dotnet core.

Example BlockChain

using System;
using System.Text.Json;
using System.Text.Json.Serialization;
using ASF.Node;
using ASF.Node.Block;

namespace nodechain {
    public class Program {
        static Guid ProgramGuid { get; set; } = new Guid ("9eccdf50-edc0-474a-bab6-2424c71a4f4e");
        static Guid NewOwnerGuid { get; } = new Guid ("35090297-22b8-44ed-b4ab-4c09f84e9b64");

        static void Main (string[] args) {
            Int32SiblingBlockChain chain = new Int32SiblingBlockChain (43,
                "55BF63AB1141E9AE52EBDB9A386D19DABB1C8F142426315332548C55AF71496686465DC4248EA595BAD996A0AA09B06226F9CD2E85E30A3B2F7339D2B680C540",
                ProgramGuid);

            chain.Transfer ("55BF63AB1141E9AE52EBDB9A386D19DABB1C8F142426315332548C55AF71496686465DC4248EA595BAD996A0AA09B06226F9CD2E85E30A3B2F7339D2B680C540",
                ProgramGuid, NewOwnerGuid);

            for (int i = 0; i < 4; i++) {
                chain.Add (new SHA512SiblingBlockEntry<Int32> (i, ProgramGuid));
            }
            Console.WriteLine("{");
            Console.WriteLine ("\"TestChain\": [\n {0}\n]", chain.ToString ());
            Console.WriteLine("}");
        }
    }
}

Ausgabe:

{
"TestChain": [
 {
	"Data": "43",
	"TimeStamp": "1582020464,5822504",
	"Index": "0",
	"Hash": "55BF63AB1141E9AE52EBDB9A386D19DABB1C8F142426315332548C55AF71496686465DC4248EA595BAD996A0AA09B06226F9CD2E85E30A3B2F7339D2B680C540",
	"PrevHash": "",

	"Creater": "9eccdf50-edc0-474a-bab6-2424c71a4f4e",
	"Transfers": [
	{
	"Name": "TC:55BF63AB1141E9AE52EBDB9A386D19DABB1C8F142426315332548C55AF71496686465DC4248EA595BAD996A0AA09B06226F9CD2E85E30A3B2F7339D2B680C540:0",
	"Owner": "9eccdf50-edc0-474a-bab6-2424c71a4f4e",
	"TimeStamp": "1582020464,5822504",
	"Hash": "3AA81D9E9F5EBF7EE5D86CDD7836FC29BC45D6317B9D6CF07816DEE31A8BB66D9141023AB8872A84715A2ADC0684A2A8C04575600D44363166A48F51117297ED",
	"LastHash": ""
	},
	{
	"Name": "TC:55BF63AB1141E9AE52EBDB9A386D19DABB1C8F142426315332548C55AF71496686465DC4248EA595BAD996A0AA09B06226F9CD2E85E30A3B2F7339D2B680C540:1",
	"Owner": "35090297-22b8-44ed-b4ab-4c09f84e9b64",
	"TimeStamp": "1582020464,6191378",
	"Hash": "E07832F075E9D1E030F4B0D9B7D900406CE6A30E6CB5077A921E208A2ED89C45F3C4AA9DC8C4C7FB5E03F27545334DF539B00870D1EF36564301677BACCAE295",
	"LastHash": "3AA81D9E9F5EBF7EE5D86CDD7836FC29BC45D6317B9D6CF07816DEE31A8BB66D9141023AB8872A84715A2ADC0684A2A8C04575600D44363166A48F51117297ED"
	}]

},
{
	"Data": "0",
	"TimeStamp": "1582020464,621457",
	"Index": "1",
	"Hash": "167FC55C09EED95DAFD327284480232B426A1E976867D66BDE1FC37BA8C309553A7EF5E3C12F5BD4A3B0B428CF372BA9903F871B307BA9CBA5815469A8CCD50B",
	"PrevHash": "55BF63AB1141E9AE52EBDB9A386D19DABB1C8F142426315332548C55AF71496686465DC4248EA595BAD996A0AA09B06226F9CD2E85E30A3B2F7339D2B680C540",

	"Creater": "9eccdf50-edc0-474a-bab6-2424c71a4f4e",
	"Transfers": [
	{
	"Name": "TC:167FC55C09EED95DAFD327284480232B426A1E976867D66BDE1FC37BA8C309553A7EF5E3C12F5BD4A3B0B428CF372BA9903F871B307BA9CBA5815469A8CCD50B:2",
	"Owner": "9eccdf50-edc0-474a-bab6-2424c71a4f4e",
	"TimeStamp": "1582020464,621457",
	"Hash": "80825472A1E0BCB921E7722FD770B7B11841D7BE52762D9D5EB235147E8EC48A6DB32AF421F52E8623846BC6B10208EDCC89E3A0898F470EF0D1D3EB19B43943",
	"LastHash": ""
	}]

},
{
	"Data": "1",
	"TimeStamp": "1582020464,6243975",
	"Index": "2",
	"Hash": "0519491CFFD3AD124EE376693DF298960D3F6825CBB6E6417051068B63E8EE283A9DC09FDEB6750C60F0CA5FC1080156444781BD56755E186A987CBFBB4913B4",
	"PrevHash": "167FC55C09EED95DAFD327284480232B426A1E976867D66BDE1FC37BA8C309553A7EF5E3C12F5BD4A3B0B428CF372BA9903F871B307BA9CBA5815469A8CCD50B",

	"Creater": "9eccdf50-edc0-474a-bab6-2424c71a4f4e",
	"Transfers": [
	{
	"Name": "TC:0519491CFFD3AD124EE376693DF298960D3F6825CBB6E6417051068B63E8EE283A9DC09FDEB6750C60F0CA5FC1080156444781BD56755E186A987CBFBB4913B4:3",
	"Owner": "9eccdf50-edc0-474a-bab6-2424c71a4f4e",
	"TimeStamp": "1582020464,6243975",
	"Hash": "AA79BB241FD2A5C96935183495C07353D4D3D918F1147E2599E9CB08EBAFBCB0EB0928E76A9B2104E6162F7FAE8D3D95D3DFDF0067B9808711BA92A25EB4B53E",
	"LastHash": ""
	}]

},
{
	"Data": "2",
	"TimeStamp": "1582020464,6244557",
	"Index": "3",
	"Hash": "27E473AE5812975540DEE43B571EB896AD75F0827370B7F4E4C3A7B9C459B4FFD5E22270CFF934B667B53FC1DB7F7785E6726D4F998764F570DC15D3C4ED166F",
	"PrevHash": "0519491CFFD3AD124EE376693DF298960D3F6825CBB6E6417051068B63E8EE283A9DC09FDEB6750C60F0CA5FC1080156444781BD56755E186A987CBFBB4913B4",

	"Creater": "9eccdf50-edc0-474a-bab6-2424c71a4f4e",
	"Transfers": [
	{
	"Name": "TC:27E473AE5812975540DEE43B571EB896AD75F0827370B7F4E4C3A7B9C459B4FFD5E22270CFF934B667B53FC1DB7F7785E6726D4F998764F570DC15D3C4ED166F:4",
	"Owner": "9eccdf50-edc0-474a-bab6-2424c71a4f4e",
	"TimeStamp": "1582020464,6244557",
	"Hash": "04CA43B310888174833401F60506261F3024B5E9300BC4C8E59D9389D5AB483D82C444051878AE678D265ED12BA9DA66B52C4303C8AC03389F8C558014FB4421",
	"LastHash": ""
	}]

},
{
	"Data": "3",
	"TimeStamp": "1582020464,6244876",
	"Index": "4",
	"Hash": "1C0F05691ADB2EDC4A4BEAF4CAC09F0D78B48F16FD5D530EED21BD8C9687FF0500B52E34A239AC1B3E11F1961E22057272F6296E787D436B9629C625E6A6B000",
	"PrevHash": "27E473AE5812975540DEE43B571EB896AD75F0827370B7F4E4C3A7B9C459B4FFD5E22270CFF934B667B53FC1DB7F7785E6726D4F998764F570DC15D3C4ED166F",

	"Creater": "9eccdf50-edc0-474a-bab6-2424c71a4f4e",
	"Transfers": [
	{
	"Name": "TC:1C0F05691ADB2EDC4A4BEAF4CAC09F0D78B48F16FD5D530EED21BD8C9687FF0500B52E34A239AC1B3E11F1961E22057272F6296E787D436B9629C625E6A6B000:5",
	"Owner": "9eccdf50-edc0-474a-bab6-2424c71a4f4e",
	"TimeStamp": "1582020464,6244876",
	"Hash": "443C4B8BAE763984218F1FFE3756234C71575B63DFABB45B7072E2173FE145571B78128D626D89A0D6AFBA59BD4B9258D0C0B70EEE6A501F007CF7DD497BC787",
	"LastHash": ""
	}]

}
]
}

Releases

No releases published

Packages

No packages published

Languages