This repository has been archived by the owner on Mar 24, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 17
refactor: get config from godwoken rpc instead of env #239
Merged
Conversation
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
6 tasks
6 tasks
blckngm
reviewed
Apr 29, 2022
classicalliu
suggested changes
Apr 29, 2022
Flouse
suggested changes
May 4, 2022
Flouse
suggested changes
May 4, 2022
keroro520
reviewed
May 5, 2022
rpc: GodwokenClient; | ||
private nodeInfo: NodeInfo | undefined; | ||
|
||
web3ChainId: HexNumber | undefined; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Use #
?
Flouse
approved these changes
May 6, 2022
keroro520
approved these changes
May 6, 2022
classicalliu
reviewed
May 7, 2022
classicalliu
approved these changes
May 7, 2022
This RPC interface
echo '{
"id": 2,
"jsonrpc": "2.0",
"method": "poly_version",
"params": []
}' | tr -d '\n' \
| curl -H 'content-type: application/json' -d @- \
https://godwoken-testnet-v1.ckbapp.dev Result: {
"jsonrpc": "2.0",
"id": 2,
"result": {
"versions": {
"web3Version": "1.0.0-rc1",
"web3IndexerVersion": "1.0.0-rc1",
"godwokenVersion": "1.1.3 5ee735b"
},
"nodeInfo": {
"nodeMode": "fullnode",
"rollupCell": {
"typeHash": "0x702359ea7f073558921eb50d8c1c77e92f760c8f8656bde4995f26b8963e2dd8",
"typeScript": {
"code_hash": "0x1e44736436b406f8e48a30dfbddcf044feb0c9eebfe63b0f81cb5bb727d84854",
"hash_type": "type",
"args": "0x86c7429247beba7ddd6e4361bcdfc0510b0b644131e2afb7e486375249a01802"
}
},
"rollupConfig": {
"requiredStakingCapacity": "0x3691d6afc000",
"challengeMaturityBlocks": "0x1c2",
"finalityBlocks": "0x64",
"rewardBurnRate": "0x32",
"chainId": "0x116e9"
},
"gwScripts": {
"deposit": {
"script": {
"code_hash": "0x00000000000000000000000000000000000000000000000000545950455f4944",
"hash_type": "type",
"args": "0x86d24e5cb132478005dcf2b59680a9f37011cb54a5947f42f19ba5076bc6594d"
},
"typeHash": "0x50704b84ecb4c4b12b43c7acb260ddd69171c21b4c0ba15f3c469b7d143f6f18"
},
"withdraw": {
"script": {
"code_hash": "0x00000000000000000000000000000000000000000000000000545950455f4944",
"hash_type": "type",
"args": "0xbfef6580c1f93b98fa7d33bb3faa63255caba9bfbebfbada5eab4ce195052b9f"
},
"typeHash": "0x06ae0706bb2d7997d66224741d3ec7c173dbb2854a6d2cf97088796b677269c6"
},
"stateValidator": {
"script": {
"code_hash": "0x00000000000000000000000000000000000000000000000000545950455f4944",
"hash_type": "type",
"args": "0x063555cc66a1c270aafbe9324718232289a462f4d9edfc7a57f9c6e0f8257669"
},
"typeHash": "0x1e44736436b406f8e48a30dfbddcf044feb0c9eebfe63b0f81cb5bb727d84854"
},
"stakeLock": {
"script": {
"code_hash": "0x00000000000000000000000000000000000000000000000000545950455f4944",
"hash_type": "type",
"args": "0x0fc0f22f9a6e000692159c9d5dc633fba7ffcd1f1f2218d23aa2ede96f4b471d"
},
"typeHash": "0x7f5a09b8bd0e85bcf2ccad96411ccba2f289748a1c16900b0635c2ed9126f288"
},
"custodianLock": {
"script": {
"code_hash": "0x00000000000000000000000000000000000000000000000000545950455f4944",
"hash_type": "type",
"args": "0xc4695745c69c298c89bc701b6cc8614332c6fd8a2ed160e04748fc6fda636e71"
},
"typeHash": "0x85ae4db0dd83f428a31deb342e4000af37ce2c9645d9e619df00096e3c50a2bb"
},
"challengeLock": {
"script": {
"code_hash": "0x00000000000000000000000000000000000000000000000000545950455f4944",
"hash_type": "type",
"args": "0x7997689a9038a5487535cd8297d37b39840e140c849efd6f07ecc20ee9b9c244"
},
"typeHash": "0x06ae0706bb2d7997d66224741d3ec7c173dbb2854a6d2cf97088796b677269c6"
},
"l1Sudt": {
"script": {
"code_hash": "0x00000000000000000000000000000000000000000000000000545950455f4944",
"hash_type": "type",
"args": "0x4db75e03349f4f2ec792476035dd1b7376c683130f7e2e74024be2d9ee064511"
},
"typeHash": "0xc5e5dcf215925f7ef4dfaf5f4b4f105bc321c02776d6e7d52a1db3fcd9d011a4"
},
"l2Sudt": {
"script": {
"code_hash": "0x00000000000000000000000000000000000000000000000000545950455f4944",
"hash_type": "type",
"args": "0xe9374fd920cd4144ce72ab7ef3405d89e5f8530d586ba986e993f1d285060a7a"
},
"typeHash": "0xb6176a6170ea33f8468d61f934c45c57d29cdc775bcd3ecaaec183f04b9f33d9"
},
"omniLock": {
"script": {
"code_hash": "0x00000000000000000000000000000000000000000000000000545950455f4944",
"hash_type": "type",
"args": "0x1b8572b16c07f46a0efed623aea6de05d45985b9a7c1b0b52276da5d9f9615b7"
},
"typeHash": "0x79f90bb5e892d80dd213439eeab551120eb417678824f282b4ffb5f21bad2e1e"
}
},
"eoaScripts": {
"eth": {
"typeHash": "0x07521d0aa8e66ef441ebc31204d86bb23fc83e9edc58c19dbb1b0ebe64336ec0",
"script": {
"code_hash": "0x00000000000000000000000000000000000000000000000000545950455f4944",
"hash_type": "type",
"args": "0x66056785e4e989729053508c30d620ead06b377f600eedc0419e6858e459ccfa"
}
}
},
"backends": {
"sudt": {
"validatorCodeHash": "0xb9d9375c0fd4d50ed95019d8307961238316cd18c1fb3faeb15ac0d3c6d76bda",
"generatorCodeHash": "0xf87824d6723b3c0be51b1213e8b35a6e8587a10f2f27734a344f201bf2ab05ef",
"validatorScriptTypeHash": "0xb6176a6170ea33f8468d61f934c45c57d29cdc775bcd3ecaaec183f04b9f33d9"
},
"meta": {
"validatorCodeHash": "0x4cf8b2b8b04dab0de276093de71f98592a5d683d42e2aa70110e904b564fc1c3",
"generatorCodeHash": "0x8c6c44b97d9de23dc0047356fb0b3e258a60e14a1f2bfa8f95ddc7b41985a8e0",
"validatorScriptTypeHash": "0x37b25df86ca495856af98dff506e49f2380d673b0874e13d29f7197712d735e8"
},
"polyjuice": {
"validatorCodeHash": "0xfeb459ef3e797e3c7b5a4ec3b647d30fd0994f0f2733f3eda018a85e7e310a1b",
"generatorCodeHash": "0x308f8b2b54df5133ea73508e4879d08ae70d437037e585dcbb800e1d0609c946",
"validatorScriptTypeHash": "0x1629b04b49ded9e5747481f985b11cba6cdd4ffc167971a585e96729455ca736"
},
"ethAddrReg": {
"validatorCodeHash": "0x9085bd6a550a9921b46d23ba7d9b0f9f5c5d0c9c00999988cd907ce16015e467",
"generatorCodeHash": "0xe2ba730569850cca7a56c9a96754bd0bfd784c8f001e997e4512edf572190c4a",
"validatorScriptTypeHash": "0xa30dcbb83ebe571f49122d8d1ce4537679ebf511261c8ffaaa6679bf9fdea3a4"
}
},
"accounts": {
"polyjuiceCreator": {
"id": "0x4",
"scriptHash": "0x829cc5785a4d8ac642ede32cb3cb5cb9dc389d5892f2fc2afc760691445be194"
},
"ethAddrReg": {
"id": "0x2",
"scriptHash": "0x08c9937e412e135928fd6dec7255965ddd7df4d5a163564b60895100bb3b2f9e"
},
"defaultFrom": {
"id": "0x3",
"scriptHash": "0x495d9cfb7b6faeaeb0f5a7ed81a830a477f7aeea8d53ef73abdc2ec2f5fed07c"
}
},
"chainId": "0x116e9"
}
}
} |
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
the current env-config consists of two parts:
database URL, redis URL etc
;rollup_type_script_hash, eth_account_lock_type_hash etc
;this pr:
gw-config.ts
to reduce the overwhelming hand-edit env config.getChainInfo
RPC #194 bypoly_version
depends on:
poly_version Rpc Example
result