-
Notifications
You must be signed in to change notification settings - Fork 283
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat(connector-polkadot): polkadot connector #1997
feat(connector-polkadot): polkadot connector #1997
Conversation
0903bed
to
91f68a1
Compare
|
||
public setProvider(wsProviderUrl: string): void { | ||
try { | ||
this.wsProvider = new WsProvider(wsProviderUrl); |
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.
Does this even try to connect to the wsProviderUrl
?
If yes, is there a way to avoid autoconnect by passing some other argument(s) to the WsProvider
constructor or some other way? (If this is enabled, this will be helpful in the DAST scan, so that we can pass a dummy wsProviderUrl
and don't require to spin up an actual all-in-one
image for Polkadot)
@petermetz will we be adding this platform as well to the DAST scans?
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.
Yes it automatically connects (behind the scenes): https://polkadot.js.org/docs/api/start/create/
and yes.
...n-ledger-connector-polkadot/src/main/typescript/web-services/deploy-contract-ink-endpoint.ts
Show resolved
Hide resolved
782ad1e
to
133f245
Compare
"Authority", | ||
"Stake", | ||
"Work", | ||
"Substrate" |
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.
@RafaelAPB By the consesus algorithm family "Substrate" are you referring to all the consensus algorithms listed here on their documentation? https://docs.substrate.io/v3/advanced/consensus/#consensus-in-substrate
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.
Updated to Substrate-GRANPA (for clarity)
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.
@RafaelAPB Please delete the package-lock.json file, it's not being used since we migrated to yarn.
...cactus-plugin-ledger-connector-polkadot/src/test/rust/fixtures/ink!/publicBulletin/README.md
Outdated
Show resolved
Hide resolved
@@ -0,0 +1,8 @@ | |||
import test, { Test } from "tape-promise/tape"; |
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.
@RafaelAPB Any chance that you could write the tests with Jest? See my earlier email on the mailing list for rationale (we've migrated over last summer)
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.
Please see comment bellow
@@ -0,0 +1,89 @@ | |||
/* |
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.
@RafaelAPB Are these commented out because they are not needed at all to achieve sufficient coverage or some other reason?
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.
Tests are not currently passing because the smart contracts are not being generated automatically from the source, and thus we cannot run them. Is this an impeditive issue?
c6f30d4
to
a296a35
Compare
a296a35
to
f3aa175
Compare
Co-authored-by: CatarinaPedreira <[email protected]> Signed-off-by: Rafael Belchior <[email protected]> feat(tools): substrate test ledger Co-authored-by: CatarinaPedreira <[email protected]> Co-authored-by: Peter Somogyvari <[email protected]> Signed-off-by: Rafael Belchior <[email protected]> feat(polkadot-connector): add transaction endpoint Signed-off-by: Rafael Belchior <[email protected]> feat(polkadot-connector): add documentation Signed-off-by: Rafael Belchior <[email protected]> chore(polkadot-connector): update dependencies Signed-off-by: Rafael Belchior <[email protected]> refactor(polkadot-connector): refactor endpoints Signed-off-by: Rafael Belchior <[email protected]> refactor(polkadot-connector): refactor connector Signed-off-by: Rafael Belchior <[email protected]> feat(polkadot-connector): get tx info endpoint Signed-off-by: Rafael Belchior <[email protected]> test(polkadot-connector): skip tests Signed-off-by: Rafael Belchior <[email protected]> feat(connector-polkadot): polkadot connector Co-authored-by: CatarinaPedreira <[email protected]> Signed-off-by: Rafael Belchior <[email protected]> feat(tools): substrate test ledger Co-authored-by: CatarinaPedreira <[email protected]> Co-authored-by: Peter Somogyvari <[email protected]> Signed-off-by: Rafael Belchior <[email protected]> feat(polkadot-connector): add transaction endpoint Signed-off-by: Rafael Belchior <[email protected]> feat(polkadot-connector): add documentation Signed-off-by: Rafael Belchior <[email protected]> chore(polkadot-connector): update dependencies Signed-off-by: Rafael Belchior <[email protected]> refactor(polkadot-connector): refactor endpoints Signed-off-by: Rafael Belchior <[email protected]> refactor(polkadot-connector): refactor connector Signed-off-by: Rafael Belchior <[email protected]> feat(polkadot-connector): get tx info endpoint Signed-off-by: Rafael Belchior <[email protected]> test(polkadot-connector): skip tests Signed-off-by: Rafael Belchior <[email protected]> feat(connector-polkadot): add connector draft Signed-off-by: Rafael Belchior <[email protected]>
f3aa175
to
a296a35
Compare
Co-authored-by: CatarinaPedreira <[email protected]> Signed-off-by: Rafael Belchior <[email protected]> feat(tools): substrate test ledger Co-authored-by: CatarinaPedreira <[email protected]> Co-authored-by: Peter Somogyvari <[email protected]> Signed-off-by: Rafael Belchior <[email protected]> feat(polkadot-connector): add transaction endpoint Signed-off-by: Rafael Belchior <[email protected]> feat(polkadot-connector): add documentation Signed-off-by: Rafael Belchior <[email protected]> chore(polkadot-connector): update dependencies Signed-off-by: Rafael Belchior <[email protected]> refactor(polkadot-connector): refactor endpoints Signed-off-by: Rafael Belchior <[email protected]> refactor(polkadot-connector): refactor connector Signed-off-by: Rafael Belchior <[email protected]> feat(polkadot-connector): get tx info endpoint Signed-off-by: Rafael Belchior <[email protected]> test(polkadot-connector): skip tests Signed-off-by: Rafael Belchior <[email protected]> feat(connector-polkadot): polkadot connector Co-authored-by: CatarinaPedreira <[email protected]> Signed-off-by: Rafael Belchior <[email protected]> feat(tools): substrate test ledger Co-authored-by: CatarinaPedreira <[email protected]> Co-authored-by: Peter Somogyvari <[email protected]> Signed-off-by: Rafael Belchior <[email protected]> feat(polkadot-connector): add transaction endpoint Signed-off-by: Rafael Belchior <[email protected]> feat(polkadot-connector): add documentation Signed-off-by: Rafael Belchior <[email protected]> chore(polkadot-connector): update dependencies Signed-off-by: Rafael Belchior <[email protected]> refactor(polkadot-connector): refactor endpoints Signed-off-by: Rafael Belchior <[email protected]> refactor(polkadot-connector): refactor connector Signed-off-by: Rafael Belchior <[email protected]> feat(polkadot-connector): get tx info endpoint Signed-off-by: Rafael Belchior <[email protected]> test(polkadot-connector): skip tests Signed-off-by: Rafael Belchior <[email protected]> feat(connector-polkadot): add connector draft Signed-off-by: Rafael Belchior <[email protected]>
a296a35
to
707eaed
Compare
@jagpreetsinghsasan @AnmolBansalDEV I'm closing this for now just to keep our backlog of PRs tidy(er) but please re-open as soon as it is ready for review with the new changes incorporated from the LF mentorship program! cc: @RafaelAPB |
This PR adds a long-term effort to adding preliminary support to Substrate-based chains. Most work wonderfully done by @CatarinaPedreira
"The Polkadot Connector provides functionality that enables any permissioned blockchain (as long as it is supported by Hyperledger Cactus) to connect to the Polkadot network and perform monetary transactions to the latter. Besides this, the connector provides methods for these blockchains to deploy and interact with smart contracts in the network.
Our connector in Hyperledger Cactus uses three different API’s to communicate with the Polkadot network: ”@polkadot/api” (which has the base API functionality), ”@polkadot/api-contracts” (which contains the API specific for smart contract interaction) and ”@polkadot/types” (which encompasses specific
Polkadot types)."
Features:
-transact on the network
-read smart contracts
-deploy smart contracts
-read from smart contracts
-endpoints for the features
Future work/limitations
Thanks to @petermetz for helping develop the test ledger.
Co-authored-by: CatarinaPedreira [email protected]
Signed-off-by: Rafael Belchior [email protected]