-
Notifications
You must be signed in to change notification settings - Fork 12
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
Add objects basic operations script and update publishContentVersion method #292
Conversation
Noting the PublishContentVersion change addresses #287 |
src/client/ContentManagement.js
Outdated
if(awaitCommitConfirmation) { | ||
this.Log(`Awaiting commit confirmation for ${objectHash}`); | ||
const pollingInterval = this.ethClient.Provider().pollingInterval || 500; | ||
const startTime = Date.now(); | ||
const duration = 2 * 60 * 1000; // 2 minutes |
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.
We shouldn't use a global timeout here because object publishing times are proportional to the size of the change (a 6 hour high-res VOD object might take 10 min to publish).
I suggest we remove this timeout at this version and we could add a timeout parameter in the future if needed
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.
sure @elv-serban will make the changes.
src/client/ContentManagement.js
Outdated
@@ -1050,6 +1052,7 @@ exports.PublishContentVersion = async function({objectId, versionHash, awaitComm | |||
} | |||
} | |||
|
|||
|
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.
There is an extra empty line here
src/client/ContentManagement.js
Outdated
@@ -1006,7 +1006,8 @@ exports.PublishContentVersion = async function({objectId, versionHash, awaitComm | |||
}); | |||
|
|||
const abi = await this.ContractAbi({id: objectId}); | |||
const fromBlock = commit.blockNumber + 1; | |||
const fromBlock = commit.blockNumber - 10; // due to block re-org |
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.
We would like to make this 30
to cover the worst case observed (25 sec and 20 blocks).
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.
made the changes
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.
Looks good!
PublishContentVersion
to:VersionConfirm
events and theobject hash
starting from last 10 blocks.