Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions packages/ceramic-cli/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -45,8 +45,8 @@
"commander": "^6.0.0",
"express": "^4.17.1",
"identity-wallet": "2.0.0-alpha.1",
"ipfs": "^0.49.0",
"ipfs-http-client": "^46.0.0"
"ipfs": "github:simonovic86/ipfs",
"ipfs-http-client": "github:simonovic86/ipfs-http-client"
Comment on lines +48 to +49
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What's going on here?

Copy link
Contributor Author

@simonovic86 simonovic86 Sep 3, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The createDagJWS method that you provided in js-did library uses, amongst other things, CID v1 and ipld-dag-cbor v0.17.0 which is not compatible with one used in the latest IPFS release. That's why I forked the js-ipfs and tested it with the latest code. Because of this incompatibility, we're currently blocked with the integration.

},
"devDependencies": {
"@babel/core": "^7.9.0",
Expand Down
9 changes: 5 additions & 4 deletions packages/ceramic-cli/src/__tests__/ceramic-daemon.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import CeramicDaemon from '../ceramic-daemon'
import { AnchorStatus, IpfsUtils } from "@ceramicnetwork/ceramic-common"
import { TileDoctypeHandler } from "@ceramicnetwork/ceramic-doctype-tile"
import { EventEmitter } from "events"
import { DoctypeUtils } from "@ceramicnetwork/ceramic-common/lib"

const seed = '0x5872d6e0ae7347b72c9216db218ebbb9d9d0ae7ab818ead3557e8e78bf944184'
const anchorUpdate = (doc: EventEmitter): Promise<void> => new Promise(resolve => doc.on('change', resolve))
Expand Down Expand Up @@ -97,13 +98,13 @@ describe('Ceramic interop: core <> http-client', () => {
await anchorUpdate(doc1)
const doc2 = await client.loadDocument(doc1.id)
expect(doc1.content).toEqual(doc2.content)
expect(doc1.state).toEqual(doc2.state)
expect(DoctypeUtils.serializeState(doc1.state)).toEqual(DoctypeUtils.serializeState(doc2.state))

const doc3 = await client.createDocument(DOCTYPE_TILE, { content: { test: 456 } })
await anchorUpdate(doc3)
const doc4 = await core.loadDocument(doc3.id)
expect(doc3.content).toEqual(doc4.content)
expect(doc3.state).toEqual(doc4.state)
expect(DoctypeUtils.serializeState(doc3.state)).toEqual(DoctypeUtils.serializeState(doc4.state))
})

it('makes and gets updates correctly', async () => {
Expand All @@ -115,13 +116,13 @@ describe('Ceramic interop: core <> http-client', () => {
await anchorUpdate(doc1)
await anchorUpdate(doc2)
expect(doc1.content).toEqual(doc2.content)
expect(doc1.state).toEqual(doc2.state)
expect(DoctypeUtils.serializeState(doc1.state)).toEqual(DoctypeUtils.serializeState(doc2.state))
// change from client viewable in core

await doc2.change({ content: {test: 456, abc: 654} })

await anchorUpdate(doc2)
expect(doc1.content).toEqual(doc2.content)
expect(doc1.state).toEqual(doc2.state)
expect(DoctypeUtils.serializeState(doc1.state)).toEqual(DoctypeUtils.serializeState(doc2.state))
})
})
3 changes: 2 additions & 1 deletion packages/ceramic-common/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,8 @@
"cids": "^1.0.0",
"dag-jose": "^0.1.1",
"did-resolver": "^2.1.1",
"ipfs": "^0.49.0",
"ipfs": "github:simonovic86/ipfs",
"ipfs-core-utils": "github:simonovic86/ipfs-core-utils",
"lodash.clonedeep": "^4.5.0",
"multiformats": "^3.0.3"
},
Expand Down
4 changes: 2 additions & 2 deletions packages/ceramic-core/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@
"did-resolver": "^2.1.1",
"dids": "^0.5.0",
"fast-json-patch": "^2.2.1",
"ipfs-http-client": "^46.0.0",
"ipfs-http-client": "github:simonovic86/ipfs-http-client",
"level-ts": "^2.0.5",
"lodash.clonedeep": "^4.5.0",
"typestub-multihashes": "^0.0.4"
Expand All @@ -64,7 +64,7 @@
"eslint": "^6.8.0",
"eslint-plugin-jest": "^23.8.2",
"identity-wallet": "2.0.0-alpha.1",
"ipfs": "^0.49.0",
"ipfs": "github:simonovic86/ipfs",
"jest": "^25.1.0",
"js-sha256": "^0.9.0",
"tmp-promise": "^2.0.2"
Expand Down
6 changes: 4 additions & 2 deletions packages/ceramic-core/src/__tests__/ceramic.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -165,11 +165,13 @@ describe('Ceramic integration', () => {
// ceramic node 2 shouldn't need to have the document open in order to forward the message
const doctype1 = await ceramic1.createDocument<ThreeIdDoctype>(DOCTYPE_3ID, { content: { test: 321 }, metadata: { owners: [owner] } })
while (doctype1.state.anchorStatus !== AnchorStatus.ANCHORED) {
// wait to propagate
await new Promise(resolve => setTimeout(resolve, 100))
await new Promise(resolve => setTimeout(resolve, 1000))
}

const doctype3 = await ceramic3.createDocument<ThreeIdDoctype>(DOCTYPE_3ID, { content: { test: 321 }, metadata: { owners: [owner] } }, { applyOnly: true })
while (doctype3.state.anchorStatus !== AnchorStatus.ANCHORED) {
await new Promise(resolve => setTimeout(resolve, 1000))
}
expect(doctype3.content).toEqual(doctype1.content)
expect(doctype3.state).toEqual(doctype1.state)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -160,7 +160,7 @@ export default class EthereumAnchorService extends AnchorService {
* @param anchorProof - Anchor proof instance
*/
async validateChainInclusion(anchorProof: AnchorProof): Promise<void> {
const decoded = decode(anchorProof.txHash.multihash);
const decoded = decode(Buffer.from(anchorProof.txHash.multihash));
const txHash = decoded.digest.toString("hex");

// determine network based on a chain ID
Expand Down
2 changes: 1 addition & 1 deletion packages/ceramic-doctype-account-link/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@
"eslint": "^6.8.0",
"eslint-plugin-jest": "^23.8.2",
"identity-wallet": "2.0.0-alpha.1",
"ipfs": "^0.49.0",
"ipfs": "github:simonovic86/ipfs",
"jest": "^25.1.0",
"js-sha256": "^0.9.0",
"tmp-promise": "^2.0.2"
Expand Down
Loading