Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 6 additions & 6 deletions ibc.ts/.env.default
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
CHAIN_A_RPC_URL="http://localhost:8080"
CHAIN_A_NETWORK_ID="tc"
CHAIN_A_FAUCET_ADDRESS="tccqym6znlgc48qeelrzccehkcaut7yz39wwq96q3y7"
CHAIN_A_RPC_URL="http://localhost:18080"
CHAIN_A_NETWORK_ID="ac"
CHAIN_A_FAUCET_ADDRESS="accqym7qmn5yj29cdl405xlmx6awd3f3yz07g7vq2c9"
CHAIN_A_COUNTERPARTY_CLIENT_ID="BClient"
CHAIN_A_COUNTERPARTY_CONNECTION_ID="BConnection"
CHAIN_A_COUNTERPARTY_CHANNEL_ID="BChannel"
CHAIN_B_RPC_URL="http://localhost:8081"
CHAIN_B_NETWORK_ID="fc"
CHAIN_B_FAUCET_ADDRESS="fccqyd6clszl2aeq4agrk8sgq8whkty6ktljuemc9y3"
CHAIN_B_RPC_URL="http://localhost:18081"
CHAIN_B_NETWORK_ID="bc"
CHAIN_B_FAUCET_ADDRESS="bccqygjwzj8wupc9m7du9ccef4j6k2u3erjuv2w8pt0"
CHAIN_B_COUNTERPARTY_CLIENT_ID="AClient"
CHAIN_B_COUNTERPARTY_CONNECTION_ID="AConnection"
CHAIN_B_COUNTERPARTY_CHANNEL_ID="AChannel"
2 changes: 2 additions & 0 deletions ibc.ts/.gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,5 @@ yarn-error.log
yarn.lock
build/
.env
/chainA/db/
/chainB/db/
17 changes: 17 additions & 0 deletions ibc.ts/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,20 @@ IBC relayer and scenario
=========================

This directory contains IBC relayer implementation and IBC demo scenario script.

## Before start

1. Please run `yarn install`. It will install dependencies.
2. Please run `cp .env.default .env`

## How to run chains

Run `yarn run runChains`

## Print debug log

Please use `DEBUG` environment variable.
If you want to print all debug log,
please use "\*" for the `DEBUG` environment variable, like: `DEBUG="*"`

For example you can run like this: `DEBUG="*" yarn run runChains`
35 changes: 35 additions & 0 deletions ibc.ts/chainA/chainA.config.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
[codechain]
quiet = false
base_path = "."

[mining]
mem_pool_mem_limit = 512 # MB
mem_pool_size = 524288
self_nomination_enable =false
mem_pool_fee_bump_shift = 3 # 12.5%
allow_create_shard = false
reseal_on_txs = "all"
reseal_min_period = 4000
no_reseal_timer = false
allowed_past_gap = 30000
allowed_future_gap = 5000

[network]
disable = true

[rpc]
disable = false
interface = "127.0.0.1"
port = 18080

[ipc]
disable = true

[ws]
disable = true

[snapshot]
disable = true

[email_alarm]
disable = true
61 changes: 61 additions & 0 deletions ibc.ts/chainA/chainA.schem.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
{
"name": "Chain A",
"engine": {
"solo": {
"params": {
"hit": {},
"genesisStakes": {
"accqym7qmn5yj29cdl405xlmx6awd3f3yz07g7vq2c9": 100000
}
}
}
},
"params": {
"maxExtraDataSize": "0x20",
"maxAssetSchemeMetadataSize": "0x0400",
"maxTransferMetadataSize": "0x0100",
"maxTextContentSize": "0x0200",
"networkID": "ac",
"minPayCost": 10,
"minSetRegularKeyCost": 10,
"minCreateShardCost": 10,
"minSetShardOwnersCost": 10,
"minSetShardUsersCost": 10,
"minWrapCccCost": 10,
"minCustomCost": 10,
"minMintAssetCost": 10,
"minTransferAssetCost": 10,
"minChangeAssetSchemeCost": 10,
"minIncreaseAssetSupplyCost": 10,
"minComposeAssetCost": 10,
"minDecomposeAssetCost": 10,
"minUnwrapCccCost": 10,
"maxBodySize": 4194304,
"snapshotPeriod": 16384
},
"genesis": {
"seal": {
"generic": "0x0"
},
"score": "0x20000",
"author": "accqym7qmn5yj29cdl405xlmx6awd3f3yz07g7vq2c9",
"timestamp": "0x00",
"parentHash": "0x0000000000000000000000000000000000000000000000000000000000000000",
"extraData": "0x"
},
"accounts": {
"accqym7qmn5yj29cdl405xlmx6awd3f3yz07g7vq2c9": {
"balance": "10000000000000000000",
"seq": "0"
}
},
"shards": {
"0": {
"seq": 0,
"owners": [
"accqym7qmn5yj29cdl405xlmx6awd3f3yz07g7vq2c9"
],
"users": []
}
}
}
28 changes: 28 additions & 0 deletions ibc.ts/chainA/keystore.db
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
{
"meta": "",
"platform": [
{
"crypto": {
"ciphertext": "767072f50b72e9404a66239ccb6872f37d8fc9d339dee1e09d31ed764e9d6ab2",
"cipherparams": {
"iv": "6abcf74e12778a38f858e29610046060"
},
"cipher": "aes-128-ctr",
"kdf": "pbkdf2",
"kdfparams": {
"dklen": 32,
"salt": "8dbe337903dce4cab897c375535fea1f268da5f0a8a5525b6d4505942b91c637",
"c": 262144,
"prf": "hmac-sha256"
},
"mac": "747f4d8df3728a3a53c1f174287e31248ff2c8f3bc3118f213fafa9a00015e64"
},
"id": "3698c735-25a8-4639-9c1d-fb794efea6b0",
"version": 3,
"address": "37e06e7424945c37f57d0dfd9b5d736298904ff2",
"meta": "{}"
}
],
"asset": [],
"hdwseed": []
}
35 changes: 35 additions & 0 deletions ibc.ts/chainB/chainB.config.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
[codechain]
quiet = false
base_path = "."

[mining]
mem_pool_mem_limit = 512 # MB
mem_pool_size = 524288
self_nomination_enable =false
mem_pool_fee_bump_shift = 3 # 12.5%
allow_create_shard = false
reseal_on_txs = "all"
reseal_min_period = 4000
no_reseal_timer = false
allowed_past_gap = 30000
allowed_future_gap = 5000

[network]
disable = true

[rpc]
disable = false
interface = "127.0.0.1"
port = 18081

[ipc]
disable = true

[ws]
disable = true

[snapshot]
disable = true

[email_alarm]
disable = true
61 changes: 61 additions & 0 deletions ibc.ts/chainB/chainB.schem.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
{
"name": "Chain B",
"engine": {
"solo": {
"params": {
"hit": {},
"genesisStakes": {
"bccqygjwzj8wupc9m7du9ccef4j6k2u3erjuv2w8pt0": 100000
}
}
}
},
"params": {
"maxExtraDataSize": "0x20",
"maxAssetSchemeMetadataSize": "0x0400",
"maxTransferMetadataSize": "0x0100",
"maxTextContentSize": "0x0200",
"networkID": "bc",
"minPayCost": 10,
"minSetRegularKeyCost": 10,
"minCreateShardCost": 10,
"minSetShardOwnersCost": 10,
"minSetShardUsersCost": 10,
"minWrapCccCost": 10,
"minCustomCost": 10,
"minMintAssetCost": 10,
"minTransferAssetCost": 10,
"minChangeAssetSchemeCost": 10,
"minIncreaseAssetSupplyCost": 10,
"minComposeAssetCost": 10,
"minDecomposeAssetCost": 10,
"minUnwrapCccCost": 10,
"maxBodySize": 4194304,
"snapshotPeriod": 16384
},
"genesis": {
"seal": {
"generic": "0x0"
},
"score": "0x20000",
"author": "bccqygjwzj8wupc9m7du9ccef4j6k2u3erjuv2w8pt0",
"timestamp": "0x00",
"parentHash": "0x0000000000000000000000000000000000000000000000000000000000000000",
"extraData": "0x"
},
"accounts": {
"bccqygjwzj8wupc9m7du9ccef4j6k2u3erjuv2w8pt0": {
"balance": "10000000000000000000",
"seq": "0"
}
},
"shards": {
"0": {
"seq": 0,
"owners": [
"bccqygjwzj8wupc9m7du9ccef4j6k2u3erjuv2w8pt0"
],
"users": []
}
}
}
28 changes: 28 additions & 0 deletions ibc.ts/chainB/keystore.db
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
{
"meta": "",
"platform": [
{
"crypto": {
"ciphertext": "4abf3dbf2e52387a4c575d125b3a8490f20497033791e2932b38186b27f69a24",
"cipherparams": {
"iv": "73ad8c88fbda0ddd7851e6070e2439e6"
},
"cipher": "aes-128-ctr",
"kdf": "pbkdf2",
"kdfparams": {
"dklen": 32,
"salt": "07b24154ec7a80d025d72c38c796fc6170526092dbedfffc5509645c2e287196",
"c": 262144,
"prf": "hmac-sha256"
},
"mac": "ce3f3d77e676f464958275d4a848613fbd7da83eade1f0a5061481a2c57d9a9f"
},
"id": "685ddee6-166e-4be4-8ad7-6deed4ce7e2c",
"version": 3,
"address": "11270a47770382efcde1718ca6b2d595c8e472e3",
"meta": "{}"
}
],
"asset": [],
"hdwseed": []
}
3 changes: 2 additions & 1 deletion ibc.ts/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,8 @@
"fmt": "tslint -p . --fix && prettier 'src/**/*.{ts, json}' --write",
"lint": "tsc -p . --noEmit && tslint -p . && prettier 'src/**/*.{ts, json}' -l",
"scenario": "yarn build && node build/scenario/index.js",
"relayer": "yarn build && node build/relayer/index.js"
"relayer": "yarn build && node build/relayer/index.js",
"runChains": "yarn build && node build/scenario/runChains.js"
},
"devDependencies": {
"@types/debug": "^4.1.5",
Expand Down
Loading