Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
M
metacrypter
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
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
Nebula
metacrypter
Commits
42f66b11
Commit
42f66b11
authored
2 years ago
by
vicotor
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
add first implement.
parent
3e5a44aa
master
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
63 additions
and
0 deletions
+63
-0
secp256k1.go
crypto/secp256k1.go
+1
-0
main.go
main.go
+24
-0
service.go
service/service.go
+38
-0
No files found.
crypto/secp256k1.go
0 → 100644
View file @
42f66b11
package
crypto
This diff is collapsed.
Click to expand it.
main.go
0 → 100644
View file @
42f66b11
package
main
import
(
"fmt"
"github.com/cmpchain/metacrypter/service"
"google.golang.org/grpc"
"net"
)
func
main
()
{
lis
,
err
:=
net
.
Listen
(
"tcp"
,
":8970"
)
if
err
!=
nil
{
fmt
.
Printf
(
"failed to listen: %v"
,
err
)
return
}
s
:=
grpc
.
NewServer
()
service
.
RegisterCrypter
(
s
)
err
=
s
.
Serve
(
lis
)
if
err
!=
nil
{
fmt
.
Printf
(
"failed to serve: %v"
,
err
)
return
}
}
This diff is collapsed.
Click to expand it.
service/service.go
0 → 100644
View file @
42f66b11
package
service
import
(
"context"
metacrypter
"github.com/cmpchain/metacrypter/pb/metacrypter/v1"
"google.golang.org/grpc"
"google.golang.org/grpc/codes"
"google.golang.org/grpc/status"
)
// hello server
type
CrypterServer
struct
{
metacrypter
.
UnimplementedCrypterServiceServer
}
func
(
*
CrypterServer
)
Sign
(
ctx
context
.
Context
,
req
*
metacrypter
.
SignRequest
)
(
*
metacrypter
.
SignResponse
,
error
)
{
return
nil
,
status
.
Errorf
(
codes
.
Unimplemented
,
"method Sign not implemented"
)
}
func
(
*
CrypterServer
)
Verify
(
ctx
context
.
Context
,
req
*
metacrypter
.
VerifyRequest
)
(
*
metacrypter
.
VerifyResponse
,
error
)
{
return
nil
,
status
.
Errorf
(
codes
.
Unimplemented
,
"method Verify not implemented"
)
}
func
(
*
CrypterServer
)
Recover
(
ctx
context
.
Context
,
req
*
metacrypter
.
RecoverRequest
)
(
*
metacrypter
.
RecoverResponse
,
error
)
{
return
nil
,
status
.
Errorf
(
codes
.
Unimplemented
,
"method Recover not implemented"
)
}
func
(
*
CrypterServer
)
BatchSign
(
ctx
context
.
Context
,
req
*
metacrypter
.
BatchSignRequest
)
(
*
metacrypter
.
BatchSignResponse
,
error
)
{
return
nil
,
status
.
Errorf
(
codes
.
Unimplemented
,
"method BatchSign not implemented"
)
}
func
(
*
CrypterServer
)
BatchVerify
(
ctx
context
.
Context
,
req
*
metacrypter
.
BatchVerifyRequest
)
(
*
metacrypter
.
BatchVerifyResponse
,
error
)
{
return
nil
,
status
.
Errorf
(
codes
.
Unimplemented
,
"method BatchVerify not implemented"
)
}
func
(
*
CrypterServer
)
BatchRecover
(
ctx
context
.
Context
,
req
*
metacrypter
.
BatchRecoverRequest
)
(
*
metacrypter
.
BatchRecoverResponse
,
error
)
{
return
nil
,
status
.
Errorf
(
codes
.
Unimplemented
,
"method BatchRecover not implemented"
)
}
func
RegisterCrypter
(
server
*
grpc
.
Server
)
{
metacrypter
.
RegisterCrypterServiceServer
(
server
,
&
CrypterServer
{})
}
This diff is collapsed.
Click to expand it.
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