What does this docker contain?

What does this docker contain?

Basically it contain completely local SingularityNet environment. It can be used to run SingularityNet services locally without using external Ethereum networks.

What is done in the docker image:

  • local IPFS instance is deployed and started
  • Ganache instance is started with predefined network number and mnemonic to generate predictable accounts numbers and private keys
  • local network id is exported as $NETWORK_ID environment variable;
  • all contracts are already deployed and their addresses are written to snet-cli configuration and exported as environment variables: $TOKEN_ADDR, $REGISTRY_ADDR, $MULTIPARTYESCROW_ADDR;
  • local Ethereum node and IPFS instance are added into snet-cli configuration
  • all addresses and private keys generated by Ganache are exported as environment variables: $DEPLOYER_ADDR, $DEPLOYER_KEY, $CALLER_ADDR, $CALLER_KEY, $PUBLISHER_ADDR, $PUBLISHER_KEY;
  • couple of snet-cli identities are created: deployer and caller, which are first and second identities generated by ganache-cli on start respectively.
  • local ETCD instance is deployed and started to allow you starting daemon without ETCD.
  • IPFS, Ethereum and service ports are exported from docker container. Thus IPFS endpoint is http://localhost:5002, Ethereum endpoint is http://localhost:8545 and daemon endpoint is http://localhost:7000.
  • Service endpoint is http://localhost:7003, its port is not exported. Thus service available only via daemon.
  • All services use HTTP to simplify setup.
  • Example Service is deployed under example-org with example-service id.

Usage

Build docker:

./build.sh

Start docker:

./start.sh

To try example service execute:

snet identity caller
snet client call example-org example-service default_group mul '{ "a": 6, "b": 7 }' -y

To publish own service use “How to Publish a SingularityNET Service” tutorial as a guide.