The repository hosts MorphDAG 1.0, a Golang implementation of an elastic DAG-based blockchain system supporting fast commitment, concurrent execution, and adaptive sharding. The prototype of MorphDAG 1.0 is affiliated with the National Key Research and Development (R&D) Program Project, 2021YFB2700700.
necessary software environment:
- installation of go
Remove any previous Go installation by deleting the /usr/local/go folder (if it exists), then extract the archive you just downloaded into /usr/local, creating a fresh Go tree in /usr/local/go:
$ rm -rf /usr/local/go && tar -C /usr/local -xzf go1.22.1.linux-amd64.tar.gz
Add /usr/local/go/bin to the PATH environment variable.
export PATH=$PATH:/usr/local/go/bin
- installation of python
sudo apt-get install python3.7
- installation of pip
$ curl https://bootstrap.pypa.io/get-pip.py -o get-pip.py
$ sudo python get-pip.py
- installation of fabric
Fabric is best installed via pip:
pip install fabric
Enable workcomputer to login in servers and clients without passwords.
Commands below are run on the work computer.
# Generate the ssh keys (if not generated before)
ssh-keygen
ssh-copy-id -i ~/.ssh/id_rsa.pub $IP_ADDR_OF_EACH_SERVER
# Enter the directory `go-MorphDAG`
go mod tidy
Run MorphDAG on a local testnetwork. Parameters of the local testnetwork are defined in the file benchmark/fabfile.py
.
The default configuration is as follows:
bench_params = {
'shard_num': 2,
'shard_size': 11,
'cycle': 100,
'rate': 2000,
'batch_size': 300,
'measure_rounds': 300,
'duration': 60,
'regenconfig': True,
}
You can use the following command to start a local testnetwork
fab local
Run MorphDAG on a lan testnetwork. Parameters of the lan testnetwork are defined in the file benchmark/fabfile.py
.
The default configuration is as follows:
bench_params = {
'shard_num': 8,
'shard_size': 6,
'cycle': 50,
'rate': 2000,
'batch_size': 500,
'measure_rounds': 300,
'duration': 200,
'regenconfig': True,
}
For node configuration such as ips and ports, you can refer to the benchmark/lan.py
file.
For stable testing, the client is instantiated together with the workserver. Normally, the number of client in each shard is set to 1 and its index is