Skip to content
Open
Show file tree
Hide file tree
Changes from all 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
25 changes: 25 additions & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
**/.classpath
**/.dockerignore
**/.env
**/.git
**/.gitignore
**/.project
**/.settings
**/.toolstarget
**/.vs
**/.vscode
**/*.*proj.user
**/*.dbmdl
**/*.jfm
**/azds.yaml
**/bin
**/charts
**/docker-compose*
**/Dockerfile*
**/node_modules
**/npm-debug.log
**/obj
**/secrets.dev.yaml
**/values.dev.yaml
LICENSE
README.md
16 changes: 5 additions & 11 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
@@ -1,22 +1,19 @@
name: publish

on:
pull_request:
branches:
- main
types: [closed]
push:
# Sequence of patterns matched against refs/tags
tags:
- '*'

jobs:
release:
name: Create draft release
if: github.event.pull_request.merged == true && startsWith(github.event.pull_request.head.ref, 'release/')
runs-on: ubuntu-latest
steps:
- name: Get tag
id: get_tag
env:
HEAD_REF: ${{ github.event.pull_request.head.ref }}
run: echo ::set-output name=tag::${HEAD_REF#release\/}
run: echo ::set-output name=tag::$(echo $GITHUB_REF | cut -d / -f 3)
- name: Create draft release
id: create_release
uses: actions/create-release@v1
Expand Down Expand Up @@ -44,7 +41,6 @@ jobs:
publish-linux:
name: Publish Linux
needs: [release]
if: github.event.pull_request.merged == true && startsWith(github.event.pull_request.head.ref, 'release/')
runs-on: ubuntu-latest

steps:
Expand Down Expand Up @@ -103,7 +99,6 @@ jobs:
publish-win:
name: Publish Windows
needs: [release]
if: github.event.pull_request.merged == true && startsWith(github.event.pull_request.head.ref, 'release/')
runs-on: ubuntu-latest

steps:
Expand Down Expand Up @@ -165,7 +160,6 @@ jobs:
publish-mac:
name: Publish macOS
needs: [release]
if: github.event.pull_request.merged == true && startsWith(github.event.pull_request.head.ref, 'release/')
runs-on: macos-latest

steps:
Expand Down
16 changes: 16 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -513,3 +513,19 @@ Add-Migration [MigrationName]
## Design

Tippy's page design is based on [mazipan/bulma-admin-dashboard-template](https://github.com/mazipan/bulma-admin-dashboard-template).

## Q&A

### I'm using Tippy in WSL and I can see the Tippy UI via localhost:5000, but the height is always 0

This is probably because you have proxy enabled. Try launching Tippy with the following command

```
unset HTTPS_PROXY HTTP_PROXY http_proxy https_proxy
path/to/Tippy
```

### Where can I find the CKB node data started with Tippy

- Linux: `~/.config/Tippy`
- Win: `~/ApplicationData/Tippy`
6 changes: 6 additions & 0 deletions Tippy.sln
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,8 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Ckb.Molecule", "src\Ckb.Mol
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Ckb.Molecule.Tests", "tests\Ckb.Molecule.Tests\Ckb.Molecule.Tests.csproj", "{3BD402C3-D2DC-4DA3-A3A2-AA880427FCF2}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Tippy.Shared", "src\Tippy.Shared\Tippy.Shared.csproj", "{8620ED2F-1A7D-47FD-B7AA-D76BC2E0E37A}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Expand Down Expand Up @@ -91,6 +93,10 @@ Global
{3BD402C3-D2DC-4DA3-A3A2-AA880427FCF2}.Debug|Any CPU.Build.0 = Debug|Any CPU
{3BD402C3-D2DC-4DA3-A3A2-AA880427FCF2}.Release|Any CPU.ActiveCfg = Release|Any CPU
{3BD402C3-D2DC-4DA3-A3A2-AA880427FCF2}.Release|Any CPU.Build.0 = Release|Any CPU
{8620ED2F-1A7D-47FD-B7AA-D76BC2E0E37A}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{8620ED2F-1A7D-47FD-B7AA-D76BC2E0E37A}.Debug|Any CPU.Build.0 = Debug|Any CPU
{8620ED2F-1A7D-47FD-B7AA-D76BC2E0E37A}.Release|Any CPU.ActiveCfg = Release|Any CPU
{8620ED2F-1A7D-47FD-B7AA-D76BC2E0E37A}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
Expand Down
31 changes: 31 additions & 0 deletions dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
#See https://aka.ms/containerfastmode to understand how Visual Studio uses this Dockerfile to build your images for faster debugging.
FROM nervos/ckb-docker-builder:bionic-rust-1.51.0 as ckb-docker-builder
WORKDIR /app
FROM mcr.microsoft.com/dotnet/aspnet:5.0 AS base
WORKDIR /app
EXPOSE 80

FROM mcr.microsoft.com/dotnet/sdk:5.0 AS build
WORKDIR /src
COPY ["src/Tippy/Tippy.csproj", "src/Tippy/"]
COPY ["src/Ckb.Molecule/Ckb.Molecule.csproj", "src/Ckb.Molecule/"]
COPY ["src/Ckb.Cryptography/Ckb.Cryptography.csproj", "src/Ckb.Cryptography/"]
COPY ["src/Ckb.Types/Ckb.Types.csproj", "src/Ckb.Types/"]
COPY ["src/Tippy.Shared/Tippy.Shared.csproj", "src/Tippy.Shared/"]
COPY ["src/Tippy.Ctrl/Tippy.Ctrl.csproj", "src/Tippy.Ctrl/"]
COPY ["src/Tippy.Core/Tippy.Core.csproj", "src/Tippy.Core/"]
COPY ["src/Ckb.Rpc/Ckb.Rpc.csproj", "src/Ckb.Rpc/"]
COPY ["src/Tippy.Util/Tippy.Util.csproj", "src/Tippy.Util/"]
COPY ["src/Ckb.Address/Ckb.Address.csproj", "src/Ckb.Address/"]
RUN dotnet restore "src/Tippy/Tippy.csproj"
COPY . .
WORKDIR "/src/src/Tippy"
RUN dotnet build "Tippy.csproj" -c Release -o /app/build

FROM build AS publish
RUN dotnet publish "Tippy.csproj" -c Release -o /app/publish

FROM base AS final
WORKDIR /app
COPY --from=publish /app/publish .
ENTRYPOINT ["dotnet", "Tippy.dll"]
3 changes: 2 additions & 1 deletion src/Ckb.Address/Ckb.Address.csproj
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFramework>netstandard2.0</TargetFramework>
<TargetFramework>net5.0</TargetFramework>
<Nullable>enable</Nullable>
<DebugType>embedded</DebugType>
</PropertyGroup>

Expand Down
8 changes: 7 additions & 1 deletion src/Ckb.Cryptography/Ckb.Cryptography.csproj
Original file line number Diff line number Diff line change
@@ -1,10 +1,16 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFramework>netstandard2.0</TargetFramework>
<TargetFramework>net5.0</TargetFramework>
<Nullable>enable</Nullable>
<DebugType>embedded</DebugType>
</PropertyGroup>

<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|AnyCPU'">
<DocumentationFile></DocumentationFile>
<GenerateSerializationAssemblies>Auto</GenerateSerializationAssemblies>
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Isopoh.Cryptography.Blake2b" Version="1.1.10" />
<PackageReference Include="Cryptography.ECDSA.Secp256K1" Version="1.1.3" />
Expand Down
8 changes: 8 additions & 0 deletions src/Ckb.Cryptography/Ckb.Cryptography.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

36 changes: 18 additions & 18 deletions src/Ckb.Cryptography/Secp256k1.cs
Original file line number Diff line number Diff line change
@@ -1,19 +1,19 @@
using System;
using Cryptography.ECDSA;

namespace Ckb.Cryptography
{
public static class Secp256k1
{
public static byte[] PrivateKeyToPublicKey(byte[] privateKey, bool compressed)
{
return Secp256K1Manager.GetPublicKey(privateKey, compressed);
}

public static string PrivateKeyToPublicKey(string privateKey, bool compressed)
{
var pk = HexStringToBytes(privateKey);
return BytesToHexString(PrivateKeyToPublicKey(pk, compressed));
using Cryptography.ECDSA;
namespace Ckb.Cryptography
{
public static class Secp256k1
{
public static byte[] PrivateKeyToPublicKey(byte[] privateKey, bool compressed)
{
return Secp256K1Manager.GetPublicKey(privateKey, compressed);
}
public static string PrivateKeyToPublicKey(string privateKey, bool compressed)
{
var pk = HexStringToBytes(privateKey);
return BytesToHexString(PrivateKeyToPublicKey(pk, compressed));
}

private static byte[] HexStringToBytes(string hex)
Expand All @@ -31,6 +31,6 @@ private static byte[] HexStringToBytes(string hex)
private static string BytesToHexString(byte[] bytes)
{
return "0x" + BitConverter.ToString(bytes).Replace("-", "").ToLower();
}
}
}
}
}
}
10 changes: 9 additions & 1 deletion src/Ckb.Molecule/Ckb.Molecule.csproj
Original file line number Diff line number Diff line change
@@ -1,11 +1,19 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFramework>netstandard2.0</TargetFramework>
<TargetFramework>net5.0</TargetFramework>
<Nullable>enable</Nullable>
<DebugType>embedded</DebugType>
</PropertyGroup>

<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|AnyCPU'">
<DocumentationFile></DocumentationFile>
<PlatformTarget>x64</PlatformTarget>
<GenerateSerializationAssemblies>Auto</GenerateSerializationAssemblies>
</PropertyGroup>

<ItemGroup>
<ProjectReference Include="..\Ckb.Cryptography\Ckb.Cryptography.csproj" />
<ProjectReference Include="..\Ckb.Types\Ckb.Types.csproj" />
</ItemGroup>

Expand Down
8 changes: 8 additions & 0 deletions src/Ckb.Molecule/Ckb.Molecule.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading