hyperledger-web3j / web3j

Lightweight Java and Android library for integration with Ethereum clients
https://www.web3labs.com/web3j-sdk
Other
5.12k stars 1.69k forks source link

How to Use Dynamic Private Key to Sign Transaction when Call Smart Contract Through web3j_openapi ? #1406

Closed bao1018 closed 3 years ago

bao1018 commented 3 years ago

We would like to expose the smart contracts functions and event to auto-generated RESTFul API, web3j's Web3j-OpenAPI generator is the tool I am looking for.

But I realize the the the private key is hard code via configuration environment variable WEB3J_PRIVATE_KEY, but in my case, I need each transaction need to sign by different user's private key or wallet before send the transaction to chain. is it a easier way for web3j-openAPI to implement this, please advise.

AlexandrouR commented 3 years ago

@bao1018 Hey I think there should be a way to configure that through code I will have a look. There are ways to pass these as a config file which can take the form of YAML or JSON. You might be able to work with that have a look here.

stale[bot] commented 3 years ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.