forked from pointnetwork/pointnetwork
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path.bash_alias
More file actions
52 lines (40 loc) · 3.24 KB
/
.bash_alias
File metadata and controls
52 lines (40 loc) · 3.24 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
# used so that hardhat console and deploy scripts will deploy to your local blockchain
export BLOCKCHAIN_HOST=localhost
# point-e2e is used for starting the e2e environment (for development and testing usage only)
alias point-e2e="docker compose -f docker-compose.e2e.yaml "
alias point-zappdev="docker compose --env-file .env.zappdev -f docker-compose.zappdev.yaml "
alias point-test="docker compose -f docker-compose.test.yaml "
# point-dev and point-deploy are alias for use when running the node outside of Docker
alias point-dev="NODE_CONFIG_ENV=devlocal MODE=zappdev npm run watch"
alias point-visit="NODE_CONFIG_ENV=visitlocal MODE=zappdev npm run watch"
alias point-dev-use-oracle="NODE_CONFIG_ENV=devlocal MODE=zappdev USE_ORACLE=true npm run watch"
alias point-visit-use-oracle="NODE_CONFIG_ENV=visitlocal MODE=zappdev USE_ORACLE=true npm run watch"
alias point-deploy="NODE_CONFIG_ENV=devlocal MODE=zappdev ./point deploy "
alias point-upload="NODE_CONFIG_ENV=devlocal MODE=zappdev ./point upload "
alias point-dev-install="./scripts/create-local-env.sh"
alias point-dev-start="./scripts/start-local.sh"
alias point-dev-stop="./scripts/stop-local.sh"
alias point-dev-clean="./scripts/clean-local.sh"
# point-browser can be used when running the node outside of Docker
alias point-browser="web-ext run --firefox-profile=pointnetwork --keep-profile-changes --source-dir dist/prod --url 'https://point?token$(cat ~/.point/keystore/token.txt)'"
# point-browser-docker-owner / visitor starts a point browser using one saved zappdev environment Firefox profiles
alias point-browser-owner="web-ext run --firefox-profile=website_owner --keep-profile-changes --source-dir dist/prod --url 'https://point?token=xGrqHMNXLhjEubp1soD0hHN6nXIBsUwA'"
alias point-browser-visitor="web-ext run --firefox-profile=website_visitor --keep-profile-changes --source-dir dist/prod --url 'https://point?token=xGrqHMNXLhjEubp1soD0hHN6nXIBsUwA'"
# point-browser-dev starts a point browser instance loading the pointsdk extention from the dist folder so that it can also be worked on by the developer using extention hot reloading provided by web-ext. See the pointsdk repo for details.
alias point-browser-dev="web-ext run --firefox-profile=website_owner --keep-profile-changes --source-dir dist --url 'https://point?token=xGrqHMNXLhjEubp1soD0hHN6nXIBsUwA'"
# build a local image from the current working branch
build-image() {
local image=$(git branch --show-current | sed 's/[^a-zA-Z0-9]/-/g');
docker image inspect pointnetwork/pointnetwork_node:$image > /dev/null 2>&1;
if [[ $status -ne 0 ]] || [[ "$1" == "--force" ]]
then
echo "Building image: pointnetwork/pointnetwork_node:$image";
docker build -t "pointnetwork/pointnetwork_node:$image" .;
else
echo "Docker Image for current branch exists. To rebuild the image run 'build-image --force'";
fi;
}
# dexec is a helper function to start a bash terminal in a running docker container
dexec() { docker exec -it "$1" bash; }
# dclean is a helper function to remove unused docker images and prune docker system resources
dclean() { docker stop $(docker ps -a -q); docker rm -f $(docker ps -a -q); docker rmi -f $(docker images | grep "<none>" | awk "{print \$3}"); docker system prune -f; docker system prune --volumes -f; }