Skip to content

feat: adapt to ethereum #3

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 6 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
27 changes: 27 additions & 0 deletions benchmark/ethInvoke/config.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
[engine]
rate = 10
duration = "10s"
cap = 5

[client]
script = "benchmark/ethInvoke/script.lua" # 脚本
type = "eth" # 区块链类型
contract = "benchmark/ethInvoke/contract" # 合约目录路径
config = "/Users/aiyoa/desktop/eth-test/data" # 区块链SDK配置路径
account = "UTC--2021-10-21T03-41-34.288690000Z--01eec173917c429901b41b98ac3dd300e060e698" #eth账户
args = [] # 合约参数路径

[client.options] # 客户端选项

[recorder.log]
dump=false
dir="./logs"
level="debug"

[recorder.csv]
dir="./csv"





407 changes: 407 additions & 0 deletions benchmark/ethInvoke/contract/Store.go

Large diffs are not rendered by default.

17 changes: 17 additions & 0 deletions benchmark/ethInvoke/contract/Store.sol
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
pragma solidity ^0.8.6;

contract Store {
event ItemSet(bytes32 key, bytes32 value);

string public version;
mapping (bytes32 => bytes32) public items;

constructor(string memory _version) public {
version = _version;
}

function setItem(bytes32 key, bytes32 value) external {
items[key] = value;
emit ItemSet(key, value);
}
}
1 change: 1 addition & 0 deletions benchmark/ethInvoke/contract/Store_sol_Store.abi
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
[{"inputs":[{"internalType":"string","name":"_version","type":"string"}],"stateMutability":"nonpayable","type":"constructor"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"bytes32","name":"key","type":"bytes32"},{"indexed":false,"internalType":"bytes32","name":"value","type":"bytes32"}],"name":"ItemSet","type":"event"},{"inputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"name":"items","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes32","name":"key","type":"bytes32"},{"internalType":"bytes32","name":"value","type":"bytes32"}],"name":"setItem","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"version","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"}]
1 change: 1 addition & 0 deletions benchmark/ethInvoke/contract/Store_sol_Store.bin
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
608060405234801561001057600080fd5b5060405161072138038061072183398181016040528101906100329190610162565b806000908051906020019061004892919061004f565b505061031a565b82805461005b90610234565b90600052602060002090601f01602090048101928261007d57600085556100c4565b82601f1061009657805160ff19168380011785556100c4565b828001600101855582156100c4579182015b828111156100c35782518255916020019190600101906100a8565b5b5090506100d191906100d5565b5090565b5b808211156100ee5760008160009055506001016100d6565b5090565b6000610105610100846101d0565b6101ab565b905082815260208101848484011115610121576101206102fa565b5b61012c848285610201565b509392505050565b600082601f830112610149576101486102f5565b5b81516101598482602086016100f2565b91505092915050565b60006020828403121561017857610177610304565b5b600082015167ffffffffffffffff811115610196576101956102ff565b5b6101a284828501610134565b91505092915050565b60006101b56101c6565b90506101c18282610266565b919050565b6000604051905090565b600067ffffffffffffffff8211156101eb576101ea6102c6565b5b6101f482610309565b9050602081019050919050565b60005b8381101561021f578082015181840152602081019050610204565b8381111561022e576000848401525b50505050565b6000600282049050600182168061024c57607f821691505b602082108114156102605761025f610297565b5b50919050565b61026f82610309565b810181811067ffffffffffffffff8211171561028e5761028d6102c6565b5b80604052505050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052602260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b600080fd5b600080fd5b600080fd5b600080fd5b6000601f19601f8301169050919050565b6103f8806103296000396000f3fe608060405234801561001057600080fd5b50600436106100415760003560e01c806348f343f31461004657806354fd4d5014610076578063f56256c714610094575b600080fd5b610060600480360381019061005b91906101c0565b6100b0565b60405161006d9190610275565b60405180910390f35b61007e6100c8565b60405161008b91906102b9565b60405180910390f35b6100ae60048036038101906100a991906101ed565b610156565b005b60016020528060005260406000206000915090505481565b600080546100d590610334565b80601f016020809104026020016040519081016040528092919081815260200182805461010190610334565b801561014e5780601f106101235761010080835404028352916020019161014e565b820191906000526020600020905b81548152906001019060200180831161013157829003601f168201915b505050505081565b8060016000848152602001908152602001600020819055507fe79e73da417710ae99aa2088575580a60415d359acfad9cdd3382d59c80281d4828260405161019f929190610290565b60405180910390a15050565b6000813590506101ba816103ab565b92915050565b6000602082840312156101d6576101d5610395565b5b60006101e4848285016101ab565b91505092915050565b6000806040838503121561020457610203610395565b5b6000610212858286016101ab565b9250506020610223858286016101ab565b9150509250929050565b610236816102f7565b82525050565b6000610247826102db565b61025181856102e6565b9350610261818560208601610301565b61026a8161039a565b840191505092915050565b600060208201905061028a600083018461022d565b92915050565b60006040820190506102a5600083018561022d565b6102b2602083018461022d565b9392505050565b600060208201905081810360008301526102d3818461023c565b905092915050565b600081519050919050565b600082825260208201905092915050565b6000819050919050565b60005b8381101561031f578082015181840152602081019050610304565b8381111561032e576000848401525b50505050565b6000600282049050600182168061034c57607f821691505b602082108114156103605761035f610366565b5b50919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052602260045260246000fd5b600080fd5b6000601f19601f8301169050919050565b6103b4816102f7565b81146103bf57600080fd5b5056fea264697066735822122005a5951e5067dae6b917ec5a4c3ccb95f0179d7371d220df636bc264a789ee6e64736f6c63430008060033
9 changes: 9 additions & 0 deletions benchmark/ethInvoke/script.lua
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
local case = testcase.new()
function case:Run()
local result = self.blockchain:Invoke({
func = "",
args = {""},
})
return result
end
return case
27 changes: 27 additions & 0 deletions benchmark/ethTransfer/config.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
[engine]
rate = 10
duration = "30s"
cap = 5

[client]
script = "benchmark/ethTransfer/script.lua" # 脚本
type = "eth" # 区块链类型
contract = "benchmark/ethTransfer/contract" # 合约目录路径
config = "/Users/aiyoa/desktop/eth-test/data" # 区块链SDK配置路径
account = "UTC--2021-10-21T03-41-34.288690000Z--01eec173917c429901b41b98ac3dd300e060e698" #eth账户
args = [] # 合约参数路径

[client.options] # 客户端选项

[recorder.log]
dump=false
dir="./logs"
level="debug"

[recorder.csv]
dir="./csv"





Loading