forked from singnet/wiki
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
front-to-back example scripts for docker
- Loading branch information
1 parent
ed9099a
commit 18cfb4e
Showing
2 changed files
with
64 additions
and
0 deletions.
There are no files selected for viewing
9 changes: 9 additions & 0 deletions
9
multiPartyEscrowContract/front-to-back-examples/scripts/example1/for_docker/install_all.sh
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
apt-get update | ||
apt-get -y install sudo wget git python3-pip nodejs npm libudev-dev libusb-1.0-0-dev psmisc | ||
apt-get -y install golang go-dep golang-goprotobuf-dev golint | ||
# install IPFS | ||
wget https://dist.ipfs.io/go-ipfs/v0.4.17/go-ipfs_v0.4.17_linux-amd64.tar.gz | ||
tar xvfz go-ipfs_*.tar.gz | ||
cp ./go-ipfs/ipfs /usr/local/bin | ||
|
||
. /example1/install_and_start.sh |
55 changes: 55 additions & 0 deletions
55
...rtyEscrowContract/front-to-back-examples/scripts/example1/for_docker/reset_environment.sh
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,55 @@ | ||
# This is a part of circleci functional tests | ||
# This script does following: | ||
# - restart ipfs | ||
# - restart ganache and remigrate platform-contracts | ||
# - set correct networks/*json for Registry and MultiPartyEscrow (but not for SingularityNetToken !) | ||
# - reset .snet configuration | ||
# - add snet-user to snet-cli with first ganache idenity | ||
|
||
cd ~/singnet | ||
export GOPATH=`pwd` | ||
export SINGNET_REPOS=${GOPATH}/src/github.com/singnet | ||
export PATH=${GOPATH}/bin:${PATH} | ||
|
||
|
||
|
||
# I. restart ipfs | ||
killall ipfs || echo "supress an error" | ||
|
||
sudo rm -rf ~/.ipfs/ | ||
ipfs init | ||
ipfs bootstrap rm --all | ||
ipfs config Addresses.API /ip4/127.0.0.1/tcp/5002 | ||
ipfs config Addresses.Gateway /ip4/0.0.0.0/tcp/8081 | ||
nohup ipfs daemon > ipfs.log 2>&1 & | ||
|
||
|
||
# II. restart ganache and remigrate platform-contracts | ||
killall node || echo "supress an error" | ||
|
||
cd $SINGNET_REPOS/platform-contracts | ||
nohup ./node_modules/.bin/ganache-cli --mnemonic 'gauge enact biology destroy normal tunnel slight slide wide sauce ladder produce' --networkId 829257324 2>&1 > ~/singnet/ganache.log & | ||
./node_modules/.bin/truffle migrate --network local | ||
|
||
|
||
# III. remove old snet-cli configuration | ||
rm -rf ~/.snet | ||
|
||
# IV. Configure SNET-CLI. | ||
|
||
# Create First identity (snet-user = first ganache) | ||
# We will automatically create new configuration file with default values | ||
snet identity create snet-user key --private-key 0xc71478a6d0fe44e763649de0a0deb5a080b788eefbbcf9c6f7aef0dd5dbd67e0 | ||
|
||
# Add local network and switch to it | ||
snet network create local http://localhost:8545 | ||
snet network local | ||
|
||
# set correct ipfs endpoint | ||
snet set default_ipfs_endpoint http://localhost:5002 | ||
|
||
|
||
# Configure contract addresses for local network (it will not be necessary for kovan or mainnet! ) | ||
snet set current_singularitynettoken_at 0x6e5f20669177f5bdf3703ec5ea9c4d4fe3aabd14 | ||
snet set current_registry_at 0x4e74fefa82e83e0964f0d9f53c68e03f7298a8b2 | ||
snet set current_multipartyescrow_at 0x5c7a4290f6f8ff64c69eeffdfafc8644a4ec3a4e |