Ferrite icon indicating copy to clipboard operation
Ferrite copied to clipboard

buiding on mac

Open johndpope opened this issue 2 years ago • 5 comments

not sure why - but project is not happy. Screen Shot 2022-08-21 at 11 17 58 pm

had to delete .env to get it to progress - but then...

build 9/13] COPY [Ferrite.Core/Ferrite.Core.csproj, Ferrite.Core/] 0.0s => ERROR [build 10/13] RUN dotnet restore "Ferrite/Ferrite.csproj" 3.6s

[build 10/13] RUN dotnet restore "Ferrite/Ferrite.csproj": #0 2.129 Determining projects to restore... #0 2.135 Skipping project "/src/Ferrite.Services/Ferrite.Services.csproj" because it was not found. #0 3.202 Skipping project "/src/Ferrite.Services/Ferrite.Services.csproj" because it was not found. #0 3.290 Skipping project "/src/Ferrite.Services/Ferrite.Services.csproj" because it was not found. #0 3.346 Skipping project "/src/Ferrite.Services/Ferrite.Services.csproj" because it was not found. #0 3.394 /usr/share/dotnet/sdk/6.0.400/Sdks/Microsoft.NET.Sdk/targets/Microsoft.NET.TargetFrameworkInference.targets(144,5): error NETSDK1045: The current .NET SDK does not support targeting .NET 7.0. Either target .NET 6.0 or lower, or use a version of the .NET SDK that supports .NET 7.0. [/src/Ferrite.Transport/Ferrite.Transport.csproj] #0 3.401 /usr/share/dotnet/sdk/6.0.400/Sdks/Microsoft.NET.Sdk/targets/Microsoft.NET.TargetFrameworkInference.targets(144,5): error NETSDK1045: The current .NET SDK does not support targeting .NET 7.0. Either target .NET 6.0 or lower, or use a version of the .NET SDK that supports .NET 7.0. [/src/Ferrite.Crypto/Ferrite.Crypto.csproj] #0 3.404 /usr/share/dotnet/sdk/6.0.400/Sdks/Microsoft.NET.Sdk/targets/Microsoft.NET.TargetFrameworkInference.targets(144,5): error NETSDK1045: The current .NET SDK does not support targeting .NET 7.0. Either target .NET 6.0 or lower, or use a version of the .NET SDK that supports .NET 7.0. [/src/Ferrite.TL/Ferrite.TL.csproj] #0 3.412 /usr/share/dotnet/sdk/6.0.400/Sdks/Microsoft.NET.Sdk/targets/Microsoft.NET.TargetFrameworkInference.targets(144,5): error NETSDK1045: The current .NET SDK does not support targeting .NET 7.0. Either target .NET 6.0 or lower, or use a version of the .NET SDK that supports .NET 7.0. [/src/Ferrite.Utils/Ferrite.Utils.csproj] #0 3.414 /usr/share/dotnet/sdk/6.0.400/Sdks/Microsoft.NET.Sdk/targets/Microsoft.NET.TargetFrameworkInference.targets(144,5): error NETSDK1045: The current .NET SDK does not support targeting .NET 7.0. Either target .NET 6.0 or lower, or use a version of the .NET SDK that supports .NET 7.0. [/src/Ferrite/Ferrite.csproj] #0 3.420 /usr/share/dotnet/sdk/6.0.400/Sdks/Microsoft.NET.Sdk/targets/Microsoft.NET.TargetFrameworkInference.targets(144,5): error NETSDK1045: The current .NET SDK does not support targeting .NET 7.0. Either target .NET 6.0 or lower, or use a version of the .NET SDK that supports .NET 7.0. [/src/Ferrite.Data/Ferrite.Data.csproj] #0 3.425 /usr/share/dotnet/sdk/6.0.400/Sdks/Microsoft.NET.Sdk/targets/Microsoft.NET.TargetFrameworkInference.targets(144,5): error NETSDK1045: The current .NET SDK does not support targeting .NET 7.0. Either target .NET 6.0 or lower, or use a version of the .NET SDK that supports .NET 7.0. [/src/Ferrite.Core/Ferrite.Core.csproj]


failed to solve: executor failed running [/bin/sh -c dotnet restore "Ferrite/Ferrite.csproj"]: exit code: 1

johndpope avatar Aug 21 '22 13:08 johndpope

I myself have stopped using docker compose a while ago so it might be why. I currently am using Rider on a Mac(x64). I am starting up Redis, Cassandra, MinIO and ElasticSearch then the Ferrite console app. But let me try to add some build instructions and also fix the docker build.

aykutalparslan avatar Aug 21 '22 13:08 aykutalparslan

I have updated the README and removed the docker files temporarily. Will be adding docker support in the near future.

aykutalparslan avatar Aug 21 '22 16:08 aykutalparslan

the infrastructure needed to run - it makes sense to run in docker - and run the c# server on local machine. I just installed rider - it seems you've invested a lot of time into this - how do you know which APIs 300 that are not implemented? have you considered using something like supabase to stand on top of gotrue / auth layer - notifications / social sign ups etc? supabase is built on postgres - and postgresREST which gives you a basic CRUD out of the box that would simplify api controller development in my opinion. you can have all the logic in stored procedure - and invoke that from client using their libraries.

is there an openapi schema - or http archive of captured traffic for telegram ? how do you know there's 300 api methods?

I checked out code - and ran project with rider - but hit these errors. googling didn't help.. is it a special setting in rider?

UPDATE Screen Shot 2022-08-22 at 11 06 50 am

Screen Shot 2022-08-22 at 11 06 44 am

johndpope avatar Aug 22 '22 00:08 johndpope

The project uses .NET 7 preview 7. Should have added that to the README too sorry. It made sense at the time because I believe the framework will be released before the project is usable. It's a preview language feature UTF8StringLiterals.

Regarding the other questions:

  • I have indeed invested a lot of time into the project in the last 6 months but I think in another 6 months it will be worth it when I can finally deploy a usable server. I actually started building another Telegram-Server in Java back in 2015 but never got to complete it. The API varied a lot(different layers) between iOS, Android and Desktop apps back then. Now all the major apps use the same API layer with minor differences and the APIs like messages.sendMessage should not change as often.
  • Telegram has -always had actually- an open API. You can also read the source of the apps if the documentation for the API method is ambiguous.
  • Most of the API has open issues organized into milestones here. That's how I keep track and there's currently a little over 320. There were a couple of new layers of the API released since I started development so 300 is a rough estimate reflecting that. I close and issue when I've implemented that particular API method.
  • Currently project has a IKVStore contract which is easy to add a new data stores for like Cassandra and RocksDB. Then it becomes trivial to create a MessageRepository. I am currently refactoring the old code into this pattern. The reasoning behind this comes from the scenarios I have in mind. I want to be able to deploy the project in a single container which would be possible with RocksDB, a custom in memory cache, Lucene and local file system. If someone wanted to run a service for say 100000 users then PostgreSQL or MariaDB would make sense. It would be however easier to scale IMHO if we had something like Cassandra at the persistence layer. Redis and ElasticSearch would be essential for any real world deployment. We can look at other alternatives for MinIO but most would be more complicated.
  • supabase seems cool. I'll investigate if adding it as an alternative data/object store will reduce the complexity of the aforementioned architecture.

aykutalparslan avatar Aug 22 '22 07:08 aykutalparslan

Please see the updated README for a link to a modified Android App as well.

aykutalparslan avatar Aug 22 '22 09:08 aykutalparslan

This infrastructure is not needed anymore. Details are in the README.

aykutalparslan avatar Sep 25 '22 20:09 aykutalparslan