code init

This commit is contained in:
Xunhui Zhang 2023-03-22 14:38:16 +08:00
commit ccd00bac49
70 changed files with 21663 additions and 0 deletions

22
.gitignore vendored Normal file
View File

@ -0,0 +1,22 @@
.vscode
__debug_bin
sdk.publickey
node.key
node.crt
# ---> Go
# Binaries for programs and plugins
*.exe
*.exe~
*.dll
*.so
*.dylib
# Test binary, built with `go test -c`
*.test
# Output of the go coverage tool, specifically when used with LiteIDE
*.out
# Dependency directories (remove the comment below to include it)
# vendor/

View File

@ -0,0 +1,5 @@
-----BEGIN PRIVATE KEY-----
MIGEAgEAMBAGByqGSM49AgEGBSuBBAAKBG0wawIBAQQguJ1C8SKQBw8jX7j7Ydz5
bjsRUWxdT2Mz8m5Ju5Vfi2KhRANCAAQf+Lvzi2JmjS3R4rkA9+O4aVk/db7Hc7H+
uzWl00qEH2Esk9fGeiCLuuQKGX3+TspTTvWA99FFi67RXgF+Sj15
-----END PRIVATE KEY-----

130
LICENSE Normal file
View File

@ -0,0 +1,130 @@
木兰宽松许可证, 第2版
木兰宽松许可证, 第2版
2020年1月 http://license.coscl.org.cn/MulanPSL2
您对“软件”的复制、使用、修改及分发受木兰宽松许可证第2版“本许可证”的如下条款的约束
0. 定义
“软件” 是指由“贡献”构成的许可在“本许可证”下的程序和相关文档的集合。
“贡献” 是指由任一“贡献者”许可在“本许可证”下的受版权法保护的作品。
“贡献者” 是指将受版权法保护的作品许可在“本许可证”下的自然人或“法人实体”。
“法人实体” 是指提交贡献的机构及其“关联实体”。
“关联实体” 是指对“本许可证”下的行为方而言控制、受控制或与其共同受控制的机构此处的控制是指有受控方或共同受控方至少50%直接或间接的投票权、资金或其他有价证券。
1. 授予版权许可
每个“贡献者”根据“本许可证”授予您永久性的、全球性的、免费的、非独占的、不可撤销的版权许可,您可以复制、使用、修改、分发其“贡献”,不论修改与否。
2. 授予专利许可
每个“贡献者”根据“本许可证”授予您永久性的、全球性的、免费的、非独占的、不可撤销的(根据本条规定撤销除外)专利许可,供您制造、委托制造、使用、许诺销售、销售、进口其“贡献”或以其他方式转移其“贡献”。前述专利许可仅限于“贡献者”现在或将来拥有或控制的其“贡献”本身或其“贡献”与许可“贡献”时的“软件”结合而将必然会侵犯的专利权利要求,不包括对“贡献”的修改或包含“贡献”的其他结合。如果您或您的“关联实体”直接或间接地,就“软件”或其中的“贡献”对任何人发起专利侵权诉讼(包括反诉或交叉诉讼)或其他专利维权行动,指控其侵犯专利权,则“本许可证”授予您对“软件”的专利许可自您提起诉讼或发起维权行动之日终止。
3. 无商标许可
“本许可证”不提供对“贡献者”的商品名称、商标、服务标志或产品名称的商标许可但您为满足第4条规定的声明义务而必须使用除外。
4. 分发限制
您可以在任何媒介中将“软件”以源程序形式或可执行形式重新分发,不论修改与否,但您必须向接收者提供“本许可证”的副本,并保留“软件”中的版权、商标、专利及免责声明。
5. 免责声明与责任限制
“软件”及其中的“贡献”在提供时不带任何明示或默示的担保。在任何情况下,“贡献者”或版权所有者不对任何人因使用“软件”或其中的“贡献”而引发的任何直接或间接损失承担责任,不论因何种原因导致或者基于何种法律理论,即使其曾被建议有此种损失的可能性。
6. 语言
“本许可证”以中英文双语表述,中英文版本具有同等法律效力。如果中英文版本存在任何冲突不一致,以中文版为准。
条款结束
如何将木兰宽松许可证第2版应用到您的软件
如果您希望将木兰宽松许可证第2版应用到您的新软件为了方便接收者查阅建议您完成如下三步
1 请您补充如下声明中的空白,包括软件名、软件的首次发表年份以及您作为版权人的名字;
2 请您在软件包的一级目录下创建以“LICENSE”为名的文件将整个许可证文本放入该文件中
3 请将如下声明文本放入每个源文件的头部注释中。
Copyright (c) [Year] [name of copyright holder]
[Software Name] is licensed under Mulan PSL v2.
You can use this software according to the terms and conditions of the Mulan PSL v2.
You may obtain a copy of Mulan PSL v2 at:
http://license.coscl.org.cn/MulanPSL2
THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND,
EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT,
MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE.
See the Mulan PSL v2 for more details.
Mulan Permissive Software LicenseVersion 2
Mulan Permissive Software LicenseVersion 2 (Mulan PSL v2)
January 2020 http://license.coscl.org.cn/MulanPSL2
Your reproduction, use, modification and distribution of the Software shall be subject to Mulan PSL v2 (this License) with the following terms and conditions:
0. Definition
Software means the program and related documents which are licensed under this License and comprise all Contribution(s).
Contribution means the copyrightable work licensed by a particular Contributor under this License.
Contributor means the Individual or Legal Entity who licenses its copyrightable work under this License.
Legal Entity means the entity making a Contribution and all its Affiliates.
Affiliates means entities that control, are controlled by, or are under common control with the acting entity under this License, control means direct or indirect ownership of at least fifty percent (50%) of the voting power, capital or other securities of controlled or commonly controlled entity.
1. Grant of Copyright License
Subject to the terms and conditions of this License, each Contributor hereby grants to you a perpetual, worldwide, royalty-free, non-exclusive, irrevocable copyright license to reproduce, use, modify, or distribute its Contribution, with modification or not.
2. Grant of Patent License
Subject to the terms and conditions of this License, each Contributor hereby grants to you a perpetual, worldwide, royalty-free, non-exclusive, irrevocable (except for revocation under this Section) patent license to make, have made, use, offer for sale, sell, import or otherwise transfer its Contribution, where such patent license is only limited to the patent claims owned or controlled by such Contributor now or in future which will be necessarily infringed by its Contribution alone, or by combination of the Contribution with the Software to which the Contribution was contributed. The patent license shall not apply to any modification of the Contribution, and any other combination which includes the Contribution. If you or your Affiliates directly or indirectly institute patent litigation (including a cross claim or counterclaim in a litigation) or other patent enforcement activities against any individual or entity by alleging that the Software or any Contribution in it infringes patents, then any patent license granted to you under this License for the Software shall terminate as of the date such litigation or activity is filed or taken.
3. No Trademark License
No trademark license is granted to use the trade names, trademarks, service marks, or product names of Contributor, except as required to fulfill notice requirements in section 4.
4. Distribution Restriction
You may distribute the Software in any medium with or without modification, whether in source or executable forms, provided that you provide recipients with a copy of this License and retain copyright, patent, trademark and disclaimer statements in the Software.
5. Disclaimer of Warranty and Limitation of Liability
THE SOFTWARE AND CONTRIBUTION IN IT ARE PROVIDED WITHOUT WARRANTIES OF ANY KIND, EITHER EXPRESS OR IMPLIED. IN NO EVENT SHALL ANY CONTRIBUTOR OR COPYRIGHT HOLDER BE LIABLE TO YOU FOR ANY DAMAGES, INCLUDING, BUT NOT LIMITED TO ANY DIRECT, OR INDIRECT, SPECIAL OR CONSEQUENTIAL DAMAGES ARISING FROM YOUR USE OR INABILITY TO USE THE SOFTWARE OR THE CONTRIBUTION IN IT, NO MATTER HOW ITS CAUSED OR BASED ON WHICH LEGAL THEORY, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
6. Language
THIS LICENSE IS WRITTEN IN BOTH CHINESE AND ENGLISH, AND THE CHINESE VERSION AND ENGLISH VERSION SHALL HAVE THE SAME LEGAL EFFECT. IN THE CASE OF DIVERGENCE BETWEEN THE CHINESE AND ENGLISH VERSIONS, THE CHINESE VERSION SHALL PREVAIL.
END OF THE TERMS AND CONDITIONS
How to Apply the Mulan Permissive Software LicenseVersion 2 (Mulan PSL v2) to Your Software
To apply the Mulan PSL v2 to your work, for easy identification by recipients, you are suggested to complete following three steps:
i. Fill in the blanks in following statement, including insert your software name, the year of the first publication of your software, and your name identified as the copyright owner;
ii. Create a file named "LICENSE" which contains the whole context of this License in the first directory of your software package;
iii. Attach the statement to the appropriate annotated syntax at the beginning of each source file.
Copyright (c) [Year] [name of copyright holder]
[Software Name] is licensed under Mulan PSL v2.
You can use this software according to the terms and conditions of the Mulan PSL v2.
You may obtain a copy of Mulan PSL v2 at:
http://license.coscl.org.cn/MulanPSL2
THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND,
EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT,
MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE.
See the Mulan PSL v2 for more details.

2
README.md Normal file
View File

@ -0,0 +1,2 @@
# gitlink_blockchain

View File

@ -0,0 +1 @@
[{"inputs":[],"stateMutability":"nonpayable","type":"constructor"},{"inputs":[{"internalType":"string","name":"token_name","type":"string"},{"internalType":"string","name":"owner","type":"string"},{"internalType":"uint256","name":"total_supply","type":"uint256"},{"internalType":"string[]","name":"username","type":"string[]"},{"internalType":"uint256[]","name":"balance","type":"uint256[]"}],"name":"createRepo","outputs":[{"internalType":"int256","name":"","type":"int256"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"string","name":"username","type":"string"}],"name":"selectUserAllBalance","outputs":[{"internalType":"string[]","name":"","type":"string[]"},{"internalType":"string[]","name":"","type":"string[]"},{"internalType":"int256[]","name":"","type":"int256[]"}],"stateMutability":"view","type":"function"}]

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

12
ca.crt Normal file
View File

@ -0,0 +1,12 @@
-----BEGIN CERTIFICATE-----
MIIBvjCCAWSgAwIBAgIUb3qQVNwwO9ACvI5KYQtOInJccMUwCgYIKoZIzj0EAwIw
NTEOMAwGA1UEAwwFY2hhaW4xEzARBgNVBAoMCmZpc2NvLWJjb3MxDjAMBgNVBAsM
BWNoYWluMCAXDTIxMDUxMjE0NDMzOFoYDzIxMjEwNDE4MTQ0MzM4WjA1MQ4wDAYD
VQQDDAVjaGFpbjETMBEGA1UECgwKZmlzY28tYmNvczEOMAwGA1UECwwFY2hhaW4w
VjAQBgcqhkjOPQIBBgUrgQQACgNCAATTFARicYMzAhCgtLlZuPqjUBQw+Q/lZTez
++QCBIKxEjGSbnTxvsn8SE3rMbxI8CAPnZyoh0EqZtczJol6KRILo1MwUTAdBgNV
HQ4EFgQUSsuLmNcqa5pN7izdi36C+gfOJaYwHwYDVR0jBBgwFoAUSsuLmNcqa5pN
7izdi36C+gfOJaYwDwYDVR0TAQH/BAUwAwEB/zAKBggqhkjOPQQDAgNIADBFAiBa
JE5AMPb+6iZzpcyK459e+902Hc7Q/gd6xklQLU8U6AIhAMRhP6UQ/jfQ0InfJk8Z
nrxv/WfiIZrgZv2Sf9z4r+hT
-----END CERTIFICATE-----

24
config.toml Normal file
View File

@ -0,0 +1,24 @@
[Network]
#type rpc or channel
Type="channel"
CAFile="ca.crt"
Cert="sdk.crt"
Key="sdk.key"
[[Network.Connection]]
NodeURL="127.0.0.1:20200"
GroupID=1
# [[Network.Connection]]
# NodeURL="127.0.0.1:20200"
# GroupID=2
[Account]
# only support PEM format for now
KeyFile="0x83309d045a19c44dc3722d15a6abd472f95866ac.pem"
[Chain]
ChainID=1
SMCrypto=false
[log]
Path="./"

View File

@ -0,0 +1,30 @@
package main
import (
"fmt"
"log"
"github.com/FISCO-BCOS/go-sdk/client"
"github.com/FISCO-BCOS/go-sdk/conf"
table "github.com/sulenn/trustie-fisco-bcos/contract/opensource" // import tabletest
)
func main() {
configs, err := conf.ParseConfigFile("config.toml")
if err != nil {
log.Fatal(err)
}
config := &configs[0]
client, err := client.Dial(config)
if err != nil {
log.Fatal(err)
}
address, tx, instance, err := table.DeployOpenSource(client.GetTransactOpts(), client)
if err != nil {
log.Fatal(err)
}
fmt.Println("contract address: ", address.Hex()) // the address should be saved
fmt.Println("transaction hash: ", tx.Hash().Hex())
_ = instance
}

View File

@ -0,0 +1,51 @@
package main
import (
"fmt"
"log"
"math/big"
"strconv"
"github.com/FISCO-BCOS/go-sdk/client"
"github.com/FISCO-BCOS/go-sdk/conf"
"github.com/ethereum/go-ethereum/common"
table "github.com/sulenn/trustie-fisco-bcos/contract/opensource"
)
func main() {
configs, err := conf.ParseConfigFile("config.toml")
if err != nil {
log.Fatal(err)
}
config := &configs[0]
client, err := client.Dial(config)
if err != nil {
log.Fatal(err)
}
// load the contract
contractAddress := common.HexToAddress("0xcb465127073489235bBB8cF6995172a7c7420b3F")
instance, err := table.NewOpenSource(contractAddress, client)
if err != nil {
log.Fatal(err)
}
tabletestSession := &table.OpenSourceSession{Contract: instance, CallOpts: *client.GetCallOpts(), TransactOpts: *client.GetTransactOpts()}
token_name := "repo1"
owner := "sulenn"
total_supply := big.NewInt(1000000)
username := []string{"qiubing"}
balance := []*big.Int{big.NewInt(100000)}
tx, receipt, err := tabletestSession.Insert(token_name, owner, total_supply, username, balance) // call Insert API
if err != nil {
log.Fatal(err)
}
fmt.Printf("tx sent: %s\n", tx.Hash().Hex())
insertedLines, err := strconv.Atoi(receipt.Output[2:])
if err != nil {
log.Fatalf("error when transfer string to int: %v\n", err)
}
fmt.Printf("inserted lines: %v\n", insertedLines)
}

12
contract/flag.go Normal file
View File

@ -0,0 +1,12 @@
package contract
var (
RepoExisted int64 = -1001 // 在合约中创建项目时,项目已存在
BalanceOverFlow int64 = -1002 // 在合约中创建项目时预分配的用户Token累积值大于项目总Token
RepoUnexisted int64 = -1003 // 项目不存在
RepoCurBalanceUpOverFlow int64 = -1004 // 当前项目总Token 数超过最大 Token 量
RepoCurBalanceDownOverFlow int64 = -1005 // 当前项目总 Token 数低于0
UserBblanceNotEnough int64 = -1006 // 用户余额不足
ContractAddress string = "0x0a68F060B46e0d8f969383D260c34105EA13a9dd"
)

View File

@ -0,0 +1 @@
[{"constant":false,"inputs":[{"name":"","type":"string"},{"name":"","type":"int256"}],"name":"GT","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":false,"inputs":[{"name":"","type":"string"},{"name":"","type":"string"}],"name":"NE","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":false,"inputs":[{"name":"","type":"int256"}],"name":"limit","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":false,"inputs":[{"name":"","type":"string"},{"name":"","type":"int256"}],"name":"NE","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":false,"inputs":[{"name":"","type":"string"},{"name":"","type":"int256"}],"name":"GE","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":false,"inputs":[{"name":"","type":"int256"},{"name":"","type":"int256"}],"name":"limit","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":false,"inputs":[{"name":"","type":"string"},{"name":"","type":"int256"}],"name":"LE","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":false,"inputs":[{"name":"","type":"string"},{"name":"","type":"int256"}],"name":"LT","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":false,"inputs":[{"name":"","type":"string"},{"name":"","type":"string"}],"name":"EQ","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":false,"inputs":[{"name":"","type":"string"},{"name":"","type":"int256"}],"name":"EQ","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"}]

View File

@ -0,0 +1 @@
608060405234801561001057600080fd5b50610570806100206000396000f3006080604052600436106100a4576000357c0100000000000000000000000000000000000000000000000000000000900463ffffffff16806308ad6333146100a95780632783acf51461011c5780632e0d738a146101cb57806339aef024146101f857806342f8dd311461026b5780637ec1cc65146102de578063b6f2385714610315578063c31c9b6514610388578063cd30a1d1146103fb578063e44594b9146104aa575b600080fd5b3480156100b557600080fd5b5061011a600480360381019080803590602001908201803590602001908080601f01602080910402602001604051908101604052809392919081815260200183838082843782019150505050505091929192908035906020019092919050505061051d565b005b34801561012857600080fd5b506101c9600480360381019080803590602001908201803590602001908080601f0160208091040260200160405190810160405280939291908181526020018383808284378201915050505050509192919290803590602001908201803590602001908080601f0160208091040260200160405190810160405280939291908181526020018383808284378201915050505050509192919290505050610521565b005b3480156101d757600080fd5b506101f660048036038101908080359060200190929190505050610525565b005b34801561020457600080fd5b50610269600480360381019080803590602001908201803590602001908080601f016020809104026020016040519081016040528093929190818152602001838380828437820191505050505050919291929080359060200190929190505050610528565b005b34801561027757600080fd5b506102dc600480360381019080803590602001908201803590602001908080601f01602080910402602001604051908101604052809392919081815260200183838082843782019150505050505091929192908035906020019092919050505061052c565b005b3480156102ea57600080fd5b506103136004803603810190808035906020019092919080359060200190929190505050610530565b005b34801561032157600080fd5b50610386600480360381019080803590602001908201803590602001908080601f016020809104026020016040519081016040528093929190818152602001838380828437820191505050505050919291929080359060200190929190505050610534565b005b34801561039457600080fd5b506103f9600480360381019080803590602001908201803590602001908080601f016020809104026020016040519081016040528093929190818152602001838380828437820191505050505050919291929080359060200190929190505050610538565b005b34801561040757600080fd5b506104a8600480360381019080803590602001908201803590602001908080601f0160208091040260200160405190810160405280939291908181526020018383808284378201915050505050509192919290803590602001908201803590602001908080601f016020809104026020016040519081016040528093929190818152602001838380828437820191505050505050919291929050505061053c565b005b3480156104b657600080fd5b5061051b600480360381019080803590602001908201803590602001908080601f016020809104026020016040519081016040528093929190818152602001838380828437820191505050505050919291929080359060200190929190505050610540565b005b5050565b5050565b50565b5050565b5050565b5050565b5050565b5050565b5050565b50505600a165627a7a7230582090710b84578cde58cb9eaefd0c7fcec7e2d7a870478771ddda19a640f950d09a0029

View File

@ -0,0 +1 @@
[{"constant":true,"inputs":[{"name":"","type":"int256"}],"name":"get","outputs":[{"name":"","type":"address"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"size","outputs":[{"name":"","type":"int256"}],"payable":false,"stateMutability":"view","type":"function"}]

View File

@ -0,0 +1 @@
608060405234801561001057600080fd5b50610118806100206000396000f3006080604052600436106049576000357c0100000000000000000000000000000000000000000000000000000000900463ffffffff168063846719e014604e578063949d225d1460b8575b600080fd5b348015605957600080fd5b5060766004803603810190808035906020019092919050505060e0565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b34801560c357600080fd5b5060ca60e7565b6040518082815260200191505060405180910390f35b6000919050565b6000905600a165627a7a723058204e5bbf9854a6bc3833fb75183dcee5b11e6303a2d5d443d48cedb3090017928b0029

View File

@ -0,0 +1 @@
[{"constant":true,"inputs":[{"name":"","type":"string"}],"name":"getBytes32","outputs":[{"name":"","type":"bytes32"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[{"name":"","type":"string"},{"name":"","type":"int256"}],"name":"set","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[{"name":"","type":"string"}],"name":"getUInt","outputs":[{"name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[{"name":"","type":"string"},{"name":"","type":"uint256"}],"name":"set","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[{"name":"","type":"string"}],"name":"getString","outputs":[{"name":"","type":"string"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[{"name":"","type":"string"},{"name":"","type":"address"}],"name":"set","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[{"name":"","type":"string"}],"name":"getAddress","outputs":[{"name":"","type":"address"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[{"name":"","type":"string"}],"name":"getBytes64","outputs":[{"name":"","type":"bytes1[64]"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[{"name":"","type":"string"},{"name":"","type":"string"}],"name":"set","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[{"name":"","type":"string"}],"name":"getInt","outputs":[{"name":"","type":"int256"}],"payable":false,"stateMutability":"view","type":"function"}]

View File

@ -0,0 +1 @@
608060405234801561001057600080fd5b50610706806100206000396000f3006080604052600436106100a4576000357c0100000000000000000000000000000000000000000000000000000000900463ffffffff16806327314f79146100a95780632ef8ba741461012e5780633536046a146101a15780638a42ebe91461021e5780639c981fcb14610291578063a815ff1514610373578063bf40fac1146103fc578063d52decd4146104a5578063e942b5161461054a578063fda69fae146105f9575b600080fd5b3480156100b557600080fd5b50610110600480360381019080803590602001908201803590602001908080601f0160208091040260200160405190810160405280939291908181526020018383808284378201915050505050509192919290505050610676565b60405180826000191660001916815260200191505060405180910390f35b34801561013a57600080fd5b5061019f600480360381019080803590602001908201803590602001908080601f01602080910402602001604051908101604052809392919081815260200183838082843782019150505050505091929192908035906020019092919050505061067d565b005b3480156101ad57600080fd5b50610208600480360381019080803590602001908201803590602001908080601f0160208091040260200160405190810160405280939291908181526020018383808284378201915050505050509192919290505050610681565b6040518082815260200191505060405180910390f35b34801561022a57600080fd5b5061028f600480360381019080803590602001908201803590602001908080601f016020809104026020016040519081016040528093929190818152602001838380828437820191505050505050919291929080359060200190929190505050610688565b005b34801561029d57600080fd5b506102f8600480360381019080803590602001908201803590602001908080601f016020809104026020016040519081016040528093929190818152602001838380828437820191505050505050919291929050505061068c565b6040518080602001828103825283818151815260200191508051906020019080838360005b8381101561033857808201518184015260208101905061031d565b50505050905090810190601f1680156103655780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b34801561037f57600080fd5b506103fa600480360381019080803590602001908201803590602001908080601f0160208091040260200160405190810160405280939291908181526020018383808284378201915050505050509192919290803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610693565b005b34801561040857600080fd5b50610463600480360381019080803590602001908201803590602001908080601f0160208091040260200160405190810160405280939291908181526020018383808284378201915050505050509192919290505050610697565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b3480156104b157600080fd5b5061050c600480360381019080803590602001908201803590602001908080601f016020809104026020016040519081016040528093929190818152602001838380828437820191505050505050919291929050505061069e565b6040518082604060200280838360005b8381101561053757808201518184015260208101905061051c565b5050505090500191505060405180910390f35b34801561055657600080fd5b506105f7600480360381019080803590602001908201803590602001908080601f0160208091040260200160405190810160405280939291908181526020018383808284378201915050505050509192919290803590602001908201803590602001908080601f01602080910402602001604051908101604052809392919081815260200183838082843782019150505050505091929192905050506106ab565b005b34801561060557600080fd5b50610660600480360381019080803590602001908201803590602001908080601f01602080910402602001604051908101604052809392919081815260200183838082843782019150505050505091929192905050506106af565b6040518082815260200191505060405180910390f35b6000919050565b5050565b6000919050565b5050565b6060919050565b5050565b6000919050565b6106a66106b6565b919050565b5050565b6000919050565b610800604051908101604052806040906020820280388339808201915050905050905600a165627a7a723058202cc4c32a72c125f4237c02f14ceba75a2f552e41a2822f92aaf71d7dfc2999ff0029

View File

@ -0,0 +1 @@
[{"constant":true,"inputs":[],"name":"newEntry","outputs":[{"name":"","type":"address"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[{"name":"","type":"string"}],"name":"get","outputs":[{"name":"","type":"bool"},{"name":"","type":"address"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[{"name":"","type":"string"},{"name":"","type":"address"}],"name":"set","outputs":[{"name":"","type":"int256"}],"payable":false,"stateMutability":"nonpayable","type":"function"}]

View File

@ -0,0 +1 @@
608060405234801561001057600080fd5b50610245806100206000396000f300608060405260043610610057576000357c0100000000000000000000000000000000000000000000000000000000900463ffffffff16806313db93461461005c578063693ec85e146100b3578063a815ff1514610167575b600080fd5b34801561006857600080fd5b50610071610204565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b3480156100bf57600080fd5b5061011a600480360381019080803590602001908201803590602001908080601f0160208091040260200160405190810160405280939291908181526020018383808284378201915050505050509192919290505050610209565b60405180831515151581526020018273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019250505060405180910390f35b34801561017357600080fd5b506101ee600480360381019080803590602001908201803590602001908080601f0160208091040260200160405190810160405280939291908181526020018383808284378201915050505050509192919290803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610211565b6040518082815260200191505060405180910390f35b600090565b600080915091565b6000929150505600a165627a7a723058200e0db23da1cb08d947b6633a5c57207aab81719b1ca016efbf6c485d32d4ede00029

View File

@ -0,0 +1 @@
[{"constant":false,"inputs":[{"name":"","type":"string"},{"name":"","type":"string"},{"name":"","type":"string"}],"name":"createTable","outputs":[{"name":"","type":"int256"}],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[{"name":"","type":"string"}],"name":"openTable","outputs":[{"name":"","type":"address"}],"payable":false,"stateMutability":"view","type":"function"}]

View File

@ -0,0 +1 @@
608060405234801561001057600080fd5b5061023f806100206000396000f30060806040526004361061004c576000357c0100000000000000000000000000000000000000000000000000000000900463ffffffff16806356004b6a14610051578063f23f63c91461015a575b600080fd5b34801561005d57600080fd5b50610144600480360381019080803590602001908201803590602001908080601f0160208091040260200160405190810160405280939291908181526020018383808284378201915050505050509192919290803590602001908201803590602001908080601f0160208091040260200160405190810160405280939291908181526020018383808284378201915050505050509192919290803590602001908201803590602001908080601f0160208091040260200160405190810160405280939291908181526020018383808284378201915050505050509192919290505050610203565b6040518082815260200191505060405180910390f35b34801561016657600080fd5b506101c1600480360381019080803590602001908201803590602001908080601f016020809104026020016040519081016040528093929190818152602001838380828437820191505050505050919291929050505061020c565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b60009392505050565b60009190505600a165627a7a72305820620c3539295804f9b2cdeb63bf347755cf7b25f807c039bde297e96301b6c48f0029

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@ -0,0 +1 @@
[{"constant":true,"inputs":[],"name":"newEntry","outputs":[{"name":"","type":"address"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[{"name":"","type":"string"},{"name":"","type":"address"}],"name":"remove","outputs":[{"name":"","type":"int256"}],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":false,"inputs":[{"name":"","type":"string"},{"name":"","type":"address"}],"name":"insert","outputs":[{"name":"","type":"int256"}],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[],"name":"newCondition","outputs":[{"name":"","type":"address"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[{"name":"","type":"string"},{"name":"","type":"address"},{"name":"","type":"address"}],"name":"update","outputs":[{"name":"","type":"int256"}],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[{"name":"","type":"string"},{"name":"","type":"address"}],"name":"select","outputs":[{"name":"","type":"address"}],"payable":false,"stateMutability":"view","type":"function"}]

View File

@ -0,0 +1 @@
608060405234801561001057600080fd5b50610442806100206000396000f300608060405260043610610078576000357c0100000000000000000000000000000000000000000000000000000000900463ffffffff16806313db93461461007d57806328bb2117146100d457806331afac36146101715780637857d7c91461020e578063bf2b70a114610265578063e8434e3914610322575b600080fd5b34801561008957600080fd5b506100926103eb565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b3480156100e057600080fd5b5061015b600480360381019080803590602001908201803590602001908080601f0160208091040260200160405190810160405280939291908181526020018383808284378201915050505050509192919290803573ffffffffffffffffffffffffffffffffffffffff1690602001909291905050506103f0565b6040518082815260200191505060405180910390f35b34801561017d57600080fd5b506101f8600480360381019080803590602001908201803590602001908080601f0160208091040260200160405190810160405280939291908181526020018383808284378201915050505050509192919290803573ffffffffffffffffffffffffffffffffffffffff1690602001909291905050506103f8565b6040518082815260200191505060405180910390f35b34801561021a57600080fd5b50610223610400565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b34801561027157600080fd5b5061030c600480360381019080803590602001908201803590602001908080601f0160208091040260200160405190810160405280939291908181526020018383808284378201915050505050509192919290803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610405565b6040518082815260200191505060405180910390f35b34801561032e57600080fd5b506103a9600480360381019080803590602001908201803590602001908080601f0160208091040260200160405190810160405280939291908181526020018383808284378201915050505050509192919290803573ffffffffffffffffffffffffffffffffffffffff16906020019092919050505061040e565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b600090565b600092915050565b600092915050565b600090565b60009392505050565b6000929150505600a165627a7a7230582027f3a06c6b7fd8fac14e10384a94f0ded8d1cdf1979b6871804cc92bbf9706500029

View File

@ -0,0 +1,67 @@
pragma solidity>=0.4.24 <=0.7.0;
contract TableFactory {
function openTable(string memory) public view returns (Table) {} //open table
function createTable(string memory, string memory, string memory) public returns (int256) {} //create table
}
//select condition
contract Condition {
function EQ(string memory, int256) public {}
function EQ(string memory, string memory) public {}
function NE(string memory, int256) public {}
function NE(string memory, string memory) public {}
function GT(string memory, int256) public {}
function GE(string memory, int256) public {}
function LT(string memory, int256) public {}
function LE(string memory, int256) public {}
function limit(int256) public {}
function limit(int256, int256) public {}
}
//one record
contract Entry {
function getInt(string memory) public view returns (int256) {}
function getUInt(string memory) public view returns (uint256) {}
function getAddress(string memory) public view returns (address) {}
function getBytes64(string memory) public view returns (bytes1[64] memory) {}
function getBytes32(string memory) public view returns (bytes32) {}
function getString(string memory) public view returns (string memory) {}
function set(string memory, int256) public {}
function set(string memory, uint256) public {}
function set(string memory, string memory) public {}
function set(string memory, address) public {}
}
//record sets
contract Entries {
function get(int256) public view returns (Entry) {}
function size() public view returns (int256) {}
}
//Table main contract
contract Table {
function select(string memory, Condition) public view returns (Entries) {}
function insert(string memory, Entry) public returns (int256) {}
function update(string memory, Entry, Condition) public returns (int256) {}
function remove(string memory, Condition) public returns (int256) {}
function newEntry() public view returns (Entry) {}
function newCondition() public view returns (Condition) {}
}
contract KVTableFactory {
function openTable(string memory) public view returns (KVTable) {}
function createTable(string memory, string memory, string memory) public returns (int256) {}
}
//KVTable per permiary key has only one Entry
contract KVTable {
function get(string memory) public view returns (bool, Entry) {}
function set(string memory, Entry) public returns (int256) {}
function newEntry() public view returns (Entry) {}
}

View File

@ -0,0 +1 @@
[{"constant":false,"inputs":[{"name":"","type":"string"},{"name":"","type":"string"},{"name":"","type":"string"}],"name":"createTable","outputs":[{"name":"","type":"int256"}],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[{"name":"","type":"string"}],"name":"openTable","outputs":[{"name":"","type":"address"}],"payable":false,"stateMutability":"view","type":"function"}]

View File

@ -0,0 +1 @@
608060405234801561001057600080fd5b5061023f806100206000396000f30060806040526004361061004c576000357c0100000000000000000000000000000000000000000000000000000000900463ffffffff16806356004b6a14610051578063f23f63c91461015a575b600080fd5b34801561005d57600080fd5b50610144600480360381019080803590602001908201803590602001908080601f0160208091040260200160405190810160405280939291908181526020018383808284378201915050505050509192919290803590602001908201803590602001908080601f0160208091040260200160405190810160405280939291908181526020018383808284378201915050505050509192919290803590602001908201803590602001908080601f0160208091040260200160405190810160405280939291908181526020018383808284378201915050505050509192919290505050610203565b6040518082815260200191505060405180910390f35b34801561016657600080fd5b506101c1600480360381019080803590602001908201803590602001908080601f016020809104026020016040519081016040528093929190818152602001838380828437820191505050505050919291929050505061020c565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b60009392505050565b60009190505600a165627a7a7230582065aa33e52fdda250c550f17e927edad93ccab126e428f56915db73e4c84e8e670029

View File

@ -0,0 +1,614 @@
pragma solidity>=0.4.24 <=0.7.0;
pragma experimental ABIEncoderV2;
import "./Table.sol";
contract OpenSource {
TableFactory tableFactory;
string constant REPO_TABLE = "repo";
string constant USER_TABLE = "user";
string constant COMMIT_TABLE = "commit";
string constant PUSH_TABLE = "push";
string constant PULL_REQUEST_TABLE = "pull_request";
string constant PULL_REQUEST_COMMENT_TABLE = "pull_request_comment";
string constant ISSUE_TABLE = "issue";
string constant ISSUE_COMMENT_TABLE = "issue_comment";
constructor() public {
tableFactory = TableFactory(0x1001); //The fixed address is 0x1001 for TableFactory
// the parameters of createTable are tableName,keyField,"vlaueFiled1,vlaueFiled2,vlaueFiled3,..."
tableFactory.createTable(REPO_TABLE, "token_name", "owner,total_supply,cur_supply");
tableFactory.createTable(USER_TABLE, "user", "token_name,balance");
tableFactory.createTable(COMMIT_TABLE, "commit_hash", "content");
tableFactory.createTable(PUSH_TABLE, "push_id", "content");
tableFactory.createTable(PULL_REQUEST_TABLE, "pull_request_id", "content");
tableFactory.createTable(PULL_REQUEST_COMMENT_TABLE, "pull_request_comment_id", "content");
tableFactory.createTable(ISSUE_TABLE, "issue_id", "content");
tableFactory.createTable(ISSUE_COMMENT_TABLE, "issue_comment_id", "content");
}
// create repo
function createRepo(string memory token_name, string memory owner, uint256 total_supply, uint256 cur_supply, string[] memory username, uint256[] memory balance)
public
returns (int256)
{
if (judgeReposExisted(token_name) == true) {
return -1001;
}
if (total_supply < cur_supply) {
return -1002;
}
Table repo_table = tableFactory.openTable(REPO_TABLE);
Table user_table = tableFactory.openTable(USER_TABLE);
Entry repo_entry = repo_table.newEntry();
repo_entry.set("token_name", token_name);
repo_entry.set("owner", owner);
repo_entry.set("total_supply", total_supply);
repo_entry.set("cur_supply", cur_supply);
int256 count = repo_table.insert(token_name, repo_entry);
if (count != 1) {
return count;
}
Entry user_entry = user_table.newEntry();
uint256 i = 0;
for (i = 0; i < balance.length; ++i) {
user_entry = user_table.newEntry();
user_entry.set("user", username[i]);
user_entry.set("token_name", token_name);
user_entry.set("balance", balance[i]);
count = user_table.insert(username[i], user_entry);
if (count != 1) {
return count;
}
}
// emit InsertResult(count);
return count;
}
function selectRepoBasicInfo(string memory token_name)
public
view
returns (string memory, string memory, int256, int256)
{
Table repo_table = tableFactory.openTable(REPO_TABLE);
Condition condition = repo_table.newCondition();
Entries entries = repo_table.select(token_name, condition);
if (entries.size() == 0) {
return ("", "", 0, 0);
}
Entry entry = entries.get(0);
return (entry.getString("token_Name"), entry.getString("owner"), entry.getInt("total_supply"), entry.getInt("cur_supply"));
}
// select user all balance
function selectUserAllBalance(string memory username)
public
view
returns (string[] memory, string[] memory, uint256[] memory)
{
Table user_table = tableFactory.openTable(USER_TABLE);
Condition condition = user_table.newCondition();
Entries entries = user_table.select(username, condition);
string[] memory username_list = new string[](uint256(entries.size()));
string[] memory token_name_list = new string[](uint256(entries.size()));
uint256[] memory balance_list = new uint256[](uint256(entries.size()));
for (int256 i = 0; i < entries.size(); ++i) {
Entry entry = entries.get(i);
username_list[uint256(i)] = entry.getString("user");
token_name_list[uint256(i)] = entry.getString("token_name");
balance_list[uint256(i)] = entry.getUInt("balance");
}
return (username_list, token_name_list, balance_list);
}
// select single user balance
function selectUserBalance(string memory username, string memory token_name)
public
view
returns (string[] memory, string[] memory, uint256[] memory)
{
Table user_table = tableFactory.openTable(USER_TABLE);
Condition condition = user_table.newCondition();
condition.EQ("token_name", token_name);
Entries entries = user_table.select(username, condition);
string[] memory username_list = new string[](uint256(entries.size()));
string[] memory token_name_list = new string[](uint256(entries.size()));
uint256[] memory balance_list = new uint256[](uint256(entries.size()));
for (int256 i = 0; i < entries.size(); ++i) {
Entry entry = entries.get(i);
username_list[uint256(i)] = entry.getString("user");
token_name_list[uint256(i)] = entry.getString("token_name");
balance_list[uint256(i)] = entry.getUInt("balance");
}
return (username_list, token_name_list, balance_list);
}
// add user balance
function addUserBalance(string memory username, string memory token_name, uint256 amount)
public
returns (int256)
{
// Token数 Token Token
Table repo_table = tableFactory.openTable(REPO_TABLE);
Condition condition = repo_table.newCondition();
Entries entries = repo_table.select(token_name, condition);
if (entries.size() == 0) {
return -1003;
}
Entry entry = entries.get(0);
uint256 cur_supply = entry.getUInt("cur_supply");
cur_supply += amount;
if (cur_supply > entry.getUInt("total_supply")) {
return -1004;
}
//
Table user_table = tableFactory.openTable(USER_TABLE);
condition = user_table.newCondition();
condition.EQ("token_name", token_name);
entries = user_table.select(username, condition);
uint256 user_balance = amount;
int256 count = 0;
if (entries.size() == 0) {
//
entry = user_table.newEntry();
entry.set("user", username);
entry.set("token_name", token_name);
entry.set("balance", user_balance);
count = user_table.insert(username, entry);
if (count != 1) {
return count;
}
} else {
//
entry = entries.get(0);
Entry updated_user_entry = user_table.newEntry();
user_balance += entry.getUInt("balance");
updated_user_entry.set("balance", user_balance);
condition = user_table.newCondition();
condition.EQ("token_name", token_name);
condition.EQ("user", username);
count = user_table.update(username, updated_user_entry, condition);
if (count != 1) {
return count;
}
}
// repo
condition = repo_table.newCondition();
entry = repo_table.newEntry();
entry.set("cur_supply", cur_supply);
condition.EQ("token_name",token_name);
count = repo_table.update(token_name, entry, condition);
return count;
}
// minus user balance
function minusUserBalance(string memory username, string memory token_name, uint256 amount)
public
returns (int256)
{
// Token数 Token Token
Table repo_table = tableFactory.openTable(REPO_TABLE);
Condition condition = repo_table.newCondition();
Entries entries = repo_table.select(token_name, condition);
if (entries.size() == 0) {
return -1003;
}
Entry entry = entries.get(0);
uint256 cur_supply = entry.getUInt("cur_supply") - amount;
//
Table user_table = tableFactory.openTable(USER_TABLE);
condition = user_table.newCondition();
condition.EQ("token_name", token_name);
entries = user_table.select(username, condition);
uint256 user_balance = amount;
int256 count = 0;
if (entries.size() == 0) {
//
entry = user_table.newEntry();
entry.set("user", username);
entry.set("token_name", token_name);
entry.set("balance", "0");
count = user_table.insert(username, entry);
if (count != 1) {
return count;
}
return -1006;
} else {
//
entry = entries.get(0);
Entry updated_user_entry = user_table.newEntry();
if (entry.getUInt("balance") < amount) {
return -1006;
}
user_balance = entry.getUInt("balance") - amount;
updated_user_entry.set("balance", user_balance);
condition = user_table.newCondition();
condition.EQ("token_name", token_name);
condition.EQ("user", username);
count = user_table.update(username, updated_user_entry, condition);
if (count != 1) {
return count;
}
}
// repo
condition = repo_table.newCondition();
entry = repo_table.newEntry();
entry.set("cur_supply", cur_supply);
condition.EQ("token_name",token_name);
count = repo_table.update(token_name, entry, condition);
return count;
}
// minus user balance
function transferUserBalance(string memory payer, string memory payee, string memory token_name, uint256 amount)
public
returns (int256)
{
//
Table repo_table = tableFactory.openTable(REPO_TABLE);
Condition condition = repo_table.newCondition();
Entries entries = repo_table.select(token_name, condition);
if (entries.size() == 0) {
return -1003;
}
//
Table user_table = tableFactory.openTable(USER_TABLE);
condition = user_table.newCondition();
condition.EQ("token_name", token_name);
entries = user_table.select(payer, condition);
int256 count = 0;
Entry entry = user_table.newEntry();
if (entries.size() == 0) {
//
entry = user_table.newEntry();
entry.set("user", payer);
entry.set("token_name", token_name);
entry.set("balance", "0");
count = user_table.insert(payer, entry);
if (count != 1) {
return count;
}
return -1006;
}
entry = entries.get(0);
Entry updated_entry = user_table.newEntry();
if (entry.getUInt("balance") < amount) {
//
return -1006;
}
//
updated_entry.set("balance", entry.getUInt("balance")-amount);
condition = user_table.newCondition();
condition.EQ("token_name", token_name);
condition.EQ("user", payer);
count = user_table.update(payer, updated_entry, condition);
if (count != 1) {
return count;
}
//
condition = user_table.newCondition();
condition.EQ("token_name", token_name);
entries = user_table.select(payee, condition);
if (entries.size() == 0) {
//
entry = user_table.newEntry();
entry.set("user", payee);
entry.set("token_name", token_name);
entry.set("balance", amount);
count = user_table.insert(payee, entry);
return count;
}
entry = entries.get(0);
updated_entry = user_table.newEntry();
//
updated_entry.set("balance", entry.getUInt("balance")+amount);
condition = user_table.newCondition();
condition.EQ("token_name", token_name);
condition.EQ("user", payee);
count = user_table.update(payee, updated_entry, condition);
return count;
}
function judgeReposExisted(string memory token_name) private returns (bool) {
Table repo_table = tableFactory.openTable(REPO_TABLE);
Condition condition = repo_table.newCondition();
Entries entries = repo_table.select(token_name, condition);
if (entries.size() > 0) {
return true;
}
return false;
}
// add commit info
function addCommitData(string memory commit_hash, string memory content)
public
returns (int256)
{
Table commit_table = tableFactory.openTable(COMMIT_TABLE);
Entry commit_entry = commit_table.newEntry();
commit_entry.set("commit_hash", commit_hash);
commit_entry.set("content", content);
int256 count = commit_table.insert(commit_hash, commit_entry);
return count;
}
// select commit info
function selectCommitInfo(string memory commit_hash)
public
view
returns (string memory, string memory)
{
Table commit_table = tableFactory.openTable(COMMIT_TABLE);
Condition condition = commit_table.newCondition();
Entries entries = commit_table.select(commit_hash, condition);
if (entries.size() == 0) {
return ("", "");
}
Entry entry = entries.get(entries.size()-1);
return (entry.getString("commit_hash"), entry.getString("content"));
}
// add push info
function addPushData(string memory push_id, string memory content)
public
returns (int256)
{
Table push_table = tableFactory.openTable(PUSH_TABLE);
Entry push_entry = push_table.newEntry();
push_entry.set("push_id", push_id);
push_entry.set("content", content);
int256 count = push_table.insert(push_id, push_entry);
return count;
}
// select push info
function selectPushInfo(string memory push_id)
public
view
returns (string memory, string memory)
{
Table push_table = tableFactory.openTable(PUSH_TABLE);
Condition condition = push_table.newCondition();
Entries entries = push_table.select(push_id, condition);
if (entries.size() == 0) {
return ("","");
}
Entry entry = entries.get(entries.size()-1);
return (entry.getString("push_id"), entry.getString("content"));
}
// add pull request info
function addPullRequestData(string memory pull_request_id, string memory content)
public
returns (int256)
{
Table pull_request_table = tableFactory.openTable(PULL_REQUEST_TABLE);
Entry pull_request_entry = pull_request_table.newEntry();
pull_request_entry.set("pull_request_id", pull_request_id);
pull_request_entry.set("content", content);
int256 count = pull_request_table.insert(pull_request_id, pull_request_entry);
return count;
}
// select pull request latest info
function selectPullRequestInfo(string memory pull_request_id)
public
view
returns (string memory, string memory)
{
Table pull_request_table = tableFactory.openTable(PULL_REQUEST_TABLE);
Condition condition = pull_request_table.newCondition();
Entries entries = pull_request_table.select(pull_request_id, condition);
if (entries.size() == 0) {
return ("", "");
}
Entry entry = entries.get(entries.size()-1);
return (entry.getString("pull_request_id"), entry.getString("content"));
}
// select pull request all info
function selectPullRequestAllInfo(string memory pull_request_id)
public
view
returns (string[] memory, string[] memory)
{
Table pull_request_table = tableFactory.openTable(PULL_REQUEST_TABLE);
Condition condition = pull_request_table.newCondition();
Entries entries = pull_request_table.select(pull_request_id, condition);
string[] memory pull_request_id_list = new string[](uint256(entries.size()));
string[] memory content_list = new string[](uint256(entries.size()));
for (int256 i = 0; i < entries.size(); ++i) {
Entry entry = entries.get(i);
pull_request_id_list[uint256(i)] = entry.getString("pull_request_id");
content_list[uint256(i)] = entry.getString("content");
}
return (pull_request_id_list, content_list);
}
// add pull request comment info
function addPullRequestCommentData(string memory pull_request_comment_id, string memory content)
public
returns (int256)
{
Table pull_request_comment_table = tableFactory.openTable(PULL_REQUEST_COMMENT_TABLE);
Entry pull_request_comment_entry = pull_request_comment_table.newEntry();
pull_request_comment_entry.set("pull_request_comment_id", pull_request_comment_id);
pull_request_comment_entry.set("content", content);
int256 count = pull_request_comment_table.insert(pull_request_comment_id, pull_request_comment_entry);
return count;
}
// select pull request comment latest info
function selectPullRequestCommentInfo(string memory pull_request_comment_id)
public
view
returns (string memory, string memory)
{
Table pull_request_comment_table = tableFactory.openTable(PULL_REQUEST_COMMENT_TABLE);
Condition condition = pull_request_comment_table.newCondition();
Entries entries = pull_request_comment_table.select(pull_request_comment_id, condition);
if (entries.size() == 0) {
return ("", "");
}
Entry entry = entries.get(entries.size()-1);
return (entry.getString("pull_request_comment_id"), entry.getString("content"));
}
// select pull request comment all info
function selectPullRequestCommentAllInfo(string memory pull_request_comment_id)
public
view
returns (string[] memory, string[] memory)
{
Table pull_request_comment_table = tableFactory.openTable(PULL_REQUEST_COMMENT_TABLE);
Condition condition = pull_request_comment_table.newCondition();
Entries entries = pull_request_comment_table.select(pull_request_comment_id, condition);
string[] memory pull_request_id_comment_list = new string[](uint256(entries.size()));
string[] memory content_list = new string[](uint256(entries.size()));
for (int256 i = 0; i < entries.size(); ++i) {
Entry entry = entries.get(i);
pull_request_id_comment_list[uint256(i)] = entry.getString("pull_request_comment_id");
content_list[uint256(i)] = entry.getString("content");
}
return (pull_request_id_comment_list, content_list);
}
// add issue info
function addIssueData(string memory issue_id, string memory content)
public
returns (int256)
{
Table issue_table = tableFactory.openTable(ISSUE_TABLE);
Entry issue_entry = issue_table.newEntry();
issue_entry.set("issue_id", issue_id);
issue_entry.set("content", content);
int256 count = issue_table.insert(issue_id, issue_entry);
return count;
}
// select issue latest info
function selectIssueInfo(string memory issue_id)
public
view
returns (string memory, string memory)
{
Table issue_table = tableFactory.openTable(ISSUE_TABLE);
Condition condition = issue_table.newCondition();
Entries entries = issue_table.select(issue_id, condition);
if (entries.size() == 0) {
return ("", "");
}
Entry entry = entries.get(entries.size()-1);
return (entry.getString("issue_id"), entry.getString("content"));
}
// select issue all info
function selectIssueAllInfo(string memory issue_id)
public
view
returns (string[] memory, string[] memory)
{
Table issue_table = tableFactory.openTable(ISSUE_TABLE);
Condition condition = issue_table.newCondition();
Entries entries = issue_table.select(issue_id, condition);
string[] memory issue_list = new string[](uint256(entries.size()));
string[] memory content_list = new string[](uint256(entries.size()));
for (int256 i = 0; i < entries.size(); ++i) {
Entry entry = entries.get(i);
issue_list[uint256(i)] = entry.getString("issue_id");
content_list[uint256(i)] = entry.getString("content");
}
return (issue_list, content_list);
}
// add issue comment info
function addIssueCommentData(string memory issue_comment_id, string memory content)
public
returns (int256)
{
Table issue_comment_table = tableFactory.openTable(ISSUE_COMMENT_TABLE);
Entry issue_comment_entry = issue_comment_table.newEntry();
issue_comment_entry.set("issue_comment_id", issue_comment_id);
issue_comment_entry.set("content", content);
int256 count = issue_comment_table.insert(issue_comment_id, issue_comment_entry);
return count;
}
// select issue comment latest info
function selectIssueCommentInfo(string memory issue_comment_id)
public
view
returns (string memory, string memory)
{
Table issue_comment_table = tableFactory.openTable(ISSUE_COMMENT_TABLE);
Condition condition = issue_comment_table.newCondition();
Entries entries = issue_comment_table.select(issue_comment_id, condition);
if (entries.size() == 0) {
return ("", "");
}
Entry entry = entries.get(entries.size()-1);
return (entry.getString("issue_comment_id"), entry.getString("content"));
}
// select issue comment all info
function selectIssueCommentAllInfo(string memory issue_comment_id)
public
view
returns (string[] memory, string[] memory)
{
Table issue_comment_table = tableFactory.openTable(ISSUE_COMMENT_TABLE);
Condition condition = issue_comment_table.newCondition();
Entries entries = issue_comment_table.select(issue_comment_id, condition);
string[] memory issue_comment_list = new string[](uint256(entries.size()));
string[] memory content_list = new string[](uint256(entries.size()));
for (int256 i = 0; i < entries.size(); ++i) {
Entry entry = entries.get(i);
issue_comment_list[uint256(i)] = entry.getString("issue_comment_id");
content_list[uint256(i)] = entry.getString("content");
}
return (issue_comment_list, content_list);
}
}

10
go.mod Normal file
View File

@ -0,0 +1,10 @@
module github.com/sulenn/trustie-fisco-bcos
go 1.15
require (
gitea.com/macaron/binding v0.0.0-20190822013154-a5f53841ed2b
gitea.com/macaron/macaron v1.5.0
github.com/FISCO-BCOS/go-sdk v0.11.0
github.com/ethereum/go-ethereum v1.10.2
)

766
go.sum Normal file
View File

@ -0,0 +1,766 @@
cloud.google.com/go v0.26.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMTw=
cloud.google.com/go v0.34.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMTw=
cloud.google.com/go v0.38.0/go.mod h1:990N+gfupTy94rShfmMCWGDn0LpTmnzTp2qbd1dvSRU=
cloud.google.com/go v0.43.0/go.mod h1:BOSR3VbTLkk6FDC/TcffxP4NF/FFBGA5ku+jvKOP7pg=
cloud.google.com/go v0.44.1/go.mod h1:iSa0KzasP4Uvy3f1mN/7PiObzGgflwredwwASm/v6AU=
cloud.google.com/go v0.44.2/go.mod h1:60680Gw3Yr4ikxnPRS/oxxkBccT6SA1yMk63TGekxKY=
cloud.google.com/go v0.45.1/go.mod h1:RpBamKRgapWJb87xiFSdk4g1CME7QZg3uwTez+TSTjc=
cloud.google.com/go v0.46.3/go.mod h1:a6bKKbmY7er1mI7TEI4lsAkts/mkhTSZK8w33B4RAg0=
cloud.google.com/go v0.50.0/go.mod h1:r9sluTvynVuxRIOHXQEHMFffphuXHOMZMycpNR5e6To=
cloud.google.com/go v0.51.0/go.mod h1:hWtGJ6gnXH+KgDv+V0zFGDvpi07n3z8ZNj3T1RW0Gcw=
cloud.google.com/go/bigquery v1.0.1/go.mod h1:i/xbL2UlR5RvWAURpBYZTtm/cXjCha9lbfbpx4poX+o=
cloud.google.com/go/bigquery v1.3.0/go.mod h1:PjpwJnslEMmckchkHFfq+HTD2DmtT67aNFKH1/VBDHE=
cloud.google.com/go/bigtable v1.2.0/go.mod h1:JcVAOl45lrTmQfLj7T6TxyMzIN/3FGGcFm+2xVAli2o=
cloud.google.com/go/datastore v1.0.0/go.mod h1:LXYbyblFSglQ5pkeyhO+Qmw7ukd3C+pD7TKLgZqpHYE=
cloud.google.com/go/firestore v1.1.0/go.mod h1:ulACoGHTpvq5r8rxGJ4ddJZBZqakUQqClKRT5SZwBmk=
cloud.google.com/go/pubsub v1.0.1/go.mod h1:R0Gpsv3s54REJCy4fxDixWD93lHJMoZTyQ2kNxGRt3I=
cloud.google.com/go/pubsub v1.1.0/go.mod h1:EwwdRX2sKPjnvnqCa270oGRyludottCI76h+R3AArQw=
cloud.google.com/go/storage v1.0.0/go.mod h1:IhtSnM/ZTZV8YYJWCY8RULGVqBDmpoyjwiyrjsg+URw=
cloud.google.com/go/storage v1.5.0/go.mod h1:tpKbwo567HUNpVclU5sGELwQWBDZ8gh0ZeosJ0Rtdos=
collectd.org v0.3.0/go.mod h1:A/8DzQBkF6abtvrT2j/AU/4tiBgJWYyh0y/oB/4MlWE=
dmitri.shuralyov.com/gpu/mtl v0.0.0-20190408044501-666a987793e9/go.mod h1:H6x//7gZCb22OMCxBHrMx7a5I7Hp++hsVxbQ4BYO7hU=
gitea.com/macaron/binding v0.0.0-20190822013154-a5f53841ed2b h1:vXt85uYV17KURaUlhU7v4GbCShkqRZDSfo0TkC0YCjQ=
gitea.com/macaron/binding v0.0.0-20190822013154-a5f53841ed2b/go.mod h1:Cxadig6POWpPYYSfg23E7jo35Yf0yvsdC1lifoKWmPo=
gitea.com/macaron/inject v0.0.0-20190803172902-8375ba841591/go.mod h1:h6E4kLao1Yko6DOU6QDnQPcuoNzvbZqzj2mtPcEn1aM=
gitea.com/macaron/inject v0.0.0-20190805023432-d4c86e31027a h1:aOKEXkDTnh4euoH0so/THLXeHtQuqHmDPb1xEk6Ehok=
gitea.com/macaron/inject v0.0.0-20190805023432-d4c86e31027a/go.mod h1:h6E4kLao1Yko6DOU6QDnQPcuoNzvbZqzj2mtPcEn1aM=
gitea.com/macaron/macaron v1.3.3-0.20190821202302-9646c0587edb/go.mod h1:0coI+mSPSwbsyAbOuFllVS38awuk9mevhLD52l50Gjs=
gitea.com/macaron/macaron v1.5.0 h1:TvWEcHw1/zaHlo0GTuKEukLh3A99+QsU2mjBrXLXjVQ=
gitea.com/macaron/macaron v1.5.0/go.mod h1:P7hfDbQjcW22lkYkXlxdRIfWOXxH2+K4EogN4Q0UlLY=
github.com/Azure/azure-pipeline-go v0.2.1/go.mod h1:UGSo8XybXnIGZ3epmeBw7Jdz+HiUVpqIlpz/HKHylF4=
github.com/Azure/azure-pipeline-go v0.2.2/go.mod h1:4rQ/NZncSvGqNkkOsNpOU1tgoNuIlp9AfUH5G1tvCHc=
github.com/Azure/azure-storage-blob-go v0.7.0/go.mod h1:f9YQKtsG1nMisotuTPpO0tjNuEjKRYAcJU8/ydDI++4=
github.com/Azure/go-autorest/autorest v0.9.0/go.mod h1:xyHB1BMZT0cuDHU7I0+g046+BFDTQ8rEZB0s4Yfa6bI=
github.com/Azure/go-autorest/autorest/adal v0.5.0/go.mod h1:8Z9fGy2MpX0PvDjB1pEgQTmVqjGhiHBW7RJJEciWzS0=
github.com/Azure/go-autorest/autorest/adal v0.8.0/go.mod h1:Z6vX6WXXuyieHAXwMj0S6HY6e6wcHn37qQMBQlvY3lc=
github.com/Azure/go-autorest/autorest/date v0.1.0/go.mod h1:plvfp3oPSKwf2DNjlBjWF/7vwR+cUD/ELuzDCXwHUVA=
github.com/Azure/go-autorest/autorest/date v0.2.0/go.mod h1:vcORJHLJEh643/Ioh9+vPmf1Ij9AEBM5FuBIXLmIy0g=
github.com/Azure/go-autorest/autorest/mocks v0.1.0/go.mod h1:OTyCOPRA2IgIlWxVYxBee2F5Gr4kF2zd2J5cFRaIDN0=
github.com/Azure/go-autorest/autorest/mocks v0.2.0/go.mod h1:OTyCOPRA2IgIlWxVYxBee2F5Gr4kF2zd2J5cFRaIDN0=
github.com/Azure/go-autorest/autorest/mocks v0.3.0/go.mod h1:a8FDP3DYzQ4RYfVAxAN3SVSiiO77gL2j2ronKKP0syM=
github.com/Azure/go-autorest/logger v0.1.0/go.mod h1:oExouG+K6PryycPJfVSxi/koC6LSNgds39diKLz7Vrc=
github.com/Azure/go-autorest/tracing v0.5.0/go.mod h1:r/s2XiOKccPW3HrqB+W0TQzfbtp2fGCgRFtBroKn4Dk=
github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU=
github.com/BurntSushi/xgb v0.0.0-20160522181843-27f122750802/go.mod h1:IVnqGOEym/WlBOVXweHU+Q+/VP0lqqI8lqeDx9IjBqo=
github.com/DATA-DOG/go-sqlmock v1.3.3/go.mod h1:f/Ixk793poVmq4qj/V1dPUg2JEAKC73Q5eFN3EC/SaM=
github.com/FISCO-BCOS/crypto v0.0.0-20200202032121-bd8ab0b5d4f1 h1:ThPht4qK10+cMZC5COIjHPq0INm5HAMVYqrez5zEgFI=
github.com/FISCO-BCOS/crypto v0.0.0-20200202032121-bd8ab0b5d4f1/go.mod h1:UrLdwsFrjiaCsvdcPLcH6B7s/FUmym3qfM93u2ziR+4=
github.com/FISCO-BCOS/go-sdk v0.11.0 h1:Lj//2Fh750MNtJqBeIc5rGLHj/dbcdz5U6GaQb3f5d8=
github.com/FISCO-BCOS/go-sdk v0.11.0/go.mod h1:PAJHW3Wuqe4EyjLNMikCEZtEvckVVzN84IXK+Eog5aw=
github.com/OneOfOne/xxhash v1.2.2/go.mod h1:HSdplMjZKSmBqAxg5vPj2TmRDmfkzw+cTzAElWljhcU=
github.com/Shopify/sarama v1.26.1/go.mod h1:NbSGBSSndYaIhRcBtY9V0U7AyH+x71bG668AuWys/yU=
github.com/Shopify/toxiproxy v2.1.4+incompatible/go.mod h1:OXgGpZ6Cli1/URJOF1DMxUHB2q5Ap20/P/eIdh4G0pI=
github.com/StackExchange/wmi v0.0.0-20180116203802-5d049714c4a6/go.mod h1:3eOhrUMpNV+6aFIbp5/iudMxNCF27Vw2OZgy4xEx0Fg=
github.com/StackExchange/wmi v0.0.0-20190523213315-cbe66965904d/go.mod h1:3eOhrUMpNV+6aFIbp5/iudMxNCF27Vw2OZgy4xEx0Fg=
github.com/VictoriaMetrics/fastcache v1.5.7/go.mod h1:ptDBkNMQI4RtmVo8VS/XwRY6RoTu1dAWCbrk+6WsEM8=
github.com/aead/siphash v1.0.1/go.mod h1:Nywa3cDsYNNK3gaciGTWPwHt0wlpNV15vwmswBAUSII=
github.com/ajstarks/svgo v0.0.0-20180226025133-644b8db467af/go.mod h1:K08gAheRH3/J6wwsYMMT4xOr94bZjxIelGM0+d/wbFw=
github.com/alecthomas/template v0.0.0-20160405071501-a0175ee3bccc/go.mod h1:LOuyumcjzFXgccqObfd/Ljyb9UuFJ6TxHnclSeseNhc=
github.com/alecthomas/template v0.0.0-20190718012654-fb15b899a751/go.mod h1:LOuyumcjzFXgccqObfd/Ljyb9UuFJ6TxHnclSeseNhc=
github.com/alecthomas/units v0.0.0-20151022065526-2efee857e7cf/go.mod h1:ybxpYRFXyAe+OPACYpWeL0wqObRcbAqCMya13uyzqw0=
github.com/alecthomas/units v0.0.0-20190717042225-c3de453c63f4/go.mod h1:ybxpYRFXyAe+OPACYpWeL0wqObRcbAqCMya13uyzqw0=
github.com/allegro/bigcache v1.2.1-0.20190218064605-e24eb225f156/go.mod h1:Cb/ax3seSYIx7SuZdm2G2xzfwmv3TPSk2ucNfQESPXM=
github.com/andreyvit/diff v0.0.0-20170406064948-c7f18ee00883/go.mod h1:rCTlJbsFo29Kk6CurOXKm700vrz8f0KW0JNfpkRJY/8=
github.com/apache/arrow/go/arrow v0.0.0-20191024131854-af6fa24be0db/go.mod h1:VTxUBvSJ3s3eHAg65PNgrsn5BtqCRPdmyXh6rAfdxN0=
github.com/aristanetworks/fsnotify v1.4.2/go.mod h1:D/rtu7LpjYM8tRJphJ0hUBYpjai8SfX+aSNsWDTq/Ks=
github.com/aristanetworks/glog v0.0.0-20191112221043-67e8567f59f3/go.mod h1:KASm+qXFKs/xjSoWn30NrWBBvdTTQq+UjkhjEJHfSFA=
github.com/aristanetworks/goarista v0.0.0-20170210015632-ea17b1a17847/go.mod h1:D/tb0zPVXnP7fmsLZjtdUhSsumbK/ij54UXjjVgMGxQ=
github.com/aristanetworks/goarista v0.0.0-20210107181124-fad53805024e/go.mod h1:Q4lsGfepQE823ePrSNr2CjCz1oeeMECJ6k1yBVujrZg=
github.com/aristanetworks/splunk-hec-go v0.3.3/go.mod h1:1VHO9r17b0K7WmOlLb9nTk/2YanvOEnLMUgsFrxBROc=
github.com/armon/circbuf v0.0.0-20150827004946-bbbad097214e/go.mod h1:3U/XgcO3hCbHZ8TKRvWD2dDTCfh9M9ya+I9JpbB7O8o=
github.com/armon/consul-api v0.0.0-20180202201655-eb2c6b5be1b6/go.mod h1:grANhF5doyWs3UAsr3K4I6qtAmlQcZDesFNEHPZAzj8=
github.com/armon/go-metrics v0.0.0-20180917152333-f0300d1749da/go.mod h1:Q73ZrmVTwzkszR9V5SSuryQ31EELlFMUz1kKyl939pY=
github.com/armon/go-radix v0.0.0-20180808171621-7fddfc383310/go.mod h1:ufUuZ+zHj4x4TnLV4JWEpy2hxWSpsRywHrMgIH9cCH8=
github.com/aws/aws-sdk-go v1.25.48/go.mod h1:KmX6BPdI08NWTb3/sm4ZGu5ShLoqVDhKgpiN924inxo=
github.com/aws/aws-sdk-go-v2 v1.2.0/go.mod h1:zEQs02YRBw1DjK0PoJv3ygDYOFTre1ejlJWl8FwAuQo=
github.com/aws/aws-sdk-go-v2/config v1.1.1/go.mod h1:0XsVy9lBI/BCXm+2Tuvt39YmdHwS5unDQmxZOYe8F5Y=
github.com/aws/aws-sdk-go-v2/credentials v1.1.1/go.mod h1:mM2iIjwl7LULWtS6JCACyInboHirisUUdkBPoTHMOUo=
github.com/aws/aws-sdk-go-v2/feature/ec2/imds v1.0.2/go.mod h1:3hGg3PpiEjHnrkrlasTfxFqUsZ2GCk/fMUn4CbKgSkM=
github.com/aws/aws-sdk-go-v2/service/internal/presigned-url v1.0.2/go.mod h1:45MfaXZ0cNbeuT0KQ1XJylq8A6+OpVV2E5kvY/Kq+u8=
github.com/aws/aws-sdk-go-v2/service/route53 v1.1.1/go.mod h1:rLiOUrPLW/Er5kRcQ7NkwbjlijluLsrIbu/iyl35RO4=
github.com/aws/aws-sdk-go-v2/service/sso v1.1.1/go.mod h1:SuZJxklHxLAXgLTc1iFXbEWkXs7QRTQpCLGaKIprQW0=
github.com/aws/aws-sdk-go-v2/service/sts v1.1.1/go.mod h1:Wi0EBZwiz/K44YliU0EKxqTCJGUfYTWXrrBwkq736bM=
github.com/aws/smithy-go v1.1.0/go.mod h1:EzMw8dbp/YJL4A5/sbhGddag+NPT7q084agLbB9LgIw=
github.com/beorn7/perks v0.0.0-20180321164747-3a771d992973/go.mod h1:Dwedo/Wpr24TaqPxmxbtue+5NUziq4I4S80YR8gNf3Q=
github.com/beorn7/perks v1.0.0/go.mod h1:KWe93zE9D1o94FZ5RNwFwVgaQK1VOXiVxmqh+CedLV8=
github.com/beorn7/perks v1.0.1/go.mod h1:G2ZrVWU2WbWT9wwq4/hrbKbnv/1ERSJQ0ibhJ6rlkpw=
github.com/bgentry/speakeasy v0.1.0/go.mod h1:+zsyZBPWlz7T6j88CTgSN5bM796AkVf0kBD4zp0CCIs=
github.com/bketelsen/crypt v0.0.3-0.20200106085610-5cbc8cc4026c/go.mod h1:MKsuJmJgSg28kpZDP6UIiPt0e0Oz0kqKNGyRaWEPv84=
github.com/bmizerany/pat v0.0.0-20170815010413-6226ea591a40/go.mod h1:8rLXio+WjiTceGBHIoTvn60HIbs7Hm7bcHjyrSqYB9c=
github.com/boltdb/bolt v1.3.1/go.mod h1:clJnj/oiGkjum5o1McbSZDSLxVThjynRyGBgiAx27Ps=
github.com/btcsuite/btcd v0.0.0-20171128150713-2e60448ffcc6/go.mod h1:Dmm/EzmjnCiweXmzRIAiUWCInVmPgjkzgv5k4tVyXiQ=
github.com/btcsuite/btcd v0.20.1-beta/go.mod h1:wVuoA8VJLEcwgqHBwHmzLRazpKxTv13Px/pDuV7OomQ=
github.com/btcsuite/btcd v0.21.0-beta/go.mod h1:ZSWyehm27aAuS9bvkATT+Xte3hjHZ+MRgMY/8NJ7K94=
github.com/btcsuite/btclog v0.0.0-20170628155309-84c8d2346e9f/go.mod h1:TdznJufoqS23FtqVCzL0ZqgP5MqXbb4fg/WgDys70nA=
github.com/btcsuite/btcutil v0.0.0-20190425235716-9e5f4b9a998d/go.mod h1:+5NJ2+qvTyV9exUAL/rxXi3DcLg2Ts+ymUAY5y4NvMg=
github.com/btcsuite/btcutil v1.0.2/go.mod h1:j9HUFwoQRsZL3V4n+qG+CUnEGHOarIxfC3Le2Yhbcts=
github.com/btcsuite/go-socks v0.0.0-20170105172521-4720035b7bfd/go.mod h1:HHNXQzUsZCxOoE+CPiyCTO6x34Zs86zZUiwtpXoGdtg=
github.com/btcsuite/goleveldb v0.0.0-20160330041536-7834afc9e8cd/go.mod h1:F+uVaaLLH7j4eDXPRvw78tMflu7Ie2bzYOH4Y8rRKBY=
github.com/btcsuite/goleveldb v1.0.0/go.mod h1:QiK9vBlgftBg6rWQIj6wFzbPfRjiykIEhBH4obrXJ/I=
github.com/btcsuite/snappy-go v0.0.0-20151229074030-0bdef8d06723/go.mod h1:8woku9dyThutzjeg+3xrA5iCpBRH8XEEg3lh6TiUghc=
github.com/btcsuite/snappy-go v1.0.0/go.mod h1:8woku9dyThutzjeg+3xrA5iCpBRH8XEEg3lh6TiUghc=
github.com/btcsuite/websocket v0.0.0-20150119174127-31079b680792/go.mod h1:ghJtEyQwv5/p4Mg4C0fgbePVuGr935/5ddU9Z3TmDRY=
github.com/btcsuite/winsvc v1.0.0/go.mod h1:jsenWakMcC0zFBFurPLEAyrnc/teJEM1O46fmI40EZs=
github.com/c-bata/go-prompt v0.2.2/go.mod h1:VzqtzE2ksDBcdln8G7mk2RX9QyGjH+OVqOCSiVIqS34=
github.com/census-instrumentation/opencensus-proto v0.2.1/go.mod h1:f6KPmirojxKA12rnyqOA5BBL4O983OfeGPqjHWSTneU=
github.com/cespare/cp v0.1.0/go.mod h1:SOGHArjBr4JWaSDEVpWpo/hNg6RoKrls6Oh40hiwW+s=
github.com/cespare/xxhash v1.1.0/go.mod h1:XrSqR1VqqWfGrhpAt58auRo0WTKS1nRRg3ghfAqPWnc=
github.com/cespare/xxhash/v2 v2.1.1/go.mod h1:VGX0DQ3Q6kWi7AoAeZDth3/j3BFtOZR5XLFGgcrjCOs=
github.com/chzyer/logex v1.1.10/go.mod h1:+Ywpsq7O8HXn0nuIou7OrIPyXbp3wmkHB+jjWRnGsAI=
github.com/chzyer/readline v0.0.0-20180603132655-2972be24d48e/go.mod h1:nSuG5e5PlCu98SY8svDHJxuZscDgtXS6KTTbou5AhLI=
github.com/chzyer/test v0.0.0-20180213035817-a1ea475d72b1/go.mod h1:Q3SI9o4m/ZMnBNeIyt5eFwwo7qiLfzFZmjNmxjkiQlU=
github.com/client9/misspell v0.3.4/go.mod h1:qj6jICC3Q7zFZvVWo7KLAzC3yx5G7kyvSDkc90ppPyw=
github.com/cloudflare/cloudflare-go v0.10.2-0.20190916151808-a80f83b9add9/go.mod h1:1MxXX1Ux4x6mqPmjkUgTP1CdXIBXKX7T+Jk9Gxrmx+U=
github.com/cloudflare/cloudflare-go v0.14.0/go.mod h1:EnwdgGMaFOruiPZRFSgn+TsQ3hQ7C/YWzIGLeu5c304=
github.com/consensys/bavard v0.1.8-0.20210105233146-c16790d2aa8b/go.mod h1:Bpd0/3mZuaj6Sj+PqrmIquiOKy397AKGThQPaGzNXAQ=
github.com/consensys/goff v0.3.10/go.mod h1:xTldOBEHmFiYS0gPXd3NsaEqZWlnmeWcRLWgD3ba3xc=
github.com/consensys/gurvy v0.3.8/go.mod h1:sN75xnsiD593XnhbhvG2PkOy194pZBzqShWF/kwuW/g=
github.com/coreos/bbolt v1.3.2/go.mod h1:iRUV2dpdMOn7Bo10OQBFzIJO9kkE559Wcmn+qkEiiKk=
github.com/coreos/etcd v3.3.10+incompatible/go.mod h1:uF7uidLiAD3TWHmW31ZFd/JWoc32PjwdhPthX9715RE=
github.com/coreos/etcd v3.3.13+incompatible/go.mod h1:uF7uidLiAD3TWHmW31ZFd/JWoc32PjwdhPthX9715RE=
github.com/coreos/go-semver v0.2.0/go.mod h1:nnelYz7RCh+5ahJtPPxZlU+153eP4D4r3EedlOD2RNk=
github.com/coreos/go-semver v0.3.0/go.mod h1:nnelYz7RCh+5ahJtPPxZlU+153eP4D4r3EedlOD2RNk=
github.com/coreos/go-systemd v0.0.0-20190321100706-95778dfbb74e/go.mod h1:F5haX7vjVVG0kc13fIWeqUViNPyEJxv/OmvnBo0Yme4=
github.com/coreos/pkg v0.0.0-20180928190104-399ea9e2e55f/go.mod h1:E3G3o1h8I7cfcXa63jLwjI0eiQQMgzzUDFVpN/nH/eA=
github.com/cpuguy83/go-md2man/v2 v2.0.0-20190314233015-f79a8a8ca69d/go.mod h1:maD7wRr/U5Z6m/iR4s+kqSMx2CaBsrgA7czyZG/E6dU=
github.com/cpuguy83/go-md2man/v2 v2.0.0/go.mod h1:maD7wRr/U5Z6m/iR4s+kqSMx2CaBsrgA7czyZG/E6dU=
github.com/dave/jennifer v1.2.0/go.mod h1:fIb+770HOpJ2fmN9EPPKOqm1vMGhB+TwXKMZhrIygKg=
github.com/davecgh/go-spew v0.0.0-20171005155431-ecdeabc65495/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
github.com/deckarep/golang-set v0.0.0-20180603214616-504e848d77ea h1:j4317fAZh7X6GqbFowYdYdI0L9bwxL07jyPZIdepyZ0=
github.com/deckarep/golang-set v0.0.0-20180603214616-504e848d77ea/go.mod h1:93vsz/8Wt4joVM7c2AVqh+YRMiUSc14yDtF28KmMOgQ=
github.com/decred/dcrd/lru v1.0.0/go.mod h1:mxKOwFd7lFjN2GZYsiz/ecgqR6kkYAl+0pz0tEMk218=
github.com/dgrijalva/jwt-go v3.2.0+incompatible/go.mod h1:E3ru+11k8xSBh+hMPgOLZmtrrCbhqsmaPHjLKYnJCaQ=
github.com/dgryski/go-bitstream v0.0.0-20180413035011-3522498ce2c8/go.mod h1:VMaSuZ+SZcx/wljOQKvp5srsbCiKDEb6K2wC4+PiBmQ=
github.com/dgryski/go-sip13 v0.0.0-20181026042036-e10d5fee7954/go.mod h1:vAd38F8PWV+bWy6jNmig1y/TA+kYO4g3RSRF0IAv0no=
github.com/dlclark/regexp2 v1.2.0/go.mod h1:2pZnwuY/m+8K6iRw6wQdMtk+rH5tNGR1i55kozfMjCc=
github.com/docker/docker v1.4.2-0.20180625184442-8e610b2b55bf/go.mod h1:eEKB0N0r5NX/I1kEveEz05bcu8tLC/8azJZsviup8Sk=
github.com/dop251/goja v0.0.0-20200219165308-d1232e640a87/go.mod h1:Mw6PkjjMXWbTj+nnj4s3QPXq1jaT0s5pC0iFD4+BOAA=
github.com/dop251/goja v0.0.0-20200721192441-a695b0cdd498/go.mod h1:Mw6PkjjMXWbTj+nnj4s3QPXq1jaT0s5pC0iFD4+BOAA=
github.com/dvyukov/go-fuzz v0.0.0-20200318091601-be3528f3a813/go.mod h1:11Gm+ccJnvAhCNLlf5+cS9KjtbaD5I5zaZpFMsTHWTw=
github.com/eapache/go-resiliency v1.2.0/go.mod h1:kFI+JgMyC7bLPUVY133qvEBtVayf5mFgVsvEsIPBvNs=
github.com/eapache/go-xerial-snappy v0.0.0-20180814174437-776d5712da21/go.mod h1:+020luEh2TKB4/GOp8oxxtq0Daoen/Cii55CzbTV6DU=
github.com/eapache/queue v1.1.0/go.mod h1:6eCeP0CKFpHLu8blIFXhExK/dRa7WDZfr6jVFPTqq+I=
github.com/eclipse/paho.mqtt.golang v1.2.0/go.mod h1:H9keYFcgq3Qr5OUJm/JZI/i6U7joQ8SYLhZwfeOo6Ts=
github.com/edsrzf/mmap-go v0.0.0-20160512033002-935e0e8a636c/go.mod h1:YO35OhQPt3KJa3ryjFM5Bs14WD66h8eGKpfaBNrHW5M=
github.com/edsrzf/mmap-go v1.0.0/go.mod h1:YO35OhQPt3KJa3ryjFM5Bs14WD66h8eGKpfaBNrHW5M=
github.com/envoyproxy/go-control-plane v0.9.1-0.20191026205805-5f8ba28d4473/go.mod h1:YTl/9mNaCwkRvm6d1a2C3ymFceY/DCBVvsKhRF0iEA4=
github.com/envoyproxy/protoc-gen-validate v0.1.0/go.mod h1:iSmxcyjqTsJpI2R4NaDN7+kN2VEUnK/pcBlmesArF7c=
github.com/ethereum/go-ethereum v1.9.16/go.mod h1:kihoiSg74VC4dZAXMkmoWp70oQabz48BJg1tuzricFc=
github.com/ethereum/go-ethereum v1.9.25/go.mod h1:vMkFiYLHI4tgPw4k2j4MHKoovchFE8plZ0M9VMk4/oM=
github.com/ethereum/go-ethereum v1.10.2 h1:qRDI7ztIBsAFH0ULVjU+twnRUYV2ApT0XJBdxxaSNzk=
github.com/ethereum/go-ethereum v1.10.2/go.mod h1:YmSRTZNqAvVUg3BIG8uhT/BOkFk9+R2iCbxw5zOlnWY=
github.com/fatih/color v1.3.0/go.mod h1:Zm6kSWBoL9eyXnKyktHP6abPY2pDugNf5KwzbycvMj4=
github.com/fatih/color v1.7.0/go.mod h1:Zm6kSWBoL9eyXnKyktHP6abPY2pDugNf5KwzbycvMj4=
github.com/fjl/memsize v0.0.0-20180418122429-ca190fb6ffbc/go.mod h1:VvhXpOYNQvB+uIk2RvXzuaQtkQJzzIx6lSBe1xv7hi0=
github.com/fjl/memsize v0.0.0-20190710130421-bcb5799ab5e5/go.mod h1:VvhXpOYNQvB+uIk2RvXzuaQtkQJzzIx6lSBe1xv7hi0=
github.com/fogleman/gg v1.2.1-0.20190220221249-0403632d5b90/go.mod h1:R/bRT+9gY/C5z7JzPU0zXsXHKM4/ayA+zqcVNZzPa1k=
github.com/fortytw2/leaktest v1.3.0/go.mod h1:jDsjWgpAGjm2CA7WthBh/CdZYEPF31XHquHwclZch5g=
github.com/frankban/quicktest v1.7.2/go.mod h1:jaStnuzAqU1AJdCO0l53JDCJrVDKcS03DbaAcR7Ks/o=
github.com/fsnotify/fsnotify v1.4.7/go.mod h1:jwhsz4b93w/PPRr/qN1Yymfu8t87LnFCMoQvtojpjFo=
github.com/fsnotify/fsnotify v1.4.9 h1:hsms1Qyu0jgnwNXIxa+/V/PDsU6CfLf6CNO8H7IWoS4=
github.com/fsnotify/fsnotify v1.4.9/go.mod h1:znqG4EE+3YCdAaPaxE2ZRY/06pZUdp0tY4IgpuI1SZQ=
github.com/garyburd/redigo v1.6.0/go.mod h1:NR3MbYisc3/PwhQ00EMzDiPmrwpPxAn5GI05/YaO1SY=
github.com/gballet/go-libpcsclite v0.0.0-20190607065134-2772fd86a8ff/go.mod h1:x7DCsMOv1taUwEWCzT4cmDeAkigA5/QCwUodaVOe8Ww=
github.com/ghodss/yaml v1.0.0/go.mod h1:4dBDuWmgqj2HViK6kFavaiC9ZROes6MMH2rRYeMEF04=
github.com/glycerine/go-unsnap-stream v0.0.0-20180323001048-9f0cb55181dd/go.mod h1:/20jfyN9Y5QPEAprSgKAUr+glWDY39ZiUEAYOEv5dsE=
github.com/glycerine/goconvey v0.0.0-20190410193231-58a59202ab31/go.mod h1:Ogl1Tioa0aV7gstGFO7KhffUsb9M4ydbEbbxpcEDc24=
github.com/go-gl/glfw v0.0.0-20190409004039-e6da0acd62b1/go.mod h1:vR7hzQXu2zJy9AVAgeJqvqgH9Q5CA+iKCZ2gyEVpxRU=
github.com/go-gl/glfw/v3.3/glfw v0.0.0-20191125211704-12ad95a8df72/go.mod h1:tQ2UAYgL5IevRw8kRxooKSPJfGvJ9fJQFa0TUsXzTg8=
github.com/go-kit/kit v0.8.0/go.mod h1:xBxKIO96dXMWWy0MnWVtmwkA9/13aqxPnvrjFYMA2as=
github.com/go-kit/kit v0.9.0/go.mod h1:xBxKIO96dXMWWy0MnWVtmwkA9/13aqxPnvrjFYMA2as=
github.com/go-logfmt/logfmt v0.3.0/go.mod h1:Qt1PoO58o5twSAckw1HlFXLmHsOX5/0LbT9GBnD5lWE=
github.com/go-logfmt/logfmt v0.4.0/go.mod h1:3RMwSq7FuexP4Kalkev3ejPJsZTpXXBr9+V4qmtdjCk=
github.com/go-ole/go-ole v1.2.1/go.mod h1:7FAglXiTm7HKlQRDeOQ6ZNUHidzCWXuZWq/1dTyBNF8=
github.com/go-ole/go-ole v1.2.5/go.mod h1:pprOEPIfldk/42T2oK7lQ4v4JSDwmV0As9GaiUsvbm0=
github.com/go-sourcemap/sourcemap v2.1.2+incompatible/go.mod h1:F8jJfvm2KbVjc5NqelyYJmf/v5J0dwNLS2mL4sNA1Jg=
github.com/go-sql-driver/mysql v1.4.1/go.mod h1:zAC/RDZ24gD3HViQzih4MyKcchzm+sOG5ZlKdlhCg5w=
github.com/go-stack/stack v1.8.0 h1:5SgMzNM5HxrEjV0ww2lTmX6E2Izsfxas4+YHWRs3Lsk=
github.com/go-stack/stack v1.8.0/go.mod h1:v0f6uXyyMGvRgIKkXu+yp6POWl0qKG85gN/melR3HDY=
github.com/gofrs/uuid v3.3.0+incompatible/go.mod h1:b2aQJv3Z4Fp6yNu3cdSllBxTCLRxnplIgP/c0N/04lM=
github.com/gogo/protobuf v1.1.1/go.mod h1:r8qH/GZQm5c6nD/R0oafs1akxWv10x8SbQlK7atdtwQ=
github.com/gogo/protobuf v1.2.1/go.mod h1:hp+jE20tsWTFYpLwKvXlhS1hjn+gTNwPg2I6zVXpSg4=
github.com/gogo/protobuf v1.3.1/go.mod h1:SlYgWuQ5SjCEi6WLHjHCa1yvBfUnHcTbrrZtXPKa29o=
github.com/golang/freetype v0.0.0-20170609003504-e2365dfdc4a0/go.mod h1:E/TSTwGwJL78qG/PmXZO1EjYhfJinVAhrmmHX6Z8B9k=
github.com/golang/geo v0.0.0-20190916061304-5b978397cfec/go.mod h1:QZ0nwyI2jOfgRAoBvP+ab5aRr7c9x7lhGEJrKvBwjWI=
github.com/golang/glog v0.0.0-20160126235308-23def4e6c14b/go.mod h1:SBH7ygxi8pfUlaOkMMuAQtPIUF8ecWP5IEl/CR7VP2Q=
github.com/golang/groupcache v0.0.0-20190129154638-5b532d6fd5ef/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc=
github.com/golang/groupcache v0.0.0-20190702054246-869f871628b6/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc=
github.com/golang/groupcache v0.0.0-20191227052852-215e87163ea7/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc=
github.com/golang/mock v1.1.1/go.mod h1:oTYuIxOrZwtPieC+H1uAHpcLFnEyAGVDL/k47Jfbm0A=
github.com/golang/mock v1.2.0/go.mod h1:oTYuIxOrZwtPieC+H1uAHpcLFnEyAGVDL/k47Jfbm0A=
github.com/golang/mock v1.3.1/go.mod h1:sBzyDLLjw3U8JLTeZvSv8jJB+tU5PVekmnlKIyFUx0Y=
github.com/golang/protobuf v1.2.0/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U=
github.com/golang/protobuf v1.3.1/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U=
github.com/golang/protobuf v1.3.2-0.20190517061210-b285ee9cfc6c/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U=
github.com/golang/protobuf v1.3.2/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U=
github.com/golang/protobuf v1.4.0-rc.1/go.mod h1:ceaxUfeHdC40wWswd/P6IGgMaK3YpKi5j83Wpe3EHw8=
github.com/golang/protobuf v1.4.0-rc.1.0.20200221234624-67d41d38c208/go.mod h1:xKAWHe0F5eneWXFV3EuXVDTCmh+JuBKY0li0aMyXATA=
github.com/golang/protobuf v1.4.0-rc.2/go.mod h1:LlEzMj4AhA7rCAGe4KMBDvJI+AwstrUpVNzEA03Pprs=
github.com/golang/protobuf v1.4.0-rc.4.0.20200313231945-b860323f09d0/go.mod h1:WU3c8KckQ9AFe+yFwt9sWVRKCVIyN9cPHBJSNnbL67w=
github.com/golang/protobuf v1.4.0/go.mod h1:jodUvKwWbYaEsadDk5Fwe5c77LiNKVO9IDvqG2KuDX0=
github.com/golang/protobuf v1.4.1/go.mod h1:U8fpvMrcmy5pZrNK1lt4xCsGvpyWQ/VVv6QDs8UjoX8=
github.com/golang/protobuf v1.4.2/go.mod h1:oDoupMAO8OvCJWAcko0GGGIgR6R6ocIYbsSw735rRwI=
github.com/golang/protobuf v1.4.3/go.mod h1:oDoupMAO8OvCJWAcko0GGGIgR6R6ocIYbsSw735rRwI=
github.com/golang/snappy v0.0.0-20180518054509-2e65f85255db/go.mod h1:/XxbfmMg8lxefKM7IXC3fBNl/7bRcc72aCRzEWrmP2Q=
github.com/golang/snappy v0.0.1/go.mod h1:/XxbfmMg8lxefKM7IXC3fBNl/7bRcc72aCRzEWrmP2Q=
github.com/golang/snappy v0.0.2-0.20200707131729-196ae77b8a26/go.mod h1:/XxbfmMg8lxefKM7IXC3fBNl/7bRcc72aCRzEWrmP2Q=
github.com/golang/snappy v0.0.3-0.20201103224600-674baa8c7fc3/go.mod h1:/XxbfmMg8lxefKM7IXC3fBNl/7bRcc72aCRzEWrmP2Q=
github.com/google/btree v0.0.0-20180813153112-4030bb1f1f0c/go.mod h1:lNA+9X1NB3Zf8V7Ke586lFgjr2dZNuvo3lPJSGZ5JPQ=
github.com/google/btree v1.0.0/go.mod h1:lNA+9X1NB3Zf8V7Ke586lFgjr2dZNuvo3lPJSGZ5JPQ=
github.com/google/flatbuffers v1.11.0/go.mod h1:1AeVuKshWv4vARoZatz6mlQ0JxURH0Kv5+zNeJKJCa8=
github.com/google/go-cmp v0.2.0/go.mod h1:oXzfMopK8JAjlY9xF4vHSVASa0yLyX7SntLO5aqRK0M=
github.com/google/go-cmp v0.3.0/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMywk6iLU=
github.com/google/go-cmp v0.3.1/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMywk6iLU=
github.com/google/go-cmp v0.4.0/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE=
github.com/google/go-cmp v0.4.1/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE=
github.com/google/go-cmp v0.5.0/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE=
github.com/google/go-cmp v0.5.4/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE=
github.com/google/gofuzz v1.0.0/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/M65Eg=
github.com/google/gofuzz v1.1.1-0.20200604201612-c04b05f3adfa/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/M65Eg=
github.com/google/martian v2.1.0+incompatible/go.mod h1:9I4somxYTbIHy5NJKHRl3wXiIaQGbYVAs8BPL6v8lEs=
github.com/google/pprof v0.0.0-20181206194817-3ea8567a2e57/go.mod h1:zfwlbNMJ+OItoe0UupaVj+oy1omPYYDuagoSzA8v9mc=
github.com/google/pprof v0.0.0-20190515194954-54271f7e092f/go.mod h1:zfwlbNMJ+OItoe0UupaVj+oy1omPYYDuagoSzA8v9mc=
github.com/google/pprof v0.0.0-20191218002539-d4f498aebedc/go.mod h1:ZgVRPoUq/hfqzAqh7sHMqb3I9Rq5C59dIz2SbBwJ4eM=
github.com/google/renameio v0.1.0/go.mod h1:KWCgfxg9yswjAJkECMjeO8J8rahYeXnNhOm40UhjYkI=
github.com/google/uuid v1.1.1/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo=
github.com/google/uuid v1.1.5 h1:kxhtnfFVi+rYdOALN0B3k9UT86zVJKfBimRaciULW4I=
github.com/google/uuid v1.1.5/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo=
github.com/googleapis/gax-go/v2 v2.0.4/go.mod h1:0Wqv26UfaUD9n4G6kQubkQ+KchISgw+vpHVxEJEs9eg=
github.com/googleapis/gax-go/v2 v2.0.5/go.mod h1:DWXyrwAJ9X0FpwwEdw+IPEYBICEFu5mhpdKc/us6bOk=
github.com/gopherjs/gopherjs v0.0.0-20181017120253-0766667cb4d1/go.mod h1:wJfORRmW1u3UXTncJ5qlYoELFm8eSnnEO6hX4iZ3EWY=
github.com/gopherjs/gopherjs v0.0.0-20181103185306-d547d1d9531e/go.mod h1:wJfORRmW1u3UXTncJ5qlYoELFm8eSnnEO6hX4iZ3EWY=
github.com/gorilla/websocket v1.4.0/go.mod h1:E7qHFY5m1UJ88s3WnNqhKjPHQ0heANvMoAMk2YaljkQ=
github.com/gorilla/websocket v1.4.1-0.20190629185528-ae1634f6a989/go.mod h1:E7qHFY5m1UJ88s3WnNqhKjPHQ0heANvMoAMk2YaljkQ=
github.com/gorilla/websocket v1.4.2/go.mod h1:YR8l580nyteQvAITg2hZ9XVh4b55+EU/adAjf1fMHhE=
github.com/graph-gophers/graphql-go v0.0.0-20191115155744-f33e81362277/go.mod h1:9CQHMSxwO4MprSdzoIEobiHpoLtHm77vfxsvsIN5Vuc=
github.com/graph-gophers/graphql-go v0.0.0-20201113091052-beb923fada29/go.mod h1:9CQHMSxwO4MprSdzoIEobiHpoLtHm77vfxsvsIN5Vuc=
github.com/grpc-ecosystem/go-grpc-middleware v1.0.0/go.mod h1:FiyG127CGDf3tlThmgyCl78X/SZQqEOJBCDaAfeWzPs=
github.com/grpc-ecosystem/go-grpc-prometheus v1.2.0/go.mod h1:8NvIoxWQoOIhqOTXgfV/d3M/q6VIi02HzZEHgUlZvzk=
github.com/grpc-ecosystem/grpc-gateway v1.9.0/go.mod h1:vNeuVxBJEsws4ogUvrchl83t/GYV9WGTSLVdBhOQFDY=
github.com/hashicorp/consul/api v1.1.0/go.mod h1:VmuI/Lkw1nC05EYQWNKwWGbkg+FbDBtguAZLlVdkD9Q=
github.com/hashicorp/consul/sdk v0.1.1/go.mod h1:VKf9jXwCTEY1QZP2MOLRhb5i/I/ssyNV1vwHyQBF0x8=
github.com/hashicorp/errwrap v1.0.0/go.mod h1:YH+1FKiLXxHSkmPseP+kNlulaMuP3n2brvKWEqk/Jc4=
github.com/hashicorp/go-cleanhttp v0.5.1/go.mod h1:JpRdi6/HCYpAwUzNwuwqhbovhLtngrth3wmdIIUrZ80=
github.com/hashicorp/go-immutable-radix v1.0.0/go.mod h1:0y9vanUI8NX6FsYoO3zeMjhV/C5i9g4Q3DwcSNZ4P60=
github.com/hashicorp/go-msgpack v0.5.3/go.mod h1:ahLV/dePpqEmjfWmKiqvPkv/twdG7iPBM1vqhUKIvfM=
github.com/hashicorp/go-multierror v1.0.0/go.mod h1:dHtQlpGsu+cZNNAkkCN/P3hoUDHhCYQXV3UM06sGGrk=
github.com/hashicorp/go-rootcerts v1.0.0/go.mod h1:K6zTfqpRlCUIjkwsN4Z+hiSfzSTQa6eBIzfwKfwNnHU=
github.com/hashicorp/go-sockaddr v1.0.0/go.mod h1:7Xibr9yA9JjQq1JpNB2Vw7kxv8xerXegt+ozgdvDeDU=
github.com/hashicorp/go-syslog v1.0.0/go.mod h1:qPfqrKkXGihmCqbJM2mZgkZGvKG1dFdvsLplgctolz4=
github.com/hashicorp/go-uuid v1.0.0/go.mod h1:6SBZvOh/SIDV7/2o3Jml5SYk/TvGqwFJ/bN7x4byOro=
github.com/hashicorp/go-uuid v1.0.1/go.mod h1:6SBZvOh/SIDV7/2o3Jml5SYk/TvGqwFJ/bN7x4byOro=
github.com/hashicorp/go-uuid v1.0.2/go.mod h1:6SBZvOh/SIDV7/2o3Jml5SYk/TvGqwFJ/bN7x4byOro=
github.com/hashicorp/go.net v0.0.1/go.mod h1:hjKkEWcCURg++eb33jQU7oqQcI9XDCnUzHA0oac0k90=
github.com/hashicorp/golang-lru v0.5.0/go.mod h1:/m3WP610KZHVQ1SGc6re/UDhFvYD7pJ4Ao+sR/qLZy8=
github.com/hashicorp/golang-lru v0.5.1/go.mod h1:/m3WP610KZHVQ1SGc6re/UDhFvYD7pJ4Ao+sR/qLZy8=
github.com/hashicorp/golang-lru v0.5.4/go.mod h1:iADmTwqILo4mZ8BN3D2Q6+9jd8WM5uGBxy+E8yxSoD4=
github.com/hashicorp/golang-lru v0.5.5-0.20210104140557-80c98217689d/go.mod h1:iADmTwqILo4mZ8BN3D2Q6+9jd8WM5uGBxy+E8yxSoD4=
github.com/hashicorp/hcl v1.0.0 h1:0Anlzjpi4vEasTeNFn2mLJgTSwt0+6sfsiTG8qcWGx4=
github.com/hashicorp/hcl v1.0.0/go.mod h1:E5yfLk+7swimpb2L/Alb/PJmXilQ/rhwaUYs4T20WEQ=
github.com/hashicorp/logutils v1.0.0/go.mod h1:QIAnNjmIWmVIIkWDTG1z5v++HQmx9WQRO+LraFDTW64=
github.com/hashicorp/mdns v1.0.0/go.mod h1:tL+uN++7HEJ6SQLQ2/p+z2pH24WQKWjBPkE0mNTz8vQ=
github.com/hashicorp/memberlist v0.1.3/go.mod h1:ajVTdAv/9Im8oMAAj5G31PhhMCZJV2pPBoIllUwCN7I=
github.com/hashicorp/serf v0.8.2/go.mod h1:6hOLApaqBFA1NXqRQAsxw9QxuDEvNxSQRwA/JwenrHc=
github.com/holiman/bloomfilter/v2 v2.0.3/go.mod h1:zpoh+gs7qcpqrHr3dB55AMiJwo0iURXE7ZOP9L9hSkA=
github.com/holiman/uint256 v1.1.0/go.mod h1:y4ga/t+u+Xwd7CpDgZESaRcWy0I7XMlTMA25ApIH5Jw=
github.com/holiman/uint256 v1.1.1/go.mod h1:y4ga/t+u+Xwd7CpDgZESaRcWy0I7XMlTMA25ApIH5Jw=
github.com/hpcloud/tail v1.0.0/go.mod h1:ab1qPbhIpdTxEkNHXyeSf5vhxWSCs/tWer42PpOxQnU=
github.com/huin/goupnp v1.0.0/go.mod h1:n9v9KO1tAxYH82qOn+UTIFQDmx5n1Zxd/ClZDMX7Bnc=
github.com/huin/goupnp v1.0.1-0.20210310174557-0ca763054c88/go.mod h1:nNs7wvRfN1eKaMknBydLNQU6146XQim8t4h+q90biWo=
github.com/huin/goutil v0.0.0-20170803182201-1ca381bf3150/go.mod h1:PpLOETDnJ0o3iZrZfqZzyLl6l7F3c6L1oWn7OICBi6o=
github.com/ianlancetaylor/demangle v0.0.0-20181102032728-5e5cf60278f6/go.mod h1:aSSvb/t6k1mPoxDqO4vJh6VOCGPwU4O0C2/Eqndh1Sc=
github.com/inconshreveable/mousetrap v1.0.0/go.mod h1:PxqpIevigyE2G7u3NXJIT2ANytuPF1OarO4DADm73n8=
github.com/influxdata/flux v0.65.1/go.mod h1:J754/zds0vvpfwuq7Gc2wRdVwEodfpCFM7mYlOw2LqY=
github.com/influxdata/influxdb v1.2.3-0.20180221223340-01288bdb0883/go.mod h1:qZna6X/4elxqT3yI9iZYdZrWWdeFOOprn86kgg4+IzY=
github.com/influxdata/influxdb v1.8.3/go.mod h1:JugdFhsvvI8gadxOI6noqNeeBHvWNTbfYGtiAn+2jhI=
github.com/influxdata/influxdb1-client v0.0.0-20191209144304-8bf82d3c094d/go.mod h1:qj24IKcXYK6Iy9ceXlo3Tc+vtHo9lIhSX5JddghvEPo=
github.com/influxdata/influxql v1.1.1-0.20200828144457-65d3ef77d385/go.mod h1:gHp9y86a/pxhjJ+zMjNXiQAA197Xk9wLxaz+fGG+kWk=
github.com/influxdata/line-protocol v0.0.0-20180522152040-32c6aa80de5e/go.mod h1:4kt73NQhadE3daL3WhR5EJ/J2ocX0PZzwxQ0gXJ7oFE=
github.com/influxdata/promql/v2 v2.12.0/go.mod h1:fxOPu+DY0bqCTCECchSRtWfc+0X19ybifQhZoQNF5D8=
github.com/influxdata/roaring v0.4.13-0.20180809181101-fc520f41fab6/go.mod h1:bSgUQ7q5ZLSO+bKBGqJiCBGAl+9DxyW63zLTujjUlOE=
github.com/influxdata/tdigest v0.0.0-20181121200506-bf2b5ad3c0a9/go.mod h1:Js0mqiSBE6Ffsg94weZZ2c+v/ciT8QRHFOap7EKDrR0=
github.com/influxdata/usage-client v0.0.0-20160829180054-6d3895376368/go.mod h1:Wbbw6tYNvwa5dlB6304Sd+82Z3f7PmVZHVKU637d4po=
github.com/jackpal/go-nat-pmp v1.0.2-0.20160603034137-1fa385a6f458/go.mod h1:QPH045xvCAeXUZOxsnwmrtiCoxIr9eob+4orBN1SBKc=
github.com/jcmturner/gofork v1.0.0/go.mod h1:MK8+TM0La+2rjBD4jE12Kj1pCCxK7d2LK/UM3ncEo0o=
github.com/jedisct1/go-minisign v0.0.0-20190909160543-45766022959e/go.mod h1:G1CVv03EnqU1wYL2dFwXxW2An0az9JTl/ZsqXQeBlkU=
github.com/jessevdk/go-flags v0.0.0-20141203071132-1679536dcc89/go.mod h1:4FA24M0QyGHXBuZZK/XkWh8h0e1EYbRYJSGM75WSRxI=
github.com/jessevdk/go-flags v1.4.0/go.mod h1:4FA24M0QyGHXBuZZK/XkWh8h0e1EYbRYJSGM75WSRxI=
github.com/jmespath/go-jmespath v0.0.0-20180206201540-c2b33e8439af/go.mod h1:Nht3zPeWKUH0NzdCt2Blrr5ys8VGpn0CEB0cQHVjt7k=
github.com/jmespath/go-jmespath v0.4.0/go.mod h1:T8mJZnbsbmF+m6zOOFylbeCJqk5+pHWvzYPziyZiYoo=
github.com/jmespath/go-jmespath/internal/testify v1.5.1/go.mod h1:L3OGu8Wl2/fWfCI6z80xFu9LTZmf1ZRjMHUOPmWr69U=
github.com/jonboulle/clockwork v0.1.0/go.mod h1:Ii8DK3G1RaLaWxj9trq07+26W01tbo22gdxWY5EU2bo=
github.com/jrick/logrotate v1.0.0/go.mod h1:LNinyqDIJnpAur+b8yyulnQw/wDuN1+BYKlTRt3OuAQ=
github.com/json-iterator/go v1.1.6/go.mod h1:+SdeFBvtyEkXs7REEP0seUULqWtbJapLOCVDaaPEHmU=
github.com/json-iterator/go v1.1.9/go.mod h1:KdQUCv79m/52Kvf8AW2vK1V8akMuk1QjK/uOdHXbAo4=
github.com/jstemmer/go-junit-report v0.0.0-20190106144839-af01ea7f8024/go.mod h1:6v2b51hI/fHJwM22ozAgKL4VKDeJcHhJFhtBdhmNjmU=
github.com/jstemmer/go-junit-report v0.9.1/go.mod h1:Brl9GWCQeLvo8nXZwPNNblvFj/XSXhF0NWZEnDohbsk=
github.com/jsternberg/zap-logfmt v1.0.0/go.mod h1:uvPs/4X51zdkcm5jXl5SYoN+4RK21K8mysFmDaM/h+o=
github.com/jtolds/gls v4.2.1+incompatible/go.mod h1:QJZ7F/aHp+rZTRtaJ1ow/lLfFfVYBRgL+9YlvaHOwJU=
github.com/jtolds/gls v4.20.0+incompatible/go.mod h1:QJZ7F/aHp+rZTRtaJ1ow/lLfFfVYBRgL+9YlvaHOwJU=
github.com/julienschmidt/httprouter v1.1.1-0.20170430222011-975b5c4c7c21/go.mod h1:SYymIcj16QtmaHHD7aYtjjsJG7VTCxuUUipMqKk8s4w=
github.com/julienschmidt/httprouter v1.2.0/go.mod h1:SYymIcj16QtmaHHD7aYtjjsJG7VTCxuUUipMqKk8s4w=
github.com/jung-kurt/gofpdf v1.0.3-0.20190309125859-24315acbbda5/go.mod h1:7Id9E/uU8ce6rXgefFLlgrJj/GYY22cpxn+r32jIOes=
github.com/jwilder/encoding v0.0.0-20170811194829-b4e1701a28ef/go.mod h1:Ct9fl0F6iIOGgxJ5npU/IUOhOhqlVrGjyIZc8/MagT0=
github.com/karalabe/usb v0.0.0-20190919080040-51dc0efba356/go.mod h1:Od972xHfMJowv7NGVDiWVxk2zxnWgjLlJzE+F4F7AGU=
github.com/kilic/bls12-381 v0.0.0-20201226121925-69dacb279461/go.mod h1:vDTTHJONJ6G+P2R74EhnyotQDTliQDnFEwhdmfzw1ig=
github.com/kisielk/errcheck v1.1.0/go.mod h1:EZBBE59ingxPouuu3KfxchcWSUPOHkagtvWXihfKN4Q=
github.com/kisielk/errcheck v1.2.0/go.mod h1:/BMXB+zMLi60iA8Vv6Ksmxu/1UDYcXs4uQLJ+jE2L00=
github.com/kisielk/gotool v1.0.0/go.mod h1:XhKaO+MFFWcvkIS/tQcRk01m1F5IRFswLeQ+oQHNcck=
github.com/kkdai/bstream v0.0.0-20161212061736-f391b8402d23/go.mod h1:J+Gs4SYgM6CZQHDETBtE9HaSEkGmuNXF86RwHhHUvq4=
github.com/klauspost/compress v1.4.0/go.mod h1:RyIbtBH6LamlWaDj8nUwkbUhJ87Yi3uG0guNDohfE1A=
github.com/klauspost/compress v1.9.8/go.mod h1:RyIbtBH6LamlWaDj8nUwkbUhJ87Yi3uG0guNDohfE1A=
github.com/klauspost/compress v1.10.1/go.mod h1:aoV0uJVorq1K+umq18yTdKaF57EivdYsUV+/s2qKfXs=
github.com/klauspost/cpuid v0.0.0-20170728055534-ae7887de9fa5/go.mod h1:Pj4uuM528wm8OyEC2QMXAi2YiTZ96dNQPGgoMS4s3ek=
github.com/klauspost/cpuid v1.2.3/go.mod h1:Pj4uuM528wm8OyEC2QMXAi2YiTZ96dNQPGgoMS4s3ek=
github.com/klauspost/crc32 v0.0.0-20161016154125-cb6bfca970f6/go.mod h1:+ZoRqAPRLkC4NPOvfYeR5KNOrY6TD+/sAC3HXPZgDYg=
github.com/klauspost/pgzip v1.0.2-0.20170402124221-0bf5dcad4ada/go.mod h1:Ch1tH69qFZu15pkjo5kYi6mth2Zzwzt50oCQKQE9RUs=
github.com/klauspost/reedsolomon v1.9.3/go.mod h1:CwCi+NUr9pqSVktrkN+Ondf06rkhYZ/pcNv7fu+8Un4=
github.com/konsorten/go-windows-terminal-sequences v1.0.1/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ=
github.com/kr/logfmt v0.0.0-20140226030751-b84e30acd515/go.mod h1:+0opPa2QZZtGFBFZlji/RkVcI2GknAs/DXo4wKdlNEc=
github.com/kr/pretty v0.1.0/go.mod h1:dAy3ld7l9f0ibDNOQOHHMYYIIbhfbHSm3C4ZsoJORNo=
github.com/kr/pretty v0.2.0/go.mod h1:ipq/a2n7PKx3OHsz4KJII5eveXtPO4qwEXGdVfWzfnI=
github.com/kr/pty v1.1.1/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ=
github.com/kr/text v0.1.0/go.mod h1:4Jbv+DJW3UT/LiOwJeYQe1efqtUx/iVham/4vfdArNI=
github.com/kylelemons/godebug v1.1.0/go.mod h1:9/0rRGxNHcop5bhtWyNeEfOS8JIWk580+fNqagV/RAw=
github.com/leanovate/gopter v0.2.8/go.mod h1:gNcbPWNEWRe4lm+bycKqxUYoH5uoVje5SkOJ3uoLer8=
github.com/leanovate/gopter v0.2.9/go.mod h1:U2L/78B+KVFIx2VmW6onHJQzXtFb+p5y3y2Sh+Jxxv8=
github.com/lib/pq v1.0.0/go.mod h1:5WUZQaWbwv1U+lTReE5YruASi9Al49XbQIvNi/34Woo=
github.com/magiconair/properties v1.8.0/go.mod h1:PppfXfuXeibc/6YijjN8zIbojt8czPbwD3XqdrwzmxQ=
github.com/magiconair/properties v1.8.1 h1:ZC2Vc7/ZFkGmsVC9KvOjumD+G5lXy2RtTKyzRKO2BQ4=
github.com/magiconair/properties v1.8.1/go.mod h1:PppfXfuXeibc/6YijjN8zIbojt8czPbwD3XqdrwzmxQ=
github.com/mattn/go-colorable v0.0.9/go.mod h1:9vuHe8Xs5qXnSaW/c/ABM9alt+Vo+STaOChaDxuIBZU=
github.com/mattn/go-colorable v0.1.0/go.mod h1:9vuHe8Xs5qXnSaW/c/ABM9alt+Vo+STaOChaDxuIBZU=
github.com/mattn/go-ieproxy v0.0.0-20190610004146-91bb50d98149/go.mod h1:31jz6HNzdxOmlERGGEc4v/dMssOfmp2p5bT/okiKFFc=
github.com/mattn/go-ieproxy v0.0.0-20190702010315-6dee0af9227d/go.mod h1:31jz6HNzdxOmlERGGEc4v/dMssOfmp2p5bT/okiKFFc=
github.com/mattn/go-isatty v0.0.3/go.mod h1:M+lRXTBqGeGNdLjl/ufCoiOlB5xdOkqRJdNxMWT7Zi4=
github.com/mattn/go-isatty v0.0.4/go.mod h1:M+lRXTBqGeGNdLjl/ufCoiOlB5xdOkqRJdNxMWT7Zi4=
github.com/mattn/go-isatty v0.0.5-0.20180830101745-3fb116b82035/go.mod h1:M+lRXTBqGeGNdLjl/ufCoiOlB5xdOkqRJdNxMWT7Zi4=
github.com/mattn/go-runewidth v0.0.3/go.mod h1:LwmH8dsx7+W8Uxz3IHJYH5QSwggIsqBzpuz5H//U1FU=
github.com/mattn/go-runewidth v0.0.4/go.mod h1:LwmH8dsx7+W8Uxz3IHJYH5QSwggIsqBzpuz5H//U1FU=
github.com/mattn/go-runewidth v0.0.9/go.mod h1:H031xJmbD/WCDINGzjvQ9THkh0rPKHF+m2gUSrubnMI=
github.com/mattn/go-sqlite3 v1.11.0/go.mod h1:FPy6KqzDD04eiIsT53CuJW3U88zkxoIYsOqkbpncsNc=
github.com/mattn/go-tty v0.0.0-20180907095812-13ff1204f104/go.mod h1:XPvLUNfbS4fJH25nqRHfWLMa1ONC8Amw+mIA639KxkE=
github.com/matttproud/golang_protobuf_extensions v1.0.1/go.mod h1:D8He9yQNgCq6Z5Ld7szi9bcBfOoFv/3dc6xSMkL2PC0=
github.com/miekg/dns v1.0.14/go.mod h1:W1PPwlIAgtquWBMBEV9nkV9Cazfe8ScdGz/Lj7v3Nrg=
github.com/mitchellh/cli v1.0.0/go.mod h1:hNIlj7HEI86fIcpObd7a0FcrxTWetlwJDGcceTlRvqc=
github.com/mitchellh/go-homedir v1.0.0/go.mod h1:SfyaCUpYCn1Vlf4IUYiD9fPX4A5wJrkLzIz1N1q0pr0=
github.com/mitchellh/go-homedir v1.1.0/go.mod h1:SfyaCUpYCn1Vlf4IUYiD9fPX4A5wJrkLzIz1N1q0pr0=
github.com/mitchellh/go-testing-interface v1.0.0/go.mod h1:kRemZodwjscx+RGhAo8eIhFbs2+BFgRtFPeD/KE+zxI=
github.com/mitchellh/gox v0.4.0/go.mod h1:Sd9lOJ0+aimLBi73mGofS1ycjY8lL3uZM3JPS42BGNg=
github.com/mitchellh/iochan v1.0.0/go.mod h1:JwYml1nuB7xOzsp52dPpHFffvOCDupsG0QubkSMEySY=
github.com/mitchellh/mapstructure v0.0.0-20160808181253-ca63d7c062ee/go.mod h1:FVVH3fgwuzCH5S8UJGiWEs2h04kUh9fWfEaFds41c1Y=
github.com/mitchellh/mapstructure v1.1.2 h1:fmNYVwqnSfB9mZU6OS2O6GsXM+wcskZDuKQzvN1EDeE=
github.com/mitchellh/mapstructure v1.1.2/go.mod h1:FVVH3fgwuzCH5S8UJGiWEs2h04kUh9fWfEaFds41c1Y=
github.com/modern-go/concurrent v0.0.0-20180228061459-e0a39a4cb421/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q=
github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q=
github.com/modern-go/reflect2 v0.0.0-20180701023420-4b7aa43c6742/go.mod h1:bx2lNnkwVCuqBIxFjflWJWanXIb3RllmbCylyMrvgv0=
github.com/modern-go/reflect2 v1.0.1/go.mod h1:bx2lNnkwVCuqBIxFjflWJWanXIb3RllmbCylyMrvgv0=
github.com/mschoch/smat v0.0.0-20160514031455-90eadee771ae/go.mod h1:qAyveg+e4CE+eKJXWVjKXM4ck2QobLqTDytGJbLLhJg=
github.com/mwitkow/go-conntrack v0.0.0-20161129095857-cc309e4a2223/go.mod h1:qRWi+5nqEBWmkhHvq77mSJWrCKwh8bxhgT7d/eI7P4U=
github.com/naoina/go-stringutil v0.1.0/go.mod h1:XJ2SJL9jCtBh+P9q5btrd/Ylo8XwT/h1USek5+NqSA0=
github.com/naoina/toml v0.1.2-0.20170918210437-9fafd6967416/go.mod h1:NBIhNtsFMo3G2szEBne+bO4gS192HuIYRqfvOWb4i1E=
github.com/nxadm/tail v1.4.4/go.mod h1:kenIhsEOeOJmVchQTgglprH7qJGnHDVpk1VPCcaMI8A=
github.com/oklog/ulid v1.3.1/go.mod h1:CirwcVhetQ6Lv90oh/F+FBtV6XMibvdAFo93nm5qn4U=
github.com/olekukonko/tablewriter v0.0.1/go.mod h1:vsDQFd/mU46D+Z4whnwzcISnGGzXWMclvtLoiIKAKIo=
github.com/olekukonko/tablewriter v0.0.2-0.20190409134802-7e037d187b0c/go.mod h1:vsDQFd/mU46D+Z4whnwzcISnGGzXWMclvtLoiIKAKIo=
github.com/olekukonko/tablewriter v0.0.5/go.mod h1:hPp6KlRPjbx+hW8ykQs1w3UBbZlj6HuIJcUGPhkA7kY=
github.com/onsi/ginkgo v1.6.0/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE=
github.com/onsi/ginkgo v1.7.0/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE=
github.com/onsi/ginkgo v1.10.1/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE=
github.com/onsi/ginkgo v1.12.1/go.mod h1:zj2OWP4+oCPe1qIXoGWkgMRwljMUYCdkwsT2108oapk=
github.com/onsi/ginkgo v1.14.0/go.mod h1:iSB4RoI2tjJc9BBv4NKIKWKya62Rps+oPG/Lv9klQyY=
github.com/onsi/gomega v1.4.1/go.mod h1:C1qb7wdrVGGVU+Z6iS04AVkA3Q65CEZX59MT0QO5uiA=
github.com/onsi/gomega v1.4.3/go.mod h1:ex+gbHU/CVuBBDIJjb2X0qEXbFg53c61hWP/1CpauHY=
github.com/onsi/gomega v1.7.0/go.mod h1:ex+gbHU/CVuBBDIJjb2X0qEXbFg53c61hWP/1CpauHY=
github.com/onsi/gomega v1.7.1/go.mod h1:XdKZgCCFLUoM/7CFJVPcG8C1xQ1AJ0vpAezJrB7JYyY=
github.com/onsi/gomega v1.10.1/go.mod h1:iN09h71vgCQne3DLsj+A5owkum+a2tYe+TOCB1ybHNo=
github.com/openconfig/gnmi v0.0.0-20190823184014-89b2bf29312c/go.mod h1:t+O9It+LKzfOAhKTT5O0ehDix+MTqbtT0T9t+7zzOvc=
github.com/openconfig/reference v0.0.0-20190727015836-8dfd928c9696/go.mod h1:ym2A+zigScwkSEb/cVQB0/ZMpU3rqiH6X7WRRsxgOGw=
github.com/opentracing/opentracing-go v1.0.2/go.mod h1:UkNAQd3GIcIGf0SeVgPpRdFStlNbqXla1AfSYxPUl2o=
github.com/opentracing/opentracing-go v1.0.3-0.20180606204148-bd9c31933947/go.mod h1:UkNAQd3GIcIGf0SeVgPpRdFStlNbqXla1AfSYxPUl2o=
github.com/opentracing/opentracing-go v1.1.0/go.mod h1:UkNAQd3GIcIGf0SeVgPpRdFStlNbqXla1AfSYxPUl2o=
github.com/pascaldekloe/goe v0.0.0-20180627143212-57f6aae5913c/go.mod h1:lzWF7FIEvWOWxwDKqyGYQf6ZUaNfKdP144TG7ZOy1lc=
github.com/paulbellamy/ratecounter v0.2.0/go.mod h1:Hfx1hDpSGoqxkVVpBi/IlYD7kChlfo5C6hzIHwPqfFE=
github.com/pborman/uuid v0.0.0-20170112150404-1b00554d8222/go.mod h1:VyrYX9gd7irzKovcSS6BIIEwPRkP2Wm2m9ufcdFSJ34=
github.com/pelletier/go-toml v1.2.0 h1:T5zMGML61Wp+FlcbWjRDT7yAxhJNAiPPLOFECq181zc=
github.com/pelletier/go-toml v1.2.0/go.mod h1:5z9KED0ma1S8pY6P1sdut58dfprrGBbd/94hg7ilaic=
github.com/peterh/liner v1.0.1-0.20180619022028-8c1271fcf47f/go.mod h1:xIteQHvHuaLYG9IFj6mSxM0fCKrs34IrEQUhOYuGPHc=
github.com/peterh/liner v1.1.1-0.20190123174540-a2c9a5303de7/go.mod h1:CRroGNssyjTd/qIG2FyxByd2S8JEAZXBl4qUrZf8GS0=
github.com/philhofer/fwd v1.0.0/go.mod h1:gk3iGcWd9+svBvR0sR+KPcfE+RNWozjowpeBVG3ZVNU=
github.com/pierrec/lz4 v2.0.5+incompatible/go.mod h1:pdkljMzZIN41W+lC3N2tnIh5sFi+IEE17M5jbnwPHcY=
github.com/pierrec/lz4 v2.4.1+incompatible/go.mod h1:pdkljMzZIN41W+lC3N2tnIh5sFi+IEE17M5jbnwPHcY=
github.com/pkg/errors v0.8.0/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0=
github.com/pkg/errors v0.8.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0=
github.com/pkg/errors v0.9.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0=
github.com/pkg/term v0.0.0-20180730021639-bffc007b7fd5/go.mod h1:eCbImbZ95eXtAUIbLAuAVnBnwf83mjf6QIVH8SHYwqQ=
github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4=
github.com/posener/complete v1.1.1/go.mod h1:em0nMJCgc9GFtwrmVmEMR/ZL6WyhyjMBndrE9hABlRI=
github.com/prometheus/client_golang v0.9.1/go.mod h1:7SWBe2y4D6OKWSNQJUaRYU/AaXPKyh/dDVn+NZz0KFw=
github.com/prometheus/client_golang v0.9.3/go.mod h1:/TN21ttK/J9q6uSwhBd54HahCDft0ttaMvbicHlPoso=
github.com/prometheus/client_golang v1.0.0/go.mod h1:db9x61etRT2tGnBNRi70OPL5FsnadC4Ky3P0J6CfImo=
github.com/prometheus/client_golang v1.4.1/go.mod h1:e9GMxYsXl05ICDXkRhurwBS4Q3OK1iX/F2sw+iXX5zU=
github.com/prometheus/client_model v0.0.0-20180712105110-5c3871d89910/go.mod h1:MbSGuTsp3dbXC40dX6PRTWyKYBIrTGTE9sqQNg2J8bo=
github.com/prometheus/client_model v0.0.0-20190129233127-fd36f4220a90/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA=
github.com/prometheus/client_model v0.0.0-20190812154241-14fe0d1b01d4/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA=
github.com/prometheus/client_model v0.2.0/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA=
github.com/prometheus/common v0.0.0-20181113130724-41aa239b4cce/go.mod h1:daVV7qP5qjZbuso7PdcryaAu0sAZbrN9i7WWcTMWvro=
github.com/prometheus/common v0.4.0/go.mod h1:TNfzLD0ON7rHzMJeJkieUDPYmFC7Snx/y86RQel1bk4=
github.com/prometheus/common v0.4.1/go.mod h1:TNfzLD0ON7rHzMJeJkieUDPYmFC7Snx/y86RQel1bk4=
github.com/prometheus/common v0.6.0/go.mod h1:eBmuwkDJBwy6iBfxCBob6t6dR6ENT/y+J+Zk0j9GMYc=
github.com/prometheus/common v0.9.1/go.mod h1:yhUN8i9wzaXS3w1O07YhxHEBxD+W35wd8bs7vj7HSQ4=
github.com/prometheus/procfs v0.0.0-20181005140218-185b4288413d/go.mod h1:c3At6R/oaqEKCNdg8wHV1ftS6bRYblBhIjjI8uT2IGk=
github.com/prometheus/procfs v0.0.0-20190507164030-5867b95ac084/go.mod h1:TjEm7ze935MbeOT/UhFTIMYKhuLP4wbCsTZCD3I8kEA=
github.com/prometheus/procfs v0.0.2/go.mod h1:TjEm7ze935MbeOT/UhFTIMYKhuLP4wbCsTZCD3I8kEA=
github.com/prometheus/procfs v0.0.8/go.mod h1:7Qr8sr6344vo1JqZ6HhLceV9o3AJ1Ff+GxbHq6oeK9A=
github.com/prometheus/procfs v0.0.10/go.mod h1:7Qr8sr6344vo1JqZ6HhLceV9o3AJ1Ff+GxbHq6oeK9A=
github.com/prometheus/tsdb v0.6.2-0.20190402121629-4f204dcbc150/go.mod h1:qhTCs0VvXwvX/y3TZrWD7rabWM+ijKTux40TwIPHuXU=
github.com/prometheus/tsdb v0.7.1/go.mod h1:qhTCs0VvXwvX/y3TZrWD7rabWM+ijKTux40TwIPHuXU=
github.com/rcrowley/go-metrics v0.0.0-20190826022208-cac0b30c2563/go.mod h1:bCqnVzQkZxMG4s8nGwiZ5l3QUCyqpo9Y+/ZMZ9VjZe4=
github.com/retailnext/hllpp v1.0.1-0.20180308014038-101a6d2f8b52/go.mod h1:RDpi1RftBQPUCDRw6SmxeaREsAaRKnOclghuzp/WRzc=
github.com/rjeczalik/notify v0.9.1 h1:CLCKso/QK1snAlnhNR/CNvNiFU2saUtjV0bx3EwNeCE=
github.com/rjeczalik/notify v0.9.1/go.mod h1:rKwnCoCGeuQnwBtTSPL9Dad03Vh2n40ePRrjvIXnJho=
github.com/rogpeppe/fastuuid v0.0.0-20150106093220-6724a57986af/go.mod h1:XWv6SoW27p1b0cqNHllgS5HIMJraePCO15w5zCzIWYg=
github.com/rogpeppe/go-internal v1.3.0/go.mod h1:M8bDsm7K2OlrFYOpmOWEs/qY81heoFRclV5y23lUDJ4=
github.com/rs/cors v0.0.0-20160617231935-a62a804a8a00/go.mod h1:gFx+x8UowdsKA9AchylcLynDq+nNFfI8FkUZdN/jGCU=
github.com/rs/cors v1.7.0/go.mod h1:gFx+x8UowdsKA9AchylcLynDq+nNFfI8FkUZdN/jGCU=
github.com/rs/xhandler v0.0.0-20160618193221-ed27b6fd6521/go.mod h1:RvLn4FgxWubrpZHtQLnOf6EwhN2hEMusxZOhcW9H3UQ=
github.com/russross/blackfriday/v2 v2.0.1/go.mod h1:+Rmxgy9KzJVeS9/2gXHxylqXiyQDYRxCVz55jmeOWTM=
github.com/ryanuber/columnize v0.0.0-20160712163229-9b3edd62028f/go.mod h1:sm1tb6uqfes/u+d4ooFouqFdy9/2g9QGwK3SQygK0Ts=
github.com/satori/go.uuid v1.2.0/go.mod h1:dA0hQrYB0VpLJoorglMZABFdXlWrHn1NEOzdhQKdks0=
github.com/sean-/seed v0.0.0-20170313163322-e2103e2c3529/go.mod h1:DxrIzT+xaE7yg65j358z/aeFdxmN0P9QXhEzd20vsDc=
github.com/segmentio/kafka-go v0.1.0/go.mod h1:X6itGqS9L4jDletMsxZ7Dz+JFWxM6JHfPOCvTvk+EJo=
github.com/segmentio/kafka-go v0.2.0/go.mod h1:X6itGqS9L4jDletMsxZ7Dz+JFWxM6JHfPOCvTvk+EJo=
github.com/sergi/go-diff v1.0.0/go.mod h1:0CfEIISq7TuYL3j771MWULgwwjU+GofnZX9QAmXWZgo=
github.com/shirou/gopsutil v2.20.5+incompatible/go.mod h1:5b4v6he4MtMOwMlS0TUMTu2PcXUg8+E1lC7eC3UO/RA=
github.com/shirou/gopsutil v3.20.12+incompatible/go.mod h1:5b4v6he4MtMOwMlS0TUMTu2PcXUg8+E1lC7eC3UO/RA=
github.com/shurcooL/sanitized_anchor_name v1.0.0/go.mod h1:1NzhyTcUVG4SuEtjjoZeVRXNmyL/1OwPU0+IJeTBvfc=
github.com/sirupsen/logrus v1.2.0/go.mod h1:LxeOpSwHxABJmUn/MG1IvRgCAasNZTLOkJPxbbu5VWo=
github.com/sirupsen/logrus v1.4.2/go.mod h1:tLMulIdttU9McNUspp0xgXVQah82FyeX6MwdIuYE2rE=
github.com/smartystreets/assertions v0.0.0-20180927180507-b2de0cb4f26d/go.mod h1:OnSkiWE9lh6wB0YB77sQom3nweQdgAjqCqsofrRNTgc=
github.com/smartystreets/assertions v0.0.0-20190116191733-b6c0e53d7304/go.mod h1:OnSkiWE9lh6wB0YB77sQom3nweQdgAjqCqsofrRNTgc=
github.com/smartystreets/assertions v1.0.1/go.mod h1:kHHU4qYBaI3q23Pp3VPrmWhuIUrLW/7eUrw0BU5VaoM=
github.com/smartystreets/goconvey v0.0.0-20181108003508-044398e4856c/go.mod h1:XDJAKZRPZ1CvBcN2aX5YOUTYGHki24fSF0Iv48Ibg0s=
github.com/smartystreets/goconvey v0.0.0-20190731233626-505e41936337/go.mod h1:syvi0/a8iFYH4r/RixwvyeAJjdLS9QV7WQ/tjFTllLA=
github.com/smartystreets/goconvey v1.6.4/go.mod h1:syvi0/a8iFYH4r/RixwvyeAJjdLS9QV7WQ/tjFTllLA=
github.com/soheilhy/cmux v0.1.4/go.mod h1:IM3LyeVVIOuxMH7sFAkER9+bJ4dT7Ms6E4xg4kGIyLM=
github.com/spaolacci/murmur3 v0.0.0-20180118202830-f09979ecbc72/go.mod h1:JwIasOWyU6f++ZhiEuf87xNszmSA2myDM2Kzu9HwQUA=
github.com/spf13/afero v1.1.2 h1:m8/z1t7/fwjysjQRYbP0RD+bUIF/8tJwPdEZsI83ACI=
github.com/spf13/afero v1.1.2/go.mod h1:j4pytiNVoe2o6bmDsKpLACNPDBIoEAkihy7loJ1B0CQ=
github.com/spf13/cast v1.3.0 h1:oget//CVOEoFewqQxwr0Ej5yjygnqGkvggSE/gB35Q8=
github.com/spf13/cast v1.3.0/go.mod h1:Qx5cxh0v+4UWYiBimWS+eyWzqEqokIECu5etghLkUJE=
github.com/spf13/cobra v0.0.3/go.mod h1:1l0Ry5zgKvJasoi3XT1TypsSe7PqH0Sj9dhYf7v3XqQ=
github.com/spf13/cobra v1.0.0/go.mod h1:/6GTrnGXV9HjY+aR4k0oJ5tcvakLuG6EuKReYlHNrgE=
github.com/spf13/cobra v1.1.1/go.mod h1:WnodtKOvamDL/PwE2M4iKs8aMDBZ5Q5klgD3qfVJQMI=
github.com/spf13/jwalterweatherman v1.0.0 h1:XHEdyB+EcvlqZamSM4ZOMGlc93t6AcsBEu9Gc1vn7yk=
github.com/spf13/jwalterweatherman v1.0.0/go.mod h1:cQK4TGJAtQXfYWX+Ddv3mKDzgVb68N+wFjFa4jdeBTo=
github.com/spf13/pflag v1.0.3/go.mod h1:DYY7MBk1bdzusC3SYhjObp+wFpr4gzcvqqNjLnInEg4=
github.com/spf13/pflag v1.0.5 h1:iy+VFUOCP1a+8yFto/drg2CJ5u0yRoB7fZw3DKv/JXA=
github.com/spf13/pflag v1.0.5/go.mod h1:McXfInJRrz4CZXVZOBLb0bTZqETkiAhM9Iw0y3An2Bg=
github.com/spf13/viper v1.4.0/go.mod h1:PTJ7Z/lr49W6bUbkmS1V3by4uWynFiR9p7+dSq/yZzE=
github.com/spf13/viper v1.6.2/go.mod h1:t3iDnF5Jlj76alVNuyFBk5oUMCvsrkbvZK0WQdfDi5k=
github.com/spf13/viper v1.7.0 h1:xVKxvI7ouOI5I+U9s2eeiUfMaWBVoXA3AWskkrqK0VM=
github.com/spf13/viper v1.7.0/go.mod h1:8WkrPz2fc9jxqZNCJI/76HCieCp4Q8HaLFoCha5qpdg=
github.com/status-im/keycard-go v0.0.0-20190316090335-8537d3370df4/go.mod h1:RZLeN1LMWmRsyYjvAu+I6Dm9QmlDaIIt+Y+4Kd7Tp+Q=
github.com/steakknife/bloomfilter v0.0.0-20180922174646-6819c0d2a570/go.mod h1:8OR4w3TdeIHIh1g6EMY5p0gVNOovcWC+1vpc7naMuAw=
github.com/steakknife/hamming v0.0.0-20180906055917-c99c65617cd3/go.mod h1:hpGUWaI9xL8pRQCTXQgocU38Qw1g0Us7n5PxxTwTCYU=
github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME=
github.com/stretchr/objx v0.1.1/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME=
github.com/stretchr/testify v1.2.0/go.mod h1:a8OnRcib4nhh0OaRAV+Yts87kKdq0PP7pXfy6kDkUVs=
github.com/stretchr/testify v1.2.2/go.mod h1:a8OnRcib4nhh0OaRAV+Yts87kKdq0PP7pXfy6kDkUVs=
github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI=
github.com/stretchr/testify v1.4.0/go.mod h1:j7eGeouHqKxXV5pUuKE4zz7dFj8WfuZ+81PSLYec5m4=
github.com/stretchr/testify v1.7.0/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg=
github.com/subosito/gotenv v1.2.0 h1:Slr1R9HxAlEKefgq5jn9U+DnETlIUa6HfgEzj0g5d7s=
github.com/subosito/gotenv v1.2.0/go.mod h1:N0PQaV/YGNqwC0u51sEeR/aUtSLEXKX9iv69rRypqCw=
github.com/syndtr/goleveldb v1.0.1-0.20190923125748-758128399b1d/go.mod h1:9OrXJhf154huy1nPWmuSrkgjPUtUNhA+Zmy+6AESzuA=
github.com/syndtr/goleveldb v1.0.1-0.20200815110645-5c35d600f0ca/go.mod h1:u2MKkTVTVJWe5D1rCvame8WqhBd88EuIwODJZ1VHCPM=
github.com/syndtr/goleveldb v1.0.1-0.20210305035536-64b5b1c73954/go.mod h1:u2MKkTVTVJWe5D1rCvame8WqhBd88EuIwODJZ1VHCPM=
github.com/templexxx/cpufeat v0.0.0-20180724012125-cef66df7f161/go.mod h1:wM7WEvslTq+iOEAMDLSzhVuOt5BRZ05WirO+b09GHQU=
github.com/templexxx/xor v0.0.0-20191217153810-f85b25db303b/go.mod h1:5XA7W9S6mni3h5uvOC75dA3m9CCCaS83lltmc0ukdi4=
github.com/tinylib/msgp v1.0.2/go.mod h1:+d+yLhGm8mzTaHzB+wgMYrodPfmZrzkirds8fDWklFE=
github.com/tjfoc/gmsm v1.3.0/go.mod h1:HaUcFuY0auTiaHB9MHFGCPx5IaLhTUd2atbCFBQXn9w=
github.com/tmc/grpc-websocket-proxy v0.0.0-20190109142713-0ad062ec5ee5/go.mod h1:ncp9v5uamzpCO7NfCPTXjqaC+bZgJeR0sMTm6dMHP7U=
github.com/tyler-smith/go-bip39 v1.0.1-0.20181017060643-dbb3b84ba2ef/go.mod h1:sJ5fKU0s6JVwZjjcUEX2zFOnvq0ASQ2K9Zr6cf67kNs=
github.com/ugorji/go v1.1.4/go.mod h1:uQMGLiO92mf5W77hV/PUCpI3pbzQx3CRekS0kk+RGrc=
github.com/unknwon/com v0.0.0-20190804042917-757f69c95f3e/go.mod h1:tOOxU81rwgoCLoOVVPHb6T/wt8HZygqH5id+GNnlCXM=
github.com/unknwon/com v1.0.1 h1:3d1LTxD+Lnf3soQiD4Cp/0BRB+Rsa/+RTvz8GMMzIXs=
github.com/unknwon/com v1.0.1/go.mod h1:tOOxU81rwgoCLoOVVPHb6T/wt8HZygqH5id+GNnlCXM=
github.com/urfave/cli v1.22.1/go.mod h1:Gos4lmkARVdJ6EkW0WaNv/tZAAMe9V7XWyB60NtXRu0=
github.com/urfave/cli/v2 v2.3.0/go.mod h1:LJmUH05zAU44vOAcrfzZQKsZbVcdbOG8rtL3/XcUArI=
github.com/willf/bitset v1.1.3/go.mod h1:RjeCKbqT1RxIR/KWY6phxZiaY1IyutSBfGjNPySAYV4=
github.com/wsddn/go-ecdh v0.0.0-20161211032359-48726bab9208/go.mod h1:IotVbo4F+mw0EzQ08zFqg7pK3FebNXpaMsRy2RT+Ees=
github.com/xdg/scram v0.0.0-20180814205039-7eeb5667e42c/go.mod h1:lB8K/P019DLNhemzwFU4jHLhdvlE6uDZjXFejJXr49I=
github.com/xdg/stringprep v1.0.0/go.mod h1:Jhud4/sHMO4oL310DaZAKk9ZaJ08SJfe+sJh0HrGL1Y=
github.com/xiang90/probing v0.0.0-20190116061207-43a291ad63a2/go.mod h1:UETIi67q53MR2AWcXfiuqkDkRtnGDLqkBTpCHuJHxtU=
github.com/xlab/treeprint v0.0.0-20180616005107-d6fb6747feb6/go.mod h1:ce1O1j6UtZfjr22oyGxGLbauSBp2YVXpARAosm7dHBg=
github.com/xordataexchange/crypt v0.0.3-0.20170626215501-b2862e3d0a77/go.mod h1:aYKd//L2LvnjZzWKhF00oedf4jCCReLcmhLdhm1A27Q=
github.com/xtaci/kcp-go v5.4.20+incompatible/go.mod h1:bN6vIwHQbfHaHtFpEssmWsN45a+AZwO7eyRCmEIbtvE=
github.com/xtaci/lossyconn v0.0.0-20190602105132-8df528c0c9ae/go.mod h1:gXtu8J62kEgmN++bm9BVICuT/e8yiLI2KFobd/TRFsE=
go.etcd.io/bbolt v1.3.2/go.mod h1:IbVyRI1SCnLcuJnV2u8VeU0CEYM7e686BmAb1XKL+uU=
go.opencensus.io v0.21.0/go.mod h1:mSImk1erAIZhrmZN+AvHh14ztQfjbGwt4TtuofqLduU=
go.opencensus.io v0.22.0/go.mod h1:+kGneAE2xo2IficOXnaByMWTGM9T73dGwxeWcUqIpI8=
go.opencensus.io v0.22.2/go.mod h1:yxeiOL68Rb0Xd1ddK5vPZ/oVn4vY4Ynel7k9FzqtOIw=
go.uber.org/atomic v1.3.2/go.mod h1:gD2HeocX3+yG+ygLZcrzQJaqmWj9AIm7n08wl/qW/PE=
go.uber.org/atomic v1.4.0/go.mod h1:gD2HeocX3+yG+ygLZcrzQJaqmWj9AIm7n08wl/qW/PE=
go.uber.org/multierr v1.1.0/go.mod h1:wR5kodmAFQ0UK8QlbwjlSNy0Z68gJhDJUG5sjR94q/0=
go.uber.org/zap v1.9.1/go.mod h1:vwi/ZaCAaUcBkycHslxD9B2zi4UTXhF60s6SWpuDF0Q=
go.uber.org/zap v1.10.0/go.mod h1:vwi/ZaCAaUcBkycHslxD9B2zi4UTXhF60s6SWpuDF0Q=
golang.org/x/crypto v0.0.0-20170930174604-9419663f5a44/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4=
golang.org/x/crypto v0.0.0-20180904163835-0709b304e793/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4=
golang.org/x/crypto v0.0.0-20181029021203-45a5f77698d3/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4=
golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w=
golang.org/x/crypto v0.0.0-20190510104115-cbcb75029529/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI=
golang.org/x/crypto v0.0.0-20190605123033-f99c8df09eb5/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI=
golang.org/x/crypto v0.0.0-20190701094942-4def268fd1a4/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI=
golang.org/x/crypto v0.0.0-20190909091759-094676da4a83/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI=
golang.org/x/crypto v0.0.0-20191011191535-87dc89f01550/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI=
golang.org/x/crypto v0.0.0-20191219195013-becbf705a915/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto=
golang.org/x/crypto v0.0.0-20200115085410-6d4e4cb37c7d/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto=
golang.org/x/crypto v0.0.0-20200204104054-c9f3fb736b72/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto=
golang.org/x/crypto v0.0.0-20200221231518-2aa609cf4a9d/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto=
golang.org/x/crypto v0.0.0-20200510223506-06a226fb4e37/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto=
golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto=
golang.org/x/crypto v0.0.0-20201221181555-eec23a3978ad h1:DN0cp81fZ3njFcrLCytUHRSUkqBjfTo4Tx9RJTWs0EY=
golang.org/x/crypto v0.0.0-20201221181555-eec23a3978ad/go.mod h1:jdWPYTVW3xRLrWPugEBEK3UY2ZEsg3UU495nc5E+M+I=
golang.org/x/exp v0.0.0-20180321215751-8460e604b9de/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA=
golang.org/x/exp v0.0.0-20180807140117-3d87b88a115f/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA=
golang.org/x/exp v0.0.0-20190121172915-509febef88a4/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA=
golang.org/x/exp v0.0.0-20190125153040-c74c464bbbf2/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA=
golang.org/x/exp v0.0.0-20190306152737-a1d7652674e8/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA=
golang.org/x/exp v0.0.0-20190510132918-efd6b22b2522/go.mod h1:ZjyILWgesfNpC6sMxTJOJm9Kp84zZh5NQWvqDGG3Qr8=
golang.org/x/exp v0.0.0-20190731235908-ec7cb31e5a56/go.mod h1:JhuoJpWY28nO4Vef9tZUw9qufEGTyX1+7lmHxV5q5G4=
golang.org/x/exp v0.0.0-20190829153037-c13cbed26979/go.mod h1:86+5VVa7VpoJ4kLfm080zCjGlMRFzhUhsZKEZO7MGek=
golang.org/x/exp v0.0.0-20191030013958-a1ab85dbe136/go.mod h1:JXzH8nQsPlswgeRAPE3MuO9GYsAcnJvJ4vnMwN/5qkY=
golang.org/x/exp v0.0.0-20191129062945-2f5052295587/go.mod h1:2RIsYlXP63K8oxa1u096TMicItID8zy7Y6sNkU49FU4=
golang.org/x/exp v0.0.0-20191227195350-da58074b4299/go.mod h1:2RIsYlXP63K8oxa1u096TMicItID8zy7Y6sNkU49FU4=
golang.org/x/image v0.0.0-20180708004352-c73c2afc3b81/go.mod h1:ux5Hcp/YLpHSI86hEcLt0YII63i6oz57MZXIpbrjZUs=
golang.org/x/image v0.0.0-20190227222117-0694c2d4d067/go.mod h1:kZ7UVZpmo3dzQBMxlp+ypCbDeSB+sBbTgSJuh5dn5js=
golang.org/x/image v0.0.0-20190802002840-cff245a6509b/go.mod h1:FeLwcggjj3mMvU+oOTbSwawSJRM1uh48EjtB4UJZlP0=
golang.org/x/lint v0.0.0-20181026193005-c67002cb31c3/go.mod h1:UVdnD1Gm6xHRNCYTkRU2/jEulfH38KcIWyp/GAMgvoE=
golang.org/x/lint v0.0.0-20190227174305-5b3e6a55c961/go.mod h1:wehouNa3lNwaWXcvxsM5YxQ5yQlVC4a0KAMCusXpPoU=
golang.org/x/lint v0.0.0-20190301231843-5614ed5bae6f/go.mod h1:UVdnD1Gm6xHRNCYTkRU2/jEulfH38KcIWyp/GAMgvoE=
golang.org/x/lint v0.0.0-20190313153728-d0100b6bd8b3/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc=
golang.org/x/lint v0.0.0-20190409202823-959b441ac422/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc=
golang.org/x/lint v0.0.0-20190909230951-414d861bb4ac/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc=
golang.org/x/lint v0.0.0-20190930215403-16217165b5de/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc=
golang.org/x/lint v0.0.0-20191125180803-fdd1cda4f05f/go.mod h1:5qLYkcX4OjUUV8bRuDixDT3tpyyb+LUpUlRWLxfhWrs=
golang.org/x/mobile v0.0.0-20190312151609-d3739f865fa6/go.mod h1:z+o9i4GpDbdi3rU15maQ/Ox0txvL9dWGYEHz965HBQE=
golang.org/x/mobile v0.0.0-20190719004257-d2bd2a29d028/go.mod h1:E/iHnbuqvinMTCcRqshq8CkpyQDoeVncDDYHnLhea+o=
golang.org/x/mobile v0.0.0-20200801112145-973feb4309de/go.mod h1:skQtrUTUwhdJvXM/2KKJzY8pDgNr9I/FOMqDVRPBUS4=
golang.org/x/mod v0.0.0-20190513183733-4bf6d317e70e/go.mod h1:mXi4GBBbnImb6dmsKGUJ2LatrhH/nqhxcFungHvyanc=
golang.org/x/mod v0.1.0/go.mod h1:0QHyrYULN0/3qlju5TqG8bIK38QM8yzMo5ekMj3DlcY=
golang.org/x/mod v0.1.1-0.20191105210325-c90efee705ee/go.mod h1:QqPTAvyqsEbceGzBzNggFXnrqF1CaUcvgkdR5Ot7KZg=
golang.org/x/mod v0.1.1-0.20191209134235-331c550502dd/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA=
golang.org/x/net v0.0.0-20180719180050-a680a1efc54d/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=
golang.org/x/net v0.0.0-20180724234803-3673e40ba225/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=
golang.org/x/net v0.0.0-20180826012351-8a410e7b638d/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=
golang.org/x/net v0.0.0-20180906233101-161cd47e91fd/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=
golang.org/x/net v0.0.0-20181011144130-49bb7cea24b1/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=
golang.org/x/net v0.0.0-20181023162649-9b4f9f5ad519/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=
golang.org/x/net v0.0.0-20181114220301-adae6a3d119a/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=
golang.org/x/net v0.0.0-20181201002055-351d144fa1fc/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=
golang.org/x/net v0.0.0-20181220203305-927f97764cc3/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=
golang.org/x/net v0.0.0-20190108225652-1e06a53dbb7e/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=
golang.org/x/net v0.0.0-20190213061140-3a22650c66bd/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=
golang.org/x/net v0.0.0-20190311183353-d8887717615a/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg=
golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg=
golang.org/x/net v0.0.0-20190501004415-9ce7a6920f09/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg=
golang.org/x/net v0.0.0-20190503192946-f4e77d36d62c/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg=
golang.org/x/net v0.0.0-20190522155817-f3200d17e092/go.mod h1:HSz+uSET+XFnRR8LxR5pz3Of3rY3CfYBVs4xY44aLks=
golang.org/x/net v0.0.0-20190603091049-60506f45cf65/go.mod h1:HSz+uSET+XFnRR8LxR5pz3Of3rY3CfYBVs4xY44aLks=
golang.org/x/net v0.0.0-20190613194153-d28f0bde5980/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s=
golang.org/x/net v0.0.0-20190620200207-3b0461eec859/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s=
golang.org/x/net v0.0.0-20190724013045-ca1201d0de80/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s=
golang.org/x/net v0.0.0-20191209160850-c0dbc17a3553/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s=
golang.org/x/net v0.0.0-20200202094626-16171245cfb2/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s=
golang.org/x/net v0.0.0-20200222125558-5a598a2470a0/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s=
golang.org/x/net v0.0.0-20200520004742-59133d7f0dd7/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A=
golang.org/x/net v0.0.0-20200625001655-4c5254603344/go.mod h1:/O7V0waA8r7cgGh81Ro3o1hOxt32SMVPicZroKQ2sZA=
golang.org/x/net v0.0.0-20200813134508-3edf25e44fcc/go.mod h1:/O7V0waA8r7cgGh81Ro3o1hOxt32SMVPicZroKQ2sZA=
golang.org/x/net v0.0.0-20200822124328-c89045814202/go.mod h1:/O7V0waA8r7cgGh81Ro3o1hOxt32SMVPicZroKQ2sZA=
golang.org/x/net v0.0.0-20210220033124-5f55cee0dc0d/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg=
golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U=
golang.org/x/oauth2 v0.0.0-20190226205417-e64efc72b421/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw=
golang.org/x/oauth2 v0.0.0-20190604053449-0f29369cfe45/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw=
golang.org/x/oauth2 v0.0.0-20191202225959-858c2ad4c8b6/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw=
golang.org/x/oauth2 v0.0.0-20200107190931-bf48bf16ab8d/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw=
golang.org/x/sync v0.0.0-20180314180146-1d60e4601c6f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
golang.org/x/sync v0.0.0-20181108010431-42b317875d0f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
golang.org/x/sync v0.0.0-20181221193216-37e7f081c4d4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
golang.org/x/sync v0.0.0-20190227155943-e225da77a7e6/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
golang.org/x/sync v0.0.0-20190911185100-cd5d95a43a6e/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
golang.org/x/sync v0.0.0-20200317015054-43a5402ce75a/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
golang.org/x/sync v0.0.0-20200625203802-6e8e738ad208/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
golang.org/x/sys v0.0.0-20180823144017-11551d06cbcc/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
golang.org/x/sys v0.0.0-20180830151530-49385e6e1522/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
golang.org/x/sys v0.0.0-20180905080454-ebe1bf3edb33/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
golang.org/x/sys v0.0.0-20180909124046-d0be0721c37e/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
golang.org/x/sys v0.0.0-20181026203630-95b1ffbd15a5/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
golang.org/x/sys v0.0.0-20181107165924-66b7b1311ac8/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
golang.org/x/sys v0.0.0-20181116152217-5ac8a444bdc5/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
golang.org/x/sys v0.0.0-20190312061237-fead79001313/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20190412213103-97732733099d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20190422165155-953cdadca894/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20190502145724-3ef323f4f1fd/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20190507160741-ecd444e8653b/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20190606165138-5da285871e9c/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20190624142023-c5567b49c5d0/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20190726091711-fc99dfbffb4e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20190904154756-749cb33beabd/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20190916202348-b4ddaad3f8a3/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20191005200804-aed5e4c7ecf9/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20191026070338-33540a1f6037/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20191120155948-bd437916bb0e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20191204072324-ce4227a45e2e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20191228213918-04cbcbbfeed8/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20200107162124-548cf772de50/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20200122134326-e047566fdf82/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20200219091948-cb0a6d8edb6c/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20200323222414-85ca7c5b95cd/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20200519105757-fe76b779f299/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20200814200057-3d37ad5750ed/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20200824131525-c12d262b63d8/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20201101102859-da207088b7d1/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20201119102817-f84b799fce68/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20210105210732-16f7687f5001/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20210124154548-22da62e12c0c h1:VwygUrnw9jn88c4u8GD3rZQbqrP/tgas88tPUbBxQrk=
golang.org/x/sys v0.0.0-20210124154548-22da62e12c0c/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/term v0.0.0-20201117132131-f5c789dd3221/go.mod h1:Nr5EML6q2oocZ2LXRh80K7BxOlk5/8JxuGnuhpl+muw=
golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo=
golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ=
golang.org/x/text v0.3.1-0.20180807135948-17ff2d5776d2/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ=
golang.org/x/text v0.3.2/go.mod h1:bEr9sfX3Q8Zfm5fL9x+3itogRgK3+ptLWKqgva+5dAk=
golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ=
golang.org/x/text v0.3.4 h1:0YWbFKbhXG/wIiuHDSKpS0Iy7FSA+u45VtBMfQcFTTc=
golang.org/x/text v0.3.4/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ=
golang.org/x/time v0.0.0-20181108054448-85acf8d2951c/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ=
golang.org/x/time v0.0.0-20190308202827-9d24e82272b4/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ=
golang.org/x/time v0.0.0-20191024005414-555d28b269f0/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ=
golang.org/x/time v0.0.0-20201208040808-7e3f01d25324/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ=
golang.org/x/tools v0.0.0-20180221164845-07fd8470d635/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ=
golang.org/x/tools v0.0.0-20180525024113-a5b4c53f6e8b/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ=
golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ=
golang.org/x/tools v0.0.0-20181030221726-6c7e314b6563/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ=
golang.org/x/tools v0.0.0-20190114222345-bf090417da8b/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ=
golang.org/x/tools v0.0.0-20190206041539-40960b6deb8e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ=
golang.org/x/tools v0.0.0-20190226205152-f727befe758c/go.mod h1:9Yl7xja0Znq3iFh3HoIrodX9oNMXvdceNzlUR8zjMvY=
golang.org/x/tools v0.0.0-20190311212946-11955173bddd/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs=
golang.org/x/tools v0.0.0-20190312151545-0bb0c0a6e846/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs=
golang.org/x/tools v0.0.0-20190312170243-e65039ee4138/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs=
golang.org/x/tools v0.0.0-20190328211700-ab21143f2384/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs=
golang.org/x/tools v0.0.0-20190425150028-36563e24a262/go.mod h1:RgjU9mgBXZiqYHBnxXauZ1Gv1EHHAz9KjViQ78xBX0Q=
golang.org/x/tools v0.0.0-20190506145303-2d16b83fe98c/go.mod h1:RgjU9mgBXZiqYHBnxXauZ1Gv1EHHAz9KjViQ78xBX0Q=
golang.org/x/tools v0.0.0-20190524140312-2c0ae7006135/go.mod h1:RgjU9mgBXZiqYHBnxXauZ1Gv1EHHAz9KjViQ78xBX0Q=
golang.org/x/tools v0.0.0-20190606124116-d0a3d012864b/go.mod h1:/rFqwRUd4F7ZHNgwSSTFct+R/Kf4OFW1sUzUTQQTgfc=
golang.org/x/tools v0.0.0-20190621195816-6e04913cbbac/go.mod h1:/rFqwRUd4F7ZHNgwSSTFct+R/Kf4OFW1sUzUTQQTgfc=
golang.org/x/tools v0.0.0-20190628153133-6cdbf07be9d0/go.mod h1:/rFqwRUd4F7ZHNgwSSTFct+R/Kf4OFW1sUzUTQQTgfc=
golang.org/x/tools v0.0.0-20190816200558-6889da9d5479/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo=
golang.org/x/tools v0.0.0-20190911174233-4f2ddba30aff/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo=
golang.org/x/tools v0.0.0-20191012152004-8de300cfc20a/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo=
golang.org/x/tools v0.0.0-20191112195655-aa38f8e97acc/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo=
golang.org/x/tools v0.0.0-20191113191852-77e3bb0ad9e7/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo=
golang.org/x/tools v0.0.0-20191115202509-3a792d9c32b2/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo=
golang.org/x/tools v0.0.0-20191119224855-298f0cb1881e/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo=
golang.org/x/tools v0.0.0-20191125144606-a911d9008d1f/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo=
golang.org/x/tools v0.0.0-20191216173652-a0e659d51361/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28=
golang.org/x/tools v0.0.0-20191227053925-7b8e75db28f4/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28=
golang.org/x/tools v0.0.0-20200108203644-89082a384178/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28=
golang.org/x/tools v0.0.0-20200117012304-6edc0a871e69/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28=
golang.org/x/tools v0.0.0-20200221224223-e1da425f72fd/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28=
golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
golang.org/x/xerrors v0.0.0-20191011141410-1b5146add898/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
gonum.org/v1/gonum v0.0.0-20180816165407-929014505bf4/go.mod h1:Y+Yx5eoAFn32cQvJDxZx5Dpnq+c3wtXuadVZAcxbbBo=
gonum.org/v1/gonum v0.0.0-20181121035319-3f7ecaa7e8ca/go.mod h1:Y+Yx5eoAFn32cQvJDxZx5Dpnq+c3wtXuadVZAcxbbBo=
gonum.org/v1/gonum v0.6.0/go.mod h1:9mxDZsDKxgMAuccQkewq682L+0eCu4dCN2yonUJTCLU=
gonum.org/v1/netlib v0.0.0-20181029234149-ec6d1f5cefe6/go.mod h1:wa6Ws7BG/ESfp6dHfk7C6KdzKA7wR7u/rKwOGE66zvw=
gonum.org/v1/netlib v0.0.0-20190313105609-8cb42192e0e0/go.mod h1:wa6Ws7BG/ESfp6dHfk7C6KdzKA7wR7u/rKwOGE66zvw=
gonum.org/v1/plot v0.0.0-20190515093506-e2840ee46a6b/go.mod h1:Wt8AAjI+ypCyYX3nZBvf6cAIx93T+c/OS2HFAYskSZc=
google.golang.org/api v0.4.0/go.mod h1:8k5glujaEP+g9n7WNsDg8QP6cUVNI86fCNMcbazEtwE=
google.golang.org/api v0.7.0/go.mod h1:WtwebWUNSVBH/HAw79HIFXZNqEvBhG+Ra+ax0hx3E3M=
google.golang.org/api v0.8.0/go.mod h1:o4eAsZoiT+ibD93RtjEohWalFOjRDx6CVaqeizhEnKg=
google.golang.org/api v0.9.0/go.mod h1:o4eAsZoiT+ibD93RtjEohWalFOjRDx6CVaqeizhEnKg=
google.golang.org/api v0.13.0/go.mod h1:iLdEw5Ide6rF15KTC1Kkl0iskquN2gFfn9o9XIsbkAI=
google.golang.org/api v0.14.0/go.mod h1:iLdEw5Ide6rF15KTC1Kkl0iskquN2gFfn9o9XIsbkAI=
google.golang.org/api v0.15.0/go.mod h1:iLdEw5Ide6rF15KTC1Kkl0iskquN2gFfn9o9XIsbkAI=
google.golang.org/appengine v1.1.0/go.mod h1:EbEs0AVv82hx2wNQdGPgUI5lhzA/G0D9YwlJXL52JkM=
google.golang.org/appengine v1.4.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4=
google.golang.org/appengine v1.5.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4=
google.golang.org/appengine v1.6.1/go.mod h1:i06prIuMbXzDqacNJfV5OdTW448YApPu5ww/cMBSeb0=
google.golang.org/appengine v1.6.5/go.mod h1:8WjMMxjGQR8xUklV/ARdw2HLXBOI7O7uCIDZVag1xfc=
google.golang.org/genproto v0.0.0-20180817151627-c66870c02cf8/go.mod h1:JiN7NxoALGmiZfu7CAH4rXhgtRTLTxftemlI0sWmxmc=
google.golang.org/genproto v0.0.0-20190307195333-5fe7a883aa19/go.mod h1:VzzqZJRnGkLBvHegQrXjBqPurQTc5/KpmUdxsrq26oE=
google.golang.org/genproto v0.0.0-20190418145605-e7d98fc518a7/go.mod h1:VzzqZJRnGkLBvHegQrXjBqPurQTc5/KpmUdxsrq26oE=
google.golang.org/genproto v0.0.0-20190425155659-357c62f0e4bb/go.mod h1:VzzqZJRnGkLBvHegQrXjBqPurQTc5/KpmUdxsrq26oE=
google.golang.org/genproto v0.0.0-20190502173448-54afdca5d873/go.mod h1:VzzqZJRnGkLBvHegQrXjBqPurQTc5/KpmUdxsrq26oE=
google.golang.org/genproto v0.0.0-20190716160619-c506a9f90610/go.mod h1:DMBHOl98Agz4BDEuKkezgsaosCRResVns1a3J2ZsMNc=
google.golang.org/genproto v0.0.0-20190801165951-fa694d86fc64/go.mod h1:DMBHOl98Agz4BDEuKkezgsaosCRResVns1a3J2ZsMNc=
google.golang.org/genproto v0.0.0-20190819201941-24fa4b261c55/go.mod h1:DMBHOl98Agz4BDEuKkezgsaosCRResVns1a3J2ZsMNc=
google.golang.org/genproto v0.0.0-20190911173649-1774047e7e51/go.mod h1:IbNlFCBrqXvoKpeg0TB2l7cyZUmoaFKYIwrEpbDKLA8=
google.golang.org/genproto v0.0.0-20191108220845-16a3f7862a1a/go.mod h1:n3cpQtvxv34hfy77yVDNjmbRyujviMdxYliBSkLhpCc=
google.golang.org/genproto v0.0.0-20191115194625-c23dd37a84c9/go.mod h1:n3cpQtvxv34hfy77yVDNjmbRyujviMdxYliBSkLhpCc=
google.golang.org/genproto v0.0.0-20191216164720-4f79533eabd1/go.mod h1:n3cpQtvxv34hfy77yVDNjmbRyujviMdxYliBSkLhpCc=
google.golang.org/genproto v0.0.0-20191230161307-f3c370f40bfb/go.mod h1:n3cpQtvxv34hfy77yVDNjmbRyujviMdxYliBSkLhpCc=
google.golang.org/genproto v0.0.0-20200108215221-bd8f9a0ef82f/go.mod h1:n3cpQtvxv34hfy77yVDNjmbRyujviMdxYliBSkLhpCc=
google.golang.org/genproto v0.0.0-20200526211855-cb27e3aa2013/go.mod h1:NbSheEEYHJ7i3ixzK3sjbqSGDJWnxyFXZblF3eUsNvo=
google.golang.org/grpc v1.19.0/go.mod h1:mqu4LbDTu4XGKhr4mRzUsmM4RtVoemTSY81AxZiDr8c=
google.golang.org/grpc v1.20.1/go.mod h1:10oTOabMzJvdu6/UiuZezV6QK5dSlG84ov/aaiqXj38=
google.golang.org/grpc v1.21.0/go.mod h1:oYelfM1adQP15Ek0mdvEgi9Df8B9CZIaU1084ijfRaM=
google.golang.org/grpc v1.21.1/go.mod h1:oYelfM1adQP15Ek0mdvEgi9Df8B9CZIaU1084ijfRaM=
google.golang.org/grpc v1.23.0/go.mod h1:Y5yQAOtifL1yxbo5wqy6BxZv8vAUGQwXBOALyacEbxg=
google.golang.org/grpc v1.26.0/go.mod h1:qbnxyOmOxrQa7FizSgH+ReBfzJrCY1pSN7KXBS8abTk=
google.golang.org/grpc v1.27.0/go.mod h1:qbnxyOmOxrQa7FizSgH+ReBfzJrCY1pSN7KXBS8abTk=
google.golang.org/grpc v1.27.1/go.mod h1:qbnxyOmOxrQa7FizSgH+ReBfzJrCY1pSN7KXBS8abTk=
google.golang.org/protobuf v0.0.0-20200109180630-ec00e32a8dfd/go.mod h1:DFci5gLYBciE7Vtevhsrf46CRTquxDuWsQurQQe4oz8=
google.golang.org/protobuf v0.0.0-20200221191635-4d8936d0db64/go.mod h1:kwYJMbMJ01Woi6D6+Kah6886xMZcty6N08ah7+eCXa0=
google.golang.org/protobuf v0.0.0-20200228230310-ab0ca4ff8a60/go.mod h1:cfTl7dwQJ+fmap5saPgwCLgHXTUD7jkjRqWcaiX5VyM=
google.golang.org/protobuf v1.20.1-0.20200309200217-e05f789c0967/go.mod h1:A+miEFZTKqfCUM6K7xSMQL9OKL/b6hQv+e19PK+JZNE=
google.golang.org/protobuf v1.21.0/go.mod h1:47Nbq4nVaFHyn7ilMalzfO3qCViNmqZ2kzikPIcrTAo=
google.golang.org/protobuf v1.22.0/go.mod h1:EGpADcykh3NcUnDUJcl1+ZksZNG86OlYog2l/sGQquU=
google.golang.org/protobuf v1.23.0/go.mod h1:EGpADcykh3NcUnDUJcl1+ZksZNG86OlYog2l/sGQquU=
google.golang.org/protobuf v1.23.1-0.20200526195155-81db48ad09cc/go.mod h1:EGpADcykh3NcUnDUJcl1+ZksZNG86OlYog2l/sGQquU=
google.golang.org/protobuf v1.25.0/go.mod h1:9JNX74DMeImyA3h4bdi1ymwjUzf21/xIlbajtzgsN7c=
gopkg.in/alecthomas/kingpin.v2 v2.2.6/go.mod h1:FMv+mEhP44yOT+4EoQTLFTRgOQ1FBLkstjWtayDeSgw=
gopkg.in/bsm/ratelimit.v1 v1.0.0-20160220154919-db14e161995a/go.mod h1:KF9sEfUPAXdG8Oev9e99iLGnl2uJMjc5B+4y3O7x610=
gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
gopkg.in/check.v1 v1.0.0-20190902080502-41f04d3bba15/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
gopkg.in/errgo.v2 v2.1.0/go.mod h1:hNsd1EY+bozCKY1Ytp96fpM3vjJbqLJn88ws8XvfDNI=
gopkg.in/fsnotify.v1 v1.4.7/go.mod h1:Tz8NjZHkW78fSQdbUxIjBTcgA1z1m8ZHf0WmKUhAMys=
gopkg.in/ini.v1 v1.44.0/go.mod h1:pNLf8WUiyNEtQjuu5G5vTm06TEv9tsIgeAvK8hOrP4k=
gopkg.in/ini.v1 v1.51.0 h1:AQvPpx3LzTDM0AjnIRlVFwFFGC+npRopjZxLJj6gdno=
gopkg.in/ini.v1 v1.51.0/go.mod h1:pNLf8WUiyNEtQjuu5G5vTm06TEv9tsIgeAvK8hOrP4k=
gopkg.in/jcmturner/aescts.v1 v1.0.1/go.mod h1:nsR8qBOg+OucoIW+WMhB3GspUQXq9XorLnQb9XtvcOo=
gopkg.in/jcmturner/dnsutils.v1 v1.0.1/go.mod h1:m3v+5svpVOhtFAP/wSz+yzh4Mc0Fg7eRhxkJMWSIz9Q=
gopkg.in/jcmturner/goidentity.v3 v3.0.0/go.mod h1:oG2kH0IvSYNIu80dVAyu/yoefjq1mNfM5bm88whjWx4=
gopkg.in/jcmturner/gokrb5.v7 v7.5.0/go.mod h1:l8VISx+WGYp+Fp7KRbsiUuXTTOnxIc3Tuvyavf11/WM=
gopkg.in/jcmturner/rpc.v1 v1.1.0/go.mod h1:YIdkC4XfD6GXbzje11McwsDuOlZQSb9W4vfLvuNnlv8=
gopkg.in/natefinch/npipe.v2 v2.0.0-20160621034901-c1b8fa8bdcce/go.mod h1:5AcXVHNjg+BDxry382+8OKon8SEWiKktQR07RKPsv1c=
gopkg.in/olebedev/go-duktape.v3 v3.0.0-20200619000410-60c24ae608a6/go.mod h1:uAJfkITjFhyEEuUfm7bsmCZRbW5WRq8s9EY8HZ6hCns=
gopkg.in/redis.v4 v4.2.4/go.mod h1:8KREHdypkCEojGKQcjMqAODMICIVwZAONWq8RowTITA=
gopkg.in/resty.v1 v1.12.0/go.mod h1:mDo4pnntr5jdWRML875a/NmxYqAlA73dVijT2AXvQQo=
gopkg.in/tomb.v1 v1.0.0-20141024135613-dd632973f1e7/go.mod h1:dt/ZhP58zS4L8KSrWDmTeBkI65Dw0HsyUHuEVlX15mw=
gopkg.in/urfave/cli.v1 v1.20.0/go.mod h1:vuBzUtMdQeixQj8LVd+/98pzhxNGQoyuPBlsXHOQNO0=
gopkg.in/yaml.v2 v2.0.0-20170812160011-eb3733d160e7/go.mod h1:JAlM8MvJe8wmxCU4Bli9HhUf9+ttbYbLASfIpnQbh74=
gopkg.in/yaml.v2 v2.2.1/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI=
gopkg.in/yaml.v2 v2.2.2/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI=
gopkg.in/yaml.v2 v2.2.3/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI=
gopkg.in/yaml.v2 v2.2.4/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI=
gopkg.in/yaml.v2 v2.2.5/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI=
gopkg.in/yaml.v2 v2.2.8/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI=
gopkg.in/yaml.v2 v2.3.0 h1:clyUAQHOM3G0M3f5vQj7LuJrETvjVot3Z5el9nffUtU=
gopkg.in/yaml.v2 v2.3.0/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI=
gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=
gotest.tools v2.2.0+incompatible/go.mod h1:DsYFclhRJ6vuDpmuTbkuFWG+y2sxOXAzmJt81HFBacw=
honnef.co/go/tools v0.0.0-20190102054323-c2f93a96b099/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4=
honnef.co/go/tools v0.0.0-20190106161140-3f1c8253044a/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4=
honnef.co/go/tools v0.0.0-20190418001031-e561f6794a2a/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4=
honnef.co/go/tools v0.0.0-20190523083050-ea95bdfd59fc/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4=
honnef.co/go/tools v0.0.1-2019.2.3/go.mod h1:a3bituU0lyd329TUQxRnasdCoJDkEUEAqEt0JzvZhAg=
rsc.io/binaryregexp v0.2.0/go.mod h1:qTv7/COck+e2FymRvadv62gMdZztPaShugOCi3I+8D8=
rsc.io/pdf v0.1.1/go.mod h1:n8OzWcQ6Sp37PL01nO98y4iUCRdTGarVfzxY20ICaU4=

12
main.go Normal file
View File

@ -0,0 +1,12 @@
package main
import (
"github.com/sulenn/trustie-fisco-bcos/modules/os"
"github.com/sulenn/trustie-fisco-bcos/routers/routes"
)
func main() {
m := routes.NewMacaron()
os.SetListeningPort("8000") // 设置监听端口
m.Run() // 如果存在环境变量 port则读取。否则默认监听 4000
}

View File

@ -0,0 +1,27 @@
package format
import (
"encoding/json"
"errors"
)
type ChaincodeArgs struct {
Func string `json:"Func"` // 调用链码时指定的函数名
Args []string `json:"Args"` // 调用链码函数时传入的参数
}
func ArgsJson(function string, args ...string) (*string, error) { //链码参数转字符串
if len(function) == 0 {
return nil, errors.New("function name is not nil")
}
chaincodeArgs := &ChaincodeArgs{
Func: function,
Args: args,
}
chaincodeArgsToJsonBytes, err := json.Marshal(chaincodeArgs)
if err != nil {
return nil, err
}
chaincodeArgsToJsonString := string(chaincodeArgsToJsonBytes)
return &chaincodeArgsToJsonString, nil
}

View File

@ -0,0 +1,15 @@
package format
import (
"testing"
)
func Test_ArgsJson(T *testing.T) {
chaincodeArgsToJsonString, err := ArgsJson("transfer", "nudt1", "sulenn", "qiubing", "10")
if err != nil {
T.Error(err)
}
if *chaincodeArgsToJsonString != "{\"Func\":\"transfer\",\"Args\":[\"nudt1\",\"sulenn\",\"qiubing\",\"10\"]}" {
T.Error(*chaincodeArgsToJsonString)
}
}

23
modules/os/common.go Normal file
View File

@ -0,0 +1,23 @@
package os
import (
"errors"
"os"
"strconv"
)
// SetListeningPort is to set listening port
func SetListeningPort(port string) error { // 设置服务监听端口
if len(port) == 0 {
return errors.New("port is nil")
}
value, err := strconv.Atoi(port)
if err != nil {
return err
}
if value < 1 || value > 65535 { // port 越界
return errors.New("out of port")
}
os.Setenv("PORT", port) // 设置端口
return nil
}

20
modules/structs/commit.go Normal file
View File

@ -0,0 +1,20 @@
package structs
// UploadCommitOption is to upload commit info to blockchain
type UploadCommitOption struct {
CommitHash string `json:"commit_hash"`
RepoID string `json:"repo_id"`
Author string `json:"author"`
AuthorEmail string `json:"author_email"`
Committer string `json:"committer"`
CommitterEmail string `json:"committer_email"`
AuthorTime string `json:"author_time"`
CommitterTime string `json:"committer_time"`
Content string `json:"content"`
CommitDiff string `json:"commit_diff"`
}
type ResponseCommit struct {
UploadCommitOption
Response
}

View File

@ -0,0 +1,71 @@
package structs
type FiscoBcos struct {
RequestType string `json:"request-type" binding:"Required"`
// repo 相关
Owner string `json:"owner"` // 创始人
TokenName string `json:"token_name"` // 项目代号(默认等同于项目名)
TotalSupply uint64 `json:"total_supply"` // 项目初始金额
CurSupply uint64 `json:"cur_supply"` // 项目当前金额
TokenBalance [][]interface{} `json:"token_balance"` // 用户初始Token分配
// repo commit 相关
CommitHash string `json:"commit_hash"`
RepoID string `json:"repo_id"`
Author string `json:"author"`
AuthorEmail string `json:"author_email"`
Committer string `json:"committer"`
CommitterEmail string `json:"committer_email"`
AuthorTime string `json:"author_time"`
CommitterTime string `json:"committer_time"`
Content string `json:"content"`
CommitDiff string `json:"commit_diff"`
// repo push 相关
PushID string `json:"push_Id"`
PushNumber uint64 `json:"push_number"`
Reponame string `json:"reponame"`
Ownername string `json:"ownername"`
Branch string `json:"branch"`
Size uint64 `json:"size"`
CommitShas []string `json:"commit_shas"`
Time string `json:"time"`
// repo_id, username, time
// repo pull request 相关
PullRequestID string `json:"pull_request_id"`
PullRequestNumber uint64 `json:"pull_request_number"`
Action string `json:"action"`
Title string `json:"title"`
SourceBranch string `json:"source_branch"`
TargetRepoID string `json:"target_repo_id"`
TargetBranch string `json:"target_branch"`
Reviewers []string `json:"reviewers"`
MergeUser string `json:"merge_user"`
CreatedAt string `json:"created_at"`
UpdatedAt string `json:"updated_at"`
// repo_id, reponame, ownername, username, content, commit_shas
// repo pull request comment 相关
PullRequestCommentID string `json:"pull_request_comment_id"`
PullRequestCommentNumber uint64 `json:"pull_request_comment_number"`
ParentID string `json:"parent_id"`
// pull_request_number, repo_id, reponame, ownername, username, action, content, created_at, updated_at
// repo issue 相关
IssueID string `json:"issue_id"`
IssueNumber uint64 `json:"issue_number"`
// repo_id, reponame, ownername, action, title, content, created_at, updated_at
// repo issue comment 相关
IssueCommentID string `json:"issue_comment_id"`
IssueCommentNumber uint64 `json:"issue_comment_number"`
// issue_number, repo_id, parent_id, reponame, ownername, username, action, content, created_at, updated_at
// user 相关
Username string `json:"username"` // 用户名
Amount uint64 `json:"amount"` // 转账金额
Payer string `json:"payer"` // 转账人
Payee string `json:"payee"` // 收款人
}

27
modules/structs/issue.go Normal file
View File

@ -0,0 +1,27 @@
package structs
type UploadIssueOption struct {
IssueID string `json:"issue_id"`
IssueNumber uint64 `json:"issue_number"`
RepoID string `json:"repo_id"`
Reponame string `json:"reponame"`
Ownername string `json:"ownername"`
Username string `json:"username"`
Action string `json:"action"`
Title string `json:"title"`
Content string `json:"content"`
CreatedAt string `json:"created_at"`
UpdatedAt string `json:"updated_at"`
}
type ResponseIssue struct {
UploadIssueOption
Response
}
type ResponseIssueArr struct {
UploadIssueOptionArr
Response
}
type UploadIssueOptionArr []UploadIssueOption

View File

@ -0,0 +1,29 @@
package structs
type UploadIssueCommentOption struct {
IssueCommentID string `json:"issue_comment_id"`
IssueCommentNumber uint64 `json:"issue_comment_number"`
IssueNumber uint64 `json:"issue_number"`
IssueID string `json:"issue_id"`
RepoID string `json:"repo_id"`
ParentID string `json:"parent_id"`
Reponame string `json:"reponame"`
Ownername string `json:"ownername"`
Username string `json:"username"`
Action string `json:"action"`
Content string `json:"content"`
CreatedAt string `json:"created_at"`
UpdatedAt string `json:"updated_at"`
}
type ResponseIssueComment struct {
UploadIssueCommentOption
Response
}
type ResponseIssueCommentArr struct {
UploadIssueCommentOptionArr
Response
}
type UploadIssueCommentOptionArr []UploadIssueCommentOption

View File

@ -0,0 +1,33 @@
package structs
type UploadPullReuqestOption struct {
PullRequestID string `json:"pull_request_id"`
PullRequestNumber uint64 `json:"pull_request_number"`
Action string `json:"action"`
Title string `json:"title"`
SourceBranch string `json:"source_branch"`
TargetRepoID string `json:"target_repo_id"`
TargetBranch string `json:"target_branch"`
Reviewers []string `json:"reviewers"`
MergeUser string `json:"merge_user"`
CreatedAt string `json:"created_at"`
UpdatedAt string `json:"updated_ad"`
RepoID string `json:"repo_id"`
Reponame string `json:"reponame"`
Ownername string `json:"ownername"`
Username string `json:"username"`
Content string `json:"content"`
CommitShas []string `json:"commit_shas"`
}
type ResponsePullRequest struct {
UploadPullReuqestOption
Response
}
type ResponsePullRequestArr struct {
UploadPullReuqestOptionArr
Response
}
type UploadPullReuqestOptionArr []UploadPullReuqestOption

View File

@ -0,0 +1,29 @@
package structs
type UploadPullReuqestCommentOption struct {
PullRequestCommentID string `json:"pull_request_comment_id"`
PullRequestCommentNumber uint64 `json:"pull_request_comment_number"`
ParentID string `json:"parent_id"`
PullRequestNumber uint64 `json:"pull_request_number"`
PullRequestID string `json:"pull_request_id"`
RepoID string `json:"repo_id"`
Reponame string `json:"reponame"`
Ownername string `json:"ownername"`
Username string `json:"username"`
Action string `json:"action"`
Content string `json:"content"`
CreatedAt string `json:"created_at"`
UpdatedAt string `json:"updated_at"`
}
type ResponsePullRequestComment struct {
UploadPullReuqestCommentOption
Response
}
type ResponsePullRequestCommentArr struct {
UploadPullReuqestCommentOptionArr
Response
}
type UploadPullReuqestCommentOptionArr []UploadPullReuqestCommentOption

19
modules/structs/push.go Normal file
View File

@ -0,0 +1,19 @@
package structs
type UploadPushOption struct {
PushID string `json:"push_Id"`
PushNumber uint64 `json:"push_number"`
Reponame string `json:"reponame"`
Ownername string `json:"ownername"`
Branch string `json:"branch"`
CommitShas []string `json:"commit_shas"`
RepoID string `json:"repo_id"`
Username string `json:"username"` // 用户名
Size uint64 `json:"size"`
Time string `json:"time"`
}
type ResponsePush struct {
UploadPushOption
Response
}

22
modules/structs/repo.go Normal file
View File

@ -0,0 +1,22 @@
package structs
// CreateRepoOption is options when to create a repository
type CreateRepoOption struct {
Owner string `json:"owner"` // 创始人
TokenName string `json:"token_name"` // 项目代号(默认等同于项目名)
TotalSupply uint64 `json:"total_supply"` // 项目初始金额
CurSupply uint64 `json:"cur_supply"` // 项目当前金额
TokenBalance [][]interface{} `json:"token_balance"` // 用户初始Token分配
}
type Repo struct {
Owner string `json:"username"` // 创始人
TokenName string `json:"token_name"` // 项目代号(默认等同于项目名)
TotalSupply uint64 `json:"total_supply"` // 项目初始金额
CurSupply uint64 `json:"cur_supply"` // 项目当前金额
}
type ReponseRepo struct {
Repo
Response
}

View File

@ -0,0 +1,51 @@
package structs
import "fmt"
type Response struct {
Status uint16 `json:"status"`
Message string `json:"message"`
}
var (
ResRepoSucc = &Response{Status: 0, Message: "create repo successfully!"} // create repo successfully!
ResRepoExisted = &Response{Status: 1, Message: "repo existed!"} // repo existed!
ResRepoNotExisted = &Response{Status: 5, Message: "repo not existed!"} // repo not existed!
ResRepoBalanceOverFlow = &Response{Status: 2, Message: "username balance overflow when create repo!"} // username balance overflow when create repo!
ResRepoUnsucc = &Response{Status: 3, Message: "create repo unsuccessfully!"} // create repo unsuccessfully!
ResRepoCurBalanceUpOverFlow = &Response{Status: 4, Message: "repo current balance up overflow when user adds amount!"} // username balance overflow when create repo!
ResRepoCurBalanceDownOverFlow = &Response{Status: 6, Message: "repo current balance less than 0 when user adds amount!"}
ResCommitUploadSucc = &Response{Status: 0, Message: "commit upload successfully!"}
ResCommitUploadUnsucc = &Response{Status: 7, Message: "commit upload unsuccessfully!"}
ResPushUploadSucc = &Response{Status: 0, Message: "push upload successfully!"}
ResPushUploadUnsucc = &Response{Status: 8, Message: "push upload unsuccessfully!"}
ResPullRequestUploadSucc = &Response{Status: 0, Message: "pull request upload successfully!"}
ResPullRequestUploadUnsucc = &Response{Status: 9, Message: "pull request upload unsuccessfully!"}
ResPullRequestCommentUploadSucc = &Response{Status: 0, Message: "pull request comment upload successfully!"}
ResPullRequestCommentUploadUnsucc = &Response{Status: 10, Message: "pull request comment upload unsuccessfully!"}
ResIssueUploadSucc = &Response{Status: 0, Message: "issue upload successfully!"}
ResIssueUploadUnsucc = &Response{Status: 10, Message: "issue upload unsuccessfully!"}
ResIssueCommentUploadSucc = &Response{Status: 0, Message: "issue comment upload successfully!"}
ResIssueCommentUploadUnsucc = &Response{Status: 10, Message: "issue comment upload unsuccessfully!"}
ResUserNotExisted = &Response{Status: 100, Message: "user not exist!"}
ResUserAddAmountSucc = &Response{Status: 0, Message: "user adds amount successfully!"}
ResUserMinusAmountSucc = &Response{Status: 0, Message: "user minus amount successfully!"}
ResUserTransferAmountSucc = &Response{Status: 0, Message: "user transfers amount successfully!"}
ResUserLockAmountSucc = &Response{Status: 0, Message: "user locks amount successfully!"}
ResUserUnlockAmountSucc = &Response{Status: 0, Message: "user unlocks amount successfully!"}
ResUserAddAmountUnsucc = &Response{Status: 101, Message: "user adds amount unsuccessfully!"}
ResUserMinusAmountUnsucc = &Response{Status: 102, Message: "user minus amount unsuccessfully!"}
ResUserLockAmountUnsucc = &Response{Status: 103, Message: "user locks amount unsuccessfully!"}
ResUserUnlockAmountUnsucc = &Response{Status: 104, Message: "user unlocks amount unsuccessfully!"}
ResUserTransferAmountUnsucc = &Response{Status: 105, Message: "user transfers amount unsuccessfully!"}
ResUserBalanceNotEnough = &Response{Status: 106, Message: "user's Balance not enough!"}
TypeTransferErr = &Response{Status: 10, Message: "type transfer error!"} // type transfer error!
StringEmpty = &Response{Status: 11, Message: "string empty!"} // string empty!
)
func UnknownErr(err interface{}) *Response {
return &Response{Status: 20, Message: fmt.Sprintf("unknown error, err:%v\n", err)}
}

23
modules/structs/user.go Normal file
View File

@ -0,0 +1,23 @@
package structs
type User struct {
Username string `json:"username"`
TokenName string `json:"token_name"`
}
type UserBalance struct {
User
Balance uint64 `json:"balance"`
}
type UserBalanceList []*UserBalance
type ResponseUserBalanceList struct {
Response
UserBalanceList
}
type ResponseUserBalance struct {
UserBalance
Response
}

View File

@ -0,0 +1,170 @@
package fiscobcos
import (
"log"
"net/http"
"gitea.com/macaron/macaron"
api "github.com/sulenn/trustie-fisco-bcos/modules/structs"
"github.com/sulenn/trustie-fisco-bcos/routers/repo"
"github.com/sulenn/trustie-fisco-bcos/routers/user"
)
// 路由统一处理
func HandleAllRoutes(ctx *macaron.Context, opt api.FiscoBcos, logger *log.Logger) {
requestType := opt.RequestType
switch requestType {
case "create repo":
repo.Create(ctx,
api.CreateRepoOption{
Owner: opt.Owner,
TokenName: opt.TokenName,
TotalSupply: opt.TotalSupply,
CurSupply: opt.CurSupply,
TokenBalance: opt.TokenBalance,
},
logger)
case "query repo basic info":
repo.QueryBasic(ctx, opt.TokenName, logger)
case "upload commit info":
repo.UploadCommitInfo(ctx,
api.UploadCommitOption{
CommitHash: opt.CommitHash,
RepoID: opt.RepoID,
Author: opt.Author,
AuthorEmail: opt.AuthorEmail,
Committer: opt.Committer,
CommitterEmail: opt.CommitterEmail,
AuthorTime: opt.AuthorTime,
CommitterTime: opt.CommitterTime,
Content: opt.Content,
CommitDiff: opt.CommitDiff,
},
logger)
case "query commit info":
repo.SelectCommitInfo(ctx, opt.CommitHash, logger)
case "upload push info":
repo.UploadPushInfo(ctx,
api.UploadPushOption{
PushID: opt.PushID,
PushNumber: opt.PushNumber,
RepoID: opt.RepoID,
Reponame: opt.Reponame,
Ownername: opt.Ownername,
Username: opt.Username,
Branch: opt.Branch,
Size: opt.Size,
CommitShas: opt.CommitShas,
Time: opt.Time,
},
logger)
case "query push info":
repo.SelectPushInfo(ctx, opt.PushID, logger)
case "upload pull request info":
repo.UploadPullRequestInfo(ctx,
api.UploadPullReuqestOption{
PullRequestID: opt.PullRequestID,
PullRequestNumber: opt.PullRequestNumber,
RepoID: opt.RepoID,
Reponame: opt.Reponame,
Ownername: opt.Ownername,
Username: opt.Username,
Action: opt.Action,
Title: opt.Title,
Content: opt.Content,
SourceBranch: opt.SourceBranch,
TargetRepoID: opt.TargetRepoID,
TargetBranch: opt.TargetBranch,
Reviewers: opt.Reviewers,
CommitShas: opt.CommitShas,
MergeUser: opt.MergeUser,
CreatedAt: opt.CreatedAt,
UpdatedAt: opt.UpdatedAt,
},
logger)
case "query pull request latest info":
repo.SelectPullRequestLatestInfo(ctx, opt.PullRequestID, logger)
case "query pull request all info":
repo.SelectPullRequestAllInfo(ctx, opt.PullRequestID, logger)
case "upload pull request comment info":
repo.UploadPullRequestCommentInfo(ctx,
api.UploadPullReuqestCommentOption{
PullRequestCommentID: opt.PullRequestCommentID,
PullRequestCommentNumber: opt.PullRequestCommentNumber,
PullRequestNumber: opt.PullRequestNumber,
RepoID: opt.RepoID,
ParentID: opt.ParentID,
Reponame: opt.Reponame,
Ownername: opt.Ownername,
Username: opt.Username,
Action: opt.Action,
CreatedAt: opt.CreatedAt,
UpdatedAt: opt.UpdatedAt,
Content: opt.Content,
PullRequestID: opt.PullRequestID,
},
logger)
case "query pull request comment latest info":
repo.SelectPullRequestCommentLatestInfo(ctx, opt.PullRequestCommentID, logger)
case "query pull request comment all info":
repo.SelectPullRequestCommentAllInfo(ctx, opt.PullRequestCommentID, logger)
case "upload issue info":
repo.UploadIssueInfo(ctx,
api.UploadIssueOption{
IssueID: opt.IssueID,
IssueNumber: opt.IssueNumber,
RepoID: opt.RepoID,
Reponame: opt.Reponame,
Ownername: opt.Ownername,
Username: opt.Username,
Action: opt.Action,
Title: opt.Title,
CreatedAt: opt.CreatedAt,
UpdatedAt: opt.UpdatedAt,
Content: opt.Content,
},
logger)
case "query issue latest info":
repo.SelectIssueLatestInfo(ctx, opt.IssueID, logger)
case "query issue all info":
repo.SelectIssueAllInfo(ctx, opt.IssueID, logger)
case "upload issue comment info":
repo.UploadIssueCommentInfo(ctx,
api.UploadIssueCommentOption{
IssueCommentID: opt.IssueCommentID,
IssueCommentNumber: opt.IssueCommentNumber,
IssueNumber: opt.IssueNumber,
RepoID: opt.RepoID,
ParentID: opt.ParentID,
Reponame: opt.Reponame,
Ownername: opt.Ownername,
Username: opt.Username,
Action: opt.Action,
CreatedAt: opt.CreatedAt,
UpdatedAt: opt.UpdatedAt,
Content: opt.Content,
IssueID: opt.IssueID,
},
logger)
case "query issue comment latest info":
repo.SelectIssueCommentLatestInfo(ctx, opt.IssueCommentID, logger)
case "query issue comment all info":
repo.SelectIssueCommentAllInfo(ctx, opt.IssueCommentID, logger)
case "query user balance of single repo":
user.SelectUserBalance(ctx, opt.Username, opt.TokenName, logger)
case "query user balance of all repos":
user.SelectUserAllBalance(ctx, opt.Username, logger)
case "add user balance":
user.AddUserAmount(ctx, opt.Username, opt.TokenName, opt.Amount, logger)
case "minus user balance":
user.MinusUserAmount(ctx, opt.Username, opt.TokenName, opt.Amount, logger)
case "lock user balance":
user.LockUserAmount(ctx, opt.Username, opt.TokenName, opt.Amount, logger)
case "unlock user balance":
user.UnlockUserAmount(ctx, opt.Username, opt.TokenName, opt.Amount, logger)
case "transfer amount":
user.TransferAmount(ctx, opt.Payer, opt.Payee, opt.TokenName, opt.Amount, logger)
default:
ctx.JSON(http.StatusNotFound, "the request type not found!")
}
}

572
routers/repo/query.go Normal file
View File

@ -0,0 +1,572 @@
package repo
import (
"encoding/json"
"fmt"
"log"
"net/http"
"github.com/FISCO-BCOS/go-sdk/client"
"github.com/FISCO-BCOS/go-sdk/conf"
"github.com/ethereum/go-ethereum/common"
"github.com/sulenn/trustie-fisco-bcos/contract"
"github.com/sulenn/trustie-fisco-bcos/contract/opensource"
"github.com/sulenn/trustie-fisco-bcos/modules/structs"
api "github.com/sulenn/trustie-fisco-bcos/modules/structs"
"gitea.com/macaron/macaron"
)
var ()
// 查询 commit 数据
func SelectCommitInfo(ctx *macaron.Context, commitHash string, logger *log.Logger) {
if commitHash == "" {
ctx.JSON(http.StatusOK, api.StringEmpty)
return
}
configs, err := conf.ParseConfigFile("config.toml")
if err != nil {
ctx.JSON(http.StatusOK, api.UnknownErr(err))
return
}
config := &configs[0]
client, err := client.Dial(config)
if err != nil {
ctx.JSON(http.StatusOK, api.UnknownErr(err))
return
}
// load the contract
contractAddress := common.HexToAddress(contract.ContractAddress)
instance, err := opensource.NewOpenSource(contractAddress, client)
if err != nil {
ctx.JSON(http.StatusOK, api.UnknownErr(err))
return
}
openSourceSession := &opensource.OpenSourceSession{Contract: instance, CallOpts: *client.GetCallOpts(), TransactOpts: *client.GetTransactOpts()}
_, strJSON, err := openSourceSession.SelectCommitInfo(commitHash) // call Insert API
if err != nil {
ctx.JSON(http.StatusOK, api.UnknownErr(err))
return
}
fmt.Printf("commitHash: %v \n", strJSON)
var uploadCommitOption api.UploadCommitOption
err = json.Unmarshal([]byte(strJSON), &uploadCommitOption)
if err != nil {
ctx.JSON(http.StatusOK, api.UnknownErr(err))
return
}
ctx.JSON(http.StatusOK, &structs.ResponseCommit{
Response: structs.Response{
Status: 0,
Message: "query success!",
},
UploadCommitOption: uploadCommitOption,
})
}
// 查询 push 数据
func SelectPushInfo(ctx *macaron.Context, pushID string, logger *log.Logger) {
if pushID == "" {
ctx.JSON(http.StatusOK, api.StringEmpty)
return
}
configs, err := conf.ParseConfigFile("config.toml")
if err != nil {
ctx.JSON(http.StatusOK, api.UnknownErr(err))
return
}
config := &configs[0]
client, err := client.Dial(config)
if err != nil {
ctx.JSON(http.StatusOK, api.UnknownErr(err))
return
}
// load the contract
contractAddress := common.HexToAddress(contract.ContractAddress)
instance, err := opensource.NewOpenSource(contractAddress, client)
if err != nil {
ctx.JSON(http.StatusOK, api.UnknownErr(err))
return
}
openSourceSession := &opensource.OpenSourceSession{Contract: instance, CallOpts: *client.GetCallOpts(), TransactOpts: *client.GetTransactOpts()}
_, strJSON, err := openSourceSession.SelectPushInfo(pushID) // call Insert API
if err != nil {
ctx.JSON(http.StatusOK, api.UnknownErr(err))
return
}
fmt.Printf("pushID: %v \n", strJSON)
var uploadPushOption api.UploadPushOption
err = json.Unmarshal([]byte(strJSON), &uploadPushOption)
if err != nil {
ctx.JSON(http.StatusOK, api.UnknownErr(err))
return
}
ctx.JSON(http.StatusOK, &structs.ResponsePush{
Response: structs.Response{
Status: 0,
Message: "query success!",
},
UploadPushOption: uploadPushOption,
})
}
// 查询 pull request 最新数据
func SelectPullRequestLatestInfo(ctx *macaron.Context, pullRequestID string, logger *log.Logger) {
if pullRequestID == "" {
ctx.JSON(http.StatusOK, api.StringEmpty)
return
}
configs, err := conf.ParseConfigFile("config.toml")
if err != nil {
ctx.JSON(http.StatusOK, api.UnknownErr(err))
return
}
config := &configs[0]
client, err := client.Dial(config)
if err != nil {
ctx.JSON(http.StatusOK, api.UnknownErr(err))
return
}
// load the contract
contractAddress := common.HexToAddress(contract.ContractAddress)
instance, err := opensource.NewOpenSource(contractAddress, client)
if err != nil {
ctx.JSON(http.StatusOK, api.UnknownErr(err))
return
}
openSourceSession := &opensource.OpenSourceSession{Contract: instance, CallOpts: *client.GetCallOpts(), TransactOpts: *client.GetTransactOpts()}
_, strJSON, err := openSourceSession.SelectPullRequestInfo(pullRequestID) // call Insert API
if err != nil {
ctx.JSON(http.StatusOK, api.UnknownErr(err))
return
}
fmt.Printf("pullRequestID: %v \n", strJSON)
var uploadPullRequestOption api.UploadPullReuqestOption
err = json.Unmarshal([]byte(strJSON), &uploadPullRequestOption)
if err != nil {
ctx.JSON(http.StatusOK, api.UnknownErr(err))
return
}
ctx.JSON(http.StatusOK, &structs.ResponsePullRequest{
Response: structs.Response{
Status: 0,
Message: "query success!",
},
UploadPullReuqestOption: uploadPullRequestOption,
})
}
// 查询 pull request 所有数据
func SelectPullRequestAllInfo(ctx *macaron.Context, pullRequestID string, logger *log.Logger) {
if pullRequestID == "" {
ctx.JSON(http.StatusOK, api.StringEmpty)
return
}
configs, err := conf.ParseConfigFile("config.toml")
if err != nil {
ctx.JSON(http.StatusOK, api.UnknownErr(err))
return
}
config := &configs[0]
client, err := client.Dial(config)
if err != nil {
ctx.JSON(http.StatusOK, api.UnknownErr(err))
return
}
// load the contract
contractAddress := common.HexToAddress(contract.ContractAddress)
instance, err := opensource.NewOpenSource(contractAddress, client)
if err != nil {
ctx.JSON(http.StatusOK, api.UnknownErr(err))
return
}
openSourceSession := &opensource.OpenSourceSession{Contract: instance, CallOpts: *client.GetCallOpts(), TransactOpts: *client.GetTransactOpts()}
_, strJSONArr, err := openSourceSession.SelectPullRequestAllInfo(pullRequestID) // call Insert API
if err != nil {
ctx.JSON(http.StatusOK, api.UnknownErr(err))
return
}
fmt.Printf("pullRequestID: %v \n", strJSONArr)
var uploadPullRequestOption api.UploadPullReuqestOption
var uploadPullReuqestOptionArr api.UploadPullReuqestOptionArr
for i := 0; i < len(strJSONArr); i++ {
err = json.Unmarshal([]byte(strJSONArr[i]), &uploadPullRequestOption)
if err != nil {
ctx.JSON(http.StatusOK, api.UnknownErr(err))
return
}
uploadPullReuqestOptionArr = append(uploadPullReuqestOptionArr, uploadPullRequestOption)
}
ctx.JSON(http.StatusOK, &structs.ResponsePullRequestArr{
Response: structs.Response{
Status: 0,
Message: "query success!",
},
UploadPullReuqestOptionArr: uploadPullReuqestOptionArr,
})
}
// 查询 pull request comment 最新数据
func SelectPullRequestCommentLatestInfo(ctx *macaron.Context, pullRequestCommentID string, logger *log.Logger) {
if pullRequestCommentID == "" {
ctx.JSON(http.StatusOK, api.StringEmpty)
return
}
configs, err := conf.ParseConfigFile("config.toml")
if err != nil {
ctx.JSON(http.StatusOK, api.UnknownErr(err))
return
}
config := &configs[0]
client, err := client.Dial(config)
if err != nil {
ctx.JSON(http.StatusOK, api.UnknownErr(err))
return
}
// load the contract
contractAddress := common.HexToAddress(contract.ContractAddress)
instance, err := opensource.NewOpenSource(contractAddress, client)
if err != nil {
ctx.JSON(http.StatusOK, api.UnknownErr(err))
return
}
openSourceSession := &opensource.OpenSourceSession{Contract: instance, CallOpts: *client.GetCallOpts(), TransactOpts: *client.GetTransactOpts()}
_, strJSON, err := openSourceSession.SelectPullRequestCommentInfo(pullRequestCommentID) // call Insert API
if err != nil {
ctx.JSON(http.StatusOK, api.UnknownErr(err))
return
}
fmt.Printf("pullRequestID: %v \n", strJSON)
var uploadPullRequestCommentOption api.UploadPullReuqestCommentOption
err = json.Unmarshal([]byte(strJSON), &uploadPullRequestCommentOption)
if err != nil {
ctx.JSON(http.StatusOK, api.UnknownErr(err))
return
}
ctx.JSON(http.StatusOK, &structs.ResponsePullRequestComment{
Response: structs.Response{
Status: 0,
Message: "query success!",
},
UploadPullReuqestCommentOption: uploadPullRequestCommentOption,
})
}
// 查询 pull request comment 所有数据
func SelectPullRequestCommentAllInfo(ctx *macaron.Context, pullRequestCommentID string, logger *log.Logger) {
if pullRequestCommentID == "" {
ctx.JSON(http.StatusOK, api.StringEmpty)
return
}
configs, err := conf.ParseConfigFile("config.toml")
if err != nil {
ctx.JSON(http.StatusOK, api.UnknownErr(err))
return
}
config := &configs[0]
client, err := client.Dial(config)
if err != nil {
ctx.JSON(http.StatusOK, api.UnknownErr(err))
return
}
// load the contract
contractAddress := common.HexToAddress(contract.ContractAddress)
instance, err := opensource.NewOpenSource(contractAddress, client)
if err != nil {
ctx.JSON(http.StatusOK, api.UnknownErr(err))
return
}
openSourceSession := &opensource.OpenSourceSession{Contract: instance, CallOpts: *client.GetCallOpts(), TransactOpts: *client.GetTransactOpts()}
_, strJSONArr, err := openSourceSession.SelectPullRequestCommentAllInfo(pullRequestCommentID) // call Insert API
if err != nil {
ctx.JSON(http.StatusOK, api.UnknownErr(err))
return
}
fmt.Printf("pullRequestID: %v \n", strJSONArr)
var uploadPullRequestCommentOption api.UploadPullReuqestCommentOption
var uploadPullReuqestCommentOptionArr api.UploadPullReuqestCommentOptionArr
for i := 0; i < len(strJSONArr); i++ {
err = json.Unmarshal([]byte(strJSONArr[i]), &uploadPullRequestCommentOption)
if err != nil {
ctx.JSON(http.StatusOK, api.UnknownErr(err))
return
}
uploadPullReuqestCommentOptionArr = append(uploadPullReuqestCommentOptionArr, uploadPullRequestCommentOption)
}
ctx.JSON(http.StatusOK, &structs.ResponsePullRequestCommentArr{
Response: structs.Response{
Status: 0,
Message: "query success!",
},
UploadPullReuqestCommentOptionArr: uploadPullReuqestCommentOptionArr,
})
}
// 查询 issue 最新数据
func SelectIssueLatestInfo(ctx *macaron.Context, issueID string, logger *log.Logger) {
if issueID == "" {
ctx.JSON(http.StatusOK, api.StringEmpty)
return
}
configs, err := conf.ParseConfigFile("config.toml")
if err != nil {
ctx.JSON(http.StatusOK, api.UnknownErr(err))
return
}
config := &configs[0]
client, err := client.Dial(config)
if err != nil {
ctx.JSON(http.StatusOK, api.UnknownErr(err))
return
}
// load the contract
contractAddress := common.HexToAddress(contract.ContractAddress)
instance, err := opensource.NewOpenSource(contractAddress, client)
if err != nil {
ctx.JSON(http.StatusOK, api.UnknownErr(err))
return
}
openSourceSession := &opensource.OpenSourceSession{Contract: instance, CallOpts: *client.GetCallOpts(), TransactOpts: *client.GetTransactOpts()}
_, strJSON, err := openSourceSession.SelectIssueInfo(issueID) // call Insert API
if err != nil {
ctx.JSON(http.StatusOK, api.UnknownErr(err))
return
}
fmt.Printf("issueID: %v \n", strJSON)
var uploadIssueOption api.UploadIssueOption
err = json.Unmarshal([]byte(strJSON), &uploadIssueOption)
if err != nil {
ctx.JSON(http.StatusOK, api.UnknownErr(err))
return
}
ctx.JSON(http.StatusOK, &structs.ResponseIssue{
Response: structs.Response{
Status: 0,
Message: "query success!",
},
UploadIssueOption: uploadIssueOption,
})
}
// 查询 issue 所有数据
func SelectIssueAllInfo(ctx *macaron.Context, issueID string, logger *log.Logger) {
if issueID == "" {
ctx.JSON(http.StatusOK, api.StringEmpty)
return
}
configs, err := conf.ParseConfigFile("config.toml")
if err != nil {
ctx.JSON(http.StatusOK, api.UnknownErr(err))
return
}
config := &configs[0]
client, err := client.Dial(config)
if err != nil {
ctx.JSON(http.StatusOK, api.UnknownErr(err))
return
}
// load the contract
contractAddress := common.HexToAddress(contract.ContractAddress)
instance, err := opensource.NewOpenSource(contractAddress, client)
if err != nil {
ctx.JSON(http.StatusOK, api.UnknownErr(err))
return
}
openSourceSession := &opensource.OpenSourceSession{Contract: instance, CallOpts: *client.GetCallOpts(), TransactOpts: *client.GetTransactOpts()}
_, strJSONArr, err := openSourceSession.SelectIssueAllInfo(issueID) // call Insert API
if err != nil {
ctx.JSON(http.StatusOK, api.UnknownErr(err))
return
}
fmt.Printf("pullRequestID: %v \n", strJSONArr)
var uploadIssueOption api.UploadIssueOption
var uploadIssueOptionArr api.UploadIssueOptionArr
for i := 0; i < len(strJSONArr); i++ {
err = json.Unmarshal([]byte(strJSONArr[i]), &uploadIssueOption)
if err != nil {
ctx.JSON(http.StatusOK, api.UnknownErr(err))
return
}
uploadIssueOptionArr = append(uploadIssueOptionArr, uploadIssueOption)
}
ctx.JSON(http.StatusOK, &structs.ResponseIssueArr{
Response: structs.Response{
Status: 0,
Message: "query success!",
},
UploadIssueOptionArr: uploadIssueOptionArr,
})
}
// 查询 issue Comment 最新数据
func SelectIssueCommentLatestInfo(ctx *macaron.Context, issueCommentID string, logger *log.Logger) {
if issueCommentID == "" {
ctx.JSON(http.StatusOK, api.StringEmpty)
return
}
configs, err := conf.ParseConfigFile("config.toml")
if err != nil {
ctx.JSON(http.StatusOK, api.UnknownErr(err))
return
}
config := &configs[0]
client, err := client.Dial(config)
if err != nil {
ctx.JSON(http.StatusOK, api.UnknownErr(err))
return
}
// load the contract
contractAddress := common.HexToAddress(contract.ContractAddress)
instance, err := opensource.NewOpenSource(contractAddress, client)
if err != nil {
ctx.JSON(http.StatusOK, api.UnknownErr(err))
return
}
openSourceSession := &opensource.OpenSourceSession{Contract: instance, CallOpts: *client.GetCallOpts(), TransactOpts: *client.GetTransactOpts()}
_, strJSON, err := openSourceSession.SelectIssueCommentInfo(issueCommentID) // call Insert API
if err != nil {
ctx.JSON(http.StatusOK, api.UnknownErr(err))
return
}
fmt.Printf("issueCommentID: %v \n", strJSON)
var uploadIssueCommentOption api.UploadIssueCommentOption
err = json.Unmarshal([]byte(strJSON), &uploadIssueCommentOption)
if err != nil {
ctx.JSON(http.StatusOK, api.UnknownErr(err))
return
}
ctx.JSON(http.StatusOK, &structs.ResponseIssueComment{
Response: structs.Response{
Status: 0,
Message: "query success!",
},
UploadIssueCommentOption: uploadIssueCommentOption,
})
}
// 查询 issue comment 所有数据
func SelectIssueCommentAllInfo(ctx *macaron.Context, issueCommentID string, logger *log.Logger) {
if issueCommentID == "" {
ctx.JSON(http.StatusOK, api.StringEmpty)
return
}
configs, err := conf.ParseConfigFile("config.toml")
if err != nil {
ctx.JSON(http.StatusOK, api.UnknownErr(err))
return
}
config := &configs[0]
client, err := client.Dial(config)
if err != nil {
ctx.JSON(http.StatusOK, api.UnknownErr(err))
return
}
// load the contract
contractAddress := common.HexToAddress(contract.ContractAddress)
instance, err := opensource.NewOpenSource(contractAddress, client)
if err != nil {
ctx.JSON(http.StatusOK, api.UnknownErr(err))
return
}
openSourceSession := &opensource.OpenSourceSession{Contract: instance, CallOpts: *client.GetCallOpts(), TransactOpts: *client.GetTransactOpts()}
_, strJSONArr, err := openSourceSession.SelectIssueCommentAllInfo(issueCommentID) // call Insert API
if err != nil {
ctx.JSON(http.StatusOK, api.UnknownErr(err))
return
}
fmt.Printf("pullRequestID: %v \n", strJSONArr)
var uploadIssueCommentOption api.UploadIssueCommentOption
var uploadIssueCommentOptionArr api.UploadIssueCommentOptionArr
for i := 0; i < len(strJSONArr); i++ {
err = json.Unmarshal([]byte(strJSONArr[i]), &uploadIssueCommentOption)
if err != nil {
ctx.JSON(http.StatusOK, api.UnknownErr(err))
return
}
uploadIssueCommentOptionArr = append(uploadIssueCommentOptionArr, uploadIssueCommentOption)
}
ctx.JSON(http.StatusOK, &structs.ResponseIssueCommentArr{
Response: structs.Response{
Status: 0,
Message: "query success!",
},
UploadIssueCommentOptionArr: uploadIssueCommentOptionArr,
})
}

412
routers/repo/repo.go Normal file
View File

@ -0,0 +1,412 @@
package repo
import (
"encoding/hex"
"fmt"
"log"
"math/big"
"net/http"
"strings"
"github.com/FISCO-BCOS/go-sdk/abi"
"github.com/FISCO-BCOS/go-sdk/client"
"github.com/FISCO-BCOS/go-sdk/conf"
"github.com/FISCO-BCOS/go-sdk/core/types"
"github.com/ethereum/go-ethereum/common"
"github.com/sulenn/trustie-fisco-bcos/contract"
"github.com/sulenn/trustie-fisco-bcos/contract/opensource"
"github.com/sulenn/trustie-fisco-bcos/modules/structs"
api "github.com/sulenn/trustie-fisco-bcos/modules/structs"
"gitea.com/macaron/macaron"
)
var ()
// Create is to create a repository in blockchain ledger
func Create(ctx *macaron.Context, opt api.CreateRepoOption, logger *log.Logger) { // 创建项目
tokenName := opt.TokenName
owner := opt.Owner
totalSupply := big.NewInt(int64(opt.TotalSupply))
token_balance := opt.TokenBalance
var usernameArr = []string{}
var balanceArr = []*big.Int{}
var curSupply int64 = 0
for i := 0; i < len(token_balance); i++ {
username, ok := token_balance[i][0].(string)
if ok != true {
ctx.JSON(http.StatusOK, structs.TypeTransferErr)
return
}
usernameArr = append(usernameArr, username)
balance, ok := token_balance[i][1].(float64)
curSupply += int64(balance)
if ok != true {
ctx.JSON(http.StatusOK, structs.TypeTransferErr)
return
}
balanceArr = append(balanceArr, big.NewInt(int64(balance)))
}
configs, err := conf.ParseConfigFile("config.toml")
if err != nil {
ctx.JSON(http.StatusOK, api.UnknownErr(err))
return
}
config := &configs[0]
client, err := client.Dial(config)
if err != nil {
ctx.JSON(http.StatusOK, api.UnknownErr(err))
return
}
// load the contract
contractAddress := common.HexToAddress(contract.ContractAddress)
instance, err := opensource.NewOpenSource(contractAddress, client)
if err != nil {
ctx.JSON(http.StatusOK, api.UnknownErr(err))
return
}
openSourceSession := &opensource.OpenSourceSession{Contract: instance, CallOpts: *client.GetCallOpts(), TransactOpts: *client.GetTransactOpts()}
tx, receipt, err := openSourceSession.CreateRepo(tokenName, owner, totalSupply, big.NewInt(curSupply), usernameArr, balanceArr) // call Insert API
if err != nil {
ctx.JSON(http.StatusOK, api.UnknownErr(err))
return
}
logger.Printf("tx sent: %s\n", tx.Hash().Hex())
// insertedLines, err := strconv.Atoi(receipt.Output[2:])
code, err := parseOutput(opensource.OpenSourceABI, "createRepo", receipt)
if err != nil {
logger.Panic("error when transfer string to int: ", err)
}
if code.Int64() > 0 {
logger.Printf("inserted lines: %v\n", code)
ctx.JSON(http.StatusOK, structs.ResRepoSucc)
return
} else if code.Int64() == contract.RepoExisted {
logger.Printf("error code: %v, message: %v\n", code, structs.ResRepoExisted)
ctx.JSON(http.StatusOK, structs.ResRepoExisted)
return
} else if code.Int64() == contract.BalanceOverFlow {
logger.Printf("error code: %v, message: %v\n", code, structs.ResRepoBalanceOverFlow)
ctx.JSON(http.StatusOK, structs.ResRepoBalanceOverFlow)
return
}
ctx.JSON(http.StatusOK, structs.ResRepoUnsucc)
}
func QueryBasic(ctx *macaron.Context, tokenName string, logger *log.Logger) {
if tokenName == "" {
ctx.JSON(http.StatusOK, api.StringEmpty)
return
}
configs, err := conf.ParseConfigFile("config.toml")
if err != nil {
ctx.JSON(http.StatusOK, api.UnknownErr(err))
return
}
config := &configs[0]
client, err := client.Dial(config)
if err != nil {
ctx.JSON(http.StatusOK, api.UnknownErr(err))
return
}
// load the contract
contractAddress := common.HexToAddress(contract.ContractAddress)
instance, err := opensource.NewOpenSource(contractAddress, client)
if err != nil {
ctx.JSON(http.StatusOK, api.UnknownErr(err))
return
}
openSourceSession := &opensource.OpenSourceSession{Contract: instance, CallOpts: *client.GetCallOpts(), TransactOpts: *client.GetTransactOpts()}
_, owner, totalSupply, curSupply, err := openSourceSession.SelectRepoBasicInfo(tokenName) // call Insert API
if err != nil {
ctx.JSON(http.StatusOK, api.UnknownErr(err))
return
}
fmt.Printf("tokenName: %v, owner: %v, totalSupply: %v, curSupply: %v \n", tokenName, owner, totalSupply, curSupply)
ctx.JSON(http.StatusOK, &structs.ReponseRepo{
Response: structs.Response{
Status: 0,
Message: "query success!",
},
Repo: structs.Repo{
TokenName: tokenName,
Owner: owner,
TotalSupply: totalSupply.Uint64(),
CurSupply: curSupply.Uint64(),
},
})
}
func parseOutput(abiStr, name string, receipt *types.Receipt) (*big.Int, error) {
parsed, err := abi.JSON(strings.NewReader(abiStr))
if err != nil {
fmt.Printf("parse ABI failed, err: %v", err)
}
var ret *big.Int
b, err := hex.DecodeString(receipt.Output[2:])
if err != nil {
return nil, fmt.Errorf("decode receipt.Output[2:] failed, err: %v", err)
}
err = parsed.Unpack(&ret, name, b)
if err != nil {
return nil, fmt.Errorf("unpack %v failed, err: %v", name, err)
}
return ret, nil
}
// // Transfer is to transfer amount from one person to another
// func Transfer(ctx *macaron.Context, opt api.TransferTokenOption) { // 转账
// tokenSymbol := opt.TokenSymbol
// from := opt.From
// to := opt.To
// amount := fmt.Sprintf("%v", opt.Amount)
// chainArgsToJsonString, err := format.ArgsJson("transfer", tokenSymbol, from, to, amount)
// if err != nil {
// ctx.Error(http.StatusInternalServerError, fmt.Sprintf("trasfer:%v", err))
// return
// }
// err = chaincode.InvokeOther(*chainArgsToJsonString)
// if err != nil {
// ctx.Error(http.StatusInternalServerError, fmt.Sprintf("trasfer:%v", err))
// return
// }
// userBalanceList := structs.UserBalanceList{}
// payerAmout, err := queryUserBalance(tokenSymbol, from) // 付款人余额信息
// if err != nil {
// ctx.Error(http.StatusInternalServerError, fmt.Sprintf("It is failed when query payer amount: %v", err))
// return
// }
// payer := &structs.UserBalance{
// Username: from,
// TokenSymbol: tokenSymbol,
// Balance: *payerAmout,
// }
// userBalanceList = append(userBalanceList, payer)
// payeeAmout, err := queryUserBalance(tokenSymbol, to) // 收款人余额信息
// if err != nil {
// ctx.Error(http.StatusInternalServerError, fmt.Sprintf("It is failed when query payee amount: %v", err))
// return
// }
// payee := &structs.UserBalance{
// Username: to,
// TokenSymbol: tokenSymbol,
// Balance: *payeeAmout,
// }
// userBalanceList = append(userBalanceList, payee)
// ctx.JSON(http.StatusOK, userBalanceList)
// }
// // Add is to help user add amount
// func Add(ctx *macaron.Context, opt api.AddTokenOption) { // 增加用户余额
// tokenSymbol := opt.TokenSymbol
// username := opt.Username
// amount := fmt.Sprintf("%v", opt.Amount)
// err := add(tokenSymbol, username, amount)
// if err != nil {
// ctx.Error(http.StatusInternalServerError, fmt.Sprintf("add: %v", err))
// return
// }
// userAmout, err := queryUserBalance(tokenSymbol, username) // 用户余额信息
// if err != nil {
// ctx.Error(http.StatusInternalServerError, fmt.Sprintf("It is failed when query user amount: %v", err))
// return
// }
// user := &structs.UserBalance{
// Username: username,
// TokenSymbol: tokenSymbol,
// Balance: *userAmout,
// }
// ctx.JSON(http.StatusOK, user)
// }
// func add(reponame string, username string, amount string) error { // 用户添加余额
// chainArgsToJsonString, err := format.ArgsJson("add", reponame, username, amount)
// if err != nil {
// return err
// }
// err = chaincode.InvokeOther(*chainArgsToJsonString) // 调用 chaincode
// return err
// }
// // Minus is to help user minus amount
// func Minus(ctx *macaron.Context, opt api.MinusTokenOption) { // 减少用户余额
// tokenSymbol := opt.TokenSymbol
// username := opt.Username
// amount := fmt.Sprintf("%v", opt.Amount)
// err := minus(tokenSymbol, username, amount)
// if err != nil {
// ctx.Error(http.StatusInternalServerError, fmt.Sprintf("minus: %v", err))
// return
// }
// userAmout, err := queryUserBalance(tokenSymbol, username) // 用户余额信息
// if err != nil {
// ctx.JSON(http.StatusInternalServerError, err)
// return
// }
// user := &structs.UserBalance{
// Username: username,
// TokenSymbol: tokenSymbol,
// Balance: *userAmout,
// }
// ctx.JSON(http.StatusOK, user)
// }
// func minus(reponame string, username string, amount string) error {
// chainArgsToJsonString, err := format.ArgsJson("minus", reponame, username, amount)
// if err != nil {
// return err
// }
// err = chaincode.InvokeOther(*chainArgsToJsonString) // 调用 chaincode
// return err
// }
// // QueryUserBalance is to query user balance by reponame and username
// func QueryUserBalance(ctx *macaron.Context) { // 查询余额
// reponame := ctx.Query("reponame")
// if reponame == "" {
// ctx.JSON(http.StatusPreconditionFailed, "reponame is not nil")
// return
// }
// username := ctx.Query("username")
// if username == "" {
// ctx.JSON(http.StatusPreconditionFailed, "username is not nil")
// return
// }
// amount, err := queryUserBalance(reponame, username)
// if err != nil {
// ctx.Error(http.StatusInternalServerError, fmt.Sprintf("queryUserBalance: %v", err))
// return
// }
// userBalance := &api.UserBalance{
// Username: username,
// TokenSymbol: reponame,
// Balance: *amount,
// }
// ctx.JSON(http.StatusOK, userBalance)
// }
// func queryUserBalance(reponame string, username string) (*uint64, error) { // 查询单次余额
// chainArgsToJsonString, err := format.ArgsJson("userBalance", reponame, username)
// if err != nil {
// return nil, err
// }
// balance, err := chaincode.InvokeBalance(*chainArgsToJsonString)
// if err != nil {
// return nil, err
// }
// return balance, err
// }
// // QueryRepoAmount is to query repository amount by reponame
// func QueryRepoAmount(ctx *macaron.Context) { // 查询项目总金额
// reponame := ctx.Query("reponame")
// if reponame == "" {
// ctx.Error(http.StatusPreconditionFailed, "reponame is not nil")
// return
// }
// username := ctx.Query("username")
// amount, err := queryRepoAmount(reponame)
// if err != nil {
// ctx.Error(http.StatusInternalServerError, fmt.Sprintf("queryRepoAmount: %v", err))
// return
// }
// userBalance := &api.Repo{
// Owner: username,
// TokenSymbol: reponame,
// TotalSupply: *amount,
// }
// ctx.JSON(http.StatusOK, userBalance)
// }
// func queryRepoAmount(reponame string) (*uint64, error) { // 查询项目总金额
// chainArgsToJsonString, err := format.ArgsJson("repoAmount", reponame)
// if err != nil {
// return nil, err
// }
// balance, err := chaincode.InvokeBalance(*chainArgsToJsonString)
// if err != nil {
// return nil, err
// }
// return balance, err
// }
// // Upload is to record commit info to blockchain
// func Upload(ctx *macaron.Context, opt api.UploadCommitOption) { // 记录 commit 信息
// commitString, err := json.Marshal(opt)
// if err != nil {
// ctx.Error(http.StatusInternalServerError, fmt.Sprintf("upload: %v", err))
// }
// chainArgsToJsonString, err := format.ArgsJson("commit", string(commitString)) // 记录 commit 信息
// if err != nil {
// ctx.Error(http.StatusInternalServerError, fmt.Sprintf("upload: %v", err))
// }
// err = chaincode.InvokeOther(*chainArgsToJsonString) // 调用 chaincode
// if err != nil {
// ctx.Error(http.StatusInternalServerError, fmt.Sprintf("upload: %v", err))
// }
// err = add(opt.Reponame, opt.Username, strconv.Itoa(opt.ModificationLines)) // 为用户加钱
// if err != nil {
// ctx.Error(http.StatusInternalServerError, fmt.Sprintf("upload: %v", err))
// }
// userAmout, err := queryUserBalance(opt.Reponame, opt.Username) // 用户余额信息
// if err != nil {
// ctx.Error(http.StatusInternalServerError, fmt.Sprintf("It is failed when query user amount: %v", err))
// return
// }
// user := &structs.UserBalance{
// Username: opt.Username,
// TokenSymbol: opt.Reponame,
// Balance: *userAmout,
// }
// ctx.JSON(http.StatusOK, user)
// }

325
routers/repo/storage.go Normal file
View File

@ -0,0 +1,325 @@
package repo
import (
"encoding/json"
"log"
"net/http"
"github.com/FISCO-BCOS/go-sdk/client"
"github.com/FISCO-BCOS/go-sdk/conf"
"github.com/ethereum/go-ethereum/common"
"github.com/sulenn/trustie-fisco-bcos/contract"
"github.com/sulenn/trustie-fisco-bcos/contract/opensource"
"github.com/sulenn/trustie-fisco-bcos/modules/structs"
api "github.com/sulenn/trustie-fisco-bcos/modules/structs"
"gitea.com/macaron/macaron"
)
var ()
// 上传 commit 数据
func UploadCommitInfo(ctx *macaron.Context, opt api.UploadCommitOption, logger *log.Logger) {
commitHash := opt.CommitHash
bytesJson, err := json.Marshal(opt)
if err != nil {
ctx.JSON(http.StatusOK, api.UnknownErr(err))
return
}
configs, err := conf.ParseConfigFile("config.toml")
if err != nil {
ctx.JSON(http.StatusOK, api.UnknownErr(err))
return
}
config := &configs[0]
client, err := client.Dial(config)
if err != nil {
ctx.JSON(http.StatusOK, api.UnknownErr(err))
return
}
// load the contract
contractAddress := common.HexToAddress(contract.ContractAddress)
instance, err := opensource.NewOpenSource(contractAddress, client)
if err != nil {
ctx.JSON(http.StatusOK, api.UnknownErr(err))
return
}
openSourceSession := &opensource.OpenSourceSession{Contract: instance, CallOpts: *client.GetCallOpts(), TransactOpts: *client.GetTransactOpts()}
tx, receipt, err := openSourceSession.AddCommitData(commitHash, string(bytesJson)) // call Insert API
if err != nil {
ctx.JSON(http.StatusOK, api.UnknownErr(err))
return
}
logger.Printf("tx sent: %s\n", tx.Hash().Hex())
// insertedLines, err := strconv.Atoi(receipt.Output[2:])
code, err := parseOutput(opensource.OpenSourceABI, "addCommitData", receipt)
if err != nil {
logger.Panic("error when transfer string to int: ", err)
}
if code.Int64() > 0 {
logger.Printf("inserted lines: %v\n", code)
ctx.JSON(http.StatusOK, structs.ResCommitUploadSucc)
return
}
ctx.JSON(http.StatusOK, structs.ResCommitUploadUnsucc)
}
// 上传 push 数据
func UploadPushInfo(ctx *macaron.Context, opt api.UploadPushOption, logger *log.Logger) {
pushID := opt.PushID
bytesJson, err := json.Marshal(opt)
if err != nil {
ctx.JSON(http.StatusOK, api.UnknownErr(err))
return
}
configs, err := conf.ParseConfigFile("config.toml")
if err != nil {
ctx.JSON(http.StatusOK, api.UnknownErr(err))
return
}
config := &configs[0]
client, err := client.Dial(config)
if err != nil {
ctx.JSON(http.StatusOK, api.UnknownErr(err))
return
}
// load the contract
contractAddress := common.HexToAddress(contract.ContractAddress)
instance, err := opensource.NewOpenSource(contractAddress, client)
if err != nil {
ctx.JSON(http.StatusOK, api.UnknownErr(err))
return
}
openSourceSession := &opensource.OpenSourceSession{Contract: instance, CallOpts: *client.GetCallOpts(), TransactOpts: *client.GetTransactOpts()}
tx, receipt, err := openSourceSession.AddPushData(pushID, string(bytesJson)) // call Insert API
if err != nil {
ctx.JSON(http.StatusOK, api.UnknownErr(err))
return
}
logger.Printf("tx sent: %s\n", tx.Hash().Hex())
// insertedLines, err := strconv.Atoi(receipt.Output[2:])
code, err := parseOutput(opensource.OpenSourceABI, "addPushData", receipt)
if err != nil {
logger.Panic("error when transfer string to int: ", err)
}
if code.Int64() > 0 {
logger.Printf("inserted lines: %v\n", code)
ctx.JSON(http.StatusOK, structs.ResPushUploadSucc)
return
}
ctx.JSON(http.StatusOK, structs.ResPushUploadUnsucc)
}
// 上传 pull request 数据
func UploadPullRequestInfo(ctx *macaron.Context, opt api.UploadPullReuqestOption, logger *log.Logger) {
pullRequestID := opt.PullRequestID
bytesJson, err := json.Marshal(opt)
if err != nil {
ctx.JSON(http.StatusOK, api.UnknownErr(err))
return
}
configs, err := conf.ParseConfigFile("config.toml")
if err != nil {
ctx.JSON(http.StatusOK, api.UnknownErr(err))
return
}
config := &configs[0]
client, err := client.Dial(config)
if err != nil {
ctx.JSON(http.StatusOK, api.UnknownErr(err))
return
}
// load the contract
contractAddress := common.HexToAddress(contract.ContractAddress)
instance, err := opensource.NewOpenSource(contractAddress, client)
if err != nil {
ctx.JSON(http.StatusOK, api.UnknownErr(err))
return
}
openSourceSession := &opensource.OpenSourceSession{Contract: instance, CallOpts: *client.GetCallOpts(), TransactOpts: *client.GetTransactOpts()}
tx, receipt, err := openSourceSession.AddPullRequestData(pullRequestID, string(bytesJson)) // call Insert API
if err != nil {
ctx.JSON(http.StatusOK, api.UnknownErr(err))
return
}
logger.Printf("tx sent: %s\n", tx.Hash().Hex())
// insertedLines, err := strconv.Atoi(receipt.Output[2:])
code, err := parseOutput(opensource.OpenSourceABI, "addPullRequestData", receipt)
if err != nil {
logger.Panic("error when transfer string to int: ", err)
}
if code.Int64() > 0 {
logger.Printf("inserted lines: %v\n", code)
ctx.JSON(http.StatusOK, structs.ResPullRequestUploadSucc)
return
}
ctx.JSON(http.StatusOK, structs.ResPullRequestUploadUnsucc)
}
// 上传 pull request comment 数据
func UploadPullRequestCommentInfo(ctx *macaron.Context, opt api.UploadPullReuqestCommentOption, logger *log.Logger) {
pullRequestCommentID := opt.PullRequestCommentID
bytesJson, err := json.Marshal(opt)
if err != nil {
ctx.JSON(http.StatusOK, api.UnknownErr(err))
return
}
configs, err := conf.ParseConfigFile("config.toml")
if err != nil {
ctx.JSON(http.StatusOK, api.UnknownErr(err))
return
}
config := &configs[0]
client, err := client.Dial(config)
if err != nil {
ctx.JSON(http.StatusOK, api.UnknownErr(err))
return
}
// load the contract
contractAddress := common.HexToAddress(contract.ContractAddress)
instance, err := opensource.NewOpenSource(contractAddress, client)
if err != nil {
ctx.JSON(http.StatusOK, api.UnknownErr(err))
return
}
openSourceSession := &opensource.OpenSourceSession{Contract: instance, CallOpts: *client.GetCallOpts(), TransactOpts: *client.GetTransactOpts()}
tx, receipt, err := openSourceSession.AddPullRequestCommentData(pullRequestCommentID, string(bytesJson)) // call Insert API
if err != nil {
ctx.JSON(http.StatusOK, api.UnknownErr(err))
return
}
logger.Printf("tx sent: %s\n", tx.Hash().Hex())
// insertedLines, err := strconv.Atoi(receipt.Output[2:])
code, err := parseOutput(opensource.OpenSourceABI, "addPullRequestCommentData", receipt)
if err != nil {
logger.Panic("error when transfer string to int: ", err)
}
if code.Int64() > 0 {
logger.Printf("inserted lines: %v\n", code)
ctx.JSON(http.StatusOK, structs.ResPullRequestCommentUploadSucc)
return
}
ctx.JSON(http.StatusOK, structs.ResPullRequestCommentUploadUnsucc)
}
// 上传 issue数据
func UploadIssueInfo(ctx *macaron.Context, opt api.UploadIssueOption, logger *log.Logger) {
issueID := opt.IssueID
bytesJson, err := json.Marshal(opt)
if err != nil {
ctx.JSON(http.StatusOK, api.UnknownErr(err))
return
}
configs, err := conf.ParseConfigFile("config.toml")
if err != nil {
ctx.JSON(http.StatusOK, api.UnknownErr(err))
return
}
config := &configs[0]
client, err := client.Dial(config)
if err != nil {
ctx.JSON(http.StatusOK, api.UnknownErr(err))
return
}
// load the contract
contractAddress := common.HexToAddress(contract.ContractAddress)
instance, err := opensource.NewOpenSource(contractAddress, client)
if err != nil {
ctx.JSON(http.StatusOK, api.UnknownErr(err))
return
}
openSourceSession := &opensource.OpenSourceSession{Contract: instance, CallOpts: *client.GetCallOpts(), TransactOpts: *client.GetTransactOpts()}
tx, receipt, err := openSourceSession.AddIssueData(issueID, string(bytesJson)) // call Insert API
if err != nil {
ctx.JSON(http.StatusOK, api.UnknownErr(err))
return
}
logger.Printf("tx sent: %s\n", tx.Hash().Hex())
// insertedLines, err := strconv.Atoi(receipt.Output[2:])
code, err := parseOutput(opensource.OpenSourceABI, "addIssueData", receipt)
if err != nil {
logger.Panic("error when transfer string to int: ", err)
}
if code.Int64() > 0 {
logger.Printf("inserted lines: %v\n", code)
ctx.JSON(http.StatusOK, structs.ResIssueUploadSucc)
return
}
ctx.JSON(http.StatusOK, structs.ResIssueUploadUnsucc)
}
// 上传 issue comment 数据
func UploadIssueCommentInfo(ctx *macaron.Context, opt api.UploadIssueCommentOption, logger *log.Logger) {
issueCommentID := opt.IssueCommentID
bytesJson, err := json.Marshal(opt)
if err != nil {
ctx.JSON(http.StatusOK, api.UnknownErr(err))
return
}
configs, err := conf.ParseConfigFile("config.toml")
if err != nil {
ctx.JSON(http.StatusOK, api.UnknownErr(err))
return
}
config := &configs[0]
client, err := client.Dial(config)
if err != nil {
ctx.JSON(http.StatusOK, api.UnknownErr(err))
return
}
// load the contract
contractAddress := common.HexToAddress(contract.ContractAddress)
instance, err := opensource.NewOpenSource(contractAddress, client)
if err != nil {
ctx.JSON(http.StatusOK, api.UnknownErr(err))
return
}
openSourceSession := &opensource.OpenSourceSession{Contract: instance, CallOpts: *client.GetCallOpts(), TransactOpts: *client.GetTransactOpts()}
tx, receipt, err := openSourceSession.AddIssueCommentData(issueCommentID, string(bytesJson)) // call Insert API
if err != nil {
ctx.JSON(http.StatusOK, api.UnknownErr(err))
return
}
logger.Printf("tx sent: %s\n", tx.Hash().Hex())
// insertedLines, err := strconv.Atoi(receipt.Output[2:])
code, err := parseOutput(opensource.OpenSourceABI, "addIssueCommentData", receipt)
if err != nil {
logger.Panic("error when transfer string to int: ", err)
}
if code.Int64() > 0 {
logger.Printf("inserted lines: %v\n", code)
ctx.JSON(http.StatusOK, structs.ResIssueCommentUploadSucc)
return
}
ctx.JSON(http.StatusOK, structs.ResIssueCommentUploadUnsucc)
}

30
routers/routes/routes.go Normal file
View File

@ -0,0 +1,30 @@
package routes
import (
"gitea.com/macaron/binding"
"gitea.com/macaron/macaron"
api "github.com/sulenn/trustie-fisco-bcos/modules/structs"
"github.com/sulenn/trustie-fisco-bcos/routers/fiscobcos"
)
// NewMacaron is to create a new macaron
func NewMacaron() *macaron.Macaron {
var m = macaron.Classic() // 经典 macaron包括 Logger、Recovery 和 Static
m.Use(macaron.Renderer()) // 数据渲染中间件,将数据渲染成 JSON 格式或 HTML 格式
RegisterRoutes(m) // 注册路由
return m
}
// RegisterRoutes is register routes
func RegisterRoutes(m *macaron.Macaron) {
bind := binding.Bind // 数据绑定和验证辅助模块
m.Get("/", func(ctx *macaron.Context) {
ctx.JSON(200, "hello world")
})
// 统一路由入口
m.Group("/trustie", func() {
m.Post("/fiscobcos", bind(api.FiscoBcos{}), fiscobcos.HandleAllRoutes)
})
}

424
routers/user/user.go Normal file
View File

@ -0,0 +1,424 @@
package user
import (
"encoding/hex"
"fmt"
"log"
"math/big"
"net/http"
"strings"
"github.com/FISCO-BCOS/go-sdk/abi"
"github.com/FISCO-BCOS/go-sdk/client"
"github.com/FISCO-BCOS/go-sdk/conf"
"github.com/FISCO-BCOS/go-sdk/core/types"
"github.com/ethereum/go-ethereum/common"
"github.com/sulenn/trustie-fisco-bcos/contract"
"github.com/sulenn/trustie-fisco-bcos/contract/opensource"
"github.com/sulenn/trustie-fisco-bcos/modules/structs"
api "github.com/sulenn/trustie-fisco-bcos/modules/structs"
"gitea.com/macaron/macaron"
)
// // 用户注册
// func Register(ctx *macaron.Context, opt api.CreateUserOption) {
// var user = &api.User{opt.Username, opt.Orgname}
// ctx.JSON(200, user)
// }
// select user all balance
func SelectUserAllBalance(ctx *macaron.Context, username string, logger *log.Logger) {
if username == "" {
ctx.JSON(http.StatusOK, api.StringEmpty)
return
}
configs, err := conf.ParseConfigFile("config.toml")
if err != nil {
ctx.JSON(http.StatusOK, api.UnknownErr(err))
return
}
config := &configs[0]
client, err := client.Dial(config)
if err != nil {
ctx.JSON(http.StatusOK, api.UnknownErr(err))
return
}
// load the contract
contractAddress := common.HexToAddress(contract.ContractAddress)
instance, err := opensource.NewOpenSource(contractAddress, client)
if err != nil {
ctx.JSON(http.StatusOK, api.UnknownErr(err))
return
}
openSourceSession := &opensource.OpenSourceSession{Contract: instance, CallOpts: *client.GetCallOpts(), TransactOpts: *client.GetTransactOpts()}
usernames, tokenNames, balances, err := openSourceSession.SelectUserAllBalance(username) // call select API
if err != nil {
ctx.JSON(http.StatusOK, api.UnknownErr(err))
return
}
var userBalancelist api.UserBalanceList
for i := 0; i < len(usernames); i++ {
userBalancelist = append(userBalancelist, &api.UserBalance{User: api.User{Username: usernames[i], TokenName: tokenNames[i]}, Balance: balances[i].Uint64()})
fmt.Printf("username: %v, token_name: %v, balance: %v \n", usernames[i], tokenNames[i], balances[i])
}
ctx.JSON(http.StatusOK, &structs.ResponseUserBalanceList{
UserBalanceList: userBalancelist,
Response: structs.Response{
Status: 0,
Message: "query success!",
},
})
}
// select user balance
func SelectUserBalance(ctx *macaron.Context, username string, tokenName string, logger *log.Logger) {
if username == "" || tokenName == "" {
ctx.JSON(http.StatusOK, api.StringEmpty)
return
}
configs, err := conf.ParseConfigFile("config.toml")
if err != nil {
ctx.JSON(http.StatusOK, api.UnknownErr(err))
return
}
config := &configs[0]
client, err := client.Dial(config)
if err != nil {
ctx.JSON(http.StatusOK, api.UnknownErr(err))
return
}
// load the contract
contractAddress := common.HexToAddress(contract.ContractAddress)
instance, err := opensource.NewOpenSource(contractAddress, client)
if err != nil {
ctx.JSON(http.StatusOK, api.UnknownErr(err))
return
}
openSourceSession := &opensource.OpenSourceSession{Contract: instance, CallOpts: *client.GetCallOpts(), TransactOpts: *client.GetTransactOpts()}
usernames, tokenNames, balances, err := openSourceSession.SelectUserBalance(username, tokenName) // call select API
if err != nil {
ctx.JSON(http.StatusOK, api.UnknownErr(err))
return
}
if len(usernames) == 0 {
ctx.JSON(http.StatusOK, api.ResUserNotExisted)
return
}
var userBalance = api.UserBalance{
User: api.User{
Username: usernames[0],
TokenName: tokenNames[0],
},
Balance: balances[0].Uint64(),
}
fmt.Printf("username: %v, token_name: %v, balance: %v \n", usernames[0], tokenNames[0], balances[0])
ctx.JSON(http.StatusOK, &structs.ResponseUserBalance{
UserBalance: userBalance,
Response: structs.Response{
Status: 0,
Message: "query success!",
},
})
}
func AddUserAmount(ctx *macaron.Context, username string, tokenName string, amount uint64, logger *log.Logger) {
if username == "" || tokenName == "" {
ctx.JSON(http.StatusOK, api.StringEmpty)
return
}
configs, err := conf.ParseConfigFile("config.toml")
if err != nil {
ctx.JSON(http.StatusOK, api.UnknownErr(err))
return
}
config := &configs[0]
client, err := client.Dial(config)
if err != nil {
ctx.JSON(http.StatusOK, api.UnknownErr(err))
return
}
// load the contract
contractAddress := common.HexToAddress(contract.ContractAddress)
instance, err := opensource.NewOpenSource(contractAddress, client)
if err != nil {
ctx.JSON(http.StatusOK, api.UnknownErr(err))
return
}
openSourceSession := &opensource.OpenSourceSession{Contract: instance, CallOpts: *client.GetCallOpts(), TransactOpts: *client.GetTransactOpts()}
tx, receipt, err := openSourceSession.AddUserBalance(username, tokenName, big.NewInt(int64(amount)))
if err != nil {
ctx.JSON(http.StatusOK, api.UnknownErr(err))
return
}
logger.Printf("tx sent: %s\n", tx.Hash().Hex())
code, err := parseOutput(opensource.OpenSourceABI, "addUserBalance", receipt)
if err != nil {
ctx.JSON(http.StatusOK, api.UnknownErr(err))
return
}
if code.Int64() > 0 {
logger.Printf("inserted lines: %v\n", code)
ctx.JSON(http.StatusOK, structs.ResUserAddAmountSucc)
return
} else if code.Int64() == contract.RepoUnexisted {
logger.Printf("error code: %v, message: %v\n", code, structs.ResRepoNotExisted)
ctx.JSON(http.StatusOK, structs.ResRepoNotExisted)
return
} else if code.Int64() == contract.RepoCurBalanceUpOverFlow {
logger.Printf("error code: %v, message: %v\n", code, structs.ResRepoCurBalanceUpOverFlow)
ctx.JSON(http.StatusOK, structs.ResRepoCurBalanceUpOverFlow)
return
}
ctx.JSON(http.StatusOK, structs.ResUserAddAmountUnsucc)
}
func MinusUserAmount(ctx *macaron.Context, username string, tokenName string, amount uint64, logger *log.Logger) {
if username == "" || tokenName == "" {
ctx.JSON(http.StatusOK, api.StringEmpty)
return
}
configs, err := conf.ParseConfigFile("config.toml")
if err != nil {
ctx.JSON(http.StatusOK, api.UnknownErr(err))
return
}
config := &configs[0]
client, err := client.Dial(config)
if err != nil {
ctx.JSON(http.StatusOK, api.UnknownErr(err))
return
}
// load the contract
contractAddress := common.HexToAddress(contract.ContractAddress)
instance, err := opensource.NewOpenSource(contractAddress, client)
if err != nil {
ctx.JSON(http.StatusOK, api.UnknownErr(err))
return
}
openSourceSession := &opensource.OpenSourceSession{Contract: instance, CallOpts: *client.GetCallOpts(), TransactOpts: *client.GetTransactOpts()}
tx, receipt, err := openSourceSession.MinusUserBalance(username, tokenName, big.NewInt(int64(amount)))
if err != nil {
ctx.JSON(http.StatusOK, api.UnknownErr(err))
return
}
logger.Printf("tx sent: %s\n", tx.Hash().Hex())
code, err := parseOutput(opensource.OpenSourceABI, "minusUserBalance", receipt)
if err != nil {
ctx.JSON(http.StatusOK, api.UnknownErr(err))
return
}
if code.Int64() > 0 {
logger.Printf("inserted lines: %v\n", code)
ctx.JSON(http.StatusOK, structs.ResUserMinusAmountSucc)
return
} else if code.Int64() == contract.RepoUnexisted {
logger.Printf("error code: %v, message: %v\n", code, structs.ResRepoNotExisted)
ctx.JSON(http.StatusOK, structs.ResRepoNotExisted)
return
} else if code.Int64() == contract.UserBblanceNotEnough {
logger.Printf("error code: %v, message: %v\n", code, structs.ResUserBalanceNotEnough)
ctx.JSON(http.StatusOK, structs.ResUserBalanceNotEnough)
return
}
ctx.JSON(http.StatusOK, structs.ResUserMinusAmountUnsucc)
}
func LockUserAmount(ctx *macaron.Context, username string, tokenName string, amount uint64, logger *log.Logger) {
if username == "" || tokenName == "" {
ctx.JSON(http.StatusOK, api.StringEmpty)
return
}
configs, err := conf.ParseConfigFile("config.toml")
if err != nil {
ctx.JSON(http.StatusOK, api.UnknownErr(err))
return
}
config := &configs[0]
client, err := client.Dial(config)
if err != nil {
ctx.JSON(http.StatusOK, api.UnknownErr(err))
return
}
// load the contract
contractAddress := common.HexToAddress(contract.ContractAddress)
instance, err := opensource.NewOpenSource(contractAddress, client)
if err != nil {
ctx.JSON(http.StatusOK, api.UnknownErr(err))
return
}
openSourceSession := &opensource.OpenSourceSession{Contract: instance, CallOpts: *client.GetCallOpts(), TransactOpts: *client.GetTransactOpts()}
tx, receipt, err := openSourceSession.TransferUserBalance(username, "temporary-account", tokenName, big.NewInt(int64(amount)))
if err != nil {
ctx.JSON(http.StatusOK, api.UnknownErr(err))
return
}
logger.Printf("tx sent: %s\n", tx.Hash().Hex())
code, err := parseOutput(opensource.OpenSourceABI, "transferUserBalance", receipt)
if err != nil {
ctx.JSON(http.StatusOK, api.UnknownErr(err))
return
}
if code.Int64() > 0 {
logger.Printf("inserted lines: %v\n", code)
ctx.JSON(http.StatusOK, structs.ResUserLockAmountSucc)
return
} else if code.Int64() == contract.RepoUnexisted {
logger.Printf("error code: %v, message: %v\n", code, structs.ResRepoNotExisted)
ctx.JSON(http.StatusOK, structs.ResRepoNotExisted)
return
} else if code.Int64() == contract.UserBblanceNotEnough {
logger.Printf("error code: %v, message: %v\n", code, structs.ResUserBalanceNotEnough)
ctx.JSON(http.StatusOK, structs.ResUserBalanceNotEnough)
return
}
ctx.JSON(http.StatusOK, structs.ResUserLockAmountUnsucc)
}
func UnlockUserAmount(ctx *macaron.Context, username string, tokenName string, amount uint64, logger *log.Logger) {
if username == "" || tokenName == "" {
ctx.JSON(http.StatusOK, api.StringEmpty)
return
}
configs, err := conf.ParseConfigFile("config.toml")
if err != nil {
ctx.JSON(http.StatusOK, api.UnknownErr(err))
return
}
config := &configs[0]
client, err := client.Dial(config)
if err != nil {
ctx.JSON(http.StatusOK, api.UnknownErr(err))
return
}
// load the contract
contractAddress := common.HexToAddress(contract.ContractAddress)
instance, err := opensource.NewOpenSource(contractAddress, client)
if err != nil {
ctx.JSON(http.StatusOK, api.UnknownErr(err))
return
}
openSourceSession := &opensource.OpenSourceSession{Contract: instance, CallOpts: *client.GetCallOpts(), TransactOpts: *client.GetTransactOpts()}
tx, receipt, err := openSourceSession.TransferUserBalance("temporary-account", username, tokenName, big.NewInt(int64(amount)))
if err != nil {
ctx.JSON(http.StatusOK, api.UnknownErr(err))
return
}
logger.Printf("tx sent: %s\n", tx.Hash().Hex())
code, err := parseOutput(opensource.OpenSourceABI, "transferUserBalance", receipt)
if err != nil {
ctx.JSON(http.StatusOK, api.UnknownErr(err))
return
}
if code.Int64() > 0 {
logger.Printf("inserted lines: %v\n", code)
ctx.JSON(http.StatusOK, structs.ResUserUnlockAmountSucc)
return
} else if code.Int64() == contract.RepoUnexisted {
logger.Printf("error code: %v, message: %v\n", code, structs.ResRepoNotExisted)
ctx.JSON(http.StatusOK, structs.ResRepoNotExisted)
return
} else if code.Int64() == contract.UserBblanceNotEnough {
logger.Printf("error code: %v, message: %v\n", code, structs.ResUserBalanceNotEnough)
ctx.JSON(http.StatusOK, structs.ResUserBalanceNotEnough)
return
}
ctx.JSON(http.StatusOK, structs.ResUserUnlockAmountUnsucc)
}
func TransferAmount(ctx *macaron.Context, payer string, payee string, tokenName string, amount uint64, logger *log.Logger) {
if payer == "" || payee == "" || tokenName == "" {
ctx.JSON(http.StatusOK, api.StringEmpty)
return
}
configs, err := conf.ParseConfigFile("config.toml")
if err != nil {
ctx.JSON(http.StatusOK, api.UnknownErr(err))
return
}
config := &configs[0]
client, err := client.Dial(config)
if err != nil {
ctx.JSON(http.StatusOK, api.UnknownErr(err))
return
}
// load the contract
contractAddress := common.HexToAddress(contract.ContractAddress)
instance, err := opensource.NewOpenSource(contractAddress, client)
if err != nil {
ctx.JSON(http.StatusOK, api.UnknownErr(err))
return
}
openSourceSession := &opensource.OpenSourceSession{Contract: instance, CallOpts: *client.GetCallOpts(), TransactOpts: *client.GetTransactOpts()}
tx, receipt, err := openSourceSession.TransferUserBalance(payer, payee, tokenName, big.NewInt(int64(amount)))
if err != nil {
ctx.JSON(http.StatusOK, api.UnknownErr(err))
return
}
logger.Printf("tx sent: %s\n", tx.Hash().Hex())
code, err := parseOutput(opensource.OpenSourceABI, "transferUserBalance", receipt)
if err != nil {
ctx.JSON(http.StatusOK, api.UnknownErr(err))
return
}
if code.Int64() > 0 {
logger.Printf("inserted lines: %v\n", code)
ctx.JSON(http.StatusOK, structs.ResUserTransferAmountSucc)
return
} else if code.Int64() == contract.RepoUnexisted {
logger.Printf("error code: %v, message: %v\n", code, structs.ResRepoNotExisted)
ctx.JSON(http.StatusOK, structs.ResRepoNotExisted)
return
} else if code.Int64() == contract.UserBblanceNotEnough {
logger.Printf("error code: %v, message: %v\n", code, structs.ResUserBalanceNotEnough)
ctx.JSON(http.StatusOK, structs.ResUserBalanceNotEnough)
return
}
ctx.JSON(http.StatusOK, structs.ResUserTransferAmountUnsucc)
}
func parseOutput(abiStr, name string, receipt *types.Receipt) (*big.Int, error) {
parsed, err := abi.JSON(strings.NewReader(abiStr))
if err != nil {
fmt.Printf("parse ABI failed, err: %v", err)
}
var ret *big.Int
b, err := hex.DecodeString(receipt.Output[2:])
if err != nil {
return nil, fmt.Errorf("decode receipt.Output[2:] failed, err: %v", err)
}
err = parsed.Unpack(&ret, name, b)
if err != nil {
return nil, fmt.Errorf("unpack %v failed, err: %v", name, err)
}
return ret, nil
}

33
sdk.crt Normal file
View File

@ -0,0 +1,33 @@
-----BEGIN CERTIFICATE-----
MIIBgjCCASmgAwIBAgIUItID+RCUjGCXxfvSTdk5/tQwVY0wCgYIKoZIzj0EAwIw
NzEPMA0GA1UEAwwGYWdlbmN5MRMwEQYDVQQKDApmaXNjby1iY29zMQ8wDQYDVQQL
DAZhZ2VuY3kwIBcNMjEwNTEyMTQ0MzM4WhgPMjEyMTA0MTgxNDQzMzhaMDExDDAK
BgNVBAMMA3NkazETMBEGA1UECgwKZmlzY28tYmNvczEMMAoGA1UECwwDc2RrMFYw
EAYHKoZIzj0CAQYFK4EEAAoDQgAEBgC2zgaiKJPhMmlzNP/pItss9AZmSXG1l34m
rCQjqkhgFdwtb+SG0P4xfWWAdrDRCnSJ7P+pNEo1u5FxXXeOjKMaMBgwCQYDVR0T
BAIwADALBgNVHQ8EBAMCBeAwCgYIKoZIzj0EAwIDRwAwRAIgdfrKwGkNJxbfX/1Z
dibRRYWEs0ClTDRq4jhu+YzOkMsCIFJ9VRSTM0d3j9xnNoKWeW/tqWAJlu3g1qnq
n89xTJdt
-----END CERTIFICATE-----
-----BEGIN CERTIFICATE-----
MIIBfDCCASGgAwIBAgIUGYMQQQRUpzRvVcEZBESovczQbWowCgYIKoZIzj0EAwIw
NTEOMAwGA1UEAwwFY2hhaW4xEzARBgNVBAoMCmZpc2NvLWJjb3MxDjAMBgNVBAsM
BWNoYWluMB4XDTIxMDUxMjE0NDMzOFoXDTMxMDUxMDE0NDMzOFowNzEPMA0GA1UE
AwwGYWdlbmN5MRMwEQYDVQQKDApmaXNjby1iY29zMQ8wDQYDVQQLDAZhZ2VuY3kw
VjAQBgcqhkjOPQIBBgUrgQQACgNCAASts0vKJk/Y6B5mDN65a0PVxhKAaN/LS9qR
m/yLs+EQGB6wiOep/dlvlXo/+1VEMcUN7fdkL2SxrzEOUes8O5eXoxAwDjAMBgNV
HRMEBTADAQH/MAoGCCqGSM49BAMCA0kAMEYCIQCfYtFqh1zPJKrPvfAt3SzPLsj6
ZK+jKmJ6Ytg80o7hiwIhALOKNgH757eCaq2PGDlLxMBkk2exUd+xeqnqq7nL2OWL
-----END CERTIFICATE-----
-----BEGIN CERTIFICATE-----
MIIBvjCCAWSgAwIBAgIUb3qQVNwwO9ACvI5KYQtOInJccMUwCgYIKoZIzj0EAwIw
NTEOMAwGA1UEAwwFY2hhaW4xEzARBgNVBAoMCmZpc2NvLWJjb3MxDjAMBgNVBAsM
BWNoYWluMCAXDTIxMDUxMjE0NDMzOFoYDzIxMjEwNDE4MTQ0MzM4WjA1MQ4wDAYD
VQQDDAVjaGFpbjETMBEGA1UECgwKZmlzY28tYmNvczEOMAwGA1UECwwFY2hhaW4w
VjAQBgcqhkjOPQIBBgUrgQQACgNCAATTFARicYMzAhCgtLlZuPqjUBQw+Q/lZTez
++QCBIKxEjGSbnTxvsn8SE3rMbxI8CAPnZyoh0EqZtczJol6KRILo1MwUTAdBgNV
HQ4EFgQUSsuLmNcqa5pN7izdi36C+gfOJaYwHwYDVR0jBBgwFoAUSsuLmNcqa5pN
7izdi36C+gfOJaYwDwYDVR0TAQH/BAUwAwEB/zAKBggqhkjOPQQDAgNIADBFAiBa
JE5AMPb+6iZzpcyK459e+902Hc7Q/gd6xklQLU8U6AIhAMRhP6UQ/jfQ0InfJk8Z
nrxv/WfiIZrgZv2Sf9z4r+hT
-----END CERTIFICATE-----

5
sdk.key Normal file
View File

@ -0,0 +1,5 @@
-----BEGIN PRIVATE KEY-----
MIGEAgEAMBAGByqGSM49AgEGBSuBBAAKBG0wawIBAQQgPZ5bYR1VT7wBytpn2iUV
NdtLITLQ+SVtvvSc+GqZMSWhRANCAAQGALbOBqIok+EyaXM0/+ki2yz0BmZJcbWX
fiasJCOqSGAV3C1v5IbQ/jF9ZYB2sNEKdIns/6k0SjW7kXFdd46M
-----END PRIVATE KEY-----

1
tabletest/Table.abi Normal file
View File

@ -0,0 +1 @@
[{"constant":true,"inputs":[],"name":"newEntry","outputs":[{"name":"","type":"address"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[{"name":"","type":"string"},{"name":"","type":"address"}],"name":"remove","outputs":[{"name":"","type":"int256"}],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":false,"inputs":[{"name":"","type":"string"},{"name":"","type":"address"}],"name":"insert","outputs":[{"name":"","type":"int256"}],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[],"name":"newCondition","outputs":[{"name":"","type":"address"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[{"name":"","type":"string"},{"name":"","type":"address"},{"name":"","type":"address"}],"name":"update","outputs":[{"name":"","type":"int256"}],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[{"name":"","type":"string"},{"name":"","type":"address"}],"name":"select","outputs":[{"name":"","type":"address"}],"payable":false,"stateMutability":"view","type":"function"}]

1
tabletest/Table.bin Normal file
View File

@ -0,0 +1 @@
608060405234801561001057600080fd5b50610442806100206000396000f300608060405260043610610078576000357c0100000000000000000000000000000000000000000000000000000000900463ffffffff16806313db93461461007d57806328bb2117146100d457806331afac36146101715780637857d7c91461020e578063bf2b70a114610265578063e8434e3914610322575b600080fd5b34801561008957600080fd5b506100926103eb565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b3480156100e057600080fd5b5061015b600480360381019080803590602001908201803590602001908080601f0160208091040260200160405190810160405280939291908181526020018383808284378201915050505050509192919290803573ffffffffffffffffffffffffffffffffffffffff1690602001909291905050506103f0565b6040518082815260200191505060405180910390f35b34801561017d57600080fd5b506101f8600480360381019080803590602001908201803590602001908080601f0160208091040260200160405190810160405280939291908181526020018383808284378201915050505050509192919290803573ffffffffffffffffffffffffffffffffffffffff1690602001909291905050506103f8565b6040518082815260200191505060405180910390f35b34801561021a57600080fd5b50610223610400565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b34801561027157600080fd5b5061030c600480360381019080803590602001908201803590602001908080601f0160208091040260200160405190810160405280939291908181526020018383808284378201915050505050509192919290803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610405565b6040518082815260200191505060405180910390f35b34801561032e57600080fd5b506103a9600480360381019080803590602001908201803590602001908080601f0160208091040260200160405190810160405280939291908181526020018383808284378201915050505050509192919290803573ffffffffffffffffffffffffffffffffffffffff16906020019092919050505061040e565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b600090565b600092915050565b600092915050565b600090565b60009392505050565b6000929150505600a165627a7a72305820b36f0366a08d14c38763ef77a6ee1184bb852df9995957257b98f0f3254fd1e30029

67
tabletest/Table.sol Normal file
View File

@ -0,0 +1,67 @@
pragma solidity>=0.4.24 <0.6.11;
contract TableFactory {
function openTable(string memory) public view returns (Table) {} //open table
function createTable(string memory, string memory, string memory) public returns (int256) {} //create table
}
//select condition
contract Condition {
function EQ(string memory, int256) public {}
function EQ(string memory, string memory) public {}
function NE(string memory, int256) public {}
function NE(string memory, string memory) public {}
function GT(string memory, int256) public {}
function GE(string memory, int256) public {}
function LT(string memory, int256) public {}
function LE(string memory, int256) public {}
function limit(int256) public {}
function limit(int256, int256) public {}
}
//one record
contract Entry {
function getInt(string memory) public view returns (int256) {}
function getUInt(string memory) public view returns (uint256) {}
function getAddress(string memory) public view returns (address) {}
function getBytes64(string memory) public view returns (bytes1[64] memory) {}
function getBytes32(string memory) public view returns (bytes32) {}
function getString(string memory) public view returns (string memory) {}
function set(string memory, int256) public {}
function set(string memory, uint256) public {}
function set(string memory, string memory) public {}
function set(string memory, address) public {}
}
//record sets
contract Entries {
function get(int256) public view returns (Entry) {}
function size() public view returns (int256) {}
}
//Table main contract
contract Table {
function select(string memory, Condition) public view returns (Entries) {}
function insert(string memory, Entry) public returns (int256) {}
function update(string memory, Entry, Condition) public returns (int256) {}
function remove(string memory, Condition) public returns (int256) {}
function newEntry() public view returns (Entry) {}
function newCondition() public view returns (Condition) {}
}
contract KVTableFactory {
function openTable(string memory) public view returns (KVTable) {}
function createTable(string memory, string memory, string memory) public returns (int256) {}
}
//KVTable per permiary key has only one Entry
contract KVTable {
function get(string memory) public view returns (bool, Entry) {}
function set(string memory, Entry) public returns (int256) {}
function newEntry() public view returns (Entry) {}
}

1
tabletest/TableTest.abi Normal file
View File

@ -0,0 +1 @@
[{"constant":false,"inputs":[{"name":"name","type":"string"},{"name":"item_id","type":"int256"},{"name":"item_name","type":"string"}],"name":"update","outputs":[{"name":"","type":"int256"}],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":false,"inputs":[{"name":"name","type":"string"},{"name":"item_id","type":"int256"}],"name":"remove","outputs":[{"name":"","type":"int256"}],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":false,"inputs":[{"name":"name","type":"string"},{"name":"item_id","type":"int256"},{"name":"item_name","type":"string"}],"name":"insert","outputs":[{"name":"","type":"int256"}],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[{"name":"name","type":"string"}],"name":"select","outputs":[{"name":"","type":"string[]"},{"name":"","type":"int256[]"},{"name":"","type":"string[]"}],"payable":false,"stateMutability":"view","type":"function"},{"inputs":[],"payable":false,"stateMutability":"nonpayable","type":"constructor"},{"anonymous":false,"inputs":[{"indexed":false,"name":"count","type":"int256"}],"name":"CreateResult","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"name":"count","type":"int256"}],"name":"InsertResult","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"name":"count","type":"int256"}],"name":"UpdateResult","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"name":"count","type":"int256"}],"name":"RemoveResult","type":"event"}]

1
tabletest/TableTest.bin Normal file

File diff suppressed because one or more lines are too long

866
tabletest/TableTest.go Normal file

File diff suppressed because one or more lines are too long

98
tabletest/TableTest.sol Normal file
View File

@ -0,0 +1,98 @@
pragma solidity>=0.4.24 <0.6.11;
pragma experimental ABIEncoderV2;
import "./Table.sol";
contract TableTest {
event CreateResult(int256 count);
event InsertResult(int256 count);
event UpdateResult(int256 count);
event RemoveResult(int256 count);
TableFactory tableFactory;
string constant TABLE_NAME = "t_test";
constructor() public {
tableFactory = TableFactory(0x1001); //The fixed address is 0x1001 for TableFactory
// the parameters of createTable are tableName,keyField,"vlaueFiled1,vlaueFiled2,vlaueFiled3,..."
tableFactory.createTable(TABLE_NAME, "name", "item_id,item_name");
}
//select records
function select(string memory name)
public
view
returns (string[] memory, int256[] memory, string[] memory)
{
Table table = tableFactory.openTable(TABLE_NAME);
Condition condition = table.newCondition();
Entries entries = table.select(name, condition);
string[] memory user_name_bytes_list = new string[](
uint256(entries.size())
);
int256[] memory item_id_list = new int256[](uint256(entries.size()));
string[] memory item_name_bytes_list = new string[](
uint256(entries.size())
);
for (int256 i = 0; i < entries.size(); ++i) {
Entry entry = entries.get(i);
user_name_bytes_list[uint256(i)] = entry.getString("name");
item_id_list[uint256(i)] = entry.getInt("item_id");
item_name_bytes_list[uint256(i)] = entry.getString("item_name");
}
return (user_name_bytes_list, item_id_list, item_name_bytes_list);
}
//insert records
function insert(string memory name, int256 item_id, string memory item_name)
public
returns (int256)
{
Table table = tableFactory.openTable(TABLE_NAME);
Entry entry = table.newEntry();
entry.set("name", name);
entry.set("item_id", item_id);
entry.set("item_name", item_name);
int256 count = table.insert(name, entry);
emit InsertResult(count);
return count;
}
//update records
function update(string memory name, int256 item_id, string memory item_name)
public
returns (int256)
{
Table table = tableFactory.openTable(TABLE_NAME);
Entry entry = table.newEntry();
entry.set("item_name", item_name);
Condition condition = table.newCondition();
condition.EQ("name", name);
condition.EQ("item_id", item_id);
int256 count = table.update(name, entry, condition);
emit UpdateResult(count);
return count;
}
//remove records
function remove(string memory name, int256 item_id) public returns (int256) {
Table table = tableFactory.openTable(TABLE_NAME);
Condition condition = table.newCondition();
condition.EQ("name", name);
condition.EQ("item_id", item_id);
int256 count = table.remove(name, condition);
emit RemoveResult(count);
return count;
}
}

View File

@ -0,0 +1,49 @@
package main
import (
"fmt"
"log"
"math/big"
"strconv"
"github.com/FISCO-BCOS/go-sdk/client"
"github.com/FISCO-BCOS/go-sdk/conf"
"github.com/ethereum/go-ethereum/common"
table "github.com/sulenn/trustie-fisco-bcos/tabletest"
)
func main() {
configs, err := conf.ParseConfigFile("config.toml")
if err != nil {
log.Fatal(err)
}
config := &configs[0]
client, err := client.Dial(config)
if err != nil {
log.Fatal(err)
}
// load the contract
contractAddress := common.HexToAddress("0x904ed579402eD8BBb80ee7F0eb02e8226d78a70f") // 0x9526BDd51d7F346ec2B48192f25a800825A8dBF3
instance, err := table.NewTableTest(contractAddress, client)
if err != nil {
log.Fatal(err)
}
tabletestSession := &table.TableTestSession{Contract: instance, CallOpts: *client.GetCallOpts(), TransactOpts: *client.GetTransactOpts()}
name := "Bob"
item_id := big.NewInt(100010001001)
item_name := "Laptop"
tx, receipt, err := tabletestSession.Insert(name, item_id, item_name) // call Insert API
if err != nil {
log.Fatal(err)
}
fmt.Printf("tx sent: %s\n", tx.Hash().Hex())
insertedLines, err := strconv.Atoi(receipt.Output[2:])
if err != nil {
log.Fatalf("error when transfer string to int: %v\n", err)
}
fmt.Printf("inserted lines: %v\n", insertedLines)
}

View File

@ -0,0 +1,30 @@
package main
import (
"fmt"
"log"
"github.com/FISCO-BCOS/go-sdk/client"
"github.com/FISCO-BCOS/go-sdk/conf"
table "github.com/sulenn/trustie-fisco-bcos/tabletest" // import tabletest
)
func main() {
configs, err := conf.ParseConfigFile("config.toml")
if err != nil {
log.Fatal(err)
}
config := &configs[0]
client, err := client.Dial(config)
if err != nil {
log.Fatal(err)
}
address, tx, instance, err := table.DeployTableTest(client.GetTransactOpts(), client)
if err != nil {
log.Fatal(err)
}
fmt.Println("contract address: ", address.Hex()) // the address should be saved
fmt.Println("transaction hash: ", tx.Hash().Hex())
_ = instance
}

View File

@ -0,0 +1,48 @@
package main
import (
"fmt"
"log"
"math/big"
"strconv"
"github.com/FISCO-BCOS/go-sdk/client"
"github.com/FISCO-BCOS/go-sdk/conf"
"github.com/ethereum/go-ethereum/common"
table "github.com/sulenn/trustie-fisco-bcos/tabletest"
)
func main() {
configs, err := conf.ParseConfigFile("config.toml")
if err != nil {
log.Fatal(err)
}
config := &configs[0]
client, err := client.Dial(config)
if err != nil {
log.Fatal(err)
}
// load the contract
contractAddress := common.HexToAddress("0x904ed579402eD8BBb80ee7F0eb02e8226d78a70f") // 0x9526BDd51d7F346ec2B48192f25a800825A8dBF3
instance, err := table.NewTableTest(contractAddress, client)
if err != nil {
log.Fatal(err)
}
tabletestSession := &table.TableTestSession{Contract: instance, CallOpts: *client.GetCallOpts(), TransactOpts: *client.GetTransactOpts()}
name := "Bob"
item_id := big.NewInt(100010001001)
tx, receipt, err := tabletestSession.Remove(name, item_id) // call Remove API
if err != nil {
log.Fatal(err)
}
fmt.Printf("tx sent: %s\n", tx.Hash().Hex())
removedLines, err := strconv.Atoi(receipt.Output[2:])
if err != nil {
log.Fatalf("error when transfer string to int: %v\n", err)
}
fmt.Printf("removed lines: %v\n", removedLines)
}

View File

@ -0,0 +1,44 @@
package main
import (
"fmt"
"log"
"github.com/FISCO-BCOS/go-sdk/client"
"github.com/FISCO-BCOS/go-sdk/conf"
"github.com/ethereum/go-ethereum/common"
table "github.com/sulenn/trustie-fisco-bcos/tabletest"
)
func main() {
configs, err := conf.ParseConfigFile("config.toml")
if err != nil {
log.Fatal(err)
}
config := &configs[0]
client, err := client.Dial(config)
if err != nil {
log.Fatal(err)
}
// load the contract
contractAddress := common.HexToAddress("0x904ed579402eD8BBb80ee7F0eb02e8226d78a70f") // 0x481D3A1dcD72cD618Ea768b3FbF69D78B46995b0
instance, err := table.NewTableTest(contractAddress, client)
if err != nil {
log.Fatal(err)
}
tabletestSession := &table.TableTestSession{Contract: instance, CallOpts: *client.GetCallOpts(), TransactOpts: *client.GetTransactOpts()}
name := "Bob"
names, item_ids, item_names, err := tabletestSession.Select(name) // call select API
if err != nil {
log.Fatal(err)
}
for i := 0; i < len(names); i++ {
fmt.Printf("name: %v, item_id: %v, item_name: %v \n", names[i], item_ids[i], item_names[i])
}
}

View File

@ -0,0 +1,49 @@
package main
import (
"fmt"
"log"
"math/big"
"strconv"
"github.com/FISCO-BCOS/go-sdk/client"
"github.com/FISCO-BCOS/go-sdk/conf"
"github.com/ethereum/go-ethereum/common"
table "github.com/sulenn/trustie-fisco-bcos/tabletest"
)
func main() {
configs, err := conf.ParseConfigFile("config.toml")
if err != nil {
log.Fatal(err)
}
config := &configs[0]
client, err := client.Dial(config)
if err != nil {
log.Fatal(err)
}
// load the contract
contractAddress := common.HexToAddress("0x904ed579402eD8BBb80ee7F0eb02e8226d78a70f") // 0x9526BDd51d7F346ec2B48192f25a800825A8dBF3
instance, err := table.NewTableTest(contractAddress, client)
if err != nil {
log.Fatal(err)
}
tabletestSession := &table.TableTestSession{Contract: instance, CallOpts: *client.GetCallOpts(), TransactOpts: *client.GetTransactOpts()}
name := "Bob"
item_id := big.NewInt(100010001001)
item_name := "Macbook Pro"
tx, receipt, err := tabletestSession.Update(name, item_id, item_name) // call Update API
if err != nil {
log.Fatal(err)
}
fmt.Printf("tx sent: %s\n", tx.Hash().Hex())
updatedLines, err := strconv.Atoi(receipt.Output[2:])
if err != nil {
log.Fatalf("error when transfer string to int: %v\n", err)
}
fmt.Printf("updated lines: %v\n", updatedLines)
}

BIN
tools/abigen Normal file

Binary file not shown.

BIN
tools/solc-0.4.25 Normal file

Binary file not shown.