-
Notifications
You must be signed in to change notification settings - Fork 2
/
Program.cs
31 lines (26 loc) · 1 KB
/
Program.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
using Shim;
using Microsoft.Extensions.Logging;
using Microsoft.Extensions.Logging.Configuration;
using Microsoft.Extensions.Logging.Console;
namespace fabric_chaincode_csharp
{
class Program
{
static void Main(string[] args)
{
using var loggerFactory = LoggerFactory.Create(builder =>
{
builder
.AddFilter("Microsoft", LogLevel.Warning)
.AddFilter("System", LogLevel.Warning)
.AddFilter("NonHostConsoleApp.Program", LogLevel.Debug)
.AddConsole();
});
ILogger logger = loggerFactory.CreateLogger<Program>();
string? address = Environment.GetEnvironmentVariable("CHAINCODE_SERVER_ADDRESS");
string? chaincodeId = Environment.GetEnvironmentVariable("CHAINCODE_ID");
ChaincodeServer server = new ChaincodeServer(chaincodeId, address, new Test.AssetTransfer(), logger);
server.Start();
}
}
}