Skip to content
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
351 changes: 345 additions & 6 deletions neo.sln

Large diffs are not rendered by default.

3 changes: 2 additions & 1 deletion src/Neo/Sign/SignException.cs
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ public class SignException : Exception
/// Initializes a new instance of the <see cref="SignException"/> class.
/// </summary>
/// <param name="message">The message that describes the error.</param>
public SignException(string message) : base(message) { }
/// <param name="cause">The cause of the exception.</param>
public SignException(string message, Exception cause = null) : base(message, cause) { }
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@
using Neo.Network.P2P.Payloads;
using Neo.Plugins.DBFTPlugin.Messages;
using Neo.Plugins.DBFTPlugin.Types;
using Neo.Sign;
using System;
using System.Buffers.Binary;
using System.Collections.Generic;
Expand Down
55 changes: 55 additions & 0 deletions src/Plugins/SignClient/Settings.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
// Copyright (C) 2015-2025 The Neo Project.
//
// Settings.cs file belongs to the neo project and is free
// software distributed under the MIT software license, see the
// accompanying file LICENSE in the main directory of the
// repository or http://www.opensource.org/licenses/mit-license.php
// for more details.
//
// Redistribution and use in source and binary forms with or without
// modifications are permitted.

using Microsoft.Extensions.Configuration;

namespace Neo.Plugins.SignClient
{
public class Settings : PluginSettings
{
public const string SectionName = "PluginConfiguration";
private const string DefaultEndpoint = "http://127.0.0.1:9991";

/// <summary>
/// The name of the sign client(i.e. Signer).
/// </summary>
public readonly string Name;

/// <summary>
/// The host of the sign client(i.e. Signer).
/// </summary>
public readonly string Endpoint;

public Settings(IConfigurationSection section) : base(section)
{
Name = section.GetValue("Name", "SignClient");

// Only support local host at present, so host always is "127.0.0.1" or "::1" now.
Endpoint = section.GetValue("Endpoint", DefaultEndpoint);
}

public static Settings Default
{
get
{
var section = new ConfigurationBuilder()
.AddInMemoryCollection(new Dictionary<string, string?>
{
[SectionName + ":Name"] = "SignClient",
[SectionName + ":Endpoint"] = DefaultEndpoint
})
.Build()
.GetSection(SectionName);
return new Settings(section);
}
}
}
}
Loading