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

Make the contribution process straightforward #342

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
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
40 changes: 4 additions & 36 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -247,52 +247,20 @@ To run examples, you need to run ethereum blockchain local (testrpc).

If you are using docker as development machain, you can try [ethdock](https://github.com/sc0vu/ethdock) to run local ethereum blockchain, just simply run `docker-compose up -d testrpc` and expose the `8545` port.

# Develop
# Development

### Local php cli installed
### Testing

1. Clone the repo and install packages.
1. Start the container(from web3.php/docker).
```
git clone https://github.com/web3p/web3.php.git && cd web3.php && composer install
docker-compose up -d php ganache
```

2. Run test script.
```
vendor/bin/phpunit
```

### Docker container

1. Clone the repo and run docker container.
```
git clone https://github.com/web3p/web3.php.git
```

2. Copy web3.php to web3.php/docker/app directory and start container.
```
cp files docker/app && docker-compose up -d php ganache
```

3. Enter php container and install packages.
```
docker-compose exec php ash
```

4. Change testHost in `TestCase.php`
```
/**
* testHost
*
* @var string
*/
protected $testHost = 'http://ganache:8545';
```

5. Run test script
```
vendor/bin/phpunit
```

###### Install packages
Enter container first
```
Expand Down
6 changes: 3 additions & 3 deletions docker/docker-compose.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
version: '2'
version: '3'

services:

Expand All @@ -7,12 +7,12 @@ services:
context: ./php
dockerfile: Dockerfile-72
volumes:
- ./app:/app
- ../:/app
tty: true

ganache:
build:
context: ./ganache
dockerfile: Dockerfile
ports:
- "8545"
- "8545:8545"
2 changes: 1 addition & 1 deletion docker/ganache/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,4 @@ RUN npm install -g ganache-cli

EXPOSE 8545

CMD ganache-cli -g 0 -l 6000000 --hostname=0.0.0.0
CMD ganache-cli -g 0 -l 6000000 --hostname=0.0.0.0