Categorygithub.com/EtherCS/SyncShard
module
0.0.0-20230717195818-d2b2c5173126
Repository: https://github.com/ethercs/syncshard.git
Documentation: pkg.go.dev

# README

SyncShard

SyncShard is an availability-priority synchronization protocol for a blockchain sharding system

Architecture

alt text

Download dependency

go mod tidy

Compile

make build

Test

node parameter description

node parametersdescriptiondefault
nshard number2
mshard size2
pbeacon chain port10057
ibeacon chain ip"127.0.0.1"
sshard chain points"20057,21057"
xshard chain ips"127.0.0.1,127.0.0.1"
kthe number of key100

transaction client parameter description

client parametersdescriptiondefault
shardsshard number2
beaconportbeacon chain port10057
beaconipbeacon chain ip"127.0.0.1"
shardportsshard chain points"20057,21057"
shardipsshard chain ips"127.0.0.2,127.0.0.3"
batchbatch size per request10
ratiocross-shard txs ratio0.8
parallelconcurrent request number100
durationexecution duration, s120

synchronization client parameter description

client parametersdescriptiondefault
shardsshard number2
beaconportbeacon chain port10057
beaconipbeacon chain ip"127.0.0.1"
shardportsshard chain points"20057,21057"
shardipsshard chain ips"127.0.0.2,127.0.0.3"
blocksizeblock size100

1. Single machine test

  • run consensus nodes
./scripts/run_test.sh -n 2 -m 2 -p 10057 -i "127.0.0.1" -s "20057,21057" -x "127.0.0.2,127.0.0.3" -k 100
  • run client
./build/user -shards 2 -beaconport 10057 -beaconip "127.0.0.1" -shardports "20057,21057" -shardips "127.0.0.1,127.0.0.1" -batch 10 -ratio 0.0
  • run synchronization request
./build/sync -shardport "20057" -shardip "127.0.0.1"

After testing finishes, you can get the log files of each node in: ./tmplog/app-$TEST-TIME

2. Multiple machines test (different IPs)

Very simple! Just replace "127.0.0.1" with the machine IPs, and run the script on different machines respectively. For example, assume two machines have #IP1 and #IP2

  • run consensus nodes on two machines respectively
./scripts/run_test.sh -n 2 -m 2 -p 10057 -i "127.0.0.1" -s "20057,21057" -x "#IP1,#IP2" -k 100
  • run client
./build/user -shards 2 -beaconport 10057 -beaconip "127.0.0.1" -shardports "20057,21057" -shardips "#IP1,#IP2" -batch 10 -ratio 0.0
  • run synchronization request
./build/sync -shardport "20057" -shardip "#IP1"

After testing finishes, you can get the log files of each node in: ./tmplog/app-$TEST-TIME

# Packages

No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author