docker
shyaml: pip install shyaml
This demo will run three docker containers containing an instance each of the storage server, test client, and test verifier respectively. It will cause interactions between the three components, and the results of these interactions will be logged.
config.yaml
currently looks like this:
docker_user: rainblock
docker_pass: some_random_password
remote_user: cc
storage_nodes:
- 129.114.108.84
evm_nodes:
- 129.114.108.84
client_nodes:
- 129.114.108.84
- Edit config.yaml
- Replace
remote_user
to user of a machine you are able to ssh into - Replace IPs of
storage_nodes
,evm_nodes
, andclient_nodes
with IPs of the machine you are able to ssh into. They can all be the same IP address. - You do not need to edit
docker_user
ordocker_pass
. This docker ID is associated with our images.
- Replace
- Run
./deploy.sh 1 1 1
- View logs in
logs/
. The expected logs already present inlogs_expected/
. For example, the server log should contain
Received shard and port: -1 50051
grpc server running on at 0.0.0.0:50051
Received Update call
Received Update call
Received Update call
Received Update call
Received Update call
ERROR: update
Error: Attempt to update a non-existent value
at StorageNode.update (/home/node/rainblock-storage/src/index.ts:290:17)
at Object.update (/home/node/rainblock-storage/src/server.ts:281:17)
at /home/node/rainblock-storage/node_modules/grpc/src/server.js:590:13
Received getBlockHash call
Received getBlockHash call
Received getStorage call
Received getStorage call
Received getAccount call
Received getAccount call
Received getCodeInfo Call
Received getCodeInfo Call
Received getCodeInfo Call
Received getCodeInfo Call
The error is expected: we are trying to update a non-existent value.
Setup configs in config.yaml. See config.yaml.example file for how to set it up. Docker username and password is required to push to a docker repo and pull from a private docker repo.
./bootstrap/create_fresh_images.sh
generates following images and pushes them to dockerhub:
- rainblock/rainblock:mainStore - storage node image
- rainblock/rainblock:testVerifStore - test verifier which simply interacts with storage nodes
- rainblock/rainblock:testCliStore - test client which simply interacts with storage nodes
-
./deploy.sh storage_node.sh num_storage num_evm num_client
will deploy entire system. It is made up of following commands explained below: -
Run
deploy_storage.sh num_storage_containers
to get storage nodes started on storage_nodes IPs specified in config.yaml.- The storage container ports are assumed to be 50051. They are mapped to ports starting from 4000 in each machine the containers are deployed in.
- Number of storage containers will be evenly distributed between storage IPs provided in config.yaml
- It is assumed that the containers will run on Chameleon Cloud. Change
USERNAME
field fromcc
to match your username on remote host - All storage
IP:port
will be written tostorage_ips.txt
in a comma newline separated format afterdeploy_storage.sh
-
Run
deploy_evm.sh num_evm_containers
to get evm nodes started on evm_nodes IPs specified in config.yaml. Right now, evm is test_verif_store instance.- The storage IP and port that evm should connect to are sent as the environment variable $SNODES. SNODES is the content of
storage_ips.txt
. - The actual EVM container will keep ports open for clients to connect to. This port is assumed to be 50052. They are mapped to ports starting from 6000 in each machine the containers are deployed in.
- Number of evm containers will be evenly distributed between evm IPs provided in config.yaml
- It is assumed that the containers will run on Chameleon Cloud. Change
USERNAME
field fromcc
to match your username on remote host - EVM IP:port will be written to
evm_ips.txt
in a comma newline separated format afterdeploy_evm.sh
- The storage IP and port that evm should connect to are sent as the environment variable $SNODES. SNODES is the content of
-
Run
deploy_client.sh num_client_containers
to get client nodes started on client_nodes IPs specified in config.yaml. Right now, client is test_client_store instance.- The storage IP and port & EVM IP and port that client should connect to are sent as the environment variable $SNODES and $ENODES. SNODES and ENODES are the content of
storage_ips.txt
andevm_ips.txt
- Number of client containers will be evenly distributed between client IPs provided in config.yaml
- It is assumed that the containers will run on Chameleon Cloud. Change
USERNAME
field fromcc
to match your username on remote host
- The storage IP and port & EVM IP and port that client should connect to are sent as the environment variable $SNODES and $ENODES. SNODES and ENODES are the content of
- For dockerizing, testVerifier.ts and testClient.ts in rainblock-storage needs extra environment variable handling to get storage nodes IP:port. We use a separate branch
dockertest
on rainblock-storage for this. We create docker containers from this branch. - Downloading a zip file directly from github/gitlab repo and making docker image based on it will fail. This is because it will not have a .git folder, which is required for gitmodules to initialize. Instead, clone the repo, zip it and send it over to docker image.