Skip to content
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

chore(relay-angular-chat): bump to @waku/core 0.0.10 & other @waku/* packages #206

Closed
wants to merge 2 commits into from

Conversation

danisharora099
Copy link
Contributor

@danisharora099 danisharora099 commented Feb 1, 2023

Blocking

While I have bumped up and fixed @waku/* packages and API, and upgraded other npm packages -- there are errors seen within chainsafe and libp2p deps.
Not sure if this is Angular specific.

cc @weboko @fryorcraken any ideas here?

Error: node_modules/@chainsafe/libp2p-gossipsub/dist/src/index.d.ts:230:5 - error TS2416: Property 'getPeers' in type 'GossipSub' is not assignable to the same property in base type 'PubSub<GossipsubEvents>'.
  Type '() => import("/Users/danisharora099/Developer/status/examples/examples/relay-angular-chat/node_modules/@libp2p/interface-peer-id/dist/src/index").PeerId[]' is not assignable to type '() => import("/Users/danisharora099/Developer/status/examples/examples/relay-angular-chat/node_modules/@libp2p/interface-peer-info/node_modules/@libp2p/interface-peer-id/dist/src/index").PeerId[]'.
    Type 'import("/Users/danisharora099/Developer/status/examples/examples/relay-angular-chat/node_modules/@libp2p/interface-peer-id/dist/src/index").PeerId[]' is not assignable to type 'import("/Users/danisharora099/Developer/status/examples/examples/relay-angular-chat/node_modules/@libp2p/interface-peer-info/node_modules/@libp2p/interface-peer-id/dist/src/index").PeerId[]'.
      Type 'import("/Users/danisharora099/Developer/status/examples/examples/relay-angular-chat/node_modules/@libp2p/interface-peer-id/dist/src/index").PeerId' is not assignable to type 'import("/Users/danisharora099/Developer/status/examples/examples/relay-angular-chat/node_modules/@libp2p/interface-peer-info/node_modules/@libp2p/interface-peer-id/dist/src/index").PeerId'.
        Type 'RSAPeerId' is not assignable to type 'PeerId'.
          Type 'import("/Users/danisharora099/Developer/status/examples/examples/relay-angular-chat/node_modules/@libp2p/interface-peer-id/dist/src/index").RSAPeerId' is not assignable to type 'import("/Users/danisharora099/Developer/status/examples/examples/relay-angular-chat/node_modules/@libp2p/interface-peer-info/node_modules/@libp2p/interface-peer-id/dist/src/index").RSAPeerId'.
            The types returned by 'toCID().toV0().toJSON()' are incompatible between these types.
              Property ''/'' is missing in type '{ code: 112; version: 0; hash: Uint8Array; }' but required in type '{ '/': ToString<CID<unknown, 112, 18, 0>, string>; }'.

230     getPeers(): PeerId[];
        ~~~~~~~~

  node_modules/@libp2p/interface-peer-info/node_modules/multiformats/dist/types/src/cid.d.ts:191:9
    191         '/': API.ToString<CID<Data, Format, Alg, Version>, string>;
                ~~~
    ''/'' is declared here.


Error: node_modules/@chainsafe/libp2p-gossipsub/dist/src/index.d.ts:273:5 - error TS2416: Property 'getSubscribers' in type 'GossipSub' is not assignable to the same property in base type 'PubSub<GossipsubEvents>'.
  Type '(topic: string) => import("/Users/danisharora099/Developer/status/examples/examples/relay-angular-chat/node_modules/@libp2p/interface-peer-id/dist/src/index").PeerId[]' is not assignable to type '(topic: string) => import("/Users/danisharora099/Developer/status/examples/examples/relay-angular-chat/node_modules/@libp2p/interface-peer-info/node_modules/@libp2p/interface-peer-id/dist/src/index").PeerId[]'.
    Type 'import("/Users/danisharora099/Developer/status/examples/examples/relay-angular-chat/node_modules/@libp2p/interface-peer-id/dist/src/index").PeerId[]' is not assignable to type 'import("/Users/danisharora099/Developer/status/examples/examples/relay-angular-chat/node_modules/@libp2p/interface-peer-info/node_modules/@libp2p/interface-peer-id/dist/src/index").PeerId[]'.

273     getSubscribers(topic: TopicStr): PeerId[];
        ~~~~~~~~~~~~~~


Error: node_modules/@waku/create/dist/index.d.ts:9:46 - error TS2694: Namespace '"/Users/danisharora099/Developer/status/examples/examples/relay-angular-chat/node_modules/@waku/core/dist/lib/relay/index"' has no exported member 'CreateOptions'.

9 declare type RelayCreateOptions = waku_relay.CreateOptions;
                                               ~~~~~~~~~~~~~


Error: node_modules/libp2p/dist/src/connection-manager/index.d.ts:171:5 - error TS2416: Property 'getConnections' in type 'DefaultConnectionManager' is not assignable to the same property in base type 'ConnectionManager'.
  Type '(peerId?: import("/Users/danisharora099/Developer/status/examples/examples/relay-angular-chat/node_modules/@libp2p/interface-peer-id/dist/src/index").PeerId | undefined) => import("/Users/danisharora099/Developer/status/examples/examples/relay-angular-chat/node_modules/@libp2p/interface-connection/dist/src/index").C...' is not assignable to type '(peerId?: import("/Users/danisharora099/Developer/status/examples/examples/relay-angular-chat/node_modules/@libp2p/interface-peer-info/node_modules/@libp2p/interface-peer-id/dist/src/index").PeerId | undefined) => import("/Users/danisharora099/Developer/status/examples/examples/relay-angular-chat/node_modules/@libp2...'.
    Types of parameters 'peerId' and 'peerId' are incompatible.
      Type 'import("/Users/danisharora099/Developer/status/examples/examples/relay-angular-chat/node_modules/@libp2p/interface-peer-info/node_modules/@libp2p/interface-peer-id/dist/src/index").PeerId | undefined' is not assignable to type 'import("/Users/danisharora099/Developer/status/examples/examples/relay-angular-chat/node_modules/@libp2p/interface-peer-id/dist/src/index").PeerId | undefined'.
        Type 'RSAPeerId' is not assignable to type 'PeerId | undefined'.
          Type 'RSAPeerId' is not assignable to type 'Secp256k1PeerId'.
            Types of property 'type' are incompatible.
              Type '"RSA"' is not assignable to type '"secp256k1"'.

171     getConnections(peerId?: PeerId): Connection[];
        ~~~~~~~~~~~~~~


Error: node_modules/libp2p/dist/src/connection-manager/index.d.ts:172:5 - error TS2416: Property 'openConnection' in type 'DefaultConnectionManager' is not assignable to the same property in base type 'ConnectionManager'.
  Type '(peerId: PeerId, options?: AbortOptions | undefined) => Promise<Connection>' is not assignable to type '(peer: PeerId | Multiaddr, options?: AbortOptions | undefined) => Promise<Connection>'.
    Types of parameters 'peerId' and 'peer' are incompatible.
      Type 'PeerId | Multiaddr' is not assignable to type 'PeerId'.
        Type 'RSAPeerId' is not assignable to type 'PeerId'.
          Type 'import("/Users/danisharora099/Developer/status/examples/examples/relay-angular-chat/node_modules/@libp2p/interface-peer-info/node_modules/@libp2p/interface-peer-id/dist/src/index").RSAPeerId' is not assignable to type 'import("/Users/danisharora099/Developer/status/examples/examples/relay-angular-chat/node_modules/@libp2p/interface-peer-id/dist/src/index").RSAPeerId'.
            The types returned by 'toCID().toV0().toJSON()' are incompatible between these types.
              Type '{ '/': ToString<CID<unknown, 112, 18, 0>, string>; }' is missing the following properties from type '{ code: 112; version: 0; hash: Uint8Array; }': code, version, hash

172     openConnection(peerId: PeerId, options?: AbortOptions): Promise<Connection>;
        ~~~~~~~~~~~~~~


Error: node_modules/libp2p/dist/src/connection-manager/index.d.ts:173:5 - error TS2416: Property 'closeConnections' in type 'DefaultConnectionManager' is not assignable to the same property in base type 'ConnectionManager'.
  Type '(peerId: PeerId) => Promise<void>' is not assignable to type '(peer: PeerId) => Promise<void>'.
    Types of parameters 'peerId' and 'peer' are incompatible.
      Type 'import("/Users/danisharora099/Developer/status/examples/examples/relay-angular-chat/node_modules/@libp2p/interface-peer-info/node_modules/@libp2p/interface-peer-id/dist/src/index").PeerId' is not assignable to type 'import("/Users/danisharora099/Developer/status/examples/examples/relay-angular-chat/node_modules/@libp2p/interface-peer-id/dist/src/index").PeerId'.
        Type 'RSAPeerId' is not assignable to type 'PeerId'.

173     closeConnections(peerId: PeerId): Promise<void>;
        ~~~~~~~~~~~~~~~~




** Angular Live Development Server is listening on localhost:4200, open your browser on http://localhost:4200/ **


✖ Failed to compile.

@danisharora099 danisharora099 changed the title bump to @waku/core 0.0.10 bump to @waku/core 0.0.10 & other @waku/* packages Feb 1, 2023
@danisharora099 danisharora099 added the help wanted Extra attention is needed label Feb 1, 2023
@danisharora099 danisharora099 changed the title bump to @waku/core 0.0.10 & other @waku/* packages chore(relay-angular-chat): bump to @waku/core 0.0.10 & other @waku/* packages Feb 1, 2023
@fryorcraken
Copy link
Collaborator

The first error is most likely due to a breaking change in a libp2p interface and the fact that libp2p-gossipsub and waku uses two different version of said interface.

Easiest is to bump all js-waku deps (working on that).

or you can find what interface has a breaking change (looks like interface-peer-id) and pin down the version.

@fryorcraken
Copy link
Collaborator

this happens quite often with libp2p packages in general, in particular libp2p-gossipsub.

This reason alone is enough to extract Waku Relay from @waku/core. Especially that we would recommend developer to use light push/store/filter first and consider relay only for privacy concerns (being aware of the scalability limitations).

@fryorcraken
Copy link
Collaborator

this happens quite often with libp2p packages in general, in particular libp2p-gossipsub.

This reason alone is enough to extract Waku Relay from @waku/core. Especially that we would recommend developer to use light push/store/filter first and consider relay only for privacy concerns (being aware of the scalability limitations).

waku-org/js-waku#1151

@danisharora099
Copy link
Contributor Author

nice!

@fryorcraken
Copy link
Collaborator

This now should be fixed on master thanks to waku-org/js-waku#1160

with waku-org/js-waku#1155 in place, a release should appear soon

@danisharora099 danisharora099 deleted the chore/bump-relay-angulat-chat branch April 3, 2023 04:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
help wanted Extra attention is needed
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants