Skip to content

Commit 0698649

Browse files
committed
Lab 2
1 parent 1216c78 commit 0698649

File tree

6 files changed

+46
-6
lines changed

6 files changed

+46
-6
lines changed

.gitignore

+3-1
Original file line numberDiff line numberDiff line change
@@ -297,5 +297,7 @@ node_modules/
297297
coverage/
298298
npm-debug.log
299299
dist/
300-
*/build/*.*
301300
Lab 2/Solidity/contracts/build/
301+
Tools/testchain/devChain/geth/chaindata/
302+
Tools/testchain/devChain/geth/lightchaindata/
303+
Tools/testchain/devChain/geth/

Common/Solidity/templates/cs-service-interface.ejs

+1-1
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ namespace <%= locals.namespace ? namespace : 'DefaultNamespace' %>
1010
{
1111
public interface I<%= capitalizeFirstLetter(getContractName()) %>Service
1212
{
13-
Task<bool> ExecuteTransactionAsync(Func<Task<string>> func, int timeoutInSeconds = 120);
13+
Task<bool> ExecuteTransactionAsync(Func<I<%= capitalizeFirstLetter(getContractName()) %>Service, Task<string>> func, int timeoutInSeconds = 120);
1414

1515
<%= abi.forEach(generateGetFunction) %>
1616
<%= abi.forEach(generateGetEvent) %>

Common/Solidity/templates/cs-service.ejs

+2-2
Original file line numberDiff line numberDiff line change
@@ -38,9 +38,9 @@ namespace <%= locals.namespace ? namespace : 'DefaultNamespace' %>
3838
_contract = _web3.Eth.GetContract(ABI, address);
3939
}
4040

41-
public async Task<bool> ExecuteTransactionAsync(Func<Task<string>> func, int timeoutInSeconds = 120)
41+
public async Task<bool> ExecuteTransactionAsync(Func<I<%= capitalizeFirstLetter(getContractName()) %>Service, Task<string>> func, int timeoutInSeconds = 120)
4242
{
43-
string transaction = await func();
43+
string transaction = await func(this);
4444
var receipt = await _web3.Eth.Transactions.GetTransactionReceipt.SendRequestAsync(transaction).ConfigureAwait(false);
4545

4646
int count = 0;

Lab 0/README.md

+23-1
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,10 @@
22

33
The following tools and software needs to be installed:
44

5+
## Git
6+
7+
- Install [git](https://git-scm.com/) to clone this github project.
8+
59
## Node
610

711
- Install NPM and Node.js (<https://nodejs.org/en/>), version 7 or greater.
@@ -22,4 +26,22 @@ Install the following the following extensions in Visual Studio Code:
2226

2327
## .NET Core 2
2428

25-
Install latest .NET Core SDK (2.0 or higher) from <https://www.microsoft.com/net/download/windows>
29+
Install latest .NET Core SDK (2.0 or higher) from <https://www.microsoft.com/net/download/windows>
30+
31+
## Steps
32+
33+
### Git Clone
34+
35+
Clone this project using **git**:
36+
37+
- make a folder where you want to download this project
38+
- go to that folder
39+
- execute this command in the command-prompt:
40+
41+
``` x
42+
git clone https://github.com/mstack/bootcamp-blockchain-smartcontracts
43+
```
44+
45+
### Or download
46+
47+
- Just download this project as a zip-file and extract that zip-file into the folder.

Lab 2/ConsoleApp/Program.cs

+3
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,9 @@ private static async Task TestService(string fromAddress, string password)
4040
Console.WriteLine($"Deploying contract done, address = {contractAddress}");
4141

4242
ISimpleStorageContractService service = new SimpleStorageContractService(web3, contractAddress);
43+
44+
// TODO 1:
45+
// await service.ExecuteTransactionAsync((srv) => srv.SetNumberAsync(fromAddress, 500));
4346
}
4447
}
4548
}

Lab 2/README.md

+14-1
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,20 @@ SimpleStorageContract: generate C# implementations
9292

9393
### Step 6
9494

95-
Now open the `Lab 2\ConsoleApp` folder in Visual Code.
95+
Now open a new command terminal in Visual Code, and type:
96+
97+
- `cd Lab 2`
98+
- `cd ConsoleApp`
99+
- `dotnet build` (if all is fine, a restore should be done and the build should complete with 0 errors.)
96100

97101
### Step 7
98102

103+
Open the file `Lab 2\ConsoleApp\Program.cs` in Visual Code.
104+
105+
### Step 8
106+
107+
Now open a new command terminal in Visual Code, and type:
108+
109+
- `cd Tools`
110+
- `cd testchain`
111+
- `startheth.bat` (this command will start a local instance from Etherum VM using GO-Eth)

0 commit comments

Comments
 (0)