This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
pragma solidity ^0.6.6; | |
contract BankContract { | |
struct client_account{ | |
int client_id; | |
address client_address; | |
uint client_balance_in_ether; | |
} | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!doctype html> | |
<html lang="en"> | |
<head> | |
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.5.1/jquery.min.js"></script> | |
<script> | |
$(document).ready(function(){ | |
$("#get").click(function(){ | |
$.get("http://localhost/services/pokemon", function(data, status){ | |
console.log(data); | |
$("#list").empty(); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
version: '3.8' | |
services: | |
frontend: | |
container_name: frontend | |
image: nginx-frontend | |
build: | |
context: ./frontend | |
ports: | |
- "80:80" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[ApiController] | |
[Produces("application/json")] | |
[Route("api/[controller]/[action]")] | |
public class MyController : Controller { | |
... | |
private readonly MyBackgroundService _myBackgroundService; | |
public MyController(HostedService hostedService) | |
{ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public IServiceProvider ConfigureServices(IServiceCollection services) | |
{ | |
... | |
services.AddSingleton<ReadFromURLProvider>(); | |
services.AddSingleton<HostedService, MyBackgroundService>(); | |
... | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class ReadFromURLProvider | |
{ | |
private const string fileURL = | |
"https://gist.githubusercontent.com/armgilles/194bcff35001e7eb53a2a8b441e8b2c6/raw/92200bc0a673d5ce2110aaad4544ed6c4010f687/pokemon.csv"; | |
private readonly HttpClient _httpClient; | |
public GetURLAndUpdateProvider() | |
{ | |
_httpClient = new HttpClient(); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class MyBackgroundService : HostedService | |
{ | |
private readonly ReadFromURLProvider _readFromURLProvider; | |
public MyBackgroundService(IServiceProvider serviceProvider, ReadFromURLProvider readFromURLprovider) : base(serviceProvider) | |
{ | |
_readFromURLProvider = readFromURLProvider; | |
} | |
public async override Task ExecuteAsync(CancellationToken cancellationToken) | |
{ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public abstract class HostedService : IHostedService | |
{ | |
private Task _executingTask; | |
private CancellationTokenSource _cts; | |
private object serviceProvider; | |
protected HostedService(object serviceProvider) | |
{ | |
this.serviceProvider = serviceProvider; | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var express = require('express'); | |
var bodyParser = require('body-parser'); | |
var app = express(); | |
app.use(bodyParser.json()); | |
// Setting for Hyperledger Fabric | |
const { Wallets, FileSystemWallet, Gateway } = require('fabric-network'); | |
const path = require('path'); | |
const fs = require('fs'); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"name": "burakcan-network-be1", | |
"version": "1.0.0", | |
"client": { | |
"organization": "Burakcan1", | |
"connection": { | |
"timeout": { | |
"peer": { | |
"endorser": "300" | |
} |
NewerOlder