Skip to content

Commit

Permalink
Merge pull request #333 from xyzshen/dev
Browse files Browse the repository at this point in the history
add get solc-bin js shell
  • Loading branch information
mingzhenliu authored Apr 7, 2021
2 parents 2807899 + 21ee649 commit d72a916
Show file tree
Hide file tree
Showing 6 changed files with 75 additions and 3 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -11,3 +11,4 @@ package-lock.json
*.ntvs*
*.njsproj
*.sln
v0.*.js
2 changes: 1 addition & 1 deletion dist/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
height: 100%;
margin: 0px;
padding: 0px;
}</style></head><body><body><div id=app></div><script type=text/javascript src=./static/js/0.886338d26d485d17674e.js></script><script type=text/javascript src=./static/js/3.a8728afaa618b51a6c6b.js></script><script type=text/javascript src=./static/js/runtime.9d60305d328001645ac5.js></script><script type=text/javascript src=./static/js/5.1529dbddc9653f1e7389.js></script></body><script src=./static/js/web3.min.js type=text/javascript></script><script>if (self == top) {
}</style></head><body><body><div id=app></div><script type=text/javascript src=./static/js/0.1ffbd173d2bc24f015ea.js></script><script type=text/javascript src=./static/js/3.a8728afaa618b51a6c6b.js></script><script type=text/javascript src=./static/js/runtime.9d60305d328001645ac5.js></script><script type=text/javascript src=./static/js/5.1529dbddc9653f1e7389.js></script></body><script src=./static/js/web3.min.js type=text/javascript></script><script>if (self == top) {
var antiClickjack = document.getElementById("antiClickjack");
antiClickjack.parentNode.removeChild(antiClickjack);
} else {
Expand Down

Large diffs are not rendered by default.

Binary file not shown.
71 changes: 71 additions & 0 deletions get_solc_js.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,71 @@
#!/usr/bin/env bash

# 在源码编译得到的WeBASE-Web目录中执行

CURRENT_DIR=$(pwd)
OUTPUT_DIR="./dist/static/js"


####### 参数解析 #######
PARAM_ERROR=1
cmdname=$(basename "$0")

# usage help doc.
usage() {
cat << USAGE >&2
Usage:
$cmdname [-o output_relative_directory]
-o solidity js file download output [relative] directory, ex: dist/static/js is [./dist/static/js]
USAGE
exit $PARAM_ERROR
}


while getopts o:h OPT;do
case ${OPT} in
o)
OUTPUT_DIR="$OPTARG"
;;
h)
usage
exit ${PARAM_ERROR}
;;
\?)
usage
exit ${PARAM_ERROR}
;;
esac
done

get_solc_js(){
STATIC_JS_DIR=${CURRENT_DIR}/${OUTPUT_DIR}
if [ ! -d "${STATIC_JS_DIR}" ];then
echo "Directory not exist: ${STATIC_JS_DIR}"
exit 1
else
echo "Now download all solidity js in ${STATIC_JS_DIR}, if offline, download js file and put them in this dir"
if [[ ! -f "${STATIC_JS_DIR}/v0.4.25.js" ]]; then
curl -#L https://osp-1257653870.cos.ap-guangzhou.myqcloud.com/WeBASE/download/solidity/v0.4.25.js -o "${STATIC_JS_DIR}"/v0.4.25.js
fi
if [[ ! -f "${STATIC_JS_DIR}/v0.4.24-gm.js" ]]; then
curl -#L https://osp-1257653870.cos.ap-guangzhou.myqcloud.com/WeBASE/download/solidity/v0.4.24-gm.js -o "${STATIC_JS_DIR}"/v0.4.24-gm.js
fi
if [[ ! -f "${STATIC_JS_DIR}/v0.5.1.js" ]]; then
curl -#L https://osp-1257653870.cos.ap-guangzhou.myqcloud.com/WeBASE/download/solidity/v0.5.1.js -o "${STATIC_JS_DIR}"/v0.5.1.js
fi
if [[ ! -f "${STATIC_JS_DIR}/v0.5.1-gm.js" ]]; then
curl -#L https://osp-1257653870.cos.ap-guangzhou.myqcloud.com/WeBASE/download/solidity/v0.5.1-gm.js -o "${STATIC_JS_DIR}"/v0.5.1-gm.js
fi
if [[ ! -f "${STATIC_JS_DIR}/v0.6.10.js" ]]; then
curl -#L https://osp-1257653870.cos.ap-guangzhou.myqcloud.com/WeBASE/download/solidity/v0.6.10.js -o "${STATIC_JS_DIR}"/v0.6.10.js
fi
if [[ ! -f "${STATIC_JS_DIR}/v0.6.10-gm.js" ]]; then
curl -#L https://osp-1257653870.cos.ap-guangzhou.myqcloud.com/WeBASE/download/solidity/v0.6.10-gm.js -o "${STATIC_JS_DIR}"/v0.6.10-gm.js
fi
fi
}
get_solc_js

echo "end of script"
exit 0
2 changes: 1 addition & 1 deletion src/views/chaincode/components/code.vue
Original file line number Diff line number Diff line change
Expand Up @@ -619,7 +619,7 @@ export default {
// this.loading = true;
try {
let wrapper = require("solc/wrapper");
let solc = wrapper(window.Module);
var solc = wrapper(window.Module);
} catch (error) {
console.log(error);
this.$message({
Expand Down

0 comments on commit d72a916

Please sign in to comment.