update .gitignore
This commit is contained in:
parent
3b7a658c36
commit
d862ddd69b
|
@ -1,5 +1,10 @@
|
|||
*.log
|
||||
sdk.crt
|
||||
sdk.key
|
||||
ca.crt
|
||||
|
||||
.vscode
|
||||
__debug_bin
|
||||
sdk.publickey
|
||||
node.key
|
||||
node.crt
|
||||
node.crt
|
||||
|
|
12
ca.crt
12
ca.crt
|
@ -1,12 +0,0 @@
|
|||
-----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-----
|
|
@ -6,7 +6,7 @@ CAFile="ca.crt"
|
|||
Cert="sdk.crt"
|
||||
Key="sdk.key"
|
||||
[[Network.Connection]]
|
||||
NodeURL="127.0.0.1:20200"
|
||||
NodeURL="8.130.51.51:20200"
|
||||
GroupID=1
|
||||
# [[Network.Connection]]
|
||||
# NodeURL="127.0.0.1:20200"
|
||||
|
|
|
@ -1,30 +0,0 @@
|
|||
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
|
||||
}
|
|
@ -1,51 +0,0 @@
|
|||
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)
|
||||
}
|
2
main.go
2
main.go
|
@ -7,6 +7,6 @@ import (
|
|||
|
||||
func main() {
|
||||
m := routes.NewMacaron()
|
||||
os.SetListeningPort("8000") // 设置监听端口
|
||||
os.SetListeningPort("3023") // 设置监听端口
|
||||
m.Run() // 如果存在环境变量 port,则读取。否则默认监听 4000
|
||||
}
|
||||
|
|
33
sdk.crt
33
sdk.crt
|
@ -1,33 +0,0 @@
|
|||
-----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-----
|
Loading…
Reference in New Issue