forked from hyperledger-cacti/cacti
-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(validator): go-ethereum validator including execSyncFunction
Signed-off-by: Takuma TAKEUCHI <takeuchi.takuma@fujitsu.com>
- Loading branch information
Showing
53 changed files
with
2,211 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
dist/ |
6 changes: 6 additions & 0 deletions
6
packages/ledger-plugin/go-ethereum-ts/validator/src/.gitignore
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
core/node_modules/ | ||
core/package-lock.json | ||
dependent/node_modules/ | ||
dependent/package-lock.json | ||
core/npm-debug.log | ||
|
17 changes: 17 additions & 0 deletions
17
packages/ledger-plugin/go-ethereum-ts/validator/src/README.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
<!-- | ||
Copyright 2019-2020 Fujitsu Laboratories Ltd. | ||
SPDX-License-Identifier: Apache-2.0 | ||
README.md | ||
--> | ||
# BIF-trial(Validator) | ||
|
||
## Assumption | ||
- geth1(geth-docker) is running | ||
- Specify the geth1 URL to connect to with "validatorUrl" in "config/default.js" | ||
|
||
## Run | ||
<pre> | ||
cd core | ||
node ./bin/www.js | ||
</pre> |
16 changes: 16 additions & 0 deletions
16
packages/ledger-plugin/go-ethereum-ts/validator/src/build/Dockerfile
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
# Copyright 2019-2020 Fujitsu Laboratories Ltd. | ||
# SPDX-License-Identifier: Apache-2.0 | ||
FROM hyperledger/fabric-ccenv:x86_64-1.0.4 | ||
#ENV http_proxy $HTTP_PROXY | ||
#ENV https_proxy $HTTP_PROXY | ||
#ENV HTTP_PROXY $HTTP_PROXY | ||
#ENV HTTPS_PROXY $HTTP_PROXY | ||
#ENV NO_PROXY "rest-server,ec1-connector,ec2-connector,geth1,geth2" | ||
RUN apt update | ||
RUN apt-get install -y screen | ||
RUN apt-get install -y npm | ||
#RUN npm -g config set proxy $HTTP_PROXY | ||
RUN npm -g install n | ||
RUN n --version | ||
RUN n 8.9.0 | ||
RUN npm -g install express |
2 changes: 2 additions & 0 deletions
2
packages/ledger-plugin/go-ethereum-ts/validator/src/copyStaticAssets.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
import * as shell from 'shelljs'; | ||
shell.cp('-R', 'core/CA/', '../dist/core'); |
10 changes: 10 additions & 0 deletions
10
packages/ledger-plugin/go-ethereum-ts/validator/src/core/CA/connector.crt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
-----BEGIN CERTIFICATE----- | ||
MIIBdTCCARoCCQC/F+Mh551QzDAKBggqhkjOPQQDAjBCMQswCQYDVQQGEwJKUDEQ | ||
MA4GA1UECAwHZXNqbXMxMjEhMB8GA1UECgwYSW50ZXJuZXQgV2lkZ2l0cyBQdHkg | ||
THRkMB4XDTE4MDYyNzA3MjIzNVoXDTI4MDYyNDA3MjIzNVowQjELMAkGA1UEBhMC | ||
SlAxEDAOBgNVBAgMB2Vzam1zMTIxITAfBgNVBAoMGEludGVybmV0IFdpZGdpdHMg | ||
UHR5IEx0ZDBZMBMGByqGSM49AgEGCCqGSM49AwEHA0IABDPpSD2w0zrqJKraGD1b | ||
5Jq2sDuacThSUqi7fvz8oyrWtuKDjZ15zIaSOtak6XRxFh9V9Gokdg5GNbW/pTZc | ||
TuowCgYIKoZIzj0EAwIDSQAwRgIhAKH6ERsyd5bpEMIkY4clPqguwDWoTLk2VKq6 | ||
ONEhUqotAiEA4yJxGmZpFdRScG2gDUIF2VDeX+XfHdJI2J41hyW9/zI= | ||
-----END CERTIFICATE----- |
8 changes: 8 additions & 0 deletions
8
packages/ledger-plugin/go-ethereum-ts/validator/src/core/CA/connector.csr
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
-----BEGIN CERTIFICATE REQUEST----- | ||
MIH9MIGkAgEAMEIxCzAJBgNVBAYTAkpQMRAwDgYDVQQIDAdlc2ptczEyMSEwHwYD | ||
VQQKDBhJbnRlcm5ldCBXaWRnaXRzIFB0eSBMdGQwWTATBgcqhkjOPQIBBggqhkjO | ||
PQMBBwNCAAQz6Ug9sNM66iSq2hg9W+SatrA7mnE4UlKou378/KMq1rbig42decyG | ||
kjrWpOl0cRYfVfRqJHYORjW1v6U2XE7qoAAwCgYIKoZIzj0EAwIDSAAwRQIgCUA1 | ||
B5mZK7Hx79J1xBb0MGwuoUkt4bGPXbHqWEMZXQMCIQCRgadPkrNw56+pT5MVxA5K | ||
vV6xTgmxUYrYnpkR4tptqQ== | ||
-----END CERTIFICATE REQUEST----- |
8 changes: 8 additions & 0 deletions
8
packages/ledger-plugin/go-ethereum-ts/validator/src/core/CA/connector.priv
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
-----BEGIN EC PARAMETERS----- | ||
BggqhkjOPQMBBw== | ||
-----END EC PARAMETERS----- | ||
-----BEGIN EC PRIVATE KEY----- | ||
MHcCAQEEICIlCfK3zMTFzUgdaj01LAHjJmHlbg6Xql9+i70iPz5EoAoGCCqGSM49 | ||
AwEHoUQDQgAEM+lIPbDTOuokqtoYPVvkmrawO5pxOFJSqLt+/PyjKta24oONnXnM | ||
hpI61qTpdHEWH1X0aiR2DkY1tb+lNlxO6g== | ||
-----END EC PRIVATE KEY----- |
46 changes: 46 additions & 0 deletions
46
packages/ledger-plugin/go-ethereum-ts/validator/src/core/app.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
/* | ||
* Copyright 2019-2020 Fujitsu Laboratories Ltd. | ||
* SPDX-License-Identifier: Apache-2.0 | ||
* | ||
* app.js | ||
*/ | ||
|
||
/* Summary: | ||
* | ||
*/ | ||
|
||
import { NextFunction, Request, Response } from 'express'; | ||
import createError = require('http-errors'); | ||
import express = require('express'); | ||
import cookieParser = require('cookie-parser'); | ||
import bodyParser = require('body-parser'); | ||
|
||
const app: express.Express = express(); | ||
|
||
app.use(bodyParser.json()); | ||
app.use(bodyParser.urlencoded({ extended: false })); | ||
app.use(cookieParser()); | ||
|
||
// catch 404 and forward to error handler | ||
app.use((req: Request, res: Response, next: NextFunction) => { | ||
next(createError(404)); | ||
}); | ||
|
||
// error handler | ||
app.use((err: { message: string, status?: number }, req: Request, res: Response, next: NextFunction) => { | ||
// set locals, only providing error in development | ||
res.locals.message = err.message; | ||
res.locals.error = req.app.get('env') === 'development' ? err : {}; | ||
|
||
// set erreor response | ||
const errorResponse: {} = { | ||
"statusCode": err.status || 500, | ||
"message": err.message | ||
}; | ||
|
||
// render the error page | ||
res.status(err.status || 500); | ||
res.send(errorResponse); | ||
}); | ||
|
||
export default app; |
Oops, something went wrong.