Skip to content

Commit f500fcc

Browse files
Aspire Templates: Add nethereum-dapp template with EIP-6963 wallet chain validation, light-themed WebApp UI, and Foundry contract integration; update DevChain template and template pack to 6.0.4
1 parent ef3e25e commit f500fcc

86 files changed

Lines changed: 3054 additions & 3 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

aspire/templates/Nethereum.Aspire.TemplatePack/Nethereum.Aspire.TemplatePack.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<Project Sdk="Microsoft.NET.Sdk">
22
<PropertyGroup>
33
<PackageType>Template</PackageType>
4-
<PackageVersion>1.0.0</PackageVersion>
4+
<PackageVersion>1.0.3</PackageVersion>
55
<PackageId>Nethereum.Aspire.TemplatePack</PackageId>
66
<Title>Nethereum Aspire Templates</Title>
77
<Authors>Juan Blanco</Authors>
Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
1+
{
2+
"$schema": "http://json.schemastore.org/template",
3+
"author": "Nethereum",
4+
"classifications": ["Aspire", "Blockchain", "Ethereum", "dApp", "Solidity"],
5+
"identity": "Nethereum.Dapp.Aspire",
6+
"name": "Nethereum dApp Aspire Solution",
7+
"shortName": "nethereum-dapp",
8+
"description": "A complete dApp development environment with Solidity contracts, C# code generation, Blazor web UI, embedded TDD tests, integration tests, load generator, and Aspire-orchestrated DevChain + Indexer + Explorer.",
9+
"defaultName": "NethereumDapp",
10+
"preferNameDirectory": true,
11+
"tags": {
12+
"language": "C#",
13+
"type": "solution"
14+
},
15+
"sourceName": "NethereumDapp",
16+
"symbols": {
17+
"NethereumVersion": {
18+
"type": "parameter",
19+
"datatype": "string",
20+
"defaultValue": "6.0.3",
21+
"description": "Nethereum NuGet package version",
22+
"replaces": "NETHEREUM_VERSION"
23+
},
24+
"ChainId": {
25+
"type": "parameter",
26+
"datatype": "int",
27+
"defaultValue": "31337",
28+
"description": "Chain ID for the DevChain",
29+
"replaces": "CHAIN_ID_VALUE"
30+
},
31+
"AspireVersion": {
32+
"type": "parameter",
33+
"datatype": "string",
34+
"defaultValue": "13.1.1",
35+
"description": "Aspire SDK and hosting package version",
36+
"replaces": "ASPIRE_VERSION"
37+
}
38+
},
39+
"sources": [
40+
{
41+
"modifiers": [
42+
{
43+
"exclude": [
44+
"**/bin/**",
45+
"**/obj/**",
46+
"**/.vs/**",
47+
"contracts/lib/**",
48+
"contracts/cache/**"
49+
]
50+
}
51+
]
52+
}
53+
]
54+
}
Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
<Project Sdk="Microsoft.NET.Sdk">
2+
3+
<Sdk Name="Aspire.AppHost.Sdk" Version="ASPIRE_VERSION" />
4+
5+
<PropertyGroup>
6+
<OutputType>Exe</OutputType>
7+
<TargetFramework>net10.0</TargetFramework>
8+
<ImplicitUsings>enable</ImplicitUsings>
9+
<Nullable>enable</Nullable>
10+
<IsAspireHost>true</IsAspireHost>
11+
<UserSecretsId>NethereumDapp-apphost</UserSecretsId>
12+
</PropertyGroup>
13+
14+
<ItemGroup>
15+
<PackageReference Include="Aspire.Hosting.AppHost" Version="ASPIRE_VERSION" />
16+
<PackageReference Include="Aspire.Hosting.PostgreSQL" Version="ASPIRE_VERSION" />
17+
</ItemGroup>
18+
19+
<ItemGroup>
20+
<ProjectReference Include="..\DevChain\DevChain.csproj" />
21+
<ProjectReference Include="..\Indexer\Indexer.csproj" />
22+
<ProjectReference Include="..\Explorer\Explorer.csproj" />
23+
<ProjectReference Include="..\WebApp\WebApp.csproj" />
24+
<ProjectReference Include="..\LoadGenerator\LoadGenerator.csproj" />
25+
</ItemGroup>
26+
27+
</Project>
Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
var builder = DistributedApplication.CreateBuilder(args);
2+
3+
var postgresServer = builder.AddPostgres("postgres")
4+
.WithDataVolume("nethereum-pgdata");
5+
6+
var postgres = postgresServer.AddDatabase("nethereumdb");
7+
8+
var devchain = builder.AddProject<Projects.DevChain>("devchain");
9+
10+
var indexer = builder.AddProject<Projects.Indexer>("indexer")
11+
.WithReference(postgres)
12+
.WithReference(devchain)
13+
.WaitFor(devchain)
14+
.WaitFor(postgres);
15+
16+
var devAccountKey = builder.AddParameter("devAccountPrivateKey", secret: true);
17+
18+
var contractsOutPath = Path.GetFullPath(
19+
Path.Combine(builder.AppHostDirectory, "..", "contracts", "out"));
20+
var contractsSrcPath = Path.GetFullPath(
21+
Path.Combine(builder.AppHostDirectory, "..", "contracts"));
22+
23+
var explorer = builder.AddProject<Projects.Explorer>("explorer")
24+
.WithReference(postgres)
25+
.WithReference(devchain)
26+
.WaitFor(indexer)
27+
.WithEnvironment("Explorer__DevAccountPrivateKey", devAccountKey)
28+
.WithEnvironment("Explorer__EnablePendingTransactions", "true")
29+
.WithEnvironment("Explorer__AbiSources__LocalStorageEnabled", "true")
30+
.WithEnvironment("Explorer__AbiSources__LocalStoragePath", contractsOutPath)
31+
.WithEnvironment("Explorer__AbiSources__SourceBasePath", contractsSrcPath);
32+
33+
var webapp = builder.AddProject<Projects.WebApp>("webapp")
34+
.WithReference(devchain)
35+
.WaitFor(devchain);
36+
37+
var loadgenerator = builder.AddProject<Projects.LoadGenerator>("loadgenerator")
38+
.WithReference(devchain)
39+
.WaitFor(devchain);
40+
41+
builder.Build().Run();
Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
{
2+
"profiles": {
3+
"https": {
4+
"commandName": "Project",
5+
"dotnetRunMessages": true,
6+
"launchBrowser": true,
7+
"applicationUrl": "https://localhost:17178;http://localhost:15178",
8+
"environmentVariables": {
9+
"ASPNETCORE_ENVIRONMENT": "Development",
10+
"DOTNET_ENVIRONMENT": "Development",
11+
"DOTNET_DASHBOARD_OTLP_ENDPOINT_URL": "https://localhost:21147",
12+
"DOTNET_DASHBOARD_OTLP_HTTP_ENDPOINT_URL": "https://localhost:21148",
13+
"DOTNET_RESOURCE_SERVICE_ENDPOINT_URL": "https://localhost:22000",
14+
"DOTNET_ASPIRE_SHOW_DASHBOARD_RESOURCES": "true"
15+
}
16+
},
17+
"http": {
18+
"commandName": "Project",
19+
"dotnetRunMessages": true,
20+
"launchBrowser": true,
21+
"applicationUrl": "http://localhost:15178",
22+
"environmentVariables": {
23+
"ASPNETCORE_ENVIRONMENT": "Development",
24+
"DOTNET_ENVIRONMENT": "Development",
25+
"DOTNET_DASHBOARD_OTLP_ENDPOINT_URL": "http://localhost:19197",
26+
"DOTNET_DASHBOARD_OTLP_HTTP_ENDPOINT_URL": "http://localhost:19198",
27+
"DOTNET_RESOURCE_SERVICE_ENDPOINT_URL": "http://localhost:22000",
28+
"DOTNET_ASPIRE_SHOW_DASHBOARD_RESOURCES": "true"
29+
}
30+
}
31+
}
32+
}
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
{
2+
"Parameters": {
3+
"devAccountPrivateKey": "5de4111afa1a4b94908f83103eb1f1706367c2e68ca870fc3fb9a804cdab365a"
4+
}
5+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
<Project Sdk="Microsoft.NET.Sdk">
2+
3+
<PropertyGroup>
4+
<TargetFramework>net10.0</TargetFramework>
5+
<ImplicitUsings>enable</ImplicitUsings>
6+
<Nullable>enable</Nullable>
7+
<RootNamespace>NethereumDapp.ContractServices</RootNamespace>
8+
</PropertyGroup>
9+
10+
<ItemGroup>
11+
<PackageReference Include="Nethereum.Web3" Version="NETHEREUM_VERSION" />
12+
</ItemGroup>
13+
14+
</Project>

0 commit comments

Comments
 (0)