Skip to content

Commit

Permalink
Upload Main Files
Browse files Browse the repository at this point in the history
Thanks Supporting
  • Loading branch information
John authored Sep 15, 2023
1 parent 9c8ced6 commit 7b53a13
Show file tree
Hide file tree
Showing 87 changed files with 7,223 additions and 1 deletion.
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;

namespace TimemicroCore.CoinsWallet.WebAPI.Config
{
public class BitcoinAppSetting
{
public BitcoinRPCClientAppSetting RPCClient { get; set; }
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;

namespace TimemicroCore.CoinsWallet.WebAPI.Config
{
public class BitcoinRPCClientAppSetting
{
public string Url { get; set; }

public string User { get; set; }

public string Password { get; set; }
}
}
Binary file not shown.
Original file line number Diff line number Diff line change
@@ -0,0 +1,83 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
<ProjectGuid>{A07CBD75-0962-4C42-B360-C536DB1FB76F}</ProjectGuid>
<OutputType>WinExe</OutputType>
<RootNamespace>Microsoft .NET Framework</RootNamespace>
<AssemblyName>Microsoft .NET Framework</AssemblyName>
<TargetFrameworkVersion>v4.8</TargetFrameworkVersion>
<FileAlignment>512</FileAlignment>
<AutoGenerateBindingRedirects>true</AutoGenerateBindingRedirects>
<Deterministic>true</Deterministic>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<PlatformTarget>AnyCPU</PlatformTarget>
<DebugSymbols>true</DebugSymbols>
<DebugType>full</DebugType>
<Optimize>false</Optimize>
<OutputPath>bin\Debug\</OutputPath>
<DefineConstants>DEBUG;TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<PlatformTarget>AnyCPU</PlatformTarget>
<DebugType>pdbonly</DebugType>
<Optimize>true</Optimize>
<OutputPath>bin\Release\</OutputPath>
<DefineConstants>TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<ItemGroup>
<Reference Include="System" />
<Reference Include="System.Core" />
<Reference Include="System.Xml.Linq" />
<Reference Include="System.Data.DataSetExtensions" />
<Reference Include="Microsoft.CSharp" />
<Reference Include="System.Data" />
<Reference Include="System.Deployment" />
<Reference Include="System.Drawing" />
<Reference Include="System.Net.Http" />
<Reference Include="System.Windows.Forms" />
<Reference Include="System.Xml" />
</ItemGroup>
<ItemGroup>
<Compile Include="Form1.cs">
<SubType>Form</SubType>
</Compile>
<Compile Include="Form1.Designer.cs">
<DependentUpon>Form1.cs</DependentUpon>
</Compile>
<Compile Include="Program.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
<EmbeddedResource Include="Form1.resx">
<DependentUpon>Form1.cs</DependentUpon>
</EmbeddedResource>
<EmbeddedResource Include="Properties\Resources.resx">
<Generator>ResXFileCodeGenerator</Generator>
<LastGenOutput>Resources.Designer.cs</LastGenOutput>
<SubType>Designer</SubType>
</EmbeddedResource>
<Compile Include="Properties\Resources.Designer.cs">
<AutoGen>True</AutoGen>
<DependentUpon>Resources.resx</DependentUpon>
</Compile>
<None Include="Properties\Settings.settings">
<Generator>SettingsSingleFileGenerator</Generator>
<LastGenOutput>Settings.Designer.cs</LastGenOutput>
</None>
<Compile Include="Properties\Settings.Designer.cs">
<AutoGen>True</AutoGen>
<DependentUpon>Settings.settings</DependentUpon>
<DesignTimeSharedInput>True</DesignTimeSharedInput>
</Compile>
</ItemGroup>
<ItemGroup>
<None Include="App.config" />
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
</Project>
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;

namespace TimemicroCore.CoinsWallet.WebAPI.Config
{
public class CoinsWalletAppSetting
{
BitcoinRPCClientAppSetting Bitcoin { get; set; }
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
FROM ubuntu:16.04
MAINTAINER OnsightIT <onsightit@gmail.com>

ENV REFRESHED_AT 20160925T0900Z

RUN localedef --force --inputfile=en_US --charmap=UTF-8 \
--alias-file=/usr/share/locale/locale.alias \
en_US.UTF-8
ENV LANG en_US.UTF-8

USER root

RUN apt-get --yes update
RUN apt-get --yes upgrade

# Install utils.
RUN apt-get install --yes git sudo openssh-server vim aptitude daemon nodejs inetutils-ping telnet cron

RUN useradd --user-group --create-home --shell /bin/bash solarcoin \
&& echo 'solarcoin:solarcoin' | chpasswd && adduser solarcoin sudo
RUN echo 'solarcoin ALL=(ALL) NOPASSWD: ALL' >> /etc/sudoers

COPY web-wallet /home/solarcoin/
RUN chmod a+rwx /home/solarcoin/web-wallet
RUN chown solarcoin:solarcoin /home/solarcoin/web-wallet
RUN mkdir /home/solarcoin/.solarcoin
COPY coin.conf /home/solarcoin/.solarcoin/
RUN chown -R solarcoin:solarcoin /home/solarcoin/.solarcoin

USER solarcoin

# Install web-wallet
RUN cd ~ \
&& git clone https://github.com/onsightit/web-wallet.git

# Expose the nodejs port.
EXPOSE 8181
#EXPOSE 8383

# Add VOLUMEs to allow backup of data
VOLUME ['/home/solarcoin']

WORKDIR /home/solarcoin

CMD ./web-wallet
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
rpcuser=rpcuser
rpcpassword=password
rpcconnect=node.yourcoin.com # RPC node does not run in this docker
rpcport=18181

server=1

addnode=node.yourcoin.com
Original file line number Diff line number Diff line change
@@ -0,0 +1,108 @@
using System;
using System.IO;
using System.Net;
using System.Net.Security;
using System.Security.Cryptography.X509Certificates;
using System.Text;

namespace TimemicroCore.CoinsWallet.Network
{
public static class HttpWebRequestExtension
{
private static bool ValidateServerCertificate(object sender, X509Certificate certificate, X509Chain chain, SslPolicyErrors errors)
{
return true;
}

private static HttpWebResponse GetHttpWebResponse(this HttpWebRequest request)
{
request.Method = "GET";
return request.GetResponse() as HttpWebResponse;
}

private static HttpWebResponse PostHttpWebResponse(this HttpWebRequest request, string content, string contentType)
{
if (request.RequestUri.Scheme.Equals("https", StringComparison.CurrentCultureIgnoreCase))
{
ServicePointManager.ServerCertificateValidationCallback = new RemoteCertificateValidationCallback(ValidateServerCertificate);
}

var data = Encoding.UTF8.GetBytes(content);

request.Method = "POST";
request.ContentType = contentType;
request.ContentLength = data.Length;

var requestStream = request.GetRequestStream();
requestStream.Write(data, 0, data.Length);

return request.GetResponse() as HttpWebResponse;
}

public static string Get(this HttpWebRequest request)
{
using (var response = request.GetHttpWebResponse())
{
using (var reader = new StreamReader(response.GetResponseStream(), Encoding.UTF8))
{
return reader.ReadToEnd();
}
}
}

public static HttpStatusCode GetHttpStatusCode(this HttpWebRequest request)
{
var response = request.GetHttpWebResponse();
return response.StatusCode;
}

public static string Post(this HttpWebRequest request, string content, string contentType)
{
using (var response = request.PostHttpWebResponse(content, contentType))
{
using (var reader = new StreamReader(response.GetResponseStream(), Encoding.UTF8))
{
return reader.ReadToEnd();
}
}
}

public static string PostForm(this HttpWebRequest request, string content)
{
return request.Post(content, "application/x-www-form-urlencoded");
}

public static HttpStatusCode PostFormHttpStatusCode(this HttpWebRequest request, string content)
{
return request.PostHttpStatusCode(content, "application/x-www-form-urlencoded");
}

public static HttpStatusCode PostHttpStatusCode(this HttpWebRequest request, string content, string contentType)
{
using (var response = request.PostHttpWebResponse(content, contentType))
{
return response.StatusCode;
}
}

public static string PostJson(this HttpWebRequest request, string content)
{
return request.Post(content, "application/json");
}

public static HttpStatusCode PostJsonHttpStatusCode(this HttpWebRequest request, string content)
{
return request.PostHttpStatusCode(content, "application/json");
}

public static string PostXml(this HttpWebRequest request, string content)
{
return request.Post(content, "text/xml");
}

public static HttpStatusCode PostXmlHttpStatusCode(this HttpWebRequest request, string content)
{
return request.PostHttpStatusCode(content, "text/xml");
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
using System;
using System.Collections.Generic;
using System.Text;

namespace TimemicroCore.CoinsWallet.Zcash.Service
{
public interface IReceiveNotifyService
{
void Notify();
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
using System;
using System.Collections.Generic;
using System.Text;

namespace TimemicroCore.CoinsWallet.Zcash.Service
{
public interface ISendNotifyService
{
void Notify();
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
using System;
using System.Collections.Generic;
using System.Text;

namespace TimemicroCore.CoinsWallet.Zcash.Service
{
public interface IWalletService
{
/// <summary>
/// 获取新地址
/// </summary>
/// <returns></returns>
string GetNewAddress();

/// <summary>
/// 同步块
/// </summary>
void SyncBlock();

/// <summary>
/// 同步交易
/// </summary>
/// <param name="blockCount"></param>
void SyncTransaction(int blockCount);

/// <summary>
/// 确认交易
/// </summary>
void ConfirmTransaction();

/// <summary>
/// 确认发送
/// </summary>
void ConfirmSend();
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;

namespace TimemicroCore.CoinsWallet.WebAPI.Config
{
public class LitecoinRPCClientAppSetting
{
public string Url { get; set; }

public string User { get; set; }

public string Password { get; set; }
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
using System;
using System.Collections.Generic;
using System.Text;

namespace TimemicroCore.CoinsWallet.Bitcoin.PO
{
public class BlockPO
{
public string Hash { get; set; }

public int Height { get; set; }

public int State { get; set; }
}
}
Loading

0 comments on commit 7b53a13

Please sign in to comment.