-
Notifications
You must be signed in to change notification settings - Fork 91
fix(ethereum-storage): OldNonce error, wait for 1 confirmation when submitting hashes #1078
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
Changes from all commits
155d04e
a480de9
f1658b5
f1204e1
00dcc4d
84c73fe
4fddbd8
2decb35
71bc1f7
34f562a
1542565
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -17,6 +17,7 @@ const config = { | |
| retryDelay: 0, | ||
| safeGasPriceLimit: '500000000000', | ||
| transactionPollingTimeout: 300, | ||
| blockConfirmations: 2, | ||
| }, | ||
| ipfs: { | ||
| defaultNode: { | ||
|
|
@@ -85,6 +86,14 @@ export function getDefaultEthereumGasPrice(): BigNumber { | |
| return BigNumber.from(process?.env?.GAS_PRICE_DEFAULT || config.ethereum.gasPriceDefault); | ||
| } | ||
|
|
||
| /** | ||
| * Retrieve from config the default number of block confirmations to wait before considering a transaction successful | ||
| * @returns the number of block confirmations | ||
| */ | ||
| export function getDefaultEthereumBlockConfirmations(): number { | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. same
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Fixed. I called it as a fallback. |
||
| return config.ethereum.blockConfirmations; | ||
| } | ||
|
|
||
| /** | ||
| * Retrieve from config the time to wait between query retries | ||
| * @returns the query retry delay | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -19,6 +19,7 @@ const defaultValues: any = { | |
| networkId: 0, | ||
| web3ProviderUrl: 'http://localhost:8545', | ||
| gasPriceMin: '1000000000', // one gwei | ||
| blockConfirmations: 2, | ||
| }, | ||
| ipfs: { | ||
| host: 'localhost', | ||
|
|
@@ -119,6 +120,18 @@ export function getGasPriceMin(): BigNumber | undefined { | |
| return gasPriceMin && BigNumber.from(gasPriceMin); | ||
| } | ||
|
|
||
| /** | ||
| * Get the number of block confirmations to wait before considering a transaction successful | ||
| * @returns the number of block confirmations | ||
| */ | ||
| export function getBlockConfirmations(): number { | ||
| return ( | ||
| (argv.blockConfirmations && Number(argv.blockConfirmations)) || | ||
| (process.env.BLOCK_CONFIRMATIONS && Number(process.env.BLOCK_CONFIRMATIONS)) || | ||
| defaultValues.ethereumStorage.ethereum.blockConfirmations | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. this is never set, see at the top of this file
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Fixed. |
||
| ); | ||
| } | ||
|
|
||
| /** | ||
| * Get host from command line argument, environment variables or default values to connect to IPFS gateway | ||
| * @returns the host of the IPFS gateway | ||
|
|
||
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.
I don't think this is ever used
Uh oh!
There was an error while loading. Please reload this page.
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.
Fixed, see comment below. it's used now.