Commit Graph

82 Commits

Author SHA1 Message Date
Shane da Silva
23d7a66675 chore: Support pure ESM output (#994)
* Fix import mapping to work with built JS files

This allows us to ship a Docker image that runs using `node` directly,
rather than via `tsx`.

* Remove use of top-level `await` expressions

These were only used in tests and weren't critical. Switch away so we
have the optional to convert to CommonJS if we need.

* Switch all imports to use relative paths instead of ~ shortcut

The ~ shortcut doesn't work in some contexts, which makes our lives more
difficult when trying to output ESM.

Since we were already using relative paths in some part of the codebase
and not others, just switch to using relative paths everywhere for
simplicity.

* Switch imports to append .js extension

And update Jest configuration to work with this extension.

* Build single image instead of two separate ones

We originally created the other image so that we could build an image
using only packages published to NPM, but this proved problematic when
wanting to test those changes without publishing.

Since there are more situations where we'd want to ship an image using
unpublished packages (i.e. for testing) remove the "public" image and
update our "testing" image to also be used as the public image. However,
a key difference is that the testing image will now run compiled JS
instead of using a TypeScript interpreter.
2023-05-24 20:02:38 -07:00
Shane da Silva
ea55abcb83 Add separate Dockerfile for dedicated public image (#962)
We want to make it easier for developers to get started with hubs.

Add a separate optimized Docker image which we'll distribute for both
AMD and ARM architectures.

For now the publishing process is manual, but once hubs are fully open
(no peering allowlists) we'll be able to auto-publish with each hubble
release on NPM.
2023-05-11 20:31:45 -07:00
Shane da Silva
fe755fbdb3 Switch to rocksdb fork with precompiled Linux ARM build (#960)
With more Macs running ARM via Apple Silicon, the significantly slow
package installation was problematic. Fix by using our fork which
includes the prebuilt binary to reduce install time.
2023-05-11 10:04:49 -07:00
Anthony D'Addeo
2ca66b179c chore: upgrade to @noble/curves (#947)
* chore: update @farcaster/core to use @noble/curves

* chore: update hubble to use @noble/curves

* add changeset

	new file:   .changeset/eleven-lies-wait.md

* preserve async interface

* update changeset
2023-05-10 12:26:07 -05:00
Michael Huang
6a8486017e feat: implement ViemLocalEip712Signer (#787)
* Implement viemEip712Signer

* Add tests

* clean

* Stubs

* Deps

* Fixes

* Clean

* Fix bugs

* Rename

* Add changeset

* rename

* clean up

* rename

* update import

* Upgrade

* Update test

* ViemEip712Signer -> ViemLocalEip712Signer

* clean up

* Convert hash bytes to hex string before signing

* use random wallet

* Add test for mnemonic account

* Simplify

* Use random mnemonic phrase

* More clean up

* Add comment

* refactor EIP-712 signer tests into util

* update changeset to patch core

---------

Co-authored-by: Tony D'Addeo <tony@merklemanufactory.com>
Co-authored-by: Paul Fletcher-Hill <pfletcherhill@gmail.com>
2023-04-27 12:40:35 -04:00
Paul Fletcher-Hill
1c6838ac7b upgrade turbo and add protoc command (#853) 2023-04-10 18:56:04 -04:00
PangZhi
c4529a7ef2 feat: merge protobufs and utils into core package (#818)
* remove protobufs as a package, merge into utils

* update yarn.lock

* rename utils package to core

* update docker

* add changeset

* tsup config

* change schema path in workflow file

* update protobufs readme link
2023-04-04 19:21:30 -07:00
PangZhi
1f47906693 feat: refactor protobufs and utils to remove grpc-js dependency (#798)
* remove grpc-js dependency from protobufs, refactor hubble to use hub-nodejs

* hub-web to use @farcaster/protobufs and utils

* add yarn.lock

* refactor hubble app to only use hub-nodejs

* update readme

* update export order

* update export order

* fix protobufs namespace build issue

* update codecov

* fix protobufCommand naming

---------

Co-authored-by: Paul Fletcher-Hill <pfletcherhill@gmail.com>
2023-04-04 09:27:53 -07:00
Paul Fletcher-Hill
7c9ca5aac0 add farcaster version and check version job (#795) 2023-04-03 17:56:21 -04:00
Varun Srinivasan
5c7840518e fix(hubble): crash by bumping ethers to 6.2.1 (#744)
* fix: crash by bumping ethers to 6.2.1

* chore: add changeset
2023-03-23 19:19:51 -07:00
adityapk00
0f6737bfc6 feat: IP based rate limiting for submitMessage RPC (#722) 2023-03-22 14:53:39 -07:00
Anthony D'Addeo
91b788d78f feat: add EthersV5Eip712Signer (#720) 2023-03-22 16:17:24 -05:00
Vincent Liao
f875c1ed65 chore: turn prettier into its own package (#653)
* chore: separate out prettier from eslint into its own package

* fix: duplicate package name in package.json
2023-03-19 12:47:15 -07:00
Varun Srinivasan
59920f9716 refactor: update ethers to v6.1 from v5.7 (#670) 2023-03-18 17:38:17 -07:00
Varun Srinivasan
1e4482e6ba chore: upgrade minor and patch versions of packages (#678)
* chore: update all devDependencies to the latest versions

* chore: update @noble/hashes to 1.3.0

* chore: update @swc/core to 1.3.41

* chore: update @noble/ed25519 by a patch version

* chore: update ts-proto and eslint/parser dev deps

* chore: upgrade pino minor version

* chore: upgrade tsx minor version

* chore: add changeset
2023-03-18 17:26:45 -07:00
Varun Srinivasan
2e0d95f33a chore: upgrade minor and patch versions of monorepo dependencies (#659) 2023-03-16 13:18:35 -07:00
Varun Srinivasan
3a1ead3039 chore: upgrade typescript to v5 from v5beta (#656) 2023-03-16 10:48:06 -07:00
Varun Srinivasan
7588fffdd5 docs: remove typedoc and outdated docs (#639) 2023-03-13 05:19:11 -07:00
Paul Fletcher-Hill
6f1c5a92fb use ts-proto removeEnumPrefix flag (#628) 2023-03-07 21:27:34 -05:00
Vincent Liao
7af59f9fd4 docs: @farcaster/js (#590)
* fix: relative path on hubble docs not resolving to contributing.md

* add: initial table structure of the docs

* remove: link on first column

* add: docs/Ed25519Signer.md

* fix: wrong links in Ed25519Signer.md

* fix: wrong link again

* add: constructor to ed25519signer.md

* add docs/Eip712Signer.md

* update: replace ambiguous description with TODO

* update: code example on readme

* add: a comment about neverthrow

* add: js docs to interact with hub

* update: wrong import on docs

* remove: make Data and Amp functions

* update: clarify the eddsa private key part

* update: move signer docs to readme

* update: readme table

* fix: wrong path

* add: docs for eip signer but in js

* remove: ambiguous descriptions

* add: doc generation with TypeDoc

* add: docs for ed25519 signer

* update: build first before running docs

* update: only use packages/js for typedoc entrypoint

* remove: function name in tsdoc comments

* update: move examples up for clarity

* add: typedoc.json

* add: description for properties of signers

* update: link to classes in readme

* update: move make message explanation above

* remove: ambiguous description in readme

* add: a line in contributing.md about generating docs for packages/*

* remove: old docs

* update: recompiled docs and add plugin on typedoc.json

* add: description to sign verification

Co-authored-by: Anthony D'Addeo <tony@tavour.com>

* update: use yarn instead of npm

Co-authored-by: Anthony D'Addeo <tony@tavour.com>

* update: disable typedoc source

* update: contributing.md packages/* to packages/js

* update: TODO to TODO DOCS

* fix: eip712 signer not rendering properly

* add: docs to message builders

* add: docs to client

---------

Co-authored-by: Anthony D'Addeo <tony@tavour.com>
2023-02-23 21:15:07 -08:00
dependabot[bot]
1711d842ab chore(deps): bump undici from 5.18.0 to 5.19.1 (#579)
Bumps [undici](https://github.com/nodejs/undici) from 5.18.0 to 5.19.1.
- [Release notes](https://github.com/nodejs/undici/releases)
- [Commits](https://github.com/nodejs/undici/compare/v5.18.0...v5.19.1)

---
updated-dependencies:
- dependency-name: undici
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-02-17 14:09:03 -08:00
Paul Fletcher-Hill
2117ac7fc1 chore: replace SequentialMergeStore with locks (#571)
* intermediate commit

* remove SequentialMergeStore in favor of async-lock
2023-02-14 17:29:26 -08:00
Varun Srinivasan
7483d8ca8e chore: upgrade libp2p to 0.42.2 (#534)
* chore: upgrade libp2p to 0.42.2

* chore: add common terms to cSpell
2023-02-07 16:51:16 -08:00
Varun Srinivasan
0311379208 chore: make version pinning stricter (#532)
* chore: strictly pin all versions of libp2p packages

* chore: pin versions with ~ instead of ^ wherever possible
2023-02-06 11:43:43 -08:00
adityapk00
a93c6b70ee feat: Persist Merkle Trie to DB (#531)
* feat: Persist Merkle Trie to DB

* Save hash and items to DB

* fix benchmark
2023-02-06 08:08:19 -08:00
Varun Srinivasan
d6634cfdd3 chore: upgrade to typescript v5 beta (#527) 2023-02-04 10:45:10 -08:00
Varun Srinivasan
26649cd3de chore: upgrade commander to 10 (#516) 2023-02-03 16:25:19 -08:00
Paul Fletcher-Hill
d21a8f2e55 chore: remove unused packages and investigate async job memory leak (#515)
* investigate async job memory leak

* add changeset
2023-02-03 17:55:54 -05:00
Varun Srinivasan
afd5a2946a chore: upgrade packages [feb 2023] (#514)
* chore: upgrade tsx, typescript

* chore: upgrade jest minor version

* chore: upgrade @swc minor

* chore: upgrade eslint, prettier minor

* chore: upgrade minor packages husky tsx

* chore: upgrade minor package undici

* chore: upgrade noble/hashes minor

* chore: upgrade ts-proto minor

* chore: upgrade grpc-js patch

* chore: upgrade rimraf major

* chore: upgrade turbo again

* chore: update node-cron types patch, move to dev deps
2023-02-03 12:22:22 -08:00
Shane da Silva
0ea683980e fix: Pin Turbo to 1.7.0 to fix Docker builds (#506)
Our previous attempts to fix the build in 50cfacd5 and 1c932091 didn't
work because we had a locally cached layer which lead to an older
version of Turbo being used, which didn't suffer from this bug.

The workaround (for now) is to pin to 1.7.0 explicitly when installing
`turbo` in the Docker build step (which previously wasn't using the
version listed in `package.json`).
2023-02-02 14:49:09 -08:00
Shane da Silva
1c93209182 fix: Update Turbo 1.6.3 → 1.7.3.canary.1 to fix Docker builds (#505)
We need this update to fix an issue with our builds that occurs on
GitHub Actions only (cannot repro locally).

Based on [this
issue](https://github.com/vercel/turbo/issues/3570#issuecomment-1413350084),
this should be fixed in 1.7.3, but since that release is not available,
we'll use the canary for now.
2023-02-02 13:51:45 -08:00
Chu Ka-cheong
b78df238cd feat: add benchmark suite for MerkleTrie (#470) 2023-02-03 00:13:58 +08:00
Paul Fletcher-Hill
9558382d60 chore: remove unused dependencies from packages (#496)
* delete unused dependencies

* add changeset
2023-02-01 12:16:55 -05:00
Paul Fletcher-Hill
6be998397d chore: port subscribe gRPC method and event streaming to protobufs (#492)
* support event streaming

* remove commented out code
2023-01-31 22:50:29 -05:00
Paul Fletcher-Hill
58738a4409 nuke flatbuffers code (#479) 2023-01-30 14:45:08 -05:00
adityapk00
1f7d8d7849 feat: Stub all RPC methods (#457) 2023-01-26 07:07:58 -08:00
Paul Fletcher-Hill
cd84f7c333 feat: add protobufs schema and migrate utils to new @farcaster/protoutils package (#447)
* add protobufs and benchmark app

* update script to run for set amount of time

* update script

* intermediate commit

* intermediate commit

* finish @farcaster/protoutils

* add changeset

* remove utils changelog

* intermediate commit

* tests passing
2023-01-23 23:08:57 -05:00
Paul Fletcher-Hill
3b68731981 chore: introduce changesets for package versioning and publishing (#433)
* changeset initial commit

* update root package.json

* use changelog-git package for changesets
2023-01-17 00:11:56 -05:00
Paul Fletcher-Hill
e2cb509e33 chore: bump package versions (#413)
* v0.1.2

* v0.1.2

* v0.1.2

* v0.1.3

* bump versions for @farcaster/hub
2023-01-11 13:53:56 -05:00
Paul Fletcher-Hill
d3583ba7d5 chore: rename packages and move app to apps/hub (#399)
* add js package readme

* change name to @farcaster/js

* intermediate commit

* update package names and build scripts

* delete renamed files

* revert eslint package upgrades and remove changelog

* move root dependencies to devDependencies

* v0.1.1

* v0.1.1

* v0.1.1

* v0.1.2

* build with tsup

* regenerate yarn.lock

* remove unused package-lock.json file

* reset yarn.lock
2023-01-09 22:51:54 -05:00
Paul Fletcher-Hill
7a3757db54 refactor: move shared code into @hub/utils (#389)
* consolidate packages into utils

* refactor to use @hub/utils

* add more tsHash constraints and tests

* fix package dependencies

* set signerKeyHex with fixed sizes
2023-01-05 23:54:29 -05:00
Paul Fletcher-Hill
712d2f0cae feat: move grpc definitions and client to packages (#384)
* move grpc definitions and client to packages

* split syncService in two based on dependencies

* refactor sync client methods to use makeUnaryRequest

* Remove @hub/grpc test script

* support sizing hex string in bytesToHexString
2023-01-05 13:21:31 -05:00
Paul Fletcher-Hill
b641f59a42 refactor: move bytes and errors to packages (#381)
* refactor: move bytes and errors to packages

* remove shard strategy

* try fixing ci again
2023-01-04 12:54:44 -05:00
Varun Srinivasan
a198dda18e refactor: monorepo (#340)
* feat: configure turborepo to run tasks

* refactor: set up app/ workspace

* fix: move tsconfig up and inherit

* fix: update turborepo

* refactor: extract flatbuffers to package

* fix: ci by using symlink instead of yalc

* refactor: extract eslint config

* ci: add manypkg to catch package issues

* security: remove manypkg due to yarn audit fail

* fix: misc changes

* refactor: move config into hub

* fix: export as module

* remove: manypkg postinstall
2022-12-31 17:12:50 -08:00
Paul Fletcher-Hill
6b9be8084d feat: add RevokeSignerJob class and queue signer revocation from hub (#331)
* feat: add RevokeSignerJob class and queue signer revocation from hub

* remove commented out line in test

* split job queue and scheduler into separate classes

* revert ethEventsProvider little endian change

* cleanup revokeSignerJob test

* ignore generated flatbuffer files with jest
2022-12-29 09:52:03 -05:00
Anthony D'Addeo
5d99da1dc4 perf: use swc to transform TS in jest (#330)
Speed up est execution
2022-12-27 14:47:21 -08:00
Varun Srinivasan
91365693de chore: upgrade minor + patch versions of libp2p (#328)
* chore: upgrade minor versions

* chore: upgrade minor versions
2022-12-27 07:48:50 -08:00
leonard
4f1cdb07dc refactor: automatically reorder imports using prettier-plugin-organize-imports (#316)
* feat: add prettier-plugin-organize-imports

* refactor: reorder imports
2022-12-21 12:32:57 -08:00
Varun Srinivasan
f7319d7f3f chore: upgrade packages (dec 16, 2022) (#293)
* upgrade: typescript to 4.9

* upgrade: minor versions for tsx, prettier, jest, lint-staged, eslint, pino

* upgrade: minor versions for flatbuffers, undici

* upgrade: patch versions for husky, node and jest types

* upgrade: major version of neverthrow

* upgrade: grpc minor version
2022-12-16 23:00:06 -08:00
Paul Fletcher-Hill
869a2bd670 feat: upgrade flatbuffers to latest version (#263)
* feat: upgrade to latest flatbuffers version

* undo unused jest.config change
2022-12-05 14:05:18 -05:00