Skip to content

Commit

Permalink
9cutil-backend -> mimir (#39)
Browse files Browse the repository at this point in the history
  • Loading branch information
Atralupus authored May 7, 2024
1 parent 48e61cb commit 4f57dae
Show file tree
Hide file tree
Showing 70 changed files with 120 additions and 120 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/docker.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,9 @@ jobs:
strategy:
matrix:
docker:
- repo: planetariumhq/9cutil-backend
- repo: planetariumhq/mimir
dockerfile: Dockerfile
- repo: planetariumhq/9cutil-backend-store
- repo: planetariumhq/mimir-store
dockerfile: Dockerfile.Store
steps:
-
Expand Down
12 changes: 6 additions & 6 deletions .vscode/launch.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,21 +2,21 @@
"version": "0.2.0",
"configurations": [
{
"name": "Debug NineChroniclesUtilBackend",
"name": "Debug Mimir",
"type": "coreclr",
"request": "launch",
"program": "${workspaceFolder}/NineChroniclesUtilBackend/bin/Debug/net8.0/NineChroniclesUtilBackend.dll",
"cwd": "${workspaceFolder}/NineChroniclesUtilBackend",
"program": "${workspaceFolder}/Mimir/bin/Debug/net8.0/Mimir.dll",
"cwd": "${workspaceFolder}/Mimir",
"stopAtEntry": false,
"console": "internalConsole",
"preLaunchTask": "build-backend"
},
{
"name": "Debug NineChroniclesUtilBackend.Store",
"name": "Debug Mimir.Store",
"type": "coreclr",
"request": "launch",
"program": "${workspaceFolder}/NineChroniclesUtilBackend.Store/bin/Debug/net8.0/NineChroniclesUtilBackend.Store.dll",
"cwd": "${workspaceFolder}/NineChroniclesUtilBackend.Store",
"program": "${workspaceFolder}/Mimir.Store/bin/Debug/net8.0/Mimir.Store.dll",
"cwd": "${workspaceFolder}/Mimir.Store",
"stopAtEntry": false,
"console": "internalConsole",
"preLaunchTask": "build-store",
Expand Down
12 changes: 6 additions & 6 deletions .vscode/tasks.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
"type": "process",
"args": [
"build",
"${workspaceFolder}/NineChroniclesUtilBackend/NineChroniclesUtilBackend.csproj",
"${workspaceFolder}/Mimir/Mimir.csproj",
"/property:GenerateFullPaths=true",
"/consoleloggerparameters:NoSummary"
],
Expand All @@ -19,7 +19,7 @@
"type": "process",
"args": [
"publish",
"${workspaceFolder}/NineChroniclesUtilBackend/NineChroniclesUtilBackend.csproj",
"${workspaceFolder}/Mimir/Mimir.csproj",
"/property:GenerateFullPaths=true",
"/consoleloggerparameters:NoSummary"
],
Expand All @@ -33,7 +33,7 @@
"watch",
"run",
"--project",
"${workspaceFolder}/NineChroniclesUtilBackend/NineChroniclesUtilBackend.csproj"
"${workspaceFolder}/Mimir/Mimir.csproj"
],
"problemMatcher": "$msCompile"
},
Expand All @@ -43,7 +43,7 @@
"type": "process",
"args": [
"build",
"${workspaceFolder}/NineChroniclesUtilBackend.Store/NineChroniclesUtilBackend.Store.csproj",
"${workspaceFolder}/Mimir.Store/Mimir.Store.csproj",
"/property:GenerateFullPaths=true",
"/consoleloggerparameters:NoSummary"
],
Expand All @@ -55,7 +55,7 @@
"type": "process",
"args": [
"publish",
"${workspaceFolder}/NineChroniclesUtilBackend.Store/NineChroniclesUtilBackend.Store.csproj",
"${workspaceFolder}/Mimir.Store/Mimir.Store.csproj",
"/property:GenerateFullPaths=true",
"/consoleloggerparameters:NoSummary"
],
Expand All @@ -69,7 +69,7 @@
"watch",
"run",
"--project",
"${workspaceFolder}/NineChroniclesUtilBackend.Store/NineChroniclesUtilBackend.Store.csproj"
"${workspaceFolder}/Mimir.Store/Mimir.Store.csproj"
],
"problemMatcher": "$msCompile"
}
Expand Down
8 changes: 4 additions & 4 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -6,21 +6,21 @@ WORKDIR /app
# Copy everything else and build
COPY . ./
RUN dotnet tool restore
RUN dotnet graphql generate NineChroniclesUtilBackend
RUN dotnet graphql generate Mimir
RUN <<EOF
#!/bin/bash
echo "TARGETPLATFROM=$TARGETPLATFORM"
echo "BUILDPLATFORM=$BUILDPLATFORM"
if [[ "$TARGETPLATFORM" = "linux/amd64" ]]
then
dotnet publish NineChroniclesUtilBackend/NineChroniclesUtilBackend.csproj \
dotnet publish Mimir/Mimir.csproj \
-c Release \
-r linux-x64 \
-o out \
--self-contained
elif [[ "$TARGETPLATFORM" = "linux/arm64" ]]
then
dotnet publish NineChroniclesUtilBackend/NineChroniclesUtilBackend.csproj \
dotnet publish Mimir/Mimir.csproj \
-c Release \
-r linux-arm64 \
-o out \
Expand All @@ -43,4 +43,4 @@ RUN apt-get update \
libc6-dev jq curl \
&& rm -rf /var/lib/apt/lists/*

ENTRYPOINT ["dotnet", "NineChroniclesUtilBackend.dll"]
ENTRYPOINT ["dotnet", "Mimir.dll"]
8 changes: 4 additions & 4 deletions Dockerfile.Store
Original file line number Diff line number Diff line change
Expand Up @@ -6,21 +6,21 @@ WORKDIR /app
# Copy everything else and build
COPY . ./
RUN dotnet tool restore
RUN dotnet graphql generate NineChroniclesUtilBackend.Store
RUN dotnet graphql generate Mimir.Store
RUN <<EOF
#!/bin/bash
echo "TARGETPLATFROM=$TARGETPLATFORM"
echo "BUILDPLATFORM=$BUILDPLATFORM"
if [[ "$TARGETPLATFORM" = "linux/amd64" ]]
then
dotnet publish NineChroniclesUtilBackend.Store/NineChroniclesUtilBackend.Store.csproj \
dotnet publish Mimir.Store/Mimir.Store.csproj \
-c Release \
-r linux-x64 \
-o out \
--self-contained
elif [[ "$TARGETPLATFORM" = "linux/arm64" ]]
then
dotnet publish NineChroniclesUtilBackend.Store/NineChroniclesUtilBackend.Store.csproj \
dotnet publish Mimir.Store/Mimir.Store.csproj \
-c Release \
-r linux-arm64 \
-o out \
Expand All @@ -43,4 +43,4 @@ RUN apt-get update \
libc6-dev jq curl \
&& rm -rf /var/lib/apt/lists/*

ENTRYPOINT ["dotnet", "NineChroniclesUtilBackend.Store.dll"]
ENTRYPOINT ["dotnet", "Mimir.Store.dll"]
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,11 @@
using HeadlessGQL;
using Libplanet.Crypto;
using Libplanet.Types.Tx;
using NineChroniclesUtilBackend.Store.Models;
using NineChroniclesUtilBackend.Store.Scrapper;
using NineChroniclesUtilBackend.Store.Services;
using Mimir.Store.Models;
using Mimir.Store.Scrapper;
using Mimir.Store.Services;

namespace NineChroniclesUtilBackend.Store;
namespace Mimir.Store;

public class BlockPoller(IStateService stateService, HeadlessGQLClient headlessGqlClient, MongoDbStore mongoDbStore)
{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
namespace NineChroniclesUtilBackend.Store;
namespace Mimir.Store;

public class Configuration
{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
using NineChroniclesUtilBackend.Store.Models;
using Mimir.Store.Models;

namespace NineChroniclesUtilBackend.Store.Events;
namespace Mimir.Store.Events;

public class ArenaDataCollectedEventArgs : EventArgs
{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
using HeadlessGQL;
using NineChroniclesUtilBackend.Store.Scrapper;
using NineChroniclesUtilBackend.Store.Services;
using Mimir.Store.Scrapper;
using Mimir.Store.Services;

namespace NineChroniclesUtilBackend.Store;
namespace Mimir.Store;

public class Initializer : BackgroundService
{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
namespace NineChroniclesUtilBackend.Store.Models;
namespace Mimir.Store.Models;

public class BlockResponse
{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
using Libplanet.Crypto;

namespace NineChroniclesUtilBackend.Store.Models;
namespace Mimir.Store.Models;

public class ScrapperResult
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
using Nekoyume.TableData;
using Libplanet.Crypto;

namespace NineChroniclesUtilBackend.Store.Models;
namespace Mimir.Store.Models;

public class ArenaData : BaseData
{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
using Nekoyume.Model.State;

namespace NineChroniclesUtilBackend.Store.Models;
namespace Mimir.Store.Models;

public class AvatarData : BaseData
{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
using Newtonsoft.Json;
using NineChroniclesUtilBackend.Store.Util;
using Mimir.Store.Util;

namespace NineChroniclesUtilBackend.Store.Models;
namespace Mimir.Store.Models;

public class BaseData
{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
namespace NineChroniclesUtilBackend.Store.Models;
namespace Mimir.Store.Models;

public class StateResponse
{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
using Libplanet.Crypto;

namespace NineChroniclesUtilBackend.Store.Models;
namespace Mimir.Store.Models;

public class StoreResult
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<TargetFramework>net8.0</TargetFramework>
<Nullable>enable</Nullable>
<ImplicitUsings>enable</ImplicitUsings>
<UserSecretsId>dotnet-NineChroniclesUtilBackend.Store-bccda56f-4d38-484b-ab03-ebb26065c837</UserSecretsId>
<UserSecretsId>dotnet-Mimir.Store-bccda56f-4d38-484b-ab03-ebb26065c837</UserSecretsId>
</PropertyGroup>

<ItemGroup>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@
using System.Net.Http.Headers;
using System.Text;
using Microsoft.IdentityModel.Tokens;
using NineChroniclesUtilBackend.Store;
using NineChroniclesUtilBackend.Store.Services;
using Mimir.Store;
using Mimir.Store.Services;
using Microsoft.Extensions.Options;

var builder = Host.CreateApplicationBuilder(args);
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"$schema": "http://json.schemastore.org/launchsettings.json",
"profiles": {
"NineChroniclesUtilBackend.Store": {
"Mimir.Store": {
"commandName": "Project",
"dotnetRunMessages": true,
"environmentVariables": {
Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
using NineChroniclesUtilBackend.Store.Events;
using NineChroniclesUtilBackend.Store.Services;
using NineChroniclesUtilBackend.Store.Models;
using Mimir.Store.Events;
using Mimir.Store.Services;
using Mimir.Store.Models;
using Nekoyume.TableData;
using Libplanet.Crypto;

namespace NineChroniclesUtilBackend.Store.Scrapper;
namespace Mimir.Store.Scrapper;

public class ArenaScrapper(ILogger<ArenaScrapper> logger, IStateService service, MongoDbStore store)
{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
using NineChroniclesUtilBackend.Store.Services;
using Mimir.Store.Services;
using Libplanet.Crypto;
using Bencodex.Types;
using Nekoyume.TableData;
Expand All @@ -8,9 +8,9 @@
using Nekoyume.Model.Item;
using Nekoyume.Model.State;
using Nekoyume.Model.Arena;
using NineChroniclesUtilBackend.Store.Models;
using Mimir.Store.Models;

namespace NineChroniclesUtilBackend.Store.Scrapper;
namespace Mimir.Store.Scrapper;

public class StateGetter
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
using Libplanet.Types.Blocks;
using StrawberryShake;

namespace NineChroniclesUtilBackend.Store.Services;
namespace Mimir.Store.Services;

public class HeadlessStateService(IHeadlessGQLClient client) : IStateService
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
using Bencodex.Types;
using Libplanet.Crypto;

namespace NineChroniclesUtilBackend.Store.Services;
namespace Mimir.Store.Services;

public interface IStateService
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@
using Libplanet.Crypto;
using MongoDB.Bson;
using MongoDB.Driver;
using NineChroniclesUtilBackend.Store.Models;
using Mimir.Store.Models;

namespace NineChroniclesUtilBackend.Store.Services;
namespace Mimir.Store.Services;

public class MongoDbStore
{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
using NineChroniclesUtilBackend.Store.Scrapper;
using Mimir.Store.Scrapper;

namespace NineChroniclesUtilBackend.Store.Services;
namespace Mimir.Store.Services;

public static class StateServiceExtensions
{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
using System.Numerics;
using Newtonsoft.Json;

namespace NineChroniclesUtilBackend.Store.Util;
namespace Mimir.Store.Util;

public class BigIntegerToStringConverter : JsonConverter
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
using Bencodex;
using Bencodex.Types;

namespace NineChroniclesUtilBackend.Store.Util;
namespace Mimir.Store.Util;

public class StateJsonConverter : JsonConverter
{
Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
},
"Configuration": {
"MongoDbConnectionString": "mongodb://rootuser:rootpass@localhost:27017",
"DatabaseName": "9cutil_backend",
"DatabaseName": "mimir",
"HeadlessEndpoint": "https://9c-main-full-state.nine-chronicles.com/graphql"
}
}
File renamed without changes.
File renamed without changes.
4 changes: 2 additions & 2 deletions NineChroniclesUtilBackend.sln → Mimir.sln
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@ Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio Version 17
VisualStudioVersion = 17.0.31903.59
MinimumVisualStudioVersion = 10.0.40219.1
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "NineChroniclesUtilBackend", "NineChroniclesUtilBackend\NineChroniclesUtilBackend.csproj", "{1909E492-D010-4FB5-BC4B-DEF73025C41E}"
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Mimir", "Mimir\Mimir.csproj", "{1909E492-D010-4FB5-BC4B-DEF73025C41E}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "NineChroniclesUtilBackend.Store", "NineChroniclesUtilBackend.Store\NineChroniclesUtilBackend.Store.csproj", "{462CDFD3-650B-46A7-A937-8E3BCE7E527C}"
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Mimir.Store", "Mimir.Store\Mimir.Store.csproj", "{462CDFD3-650B-46A7-A937-8E3BCE7E527C}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Expand Down
File renamed without changes.
Loading

0 comments on commit 4f57dae

Please sign in to comment.