github.com/inklabsfoundation/inkchain@v0.17.1-0.20181025012015-c3cef8062f19/examples/creative/scripts/test.sh (about) 1 #!/usr/bin/env bash 2 # 3 #Copyright Ziggurat Corp. 2017 All Rights Reserved. 4 # 5 #SPDX-License-Identifier: Apache-2.0 6 # 7 8 # Detecting whether can import the header file to render colorful cli output 9 if [ -f ./func_user.sh ]; then 10 source ./func_user.sh 11 elif [ -f scripts/func_user.sh ]; then 12 source scripts/func_user.sh 13 fi 14 15 if [ -f ./func_artist.sh ]; then 16 source ./func_artist.sh 17 elif [ -f scripts/func_artist.sh ]; then 18 source scripts/func_artist.sh 19 fi 20 21 if [ -f ./func_production.sh ]; then 22 source ./func_production.sh 23 elif [ -f scripts/func_production.sh ]; then 24 source scripts/func_production.sh 25 fi 26 27 if [ -f ./func_token.sh ]; then 28 source ./func_token.sh 29 elif [ -f scripts/func_token.sh ]; then 30 source scripts/func_token.sh 31 fi 32 33 # example 34 35 #echo_b "===================== issueToken ========================" 36 #issueToken INK "1000" "18" ${USER_ADDRESS_01} 37 #echo_b "===================== makeTransfer ========================" 38 #makeTransfer ${USER_ADDRESS_02} INK 500 ${USER_TOKEN_01} 39 #echo_b "===================== chaincodeQuery ========================" 40 chaincodeQuery $USER_ADDRESS_01 INK 41 chaincodeQuery $USER_ADDRESS_02 INK 42 43 #echo_b "===================== add user ========================" 44 # addUser $USER_TOKEN_01 hanmeimei hanmeimei@qq.com 45 # addUser $USER_TOKEN_02 lilei lilei@qq.com 46 47 #echo_b "===================== delete user ========================" 48 # deleteUser $USER_TOKEN_01 hanmeimei 49 # deleteUser $USER_TOKEN_02 lilei 50 51 #echo_b "===================== modify user 可1次修改多值 "Name,xxx" "Desc,xxx" 用 ',' 分割键值 ========================" 52 # modifyUser $USER_TOKEN_01 "hanmeimei" "Email,meimei@qq.com" 53 # modifyUser $USER_TOKEN_02 "lilei" "Email,leilei@qq.com" 54 # 55 #echo_b "===================== query user ========================" 56 # queryUser hanmeimei 57 # queryUser lilei 58 59 #echo_b "===================== list user ========================" 60 # listOfUser 61 62 #echo_b "===================== addArtist ========================" 63 # addArtist $USER_TOKEN_01 "hanmeimei" "女作家" "韩梅梅,女,金牛座,1981年出生于云南。毕业于北京电影学院导演系,畅销书作家。" 64 # addArtist $USER_TOKEN_02 "lilei" "程序员" "李雷,男,狮子座,1980年出生于山东。毕业于蓝翔,屌丝程序员。" 65 66 # deleteArtist $USER_TOKEN_01 "hanmeimei" 67 # deleteArtist $USER_TOKEN_02 "lilei" 68 69 # 可1次修改多值 "Name,xxx" "Desc,xxx" 用 ',' 分割键值 70 # modifyArtist $USER_TOKEN_01 "hanmeimei" "Name,女作家、女演员" "Desc,韩梅梅" 71 # modifyArtist $USER_TOKEN_02 "lilei" "Name,程序员&架构师" "Desc,李雷,男,狮子座,1980年出生于山东。毕业于蓝翔,屌丝程序员。TO DO +" 72 # 73 # queryArtist "hanmeimei" 74 # queryArtist "lilei" 75 76 # listOfArtist 77 78 # addProduction $USER_TOKEN_01 "hanmeimei" "book" "00000001" "《李雷和韩梅梅》" "青春偶像" "INK" "100" "10000" "1000" 79 # addProduction $USER_TOKEN_02 "lilei" "code" "00000001" "《PHP从出门到放弃》" "抓狂日志" "INK" "1" "10000" "5000" 80 81 # deleteProduction $USER_TOKEN_01 "hanmeimei" "book" "00000001" 82 # deleteProduction $USER_TOKEN_02 "lilei" "code" "00000001" 83 84 # Name、Desc、CopyrightPriceType、CopyrightPrice、CopyrightNum、CopyrightTransferPart 可1次修改多值 "Name,xxx" "Desc,xxx" 用 ',' 分割键值 85 # modifyProduction $USER_TOKEN_01 "hanmeimei" "book" "00000001" "Name,《老王,韩梅梅》" "Desc,xxxxx" 86 # modifyProduction $USER_TOKEN_02 "lilei" "code" "00000001" "Name,《再见!coding》" 87 ## 88 # queryProduction "hanmeimei" "book" "00000001" 89 # queryProduction "lilei" "code" "00000001" 90 91 92 # listOfProduction "username" "product_type" 参数可变 93 # listOfProduction "hanmeimei" "book" 94 # listOfProduction "lilei" "code" 95 # listOfProduction "hanmeimei" 96 # listOfProduction "lilei" 97 # listOfProduction 98 99 # addSupporter $USER_TOKEN_01 "lilei" "code" "00000001" "INK" "99" "hanmeimei" 100 # addSupporter $USER_TOKEN_02 "hanmeimei" "book" "00000001" "INK" "199" "lilei" 101 102 # listOfSupporter "username" "product_type" "product_serial" 参数可变 103 # listOfSupporter "hanmeimei" "book" "00000001" 104 # listOfSupporter "lilei" "code" "00000001" 105 # 106 # addBuyer $USER_TOKEN_02 "hanmeimei" "book" "00000001" "INK" "1" "lilei" 107 # addBuyer $USER_TOKEN_01 "lilei" "code" "00000001" "INK" "5" "hanmeimei" 108 # 109 # queryProduction "hanmeimei" "book" "00000001" 110 # queryProduction "lilei" "code" "00000001" 111 112 # listOfBuyer username product_type product_serial 113 # listOfBuyer "hanmeimei" "book" "00000001" 114 # listOfBuyer "lilei" "code" "00000001"