Bit-Wasp / bitcoin-php

Bitcoin implementation in PHP
The Unlicense
1.05k stars 418 forks source link

Composer install problem #535

Closed minioff closed 7 years ago

minioff commented 7 years ago

Hi,

I am trying to install this lib, but there seems to be something off;

test@machine:~$ ./composer.phar require bitwasp/bitcoin
Using version ^0.0.34 for bitwasp/bitcoin
./composer.json has been created
Loading composer repositories with package information
Updating dependencies (including require-dev)
Package operations: 12 installs, 0 updates, 0 removals
  - Installing symfony/polyfill-mbstring (v1.5.0): Downloading (100%)         
  - Installing symfony/http-foundation (v3.3.9): Downloading (100%)         
  - Installing rgooding/protobuf-php (0.0.1): Downloading (100%)         
  - Installing pleonasm/merkle-tree (1.0.0): Downloading (100%)         
  - Installing paragonie/random_compat (v2.0.10): Downloading (100%)         
  - Installing fgrosse/phpasn1 (1.5.2): Downloading (100%)         
  - Installing mdanter/ecc (v0.4.2): Downloading (100%)         
  - Installing lastguest/murmurhash (1.3.0): Downloading (100%)         
  - Installing composer/semver (1.4.2): Downloading (100%)         
  - Installing bitwasp/secp256k1-php (v0.1.2): Downloading (100%)         
  - Installing bitwasp/buffertools (v0.4.1): Downloading (100%)         
  - Installing bitwasp/bitcoin (v0.0.34.0): Downloading (100%)         
paragonie/random_compat suggests installing ext-libsodium (Provides a modern crypto API that can be used to generate random bytes.)
fgrosse/phpasn1 suggests installing php-curl (For loading OID information from the web if they have not bee defined statically)
Writing lock file
Generating autoload files
test@machine:~$ cd vendor/bitwasp/bitcoin/
test@machine:~/vendor/bitwasp/bitcoin$ ls
BIPS.md  CONTRIBUTING.md  LICENCE  Makefile  build.xml  composer.json  doc  examples  release-notes.md  src  stubs  validate_examples.sh
test@machine:~/vendor/bitwasp/bitcoin$ ./validate_examples.sh 
PHP Warning:  require(/home/test/vendor/bitwasp/bitcoin/examples/../vendor/autoload.php): failed to open stream: No such file or directory in /home/test/vendor/bitwasp/bitcoin/examples/bip32.php on line 6
PHP Fatal error:  require(): Failed opening required '/home/test/vendor/bitwasp/bitcoin/examples/../vendor/autoload.php' (include_path='.:/usr/share/php') in /home/test/vendor/bitwasp/bitcoin/examples/bip32.php on line 6
Error running example code
test@machine:~/vendor/bitwasp/bitcoin$ 

Any pointers of what am I doing wrong?

Thank you.

minioff commented 7 years ago

I managed to run the some commands from the code so it works -- not sure how to run the tests though?

afk11 commented 7 years ago

The examples don't pick up that they are imported in another project, so vendor 'appears' to be missing. There's a way to get it to work for examples, but for now just clone this project separately, composer install, and it should work then

afk11 commented 7 years ago

To run the tests, vendor/bin/phpunit

minioff commented 7 years ago

Thank you!