Docker image and number of simple application examples which demonstrate how to work with SingularityNet platform.
For the sake of clarity and simplicity it is a prepared environment which simulates behaviour of the Ethereum testnet like Kovan. But all things you are doing happens in 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:
docker run -ti singnet
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 00-snet-cli/README
file and follow instructions.
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
,$CLIENT_ADDR
,$CLIENT_KEY
,$PUBLISHER_ADDR
,$PUBLISHED_KEY
; - couple of
snet-cli
identities are created:deployer
andclient
, 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.