Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
S
sidecar
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
JIRA
JIRA
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
link33
sidecar
Commits
65c121b8
Commit
65c121b8
authored
Sep 16, 2021
by
suyanlong
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
update CI and update makefile and update source file
parent
560a6263
Pipeline
#8003
canceled with stages
Changes
41
Pipelines
1
Show whitespace changes
Inline
Side-by-side
Showing
41 changed files
with
193 additions
and
116 deletions
+193
-116
.clang-format
.clang-format
+21
-0
.gitlab-ci.yml
.gitlab-ci.yml
+1
-1
Makefile
Makefile
+42
-3
pool.go
internal/exchanger/pool.go
+2
-1
logger_test.go
internal/loggers/logger_test.go
+2
-1
persister.go
internal/manger/persister.go
+1
-0
local.go
internal/peermgr/local.go
+1
-0
direct_cryptor.go
internal/txcrypto/direct_cryptor.go
+1
-0
arg.pb.go
model/pb/arg.pb.go
+2
-1
arg.proto
model/pb/arg.proto
+0
-0
basic.pb.go
model/pb/basic.pb.go
+2
-1
basic.proto
model/pb/basic.proto
+0
-0
block.pb.go
model/pb/block.pb.go
+4
-3
block.proto
model/pb/block.proto
+8
-7
broker.pb.go
model/pb/broker.pb.go
+4
-3
broker.proto
model/pb/broker.proto
+43
-43
bxh_transaction.pb.go
model/pb/bxh_transaction.pb.go
+4
-3
bxh_transaction.proto
model/pb/bxh_transaction.proto
+3
-3
chain.pb.go
model/pb/chain.pb.go
+4
-3
chain.proto
model/pb/chain.proto
+2
-1
commit.pb.go
model/pb/commit.pb.go
+3
-2
commit.proto
model/pb/commit.proto
+0
-0
ibtp.pb.go
model/pb/ibtp.pb.go
+2
-1
ibtp.proto
model/pb/ibtp.proto
+0
-0
ibtpx.pb.go
model/pb/ibtpx.pb.go
+2
-1
ibtpx.proto
model/pb/ibtpx.proto
+5
-6
interchain_meta.pb.go
model/pb/interchain_meta.pb.go
+4
-3
interchain_meta.proto
model/pb/interchain_meta.proto
+1
-1
message.pb.go
model/pb/message.pb.go
+2
-1
message.proto
model/pb/message.proto
+0
-2
plugin.pb.go
model/pb/plugin.pb.go
+4
-3
plugin.proto
model/pb/plugin.proto
+4
-4
receipt.pb.go
model/pb/receipt.pb.go
+4
-3
receipt.proto
model/pb/receipt.proto
+8
-8
vp_info.pb.go
model/pb/vp_info.pb.go
+2
-1
vp_info.proto
model/pb/vp_info.proto
+0
-0
cross_compile.sh
scripts/cross_compile.sh
+2
-2
docker_entrypoint.sh
scripts/docker_entrypoint.sh
+2
-3
prepare.sh
scripts/prepare.sh
+0
-0
release_binary.sh
scripts/release_binary.sh
+1
-1
x.sh
scripts/x.sh
+0
-0
No files found.
.clang-format
0 → 100644
View file @
65c121b8
Language: 'Proto'
BasedOnStyle: 'LLVM'
AccessModifierOffset: '-1'
AlignAfterOpenBracket: 'Align'
AlignConsecutiveAssignments: 'true'
AlignConsecutiveDeclarations: 'true'
AlignEscapedNewlinesLeft: 'true'
AlignOperands: 'true'
AlignTrailingComments: 'true'
AllowAllParametersOfDeclarationOnNextLine: 'true'
AllowShortBlocksOnASingleLine: 'true'
AllowShortCaseLabelsOnASingleLine: 'true'
ColumnLimit: '200'
IndentWidth: '4'
ContinuationIndentWidth: '4'
TabWidth: '4'
TabWidth: '4'
ReflowComments: 'true'
SortIncludes: 'true'
AllowShortFunctionsOnASingleLine: 'Empty'
AllowShortIfStatementsOnASingleLine: 'true'
.gitlab-ci.yml
View file @
65c121b8
...
...
@@ -11,7 +11,7 @@ stages:
build
:
stage
:
build
script
:
-
make
fmt
-
make
check
-
make build
test
:
...
...
Makefile
View file @
65c121b8
...
...
@@ -38,7 +38,7 @@ GREEN=\033[0;32m
BLUE
=
\0
33[0
;
34m
NC
=
\0
33[0m
.PHONY
:
test
.PHONY
:
test
fmt_proto fmt_shell check checkgofmt
help
:
Makefile
@
echo
"Choose a command run:"
...
...
@@ -107,9 +107,19 @@ linter:
golangci-lint run
golangci-lint run
-E
goimports
-E
bodyclose
--skip-dirs-use-default
fmt
:
go
fmt
./...
fmt
_proto
:
##
go fmt protobuf file
@
find
.
-name
'*.proto'
-not
-path
"./vendor/*"
| xargs clang-format
-i
fmt_shell
:
##
check shell file
@
find
.
-name
'*.sh'
-not
-path
"./vendor/*"
| xargs shfmt
-w
-s
-i
4
-ci
-bn
fmt_go
:
fmt_shell
##
go fmt
@
go
fmt
./...
@
find
.
-name
'*.go'
-not
-path
"./vendor/*"
| xargs goimports
-l
-w
fmt
:
fmt_proto fmt_shell
##
go fmt
@
go
fmt
./...
@
find
.
-name
'*.go'
-not
-path
"./vendor/*"
| xargs goimports
-l
-w
all
:
pb grpc
...
...
@@ -142,3 +152,32 @@ grpc:
clean
:
@
go clean
build-dep
:
@
go
install
golang.org/x/tools/cmd/goimports@latest
@
go
install
github.com/suyanlong/aligner@latest
@
go
install
mvdan.cc/gofumpt@latest
@
go
install
mvdan.cc/sh/v3/cmd/shfmt@latest
@
go
install
mvdan.cc/sh/v3/cmd/gosh@latest
# @apt install clang-format or brew isntall clang-format
# @apt install shellcheck or brew install shellcheck
aligner
:
@
aligner
-r
-c
"//"
-e
".go"
-i
./internal/repo/a_repo-packr.go comment
aligner-check
:
@
aligner
-r
-c
"//"
-e
".go"
-i
./internal/repo/a_repo-packr.go check
checkgofmt
:
##
get all go files and run go fmt on them
@
files
=
$$
(
find
.
-name
'*.go'
-not
-path
"./vendor/*"
| xargs gofmt
-l
-s
)
;
if
[
-n
"
$$
files"
]
;
then
\
echo
"Error: 'make fmt' needs to be run on:"
;
\
find
.
-name
'*.go'
-not
-path
"./vendor/*"
| xargs gofmt
-l
-s
;
\
exit
1
;
\
fi
;
@
files
=
$$
(
find
.
-name
'*.go'
-not
-path
"./vendor/*"
| xargs goimports
-l
-w
)
;
if
[
-n
"
$$
files"
]
;
then
\
echo
"Error: 'make fmt' needs to be run on:"
;
\
find
.
-name
'*.go'
-not
-path
"./vendor/*"
| xargs goimports
-l
-w
;
\
exit
1
;
\
fi
;
check
:
aligner-check checkgofmt
internal/exchanger/pool.go
View file @
65c121b8
package
exchanger
import
(
"github.com/link33/sidecar/model/pb"
"sync"
"github.com/link33/sidecar/model/pb"
)
type
Pool
struct
{
...
...
internal/loggers/logger_test.go
View file @
65c121b8
package
loggers
import
(
"github.com/stretchr/testify/require"
"testing"
"github.com/stretchr/testify/require"
"github.com/link33/sidecar/internal/repo"
)
...
...
internal/manger/persister.go
View file @
65c121b8
...
...
@@ -2,6 +2,7 @@ package manger
import
(
"encoding/json"
"github.com/meshplus/bitxhub-core/governance"
"github.com/meshplus/bitxhub-kit/storage"
"github.com/sirupsen/logrus"
...
...
internal/peermgr/local.go
View file @
65c121b8
...
...
@@ -2,6 +2,7 @@ package peermgr
import
(
"errors"
"github.com/libp2p/go-libp2p-core/peer"
"github.com/sirupsen/logrus"
...
...
internal/txcrypto/direct_cryptor.go
View file @
65c121b8
...
...
@@ -2,6 +2,7 @@ package txcrypto
import
(
"fmt"
appchainmgr
"github.com/meshplus/bitxhub-core/appchain-mgr"
"github.com/btcsuite/btcd/btcec"
...
...
model/pb/arg.pb.go
View file @
65c121b8
...
...
@@ -5,10 +5,11 @@ package pb
import
(
fmt
"fmt"
proto
"github.com/gogo/protobuf/proto"
io
"io"
math
"math"
math_bits
"math/bits"
proto
"github.com/gogo/protobuf/proto"
)
// Reference imports to suppress errors if they are not otherwise used.
...
...
model/pb/arg.proto
View file @
65c121b8
model/pb/basic.pb.go
View file @
65c121b8
...
...
@@ -5,10 +5,11 @@ package pb
import
(
fmt
"fmt"
proto
"github.com/gogo/protobuf/proto"
io
"io"
math
"math"
math_bits
"math/bits"
proto
"github.com/gogo/protobuf/proto"
)
// Reference imports to suppress errors if they are not otherwise used.
...
...
model/pb/basic.proto
View file @
65c121b8
model/pb/block.pb.go
View file @
65c121b8
...
...
@@ -5,12 +5,13 @@ package pb
import
(
fmt
"fmt"
_
"github.com/gogo/protobuf/gogoproto"
proto
"github.com/gogo/protobuf/proto"
github_com_meshplus_bitxhub_kit_types
"github.com/meshplus/bitxhub-kit/types"
io
"io"
math
"math"
math_bits
"math/bits"
_
"github.com/gogo/protobuf/gogoproto"
proto
"github.com/gogo/protobuf/proto"
github_com_meshplus_bitxhub_kit_types
"github.com/meshplus/bitxhub-kit/types"
)
// Reference imports to suppress errors if they are not otherwise used.
...
...
model/pb/block.proto
View file @
65c121b8
...
...
@@ -7,19 +7,19 @@ import "github.com/gogo/protobuf/gogoproto/gogo.proto";
message
Block
{
BlockHeader
block_header
=
1
;
bytes
transactions
=
2
[(
gogoproto.customtype
)
=
"Transactions"
];
// transaction set
bytes
block_hash
=
3
[(
gogoproto.customtype
)
=
"github.com/meshplus/bitxhub-kit/types.Hash"
];
bytes
transactions
=
2
[
(
gogoproto.customtype
)
=
"Transactions"
];
// transaction set
bytes
block_hash
=
3
[
(
gogoproto.customtype
)
=
"github.com/meshplus/bitxhub-kit/types.Hash"
];
bytes
signature
=
4
;
bytes
extra
=
5
;
}
message
BlockHeader
{
uint64
number
=
1
;
bytes
state_root
=
2
[(
gogoproto.customtype
)
=
"github.com/meshplus/bitxhub-kit/types.Hash"
];
bytes
tx_root
=
3
[(
gogoproto.customtype
)
=
"github.com/meshplus/bitxhub-kit/types.Hash"
];
bytes
receipt_root
=
4
[(
gogoproto.customtype
)
=
"github.com/meshplus/bitxhub-kit/types.Hash"
];
bytes
parent_hash
=
5
[(
gogoproto.customtype
)
=
"github.com/meshplus/bitxhub-kit/types.Hash"
];
bytes
state_root
=
2
[
(
gogoproto.customtype
)
=
"github.com/meshplus/bitxhub-kit/types.Hash"
];
bytes
tx_root
=
3
[
(
gogoproto.customtype
)
=
"github.com/meshplus/bitxhub-kit/types.Hash"
];
bytes
receipt_root
=
4
[
(
gogoproto.customtype
)
=
"github.com/meshplus/bitxhub-kit/types.Hash"
];
bytes
parent_hash
=
5
[
(
gogoproto.customtype
)
=
"github.com/meshplus/bitxhub-kit/types.Hash"
];
int64
timestamp
=
6
;
bytes
version
=
7
;
bytes
Bloom
=
8
[(
gogoproto.customtype
)
=
"github.com/meshplus/bitxhub-kit/types.Bloom"
];
bytes
Bloom
=
8
[
(
gogoproto.customtype
)
=
"github.com/meshplus/bitxhub-kit/types.Bloom"
];
}
\ No newline at end of file
model/pb/broker.pb.go
View file @
65c121b8
...
...
@@ -6,6 +6,10 @@ package pb
import
(
context
"context"
fmt
"fmt"
io
"io"
math
"math"
math_bits
"math/bits"
_
"github.com/gogo/protobuf/gogoproto"
proto
"github.com/gogo/protobuf/proto"
github_com_meshplus_bitxhub_kit_types
"github.com/meshplus/bitxhub-kit/types"
...
...
@@ -13,9 +17,6 @@ import (
grpc
"google.golang.org/grpc"
codes
"google.golang.org/grpc/codes"
status
"google.golang.org/grpc/status"
io
"io"
math
"math"
math_bits
"math/bits"
)
// Reference imports to suppress errors if they are not otherwise used.
...
...
model/pb/broker.proto
View file @
65c121b8
...
...
@@ -10,128 +10,128 @@ import "block.proto";
import
"chain.proto"
;
service
ChainBroker
{
rpc
Subscribe
(
SubscriptionRequest
)
returns
(
stream
Response
)
{
rpc
Subscribe
(
SubscriptionRequest
)
returns
(
stream
Response
)
{
option
(
google.api.http
)
=
{
get
:
"/v1/subscription"
get
:
"/v1/subscription"
};
}
rpc
GetBlockHeader
(
GetBlockHeaderRequest
)
returns
(
stream
pb.BlockHeader
)
{
rpc
GetBlockHeader
(
GetBlockHeaderRequest
)
returns
(
stream
pb.BlockHeader
)
{
option
(
google.api.http
)
=
{
get
:
"/v1/block_header"
get
:
"/v1/block_header"
};
}
rpc
GetInterchainTxWrappers
(
GetInterchainTxWrappersRequest
)
returns
(
stream
InterchainTxWrappers
)
{
rpc
GetInterchainTxWrappers
(
GetInterchainTxWrappersRequest
)
returns
(
stream
InterchainTxWrappers
)
{
option
(
google.api.http
)
=
{
get
:
"/v1/interchain_tx_wrappers"
get
:
"/v1/interchain_tx_wrappers"
};
}
rpc
SendTransaction
(
pb.BxhTransaction
)
returns
(
TransactionHashMsg
)
{
rpc
SendTransaction
(
pb.BxhTransaction
)
returns
(
TransactionHashMsg
)
{
option
(
google.api.http
)
=
{
post
:
"/v1/transaction"
body
:
"*"
post
:
"/v1/transaction"
body
:
"*"
};
}
rpc
SendView
(
pb.BxhTransaction
)
returns
(
pb.Receipt
)
{
rpc
SendView
(
pb.BxhTransaction
)
returns
(
pb.Receipt
)
{
option
(
google.api.http
)
=
{
post
:
"/v1/view"
body
:
"*"
post
:
"/v1/view"
body
:
"*"
};
}
rpc
GetTransaction
(
TransactionHashMsg
)
returns
(
GetTransactionResponse
)
{
rpc
GetTransaction
(
TransactionHashMsg
)
returns
(
GetTransactionResponse
)
{
option
(
google.api.http
)
=
{
get
:
"/v1/transaction/{tx_hash}"
get
:
"/v1/transaction/{tx_hash}"
};
}
rpc
GetReceipt
(
TransactionHashMsg
)
returns
(
pb.Receipt
)
{
rpc
GetReceipt
(
TransactionHashMsg
)
returns
(
pb.Receipt
)
{
option
(
google.api.http
)
=
{
get
:
"/v1/receipt/{tx_hash}"
get
:
"/v1/receipt/{tx_hash}"
};
}
rpc
GetBlock
(
GetBlockRequest
)
returns
(
pb.Block
)
{
rpc
GetBlock
(
GetBlockRequest
)
returns
(
pb.Block
)
{
option
(
google.api.http
)
=
{
get
:
"/v1/block"
get
:
"/v1/block"
};
}
rpc
GetBlocks
(
GetBlocksRequest
)
returns
(
GetBlocksResponse
)
{
rpc
GetBlocks
(
GetBlocksRequest
)
returns
(
GetBlocksResponse
)
{
option
(
google.api.http
)
=
{
get
:
"/v1/blocks"
get
:
"/v1/blocks"
};
}
rpc
GetBlockHeaders
(
GetBlockHeadersRequest
)
returns
(
GetBlockHeadersResponse
)
{
rpc
GetBlockHeaders
(
GetBlockHeadersRequest
)
returns
(
GetBlockHeadersResponse
)
{
option
(
google.api.http
)
=
{
get
:
"/v1/block_headers"
get
:
"/v1/block_headers"
};
}
rpc
GetChainMeta
(
Request
)
returns
(
pb.ChainMeta
)
{
rpc
GetChainMeta
(
Request
)
returns
(
pb.ChainMeta
)
{
option
(
google.api.http
)
=
{
get
:
"/v1/chain_meta"
get
:
"/v1/chain_meta"
};
}
rpc
GetInfo
(
Request
)
returns
(
Response
)
{
rpc
GetInfo
(
Request
)
returns
(
Response
)
{
option
(
google.api.http
)
=
{
get
:
"/v1/info"
get
:
"/v1/info"
};
}
rpc
GetAccountBalance
(
Address
)
returns
(
Response
)
{
rpc
GetAccountBalance
(
Address
)
returns
(
Response
)
{
option
(
google.api.http
)
=
{
get
:
"/v1/account_balance/{address}"
get
:
"/v1/account_balance/{address}"
};
}
rpc
GetMultiSigns
(
GetMultiSignsRequest
)
returns
(
SignResponse
)
{
rpc
GetMultiSigns
(
GetMultiSignsRequest
)
returns
(
SignResponse
)
{
option
(
google.api.http
)
=
{
get
:
"/v1/multi_sign/{content}"
get
:
"/v1/multi_sign/{content}"
};
}
rpc
GetTPS
(
GetTPSRequest
)
returns
(
Response
)
{
option
(
google.api.http
)
=
{
get
:
"/v1/tps/{begin}/{end}"
get
:
"/v1/tps/{begin}/{end}"
};
}
rpc
GetPendingNonceByAccount
(
Address
)
returns
(
Response
)
{
option
(
google.api.http
)
=
{
get
:
"/v1/pendingNonce/{address}"
get
:
"/v1/pendingNonce/{address}"
};
}
rpc
DelVPNode
(
DelVPNodeRequest
)
returns
(
Response
)
{
option
(
google.api.http
)
=
{
post
:
"/v1/delvpnode"
body
:
"*"
post
:
"/v1/delvpnode"
body
:
"*"
};
}
rpc
CheckMasterSidecar
(
Address
)
returns
(
Response
)
{
rpc
CheckMasterSidecar
(
Address
)
returns
(
Response
)
{
option
(
google.api.http
)
=
{
get
:
"/v1/check_master_sidecar/{address}"
get
:
"/v1/check_master_sidecar/{address}"
};
}
rpc
SetMasterSidecar
(
SidecarInfo
)
returns
(
Response
)
{
rpc
SetMasterSidecar
(
SidecarInfo
)
returns
(
Response
)
{
option
(
google.api.http
)
=
{
post
:
"/v1/set_master_sidecar"
body
:
"*"
post
:
"/v1/set_master_sidecar"
body
:
"*"
};
}
rpc
HeartBeat
(
SidecarInfo
)
returns
(
Response
)
{
rpc
HeartBeat
(
SidecarInfo
)
returns
(
Response
)
{
option
(
google.api.http
)
=
{
post
:
"/v1/heart_beat"
body
:
"*"
post
:
"/v1/heart_beat"
body
:
"*"
};
}
}
...
...
@@ -233,7 +233,7 @@ message VerifiedTx {
}
message
InterchainTxWrapper
{
repeated
bytes
l2Roots
=
1
[(
gogoproto.customtype
)
=
"github.com/meshplus/bitxhub-kit/types.Hash"
];
repeated
bytes
l2Roots
=
1
[
(
gogoproto.customtype
)
=
"github.com/meshplus/bitxhub-kit/types.Hash"
];
repeated
VerifiedTx
transactions
=
2
;
uint64
height
=
3
;
}
...
...
model/pb/bxh_transaction.pb.go
View file @
65c121b8
...
...
@@ -5,12 +5,13 @@ package pb
import
(
fmt
"fmt"
_
"github.com/gogo/protobuf/gogoproto"
proto
"github.com/gogo/protobuf/proto"
github_com_meshplus_bitxhub_kit_types
"github.com/meshplus/bitxhub-kit/types"
io
"io"
math
"math"
math_bits
"math/bits"
_
"github.com/gogo/protobuf/gogoproto"
proto
"github.com/gogo/protobuf/proto"
github_com_meshplus_bitxhub_kit_types
"github.com/meshplus/bitxhub-kit/types"
)
// Reference imports to suppress errors if they are not otherwise used.
...
...
model/pb/bxh_transaction.proto
View file @
65c121b8
...
...
@@ -8,10 +8,10 @@ import "ibtp.proto";
message
BxhTransaction
{
bytes
version
=
1
;
bytes
from
=
2
[(
gogoproto.customtype
)
=
"github.com/meshplus/bitxhub-kit/types.Address"
];
bytes
to
=
3
[(
gogoproto.customtype
)
=
"github.com/meshplus/bitxhub-kit/types.Address"
];
bytes
from
=
2
[
(
gogoproto.customtype
)
=
"github.com/meshplus/bitxhub-kit/types.Address"
];
bytes
to
=
3
[
(
gogoproto.customtype
)
=
"github.com/meshplus/bitxhub-kit/types.Address"
];
int64
timestamp
=
4
;
bytes
transaction_hash
=
5
[(
gogoproto.customtype
)
=
"github.com/meshplus/bitxhub-kit/types.Hash"
];
bytes
transaction_hash
=
5
[
(
gogoproto.customtype
)
=
"github.com/meshplus/bitxhub-kit/types.Hash"
];
bytes
payload
=
6
;
pb.IBTP
IBTP
=
7
;
uint64
nonce
=
8
;
...
...
model/pb/chain.pb.go
View file @
65c121b8
...
...
@@ -5,12 +5,13 @@ package pb
import
(
fmt
"fmt"
_
"github.com/gogo/protobuf/gogoproto"
proto
"github.com/gogo/protobuf/proto"
github_com_meshplus_bitxhub_kit_types
"github.com/meshplus/bitxhub-kit/types"
io
"io"
math
"math"
math_bits
"math/bits"
_
"github.com/gogo/protobuf/gogoproto"
proto
"github.com/gogo/protobuf/proto"
github_com_meshplus_bitxhub_kit_types
"github.com/meshplus/bitxhub-kit/types"
)
// Reference imports to suppress errors if they are not otherwise used.
...
...
model/pb/chain.proto
View file @
65c121b8
...
...
@@ -6,6 +6,6 @@ import "github.com/gogo/protobuf/gogoproto/gogo.proto";
message
ChainMeta
{
uint64
height
=
1
;
bytes
block_hash
=
2
[(
gogoproto.customtype
)
=
"github.com/meshplus/bitxhub-kit/types.Hash"
];
bytes
block_hash
=
2
[
(
gogoproto.customtype
)
=
"github.com/meshplus/bitxhub-kit/types.Hash"
];
uint64
interchain_tx_count
=
3
;
}
\ No newline at end of file
model/pb/commit.pb.go
View file @
65c121b8
...
...
@@ -5,10 +5,11 @@ package pb
import
(
fmt
"fmt"
_
"github.com/gogo/protobuf/gogoproto"
proto
"github.com/gogo/protobuf/proto"
io
"io"
math
"math"
_
"github.com/gogo/protobuf/gogoproto"
proto
"github.com/gogo/protobuf/proto"
)
// Reference imports to suppress errors if they are not otherwise used.
...
...
model/pb/commit.proto
View file @
65c121b8
model/pb/ibtp.pb.go
View file @
65c121b8
...
...
@@ -5,10 +5,11 @@ package pb
import
(
fmt
"fmt"
proto
"github.com/gogo/protobuf/proto"
io
"io"
math
"math"
math_bits
"math/bits"
proto
"github.com/gogo/protobuf/proto"
)
// Reference imports to suppress errors if they are not otherwise used.
...
...
model/pb/ibtp.proto
View file @
65c121b8
model/pb/ibtpx.pb.go
View file @
65c121b8
...
...
@@ -5,10 +5,11 @@ package pb
import
(
fmt
"fmt"
proto
"github.com/gogo/protobuf/proto"
io
"io"
math
"math"
math_bits
"math/bits"
proto
"github.com/gogo/protobuf/proto"
)
// Reference imports to suppress errors if they are not otherwise used.
...
...
model/pb/ibtpx.proto
View file @
65c121b8
...
...
@@ -2,16 +2,16 @@ syntax = "proto3";
package
pb
;
//import "basic.proto";
//
import "basic.proto";
import
"ibtp.proto"
;
message
IBTPX
{
IBTP
ibtp
=
1
;
// route mode
string
mode
=
2
;
//
dirct、relay
repeated
string
routeSign
=
3
;
//路由节点签名路径,主要是对data hash签名,主要是相互校验。sidecar节点之间相互校验。sidecar 节点需要注册到中继连上。还可以过滤已经发送过的交易、也可以作恶惩罚。
string
routeMethod
=
4
;
//
single、multicast、broadcast、
repeated
string
routeMethodArg
=
5
;
//路由节点,默认第一个节点。或者转发消息。
string
mode
=
2
;
//
dirct、relay
repeated
string
routeSign
=
3
;
//路由节点签名路径,主要是对data hash签名,主要是相互校验。sidecar节点之间相互校验。sidecar 节点需要注册到中继连上。还可以过滤已经发送过的交易、也可以作恶惩罚。
string
routeMethod
=
4
;
//
single、multicast、broadcast、
repeated
string
routeMethodArg
=
5
;
//路由节点,默认第一个节点。或者转发消息。
bool
IsValid
=
6
;
}
// 若目的地址to不在路由表中,则使用如下规则,即routeRule如下值时。
...
...
@@ -22,4 +22,3 @@ message IBTPX {
// broadcast:广播所有的给所有的peer。
// 设置节点筛选器,根据标签。
// 不需要指定节点ID,
model/pb/interchain_meta.pb.go
View file @
65c121b8
...
...
@@ -5,12 +5,13 @@ package pb
import
(
fmt
"fmt"
_
"github.com/gogo/protobuf/gogoproto"
proto
"github.com/gogo/protobuf/proto"
github_com_meshplus_bitxhub_kit_types
"github.com/meshplus/bitxhub-kit/types"
io
"io"
math
"math"
math_bits
"math/bits"
_
"github.com/gogo/protobuf/gogoproto"
proto
"github.com/gogo/protobuf/proto"
github_com_meshplus_bitxhub_kit_types
"github.com/meshplus/bitxhub-kit/types"
)
// Reference imports to suppress errors if they are not otherwise used.
...
...
model/pb/interchain_meta.proto
View file @
65c121b8
...
...
@@ -7,7 +7,7 @@ import "basic.proto";
message
InterchainMetaS
{
StringVerifiedIndexSliceMap
counter
=
1
;
repeated
bytes
l2Roots
=
2
[(
gogoproto.customtype
)
=
"github.com/meshplus/bitxhub-kit/types.Hash"
];
repeated
bytes
l2Roots
=
2
[
(
gogoproto.customtype
)
=
"github.com/meshplus/bitxhub-kit/types.Hash"
];
}
message
InterchainS
{
...
...
model/pb/message.pb.go
View file @
65c121b8
...
...
@@ -5,10 +5,11 @@ package pb
import
(
fmt
"fmt"
proto
"github.com/gogo/protobuf/proto"
io
"io"
math
"math"
math_bits
"math/bits"
proto
"github.com/gogo/protobuf/proto"
)
// Reference imports to suppress errors if they are not otherwise used.
...
...
model/pb/message.proto
View file @
65c121b8
...
...
@@ -28,9 +28,7 @@ message Pack {
bytes
data
=
2
;
}
message
PeerInfo
{
string
ID
=
1
;
string
Tag
=
2
;
}
model/pb/plugin.pb.go
View file @
65c121b8
...
...
@@ -6,13 +6,14 @@ package pb
import
(
context
"context"
fmt
"fmt"
io
"io"
math
"math"
math_bits
"math/bits"
proto
"github.com/gogo/protobuf/proto"
grpc
"google.golang.org/grpc"
codes
"google.golang.org/grpc/codes"
status
"google.golang.org/grpc/status"
io
"io"
math
"math"
math_bits
"math/bits"
)
// Reference imports to suppress errors if they are not otherwise used.
...
...
model/pb/plugin.proto
View file @
65c121b8
...
...
@@ -28,13 +28,13 @@ message RollbackIBTPResponse {
}
message
GetOutMessageRequest
{
string
to
=
1
;
uint64
idx
=
2
;
string
to
=
1
;
uint64
idx
=
2
;
}
message
GetInMessageRequest
{
string
from
=
1
;
uint64
idx
=
2
;
string
from
=
1
;
uint64
idx
=
2
;
}
message
GetInMessageResponse
{
...
...
model/pb/receipt.pb.go
View file @
65c121b8
...
...
@@ -5,12 +5,13 @@ package pb
import
(
fmt
"fmt"
_
"github.com/gogo/protobuf/gogoproto"
proto
"github.com/gogo/protobuf/proto"
github_com_meshplus_bitxhub_kit_types
"github.com/meshplus/bitxhub-kit/types"
io
"io"
math
"math"
math_bits
"math/bits"
_
"github.com/gogo/protobuf/gogoproto"
proto
"github.com/gogo/protobuf/proto"
github_com_meshplus_bitxhub_kit_types
"github.com/meshplus/bitxhub-kit/types"
)
// Reference imports to suppress errors if they are not otherwise used.
...
...
model/pb/receipt.proto
View file @
65c121b8
...
...
@@ -10,14 +10,14 @@ message Receipt {
FAILED
=
1
;
}
bytes
version
=
1
;
bytes
tx_hash
=
2
[(
gogoproto.customtype
)
=
"github.com/meshplus/bitxhub-kit/types.Hash"
];
bytes
tx_hash
=
2
[
(
gogoproto.customtype
)
=
"github.com/meshplus/bitxhub-kit/types.Hash"
];
bytes
ret
=
3
;
Status
status
=
4
;
repeated
Event
events
=
5
;
uint64
gas_used
=
6
;
repeated
EvmLog
evm_logs
=
7
;
bytes
bloom
=
8
[(
gogoproto.customtype
)
=
"github.com/meshplus/bitxhub-kit/types.Bloom"
];
bytes
contract_address
=
9
[(
gogoproto.customtype
)
=
"github.com/meshplus/bitxhub-kit/types.Address"
];
bytes
bloom
=
8
[
(
gogoproto.customtype
)
=
"github.com/meshplus/bitxhub-kit/types.Bloom"
];
bytes
contract_address
=
9
[
(
gogoproto.customtype
)
=
"github.com/meshplus/bitxhub-kit/types.Address"
];
}
message
Receipts
{
...
...
@@ -26,26 +26,26 @@ message Receipts {
message
Event
{
// Transaction Hash
bytes
tx_hash
=
1
[
(
gogoproto.customtype
)
=
"github.com/meshplus/bitxhub-kit/types.Hash"
];
bytes
tx_hash
=
1
[
(
gogoproto.customtype
)
=
"github.com/meshplus/bitxhub-kit/types.Hash"
];
bytes
data
=
2
;
// The interchain flag used by interchain contract
bool
interchain
=
3
;
}
message
EvmLog
{
bytes
address
=
1
[
(
gogoproto.customtype
)
=
"github.com/meshplus/bitxhub-kit/types.Address"
];
bytes
address
=
1
[
(
gogoproto.customtype
)
=
"github.com/meshplus/bitxhub-kit/types.Address"
];
repeated
bytes
topics
=
2
[
(
gogoproto.customtype
)
=
"github.com/meshplus/bitxhub-kit/types.Hash"
];
repeated
bytes
topics
=
2
[
(
gogoproto.customtype
)
=
"github.com/meshplus/bitxhub-kit/types.Hash"
];
bytes
data
=
3
;
uint64
block_number
=
4
;
bytes
tx_hash
=
5
[
(
gogoproto.customtype
)
=
"github.com/meshplus/bitxhub-kit/types.Hash"
];
bytes
tx_hash
=
5
[
(
gogoproto.customtype
)
=
"github.com/meshplus/bitxhub-kit/types.Hash"
];
uint64
tx_index
=
6
;
bytes
block_hash
=
7
[
(
gogoproto.customtype
)
=
"github.com/meshplus/bitxhub-kit/types.Hash"
];
bytes
block_hash
=
7
[
(
gogoproto.customtype
)
=
"github.com/meshplus/bitxhub-kit/types.Hash"
];
uint64
index
=
8
;
...
...
model/pb/vp_info.pb.go
View file @
65c121b8
...
...
@@ -5,10 +5,11 @@ package pb
import
(
fmt
"fmt"
proto
"github.com/gogo/protobuf/proto"
io
"io"
math
"math"
math_bits
"math/bits"
proto
"github.com/gogo/protobuf/proto"
)
// Reference imports to suppress errors if they are not otherwise used.
...
...
model/pb/vp_info.proto
View file @
65c121b8
scripts/cross_compile.sh
View file @
65c121b8
...
...
@@ -6,7 +6,7 @@ source x.sh
# $1 is arch, $2 is source code path
case
$1
in
linux-amd64
)
linux-amd64
)
print_blue
"Compile for linux/amd64"
docker run
-t
\
-v
$2
:/code/sidecar
\
...
...
@@ -27,7 +27,7 @@ linux-amd64)
cp /code/sidecar-client-fabric/build/fabric-client-1.4.so /code/sidecar/bin/sidecar-fabric-linux.so &&
cp /code/sidecar-client-ethereum/build/eth-client.so /code/sidecar/bin/sidecar-eth-linux.so"
;;
*
)
*
)
print_red
"Other architectures are not supported yet"
;;
esac
scripts/docker_entrypoint.sh
View file @
65c121b8
...
...
@@ -10,13 +10,12 @@ sidecar --repo=/root/sidecar appchain method register --admin-key ./key.json --m
--name
"
${
APPCHAIN_NAME
}
"
--type
fabric
--desc
=
"test for fabric"
--version
v1.4.3
\
--validators
./
"
${
PLUGIN_CONFIG
}
"
/fabric.validators
--consensus
raft
command1
=
$(
sidecar
--repo
=
/root/sidecar rule deploy
--path
./
"
${
PLUGIN_CONFIG
}
"
/validating.wasm
--method
fabappchain
--admin-key
./key.json
)
address
=
$(
echo
"
$command1
"
|
grep
-o
'0x.\{40\}'
)
address
=
$(
echo
"
$command1
"
|
grep
-o
'0x.\{40\}'
)
echo
"
${
address
}
"
command2
=
$(
sidecar
--repo
=
/root/sidecar rule
bind
--addr
"
${
address
}
"
--method
fabappchain
--admin-key
./key.json
)
proposalID
=
$(
echo
"
$command2
"
|
grep
-o
'0x.\{42\}'
)
proposalID
=
$(
echo
"
$command2
"
|
grep
-o
'0x.\{42\}'
)
echo
"
${
proposalID
}
"
sidecar
--repo
=
/root/sidecar start
...
...
scripts/prepare.sh
View file @
65c121b8
scripts/release_binary.sh
View file @
65c121b8
...
...
@@ -6,7 +6,7 @@ source x.sh
CURRENT_PATH
=
$(
pwd
)
PROJECT_PATH
=
$(
dirname
"
${
CURRENT_PATH
}
"
)
RELEASE_PATH
=
${
PROJECT_PATH
}
/bin
APP_VERSION
=
$(if
[
`
git rev-parse
--abbrev-ref
HEAD
`
==
'HEAD'
]
;
then
git describe
--tags
HEAD
;
else
echo
"dev"
;
fi)
APP_VERSION
=
$(if
[
$(
git rev-parse
--abbrev-ref
HEAD
)
==
'HEAD'
]
;
then
git describe
--tags
HEAD
;
else
echo
"dev"
;
fi)
print_blue
"===> 1. Install packr"
if
!
type
packr
>
/dev/null 2>&1
;
then
...
...
scripts/x.sh
View file @
65c121b8
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment