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

Adds documentation for a smooth onboarding #784

Merged
merged 4 commits into from
Jun 19, 2020
Merged

Conversation

evertonfraga
Copy link
Contributor

@evertonfraga evertonfraga commented Jun 18, 2020

Basic docs, showing how to quickly get started.

Please let me know your wishlist for these docs, as I will grow them in the following days.

@evertonfraga evertonfraga self-assigned this Jun 18, 2020
@codecov
Copy link

codecov bot commented Jun 18, 2020

Codecov Report

Merging #784 into master will increase coverage by 0.05%.
The diff coverage is n/a.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #784      +/-   ##
==========================================
+ Coverage   90.48%   90.54%   +0.05%     
==========================================
  Files          48       50       +2     
  Lines        3162     3182      +20     
  Branches      482      482              
==========================================
+ Hits         2861     2881      +20     
  Misses        204      204              
  Partials       97       97              
Flag Coverage Δ
#account 94.11% <ø> (ø)
#block 82.87% <ø> (+0.18%) ⬆️
#blockchain 89.22% <ø> (ø)
#common 93.78% <ø> (ø)
#ethash 86.30% <ø> (+0.89%) ⬆️
#tx 94.16% <ø> (+0.13%) ⬆️
#vm 93.10% <ø> (ø)
Impacted Files Coverage Δ
packages/tx/src/index.ts 100.00% <0.00%> (ø)
packages/block/src/index.ts 100.00% <0.00%> (ø)
packages/ethash/src/util.ts 97.22% <0.00%> (+0.92%) ⬆️
packages/block/src/header-from-rpc.ts 87.50% <0.00%> (+20.83%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 094d24b...d0b2c23. Read the comment docs.

@evertonfraga
Copy link
Contributor Author

@jochem-brouwer I have added the changes you suggested.

It is ready for review.

README.md Show resolved Hide resolved
Copy link
Member

@holgerd77 holgerd77 left a comment

Choose a reason for hiding this comment

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

Thanks Everton, this looks really good for some start and will likely be super-helpful for people (including us 😄) to get on board!

Will directly merge here since uncritical, then we have less interferences with people not being on latest master state.

@holgerd77 holgerd77 merged commit d2b172c into master Jun 19, 2020
@holgerd77 holgerd77 deleted the deveopment-quickstart branch June 19, 2020 10:40
@evertonfraga
Copy link
Contributor Author

Thanks @holgerd77!

We can talk about improvements next week

@holgerd77
Copy link
Member

I know ran the instructions from this on a pretty-much newly setup repository (yesterday I deleted my local copy and just set up everything from scratch and initialized with npm install (from root) and npm build.

I now pulled in the various changes from #787 into master and wanted to update the merkle-patricia-tree dependencies. So I went back to the root folder and did npm run bootstrap and npm run build.

Command worked without direct error output. However in the VM there are now half of the packages missing, I get e.g. the following output for npm list --depth=0:

@ethereumjs/vm@4.1.3 /ethereumjs-vm/packages/vm
├── UNMET DEPENDENCY @ethereumjs/account@^3.0.0
├── UNMET DEPENDENCY @ethereumjs/block@^3.0.0
├── UNMET DEPENDENCY @ethereumjs/blockchain@^4.0.3
├── UNMET DEPENDENCY @ethereumjs/common@^1.5.1
├── UNMET DEPENDENCY @ethereumjs/tx@^2.1.2
├── UNMET DEPENDENCY async@3.2.0
├─┬ UNMET DEPENDENCY async-eventemitter@0.2.4
│ └── async@2.6.3
├── UNMET DEPENDENCY core-js-pure@3.6.5
├─┬ UNMET DEPENDENCY ethereumjs-util@7.0.2
│ ├── @types/bn.js@4.11.6
│ ├── bn.js@5.1.2
│ ├── create-hash@1.2.0
│ ├── ethjs-util@0.1.6
│ ├── keccak@3.0.0
│ ├── rlp@2.2.5
│ └── secp256k1@4.0.1
├── UNMET DEPENDENCY functional-red-black-tree@1.0.1
├─┬ UNMET DEPENDENCY merkle-patricia-tree@4.0.0
│ ├── @types/levelup@3.1.1
│ ├── ethereumjs-util@7.0.2
│ ├── level-mem@5.0.1
│ ├── level-ws@2.0.0
│ ├── readable-stream@3.6.0
│ ├── rlp@2.2.5
│ └── semaphore-async-await@1.5.1
├── UNMET DEPENDENCY rustbn.js@0.2.0
├── UNMET DEPENDENCY safe-buffer@5.2.1
├─┬ UNMET DEPENDENCY util-callbackify@1.0.0
│ └── object.getownpropertydescriptors@2.1.0
└─┬ UNMET DEPENDENCY util.promisify@1.0.1
  ├── define-properties@1.1.3
  ├── es-abstract@1.17.5
  ├── has-symbols@1.0.1
  └── object.getownpropertydescriptors@2.1.0 deduped

npm ERR! missing: async@3.2.0, required by @ethereumjs/vm@4.1.3
npm ERR! missing: async-eventemitter@0.2.4, required by @ethereumjs/vm@4.1.3
npm ERR! missing: core-js-pure@3.6.5, required by @ethereumjs/vm@4.1.3
npm ERR! missing: ethereumjs-util@7.0.2, required by @ethereumjs/vm@4.1.3
npm ERR! missing: functional-red-black-tree@1.0.1, required by @ethereumjs/vm@4.1.3
npm ERR! missing: merkle-patricia-tree@4.0.0, required by @ethereumjs/vm@4.1.3
npm ERR! missing: rustbn.js@0.2.0, required by @ethereumjs/vm@4.1.3
npm ERR! missing: safe-buffer@5.2.1, required by @ethereumjs/vm@4.1.3
npm ERR! missing: util-callbackify@1.0.0, required by @ethereumjs/vm@4.1.3
npm ERR! missing: util.promisify@1.0.1, required by @ethereumjs/vm@4.1.3
npm ERR! missing: @ethereumjs/account@^3.0.0, required by @ethereumjs/vm@4.1.3
npm ERR! missing: @ethereumjs/block@^3.0.0, required by @ethereumjs/vm@4.1.3
npm ERR! missing: @ethereumjs/blockchain@^4.0.3, required by @ethereumjs/vm@4.1.3
npm ERR! missing: @ethereumjs/common@^1.5.1, required by @ethereumjs/vm@4.1.3
npm ERR! missing: @ethereumjs/tx@^2.1.2, required by @ethereumjs/vm@4.1.3
npm ERR! missing: async@2.6.3, required by async-eventemitter@0.2.4
npm ERR! missing: @types/bn.js@4.11.6, required by ethereumjs-util@7.0.2
npm ERR! missing: rlp@2.2.5, required by ethereumjs-util@7.0.2
npm ERR! missing: @types/node@14.0.14, required by @types/bn.js@4.11.6
npm ERR! missing: safe-buffer@5.2.1, required by cipher-base@1.0.4
npm ERR! missing: safe-buffer@5.2.1, required by md5.js@1.3.5
npm ERR! missing: safe-buffer@5.2.1, required by hash-base@3.1.0
npm ERR! missing: safe-buffer@5.2.1, required by sha.js@2.4.11
npm ERR! missing: bn.js@4.11.9, required by rlp@2.2.5
npm ERR! missing: elliptic@6.5.2, required by secp256k1@4.0.1
npm ERR! missing: bn.js@4.11.9, required by elliptic@6.5.2
npm ERR! missing: @types/levelup@3.1.1, required by merkle-patricia-tree@4.0.0
npm ERR! missing: ethereumjs-util@7.0.2, required by merkle-patricia-tree@4.0.0
npm ERR! missing: level-ws@2.0.0, required by merkle-patricia-tree@4.0.0
npm ERR! missing: level-mem@5.0.1, required by merkle-patricia-tree@4.0.0
npm ERR! missing: rlp@2.2.5, required by merkle-patricia-tree@4.0.0
npm ERR! missing: semaphore-async-await@1.5.1, required by merkle-patricia-tree@4.0.0
npm ERR! missing: @types/abstract-leveldown@5.0.1, required by @types/levelup@3.1.1
npm ERR! missing: @types/node@11.15.16, required by @types/levelup@3.1.1
npm ERR! missing: xtend@4.0.2, required by level-ws@2.0.0
npm ERR! missing: memdown@5.1.0, required by level-mem@5.0.1
npm ERR! missing: abstract-leveldown@6.2.3, required by memdown@5.1.0
npm ERR! missing: functional-red-black-tree@1.0.1, required by memdown@5.1.0
npm ERR! missing: immediate@3.2.3, required by memdown@5.1.0
npm ERR! missing: safe-buffer@5.2.1, required by memdown@5.1.0
npm ERR! missing: buffer@5.6.0, required by abstract-leveldown@6.2.3
npm ERR! missing: xtend@4.0.2, required by abstract-leveldown@6.2.3
npm ERR! missing: safe-buffer@5.2.1, required by string_decoder@1.3.0
npm ERR! missing: es-abstract@1.17.5, required by object.getownpropertydescriptors@2.1.0
npm ERR! missing: es-abstract@1.17.5, required by util.promisify@1.0.1
npm ERR! missing: object-keys@1.1.1, required by es-abstract@1.17.5
npm ERR! missing: object-inspect@1.7.0, required by es-abstract@1.17.5
npm ERR! missing: string.prototype.trimleft@2.1.2, required by es-abstract@1.17.5
npm ERR! missing: string.prototype.trimright@2.1.2, required by es-abstract@1.17.5
npm ERR! missing: es-abstract@1.17.5, required by string.prototype.trimleft@2.1.2
npm ERR! missing: es-abstract@1.17.5, required by string.prototype.trimstart@1.0.1
npm ERR! missing: es-abstract@1.17.5, required by string.prototype.trimright@2.1.2
npm ERR! missing: es-abstract@1.17.5, required by string.prototype.trimend@1.0.1

I would very much assume there is something broken in the setup scripts? Or am I missing something on the application side?

@holgerd77
Copy link
Member

Update: ah, this actually breaks my whole installation, and I am a bit lost on how to get out of this again (easily) without setting everything up from scratch again?

@evertonfraga
Copy link
Contributor Author

Command worked without direct error output. However in the VM there are now half of the packages missing, I get e.g. the following output for npm list --depth=0:

➜ ls -l packages/vm/node_modules | wc -l
> 1

➜ ls -l ./node_modules | wc -l
> 948

@holgerd77 We started using lerna hoisting, that installs most of the node modules in the root folder. So the output you got is quite valid. What other side-effect did you have while using it?

You can temporarily remove --hoist from root package.json and see if things improve.

@holgerd77
Copy link
Member

I originally stumbled upon this because I couldn't run the tests any more after doing these steps, now I got there:

$ npm run build && node -r ts-node/register --stack-size=1500 ./node_modules/tape/bin/tape './tests/api/runBlock.js'

> @ethereumjs/vm@4.1.3 build /ethereumjs-vm/packages/vm
> ethereumjs-config-build

+ exec tsc -p ./tsconfig.prod.json
Error: Cannot find module '/ethereumjs-vm/packages/vm/node_modules/tape/bin/tape'

@holgerd77
Copy link
Member

Ah, ok, got it myself, this is because of the direct path referencing I guess? So we need to update these kind of things I suppose.

@ryanio
Copy link
Contributor

ryanio commented Jun 26, 2020

@evertonfraga
Copy link
Contributor Author

yes! My fault, then. I took care to update all direct path referencing in all package.json, but forgot the test documentation.

@evertonfraga
Copy link
Contributor Author

After hoisting, the ./packages/*node_modules/.bin directories are kept, so you can still run tape or any other script. So for the case you posted, you can test it with:

./node_modules/.bin/tape -r ts-node/register --stack-size=1500 ./tests/api/**/*.js

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants