public SwarmTest(ITestOutputHelper output) { Log.Logger = new LoggerConfiguration() .MinimumLevel.Debug() .Enrich.WithThreadId() .WriteTo.TestOutput(output, outputTemplate: "{Timestamp:HH:mm:ss}[@{SwarmId}][{ThreadId}] - {Message}") .CreateLogger() .ForContext <SwarmTest>(); var policy = new BlockPolicy <BaseAction>(); _fx1 = new FileStoreFixture(); _fx2 = new FileStoreFixture(); _fx3 = new FileStoreFixture(); _blockchains = new List <BlockChain <BaseAction> > { new BlockChain <BaseAction>(policy, _fx1.Store), new BlockChain <BaseAction>(policy, _fx2.Store), new BlockChain <BaseAction>(policy, _fx3.Store), }; _swarms = new List <Swarm> { new Swarm( new PrivateKey(), ipAddress: IPAddress.Loopback), new Swarm( new PrivateKey(), ipAddress: IPAddress.Loopback), new Swarm( new PrivateKey(), ipAddress: IPAddress.Loopback), }; }
public BlockChainTest() { _fx = new FileStoreFixture(); _blockChain = new BlockChain <BaseAction>( new BlockPolicy <BaseAction>(), _fx.Store ); }
public MineBlock() { _fx = new FileStoreFixture(); _blockChain = new BlockChain <DumbAction>( new NullPolicy <DumbAction>(), _fx.Store ); }
public SwarmTest(ITestOutputHelper output) { const string outputTemplate = "{Timestamp:HH:mm:ss}[@{SwarmId}][{ThreadId}] - {Message}"; Log.Logger = new LoggerConfiguration() .MinimumLevel.Debug() .Enrich.WithThreadId() .WriteTo.TestOutput(output, outputTemplate: outputTemplate) .CreateLogger() .ForContext <SwarmTest>(); _output = output; var policy = new BlockPolicy <DumbAction>(new MinerReward(1)); _fx1 = new FileStoreFixture(); _fx2 = new FileStoreFixture(); _fx3 = new FileStoreFixture(); _blockchains = new List <BlockChain <DumbAction> > { new BlockChain <DumbAction>(policy, _fx1.Store), new BlockChain <DumbAction>(policy, _fx2.Store), new BlockChain <DumbAction>(policy, _fx3.Store), }; _swarms = new List <Swarm <DumbAction> > { new Swarm <DumbAction>( _blockchains[0], new PrivateKey(), appProtocolVersion: 1, host: IPAddress.Loopback.ToString()), new Swarm <DumbAction>( _blockchains[1], new PrivateKey(), appProtocolVersion: 1, host: IPAddress.Loopback.ToString()), new Swarm <DumbAction>( _blockchains[2], new PrivateKey(), appProtocolVersion: 1, host: IPAddress.Loopback.ToString()), }; }
public SwarmTest(ITestOutputHelper output) { Log.Logger = new LoggerConfiguration() .MinimumLevel.Verbose() .Enrich.WithThreadId() .WriteTo.TestOutput(output, outputTemplate: "{Timestamp:HH:mm:ss}[@{Swarm_listenUrl}][{ThreadId}] - {Message}") .CreateLogger() .ForContext <SwarmTest>(); var policy = new BlockPolicy <BaseAction>(); _fx1 = new FileStoreFixture(); _fx2 = new FileStoreFixture(); _fx3 = new FileStoreFixture(); _blockchains = new List <BlockChain <BaseAction> > { new BlockChain <BaseAction>(policy, _fx1.Store), new BlockChain <BaseAction>(policy, _fx2.Store), new BlockChain <BaseAction>(policy, _fx3.Store), }; _swarms = new List <Swarm> { new Swarm( new PrivateKey(), new Uri($"inproc://swarmtest.a"), 3000), new Swarm( new PrivateKey(), new Uri($"inproc://swarmtest.b"), 3000), new Swarm( new PrivateKey(), new Uri($"inproc://swarmtest.c"), 3000), }; }
public BlockchainTest() { _fx = new FileStoreFixture(); _blockchain = new Blockchain <BaseAction>(_fx.Store); }