Skip to content

Instantly share code, notes, and snippets.

@0xGabi
Last active October 17, 2019 07:44
Show Gist options
  • Save 0xGabi/0e354c22d3462ea78e5cb89d86e0a569 to your computer and use it in GitHub Desktop.
Save 0xGabi/0e354c22d3462ea78e5cb89d86e0a569 to your computer and use it in GitHub Desktop.
Aragon template bash script
#!/bin/bash
# MODE is 'ipfs' or 'http'
MODE=$1
echo RUNNING APP IN MODE: \"$MODE\"
# Exit script as soon as a command fails.
set - o errexit
# Executes cleanup function at script exit.
trap cleanup EXIT
cleanup() {
# Kill the RPC instance that we started(if we started one and if it's still running).
if [-n "$pid"] && ps - p $pid > /dev/null; then
kill - 9 $pid
fi
}
run() {
echo Running org...
if [ $MODE == 'ipfs' ]
then
runUsingIPFS
elif [ $MODE == 'http' ]
then
runUsingHTTP
else
echo ERROR: Unrecognized mode \"$MODE\". Please use 'ipfs' or 'http'
fi
}
runUsingIPFS() {
npx aragon run \
--files dist \
--template template \
--template-init 0x5d94e3e7aec542ab0f9129b9a7badeb5b3ca0f77 @ARAGON_ENS 0xd526b7aba39cccf76422835e7fd5327b98ad73c9 0xf1f8aac64036cdd399886b1c157b7e3b361093f3 \
--template-new-instance newTokenAndInstance \
--template-args MyToken TKN mytemplate ['"0xb4124cEB3451635DAcedd11767f004d8a28c6eE7"'] ['"1000000000000000000"'] ['"500000000000000000","50000000000000000","604800"'] 1296000 true
}
runUsingHTTP() {
npx aragon run \
--http localhost: 8001 \
--http-served-from dist \
--template template \
--template-init 0x5d94e3e7aec542ab0f9129b9a7badeb5b3ca0f77 @ARAGON_ENS 0xd526b7aba39cccf76422835e7fd5327b98ad73c9 0xf1f8aac64036cdd399886b1c157b7e3b361093f3 \
--template-new-instance newTokenAndInstance \
--template-args MyToken TKN mytemplate ['"0xb4124cEB3451635DAcedd11767f004d8a28c6eE7"'] ['"1000000000000000000"'] ['"500000000000000000","50000000000000000","604800"'] 1296000 true
}
run
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment