forked from hyperledger-labs/yui-ibc-solidity
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Signed-off-by: Jun Kimura <jun.kimura@datachain.jp>
- Loading branch information
Showing
61 changed files
with
19,405 additions
and
0 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
name: Test | ||
on: [push] | ||
jobs: | ||
|
||
test: | ||
name: Test | ||
runs-on: ubuntu-latest | ||
steps: | ||
|
||
- name: Set up Go 1.15 | ||
uses: actions/setup-go@v1 | ||
with: | ||
go-version: 1.15 | ||
id: go | ||
- uses: actions/setup-node@v2 | ||
with: | ||
node-version: '12' | ||
|
||
- name: Check out code into the Go module directory | ||
uses: actions/checkout@v2 | ||
|
||
- name: Test | ||
run: go test -v ./pkg/... | ||
|
||
- name: Resolve dependencies | ||
run: npm install | ||
|
||
- name: Setup chains | ||
run: NO_GEN_CODE=1 ./scripts/setup.sh testtwochainz | ||
|
||
- name: E2E test | ||
run: go test -v ./tests/e2e/... |
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,112 @@ | ||
build/ | ||
### https://raw.github.com/github/gitignore/6c87d249af5f2b3f8ab65ae0a2648682ee4e8a2d/Node.gitignore | ||
|
||
# Logs | ||
logs | ||
*.log | ||
npm-debug.log* | ||
yarn-debug.log* | ||
yarn-error.log* | ||
lerna-debug.log* | ||
|
||
# Diagnostic reports (https://nodejs.org/api/report.html) | ||
report.[0-9]*.[0-9]*.[0-9]*.[0-9]*.json | ||
|
||
# Runtime data | ||
pids | ||
*.pid | ||
*.seed | ||
*.pid.lock | ||
|
||
# Directory for instrumented libs generated by jscoverage/JSCover | ||
lib-cov | ||
|
||
# Coverage directory used by tools like istanbul | ||
coverage | ||
*.lcov | ||
|
||
# nyc test coverage | ||
.nyc_output | ||
|
||
# Grunt intermediate storage (https://gruntjs.com/creating-plugins#storing-task-files) | ||
.grunt | ||
|
||
# Bower dependency directory (https://bower.io/) | ||
bower_components | ||
|
||
# node-waf configuration | ||
.lock-wscript | ||
|
||
# Compiled binary addons (https://nodejs.org/api/addons.html) | ||
build/Release | ||
|
||
# Dependency directories | ||
node_modules/ | ||
jspm_packages/ | ||
|
||
# TypeScript v1 declaration files | ||
typings/ | ||
|
||
# TypeScript cache | ||
*.tsbuildinfo | ||
|
||
# Optional npm cache directory | ||
.npm | ||
|
||
# Optional eslint cache | ||
.eslintcache | ||
|
||
# Microbundle cache | ||
.rpt2_cache/ | ||
.rts2_cache_cjs/ | ||
.rts2_cache_es/ | ||
.rts2_cache_umd/ | ||
|
||
# Optional REPL history | ||
.node_repl_history | ||
|
||
# Output of 'npm pack' | ||
*.tgz | ||
|
||
# Yarn Integrity file | ||
.yarn-integrity | ||
|
||
# dotenv environment variables file | ||
.env | ||
.env.test | ||
|
||
# parcel-bundler cache (https://parceljs.org/) | ||
.cache | ||
|
||
# Next.js build output | ||
.next | ||
|
||
# Nuxt.js build / generate output | ||
.nuxt | ||
dist | ||
|
||
# Gatsby files | ||
.cache/ | ||
# Comment in the public line in if your project uses Gatsby and not Next.js | ||
# https://nextjs.org/blog/next-9-1#public-directory-support | ||
# public | ||
|
||
# vuepress build output | ||
.vuepress/dist | ||
|
||
# Serverless directories | ||
.serverless/ | ||
|
||
# FuseBox cache | ||
.fusebox/ | ||
|
||
# DynamoDB Local files | ||
.dynamodb/ | ||
|
||
# TernJS port file | ||
.tern-port | ||
|
||
# Stores VSCode versions used for testing VSCode extensions | ||
.vscode-test | ||
|
||
|
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,48 @@ | ||
NETWORK ?= development | ||
TRUFFLE ?= npx truffle | ||
ABIGEN ?= abigen | ||
|
||
.PHONY: build | ||
build: | ||
go build -o ./build/cmd/ibcsol ./cmd | ||
|
||
.PHONY: config | ||
config: | ||
export CONF_TPL="./pkg/consts/contract.go:./scripts/template/contract.go.tpl" && $(TRUFFLE) exec ./scripts/confgen.js --network=$(NETWORK) | ||
|
||
.PHONY: abi | ||
abi: | ||
ifdef SOURCE | ||
$(eval TARGET := $(shell echo ${SOURCE} | tr A-Z a-z)) | ||
@mkdir -p ./build/abi ./pkg/contract | ||
@mkdir -p ./pkg/contract/$(TARGET) | ||
@cat ./build/contracts/${SOURCE}.json | jq ".abi" > ./build/abi/${SOURCE}.abi | ||
$(ABIGEN) --abi ./build/abi/${SOURCE}.abi --pkg $(TARGET) --out ./pkg/contract/$(TARGET)/$(TARGET).go | ||
else | ||
@echo "'SOURCE={SOURCE}' is required" | ||
endif | ||
|
||
.PHONY: proto | ||
proto: | ||
protoc --go_out=. ./proto/*.proto | ||
|
||
.PHONY: test | ||
test: | ||
go test -v ./tests/... -count=1 | ||
|
||
.PHONY: setup | ||
setup: | ||
./scripts/setup.sh development | ||
|
||
.PHONY: down | ||
down: | ||
./scripts/setup.sh down | ||
|
||
.PHONY: proto-gen | ||
proto-gen: | ||
@echo "Generating Protobuf files" | ||
docker run -v $(CURDIR):/workspace --workdir /workspace tendermintdev/sdk-proto-gen sh ./scripts/protocgen.sh | ||
|
||
.PHONY: e2e-test | ||
e2e-test: | ||
go test -v ./tests/e2e/... |
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 |
---|---|---|
@@ -1 +1,27 @@ | ||
# IBC-Solidity | ||
|
||
IBC implementations in solidity. | ||
|
||
# Features | ||
|
||
- Implementation of ICS-compatible IBC | ||
- includes Proto3 serialization support | ||
- Light client of IBFT2.0 | ||
|
||
# Getting started | ||
|
||
Launch two Besu chains with IBC Contract deployed with the following command: | ||
|
||
```sh | ||
$ ./scripts/setup.sh testtwochainz | ||
``` | ||
|
||
// TODO write a description of cli tools. | ||
|
||
# Test | ||
|
||
After launch the chains, execute the following command: | ||
|
||
``` | ||
$ make e2e-test | ||
``` |
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,13 @@ | ||
FROM hyperledger/besu:21.1 | ||
|
||
USER root | ||
|
||
RUN mkdir -p /tmp/besu/data | ||
WORKDIR /tmp/besu | ||
ADD ibftConfigFile.json /tmp/besu/ibftConfigFile.json | ||
RUN besu operator generate-blockchain-config --config-file=ibftConfigFile.json --to=networkFiles --private-key-file-name=key | ||
RUN cp ./networkFiles/keys/*/* ./data/ | ||
|
||
EXPOSE 8545 8546 8547 30303 | ||
ENTRYPOINT [ "besu" ] | ||
CMD ["--data-path", "./data", "--genesis-file", "./networkFiles/genesis.json", "--rpc-http-enabled", "--rpc-http-api", "ETH,NET,IBFT", "--host-allowlist", "*", "--rpc-http-cors-origins", "all", "--revert-reason-enabled"] |
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,47 @@ | ||
{ | ||
"genesis": { | ||
"config": { | ||
"chainId": 2018, | ||
"muirglacierblock": 0, | ||
"ibft2": { | ||
"blockperiodseconds": 2, | ||
"epochlength": 30000, | ||
"requesttimeoutseconds": 4 | ||
} | ||
}, | ||
"nonce": "0x0", | ||
"timestamp": "0x58ee40ba", | ||
"gasLimit": "0x1fffffffffffff", | ||
"difficulty": "0x1", | ||
"mixHash": "0x63746963616c2062797a616e74696e65206661756c7420746f6c6572616e6365", | ||
"coinbase": "0x0000000000000000000000000000000000000000", | ||
"alloc": { | ||
"fe3b557e8fb62b89f4916b721be55ceb828dbd73": { | ||
"privateKey": "8f2a55949038a9610f50fb23b5883af3b4ecb3c3bb792cbcefbd1542c692be63", | ||
"comment": "private key and this comment are ignored. In a real chain, the private key should NOT be stored", | ||
"balance": "0xad78ebc5ac6200000" | ||
}, | ||
"627306090abaB3A6e1400e9345bC60c78a8BEf57": { | ||
"privateKey": "c87509a1c067bbde78beb793e6fa76530b6382a4c0241e5e4a9ec0a0f44dc0d3", | ||
"comment": "private key and this comment are ignored. In a real chain, the private key should NOT be stored", | ||
"balance": "90000000000000000000000" | ||
}, | ||
"f17f52151EbEF6C7334FAD080c5704D77216b732": { | ||
"privateKey": "ae6ae8e5ccbfb04590405997ee2d52d2b330726137b875053c36d94e974d162f", | ||
"comment": "private key and this comment are ignored. In a real chain, the private key should NOT be stored", | ||
"balance": "90000000000000000000000" | ||
}, | ||
"a89f47c6b463f74d87572b058427da0a13ec5425": { | ||
"privateKey": "e517af47112e4f501afb26e4f34eadc8b0ad8eadaf4962169fc04bc8ddbfe091", | ||
"comment": "private key and this comment are ignored. In a real chain, the private key should NOT be stored", | ||
"balance": "0xad78ebc5ac6200000" | ||
} | ||
} | ||
}, | ||
"blockchain": { | ||
"nodes": { | ||
"generate": true, | ||
"count": 1 | ||
} | ||
} | ||
} |
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,13 @@ | ||
FROM hyperledger/besu:21.1 | ||
|
||
USER root | ||
|
||
RUN mkdir -p /tmp/besu/data | ||
WORKDIR /tmp/besu | ||
ADD ibftConfigFile.json /tmp/besu/ibftConfigFile.json | ||
RUN besu operator generate-blockchain-config --config-file=ibftConfigFile.json --to=networkFiles --private-key-file-name=key | ||
RUN cp ./networkFiles/keys/*/* ./data/ | ||
|
||
EXPOSE 8545 8546 8547 30303 | ||
ENTRYPOINT [ "besu" ] | ||
CMD ["--data-path", "./data", "--genesis-file", "./networkFiles/genesis.json", "--rpc-http-enabled", "--rpc-http-api", "ETH,NET,IBFT", "--host-allowlist", "*", "--rpc-http-cors-origins", "all", "--revert-reason-enabled"] |
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,47 @@ | ||
{ | ||
"genesis": { | ||
"config": { | ||
"chainId": 3018, | ||
"muirglacierblock": 0, | ||
"ibft2": { | ||
"blockperiodseconds": 2, | ||
"epochlength": 30000, | ||
"requesttimeoutseconds": 4 | ||
} | ||
}, | ||
"nonce": "0x0", | ||
"timestamp": "0x58ee40ba", | ||
"gasLimit": "0x1fffffffffffff", | ||
"difficulty": "0x1", | ||
"mixHash": "0x63746963616c2062797a616e74696e65206661756c7420746f6c6572616e6365", | ||
"coinbase": "0x0000000000000000000000000000000000000000", | ||
"alloc": { | ||
"fe3b557e8fb62b89f4916b721be55ceb828dbd73": { | ||
"privateKey": "8f2a55949038a9610f50fb23b5883af3b4ecb3c3bb792cbcefbd1542c692be63", | ||
"comment": "private key and this comment are ignored. In a real chain, the private key should NOT be stored", | ||
"balance": "0xad78ebc5ac6200000" | ||
}, | ||
"627306090abaB3A6e1400e9345bC60c78a8BEf57": { | ||
"privateKey": "c87509a1c067bbde78beb793e6fa76530b6382a4c0241e5e4a9ec0a0f44dc0d3", | ||
"comment": "private key and this comment are ignored. In a real chain, the private key should NOT be stored", | ||
"balance": "90000000000000000000000" | ||
}, | ||
"f17f52151EbEF6C7334FAD080c5704D77216b732": { | ||
"privateKey": "ae6ae8e5ccbfb04590405997ee2d52d2b330726137b875053c36d94e974d162f", | ||
"comment": "private key and this comment are ignored. In a real chain, the private key should NOT be stored", | ||
"balance": "90000000000000000000000" | ||
}, | ||
"a89f47c6b463f74d87572b058427da0a13ec5425": { | ||
"privateKey": "e517af47112e4f501afb26e4f34eadc8b0ad8eadaf4962169fc04bc8ddbfe091", | ||
"comment": "private key and this comment are ignored. In a real chain, the private key should NOT be stored", | ||
"balance": "0xad78ebc5ac6200000" | ||
} | ||
} | ||
}, | ||
"blockchain": { | ||
"nodes": { | ||
"generate": true, | ||
"count": 1 | ||
} | ||
} | ||
} |
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 @@ | ||
version: "3.3" | ||
services: | ||
development: | ||
build: ./chain0 | ||
ports: | ||
- 8545:8545 | ||
- 8546:8546 | ||
testchain0: | ||
build: ./chain0 | ||
ports: | ||
- 8645:8545 | ||
- 8646:8546 | ||
testchain1: | ||
build: ./chain1 | ||
ports: | ||
- 8745:8545 | ||
- 8746:8546 |
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,7 @@ | ||
version: "3.3" | ||
services: | ||
geth: | ||
build: ./geth | ||
ports: | ||
- 8545:8545 | ||
- 8546:8546 |
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,15 @@ | ||
FROM ethereum/client-go:v1.9.25 | ||
|
||
ADD geth.password /root/geth.password | ||
ADD genesis.json /root/genesis.json | ||
ADD privatekey /root/privatekey | ||
ADD run.sh /run.sh | ||
|
||
RUN /usr/local/bin/geth --nousb --datadir /root/.ethereum init /root/genesis.json | ||
|
||
RUN /usr/local/bin/geth --nousb account import /root/privatekey --password /root/geth.password | ||
|
||
EXPOSE 8545 | ||
|
||
ENTRYPOINT ["/run.sh"] | ||
CMD ["--verbosity", "5", "--vmdebug", "--shh"] |
Oops, something went wrong.