Explore

Contents

This example contains a Docker image and a number of simple application examples which demonstrate how to work with the SingularityNET platform.

For the sake of clarity and simplicity, we prepared an environment which simulates the behaviour of the Kovan Ethereum testnet. All actions occur within your own instance of Ganache and doesn’t affect any public networks.

Prerequisites:

Hardware requirements:

  • 1 Gb free RAM to run docker image
  • 4 Gb free disk space to keep docker image

Clone repository:

git clone https://github.com/singnet/wiki
cd wiki/workshop/docker

Build docker image:

docker build -t singnet .

Run docker image with examples:

./run.sh

After docker image is up you will be in the singnet folder which contains all main SingularityNet git repositories and SingularityNet examples.

Please start with reading examples/01-snet-cli/README file and follow instructions.

Preparations made in image

What is done in the docker image:

  • local IPFS instance is deployed and started (see deploy local IPFS instance and start local IPFS instance
  • Ganache instance is started with predefined network number and mnemonic to generate predictable accounts numbers and private keys (see start local ethereum network);
  • 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 setup snet-cli interface;
  • all addresses and private keys generated by Ganache are exported as environment variables: $DEPLOYER_ADDR, $DEPLOYER_KEY, $CALLER_ADDR, $CALLER_KEY, $PUBLISHER_ADDR, $PUBLISHED_KEY;
  • couple of snet-cli identities are created: deployer and caller, which are first and second identities generated by ganache-cli on start respectively.

In order to see full list of preparations you need to work with local Ethereum network you need to look at page build and deploy SingularityNET locally.

Last modified on : 18-Apr-24

Sign up for developer updates

×