Skip to content

Commit

Permalink
Merge pull request #123 from aklenik/update-ethereum-network
Browse files Browse the repository at this point in the history
Update Ethereum and HL Besu network examples
  • Loading branch information
nklincoln authored Oct 8, 2020
2 parents cbbc731 + 733bba6 commit c590899
Show file tree
Hide file tree
Showing 20 changed files with 47 additions and 217 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ launch.json

# Limited npm runtime artifacts
node_modules/*
package.json
package-lock.json

src/fabric/samples/fabcar/java
Expand Down
2 changes: 1 addition & 1 deletion benchmarks/scenario/simple/config.yaml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
simpleArgs: &simple-args
initialMoney: 10000
moneyToTransfer: 100
numberOfAccounts: &number-of-accounts 100
numberOfAccounts: &number-of-accounts 1000

test:
name: simple
Expand Down
2 changes: 1 addition & 1 deletion benchmarks/scenario/smallbank/create.js
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ class Create extends OperationBase {
* @return {Promise<TxStatus[]>}
*/
async submitTransaction() {
const createArgs = this.smallbank.getOpenAccountArguments();
const createArgs = this.smallbank.getCreateAccountArguments();
const request = this.createConnectorRequest('create_account', createArgs);
await this.sutAdapter.sendRequests(request);
}
Expand Down
2 changes: 1 addition & 1 deletion networks/besu/1node-clique/caliper-besu-clique.Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
# limitations under the License.
#

FROM hyperledger/besu:1.4
FROM hyperledger/besu:latest
COPY ./data/ /root/
VOLUME [ "/root/.ethereum/keystore/" ]
ENTRYPOINT [ "/opt/besu/bin/besu", "--genesis-file=/root/genesis.json", "--node-private-key-file=/root/.ethereum/keystore/key" ]
10 changes: 8 additions & 2 deletions networks/besu/1node-clique/data/genesis.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,13 @@
{
"config": {
"chainId": 48122,
"istanbulBlock": 0,
"homesteadBlock": 1,
"eip150Block": 2,
"eip150Hash": "0x0000000000000000000000000000000000000000000000000000000000000000",
"eip155Block": 3,
"eip158Block": 3,
"byzantiumBlock": 4,
"constantinopleBlock": 5,
"clique": {
"blockperiodseconds": 5,
"epoch": 30000
Expand All @@ -10,7 +16,7 @@
"nonce": "0x0",
"timestamp": "0x5ca916c6",
"extraData": "0x0000000000000000000000000000000000000000000000000000000000000000c0A8e4D217eB85b812aeb1226fAb6F588943C2C20000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000",
"gasLimit": "0x2faf080",
"gasLimit": "0x47b760",
"difficulty": "0x1",
"mixHash": "0x0000000000000000000000000000000000000000000000000000000000000000",
"coinbase": "0xc0A8e4D217eB85b812aeb1226fAb6F588943C2C2",
Expand Down
3 changes: 2 additions & 1 deletion networks/besu/1node-clique/docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ services:
container_name: besu_clique
volumes:
- ./keys:/root/.ethereum/keystore
- ./data:/root
ports:
- 8545-8547:8545-8547
command: --revert-reason-enabled --rpc-http-enabled --rpc-http-host 0.0.0.0 --host-whitelist=* --rpc-http-apis admin,eth,miner,web3,net --graphql-http-enabled --discovery-enabled=false
command: --revert-reason-enabled --rpc-ws-enabled --rpc-ws-host 0.0.0.0 --host-whitelist=* --rpc-ws-apis admin,eth,miner,web3,net --graphql-http-enabled --discovery-enabled=false
14 changes: 7 additions & 7 deletions networks/besu/1node-clique/networkconfig.json
Original file line number Diff line number Diff line change
@@ -1,22 +1,22 @@
{
"caliper": {
"blockchain": "ethereum",
"command": {
"start": "docker-compose -f networks/besu/1node-clique/docker-compose.yml up -d && sleep 30",
"end": "docker-compose -f networks/besu/1node-clique/docker-compose.yml down"
}
"command" : {
"start": "docker-compose -f ./networks/besu/1node-clique/docker-compose.yml up -d && sleep 60",
"end" : "docker-compose -f ./networks/besu/1node-clique/docker-compose.yml down"
}
},
"ethereum": {
"url": "http://localhost:8545",
"url": "ws://localhost:8546",
"contractDeployerAddress": "0xD1cf9D73a91DE6630c2bb068Ba5fDdF9F0DEac09",
"contractDeployerAddressPrivateKey": "0x797c13f7235c627f6bd013dc17fff4c12213ab49abcf091f77c83f16db10e90b",
"fromAddressSeed": "0x3f841bf589fdf83a521e55d51afddc34fa65351161eead24f064855fc29c9580",
"transactionConfirmationBlocks": 2,
"contracts": {
"simple": {
"path": "src/besu/simple/simple.json",
"path": "./src/ethereum/simple/simple.json",
"estimateGas": true,
"gas": {
"open": 45000,
"query": 100000,
"transfer": 70000
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
Expand All @@ -9,9 +10,10 @@
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#

FROM ethereum/client-go:stable
COPY ./data/ /root/
VOLUME [ "/root/.ethereum/keystore/" ]
RUN geth --nousb init /root/genesis.json && geth --nousb import /root/bc.dat
ENTRYPOINT [ "geth" ]
ENTRYPOINT [ "geth" ]
17 changes: 8 additions & 9 deletions networks/ethereum/1node-clique/data/genesis.json
Original file line number Diff line number Diff line change
@@ -1,14 +1,13 @@
{
"config": {
"chainId": 48122,
"istanbulBlock": 0,
"petersburgBlock": 0,
"constantinopleBlock": 0,
"byzantiumBlock": 0,
"eip158Block": 0,
"eip155Block": 0,
"eip150Block": 0,
"homesteadBlock": 0,
"homesteadBlock": 1,
"eip150Block": 2,
"eip150Hash": "0x0000000000000000000000000000000000000000000000000000000000000000",
"eip155Block": 3,
"eip158Block": 3,
"byzantiumBlock": 4,
"constantinopleBlock": 5,
"clique": {
"period": 5,
"epoch": 30000
Expand All @@ -17,7 +16,7 @@
"nonce": "0x0",
"timestamp": "0x5ca916c6",
"extraData": "0x0000000000000000000000000000000000000000000000000000000000000000c0A8e4D217eB85b812aeb1226fAb6F588943C2C20000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000",
"gasLimit": "0x2faf080",
"gasLimit": "0x47b760",
"difficulty": "0x1",
"mixHash": "0x0000000000000000000000000000000000000000000000000000000000000000",
"coinbase": "0xc0A8e4D217eB85b812aeb1226fAb6F588943C2C2",
Expand Down
8 changes: 5 additions & 3 deletions networks/ethereum/1node-clique/docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,13 @@
version: "3"
services:
node:
build: .
build:
context: .
dockerfile: caliper-ethereum-clique.Dockerfile
image: caliper-ethereum-clique
container_name: ethereum_clique
volumes:
- ./keys:/root/.ethereum/keystore
ports:
- 8545:8545
command: --unlock 0xc0A8e4D217eB85b812aeb1226fAb6F588943C2C2 --password /root/.ethereum/keystore/password --mine --minerthreads 2 --etherbase 0xc0A8e4D217eB85b812aeb1226fAb6F588943C2C2 --rpc --rpcaddr 0.0.0.0 --rpcvhosts=* --rpcapi admin,eth,miner,personal,web3 --allow-insecure-unlock --nodiscover --gasprice 1
- 8546:8546
command: --unlock 0xc0A8e4D217eB85b812aeb1226fAb6F588943C2C2 --password /root/.ethereum/keystore/password --mine --minerthreads 2 --etherbase 0xc0A8e4D217eB85b812aeb1226fAb6F588943C2C2 --ws --wsaddr 0.0.0.0 --wsorigins='*' --wsapi admin,eth,miner,personal,web3 --allow-insecure-unlock --nodiscover --gasprice 1
Original file line number Diff line number Diff line change
Expand Up @@ -2,21 +2,26 @@
"caliper": {
"blockchain": "ethereum",
"command" : {
"start": "docker-compose -f networks/ethereum/1node-clique/docker-compose.yml up -d && sleep 3",
"end" : "docker-compose -f networks/ethereum/1node-clique/docker-compose.yml down"
"start": "docker-compose -f ./networks/ethereum/1node-clique/docker-compose.yml up -d && sleep 60s",
"end" : "docker-compose -f ./networks/ethereum/1node-clique/docker-compose.yml down"
}
},
"ethereum": {
"url": "http://localhost:8545",
"url": "ws://localhost:8546",
"contractDeployerAddress": "0xc0A8e4D217eB85b812aeb1226fAb6F588943C2C2",
"contractDeployerAddressPassword": "password",
"fromAddress": "0xc0A8e4D217eB85b812aeb1226fAb6F588943C2C2",
"fromAddressPassword": "password",
"transactionConfirmationBlocks": 2,
"contracts": {
"simple": {
"path": "src/ethereum/simple/simple.json"
"path": "./src/ethereum/simple/simple.json",
"estimateGas": true,
"gas": {
"query": 100000,
"transfer": 70000
}
}
}
}
}
}
17 changes: 0 additions & 17 deletions networks/ethereum/1node/Dockerfile

This file was deleted.

Binary file removed networks/ethereum/1node/data/bc.dat
Binary file not shown.
29 changes: 0 additions & 29 deletions networks/ethereum/1node/data/genesis.json

This file was deleted.

25 changes: 0 additions & 25 deletions networks/ethereum/1node/docker-compose.yml

This file was deleted.

22 changes: 0 additions & 22 deletions networks/ethereum/1node/ethereum.json

This file was deleted.

This file was deleted.

1 change: 0 additions & 1 deletion networks/ethereum/1node/keys/password

This file was deleted.

73 changes: 0 additions & 73 deletions src/besu/simple/simple.json

This file was deleted.

18 changes: 0 additions & 18 deletions src/besu/simple/simple.sol

This file was deleted.

0 comments on commit c590899

Please sign in to comment.