Skip to content

Commit

Permalink
fron-to-back example1 with docker
Browse files Browse the repository at this point in the history
  • Loading branch information
astroseger committed Dec 6, 2018
1 parent 3cc8939 commit d253222
Showing 1 changed file with 67 additions and 1 deletion.
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# DESCRIPTION
# DESCRIPTION

* install_and_start.sh - install and setup everything and start local network
and ipfs
Expand All @@ -9,3 +9,69 @@ group one endpoint)
of claimed channels, and claim your channels

Test should be run on clean environment in the given order.

### Run tests in docker container

##### Install everything

```bash
#I. Download example scripts and make sure that scripts are in the
# current directory. There is one possible way to do it:

git clone https://github.com/singnet/wiki
cd wiki/multiPartyEscrowContract/front-to-back-examples/scripts/example1/

#II. Run ubuntu:latest docker container and "mount" ./ to /example1
docker run -v `pwd`:/example1 -it ubuntu:latest

#III. Now you are inside a docker container. We will install everything.
. /example1/for_docker/install_all.sh
```

##### Create docker image with everything installed (optional)

At this point your can "commit" your docker container.

1. Open new terminal on your main system (without closing your docker container!)
2. Using "docker ps" your get "container id" of your running container.
3. your type "docker commit <container_id> $USER/snet_example1"

After this your will be able to use $USER/snet_example1 instead of ubuntu:latest and your can skill install_all.
```
# your should be inside example1 directory
# cd wiki/multiPartyEscrowContract/front-to-back-examples/scripts/example1/
docker run -v `pwd`:/example1 -it $USER/snet_example1
```

##### Register and run example service

```bash
# reset environment
. /example1/for_docker/reset_environment.sh

# register your service
. /example1/run_service.sh
```

##### Run client

After running the service terminal will not return to your, so you will need to open the second terminal in your container

1. You should open new terminal in your main system.
2. You should get "container id" of your running container by typing "docker ps"
3. You should type "docker exec -it <container_id> bash".

And your can run your client

```bash
. /example1/run_client.sh

# it should print "42.0"
```

#### Run treasurer

```bash
. /example1/run_treasurer.sh
```

0 comments on commit d253222

Please sign in to comment.