commit
b9cf0edc27
@ -4,6 +4,7 @@ language: php
|
|||||||
|
|
||||||
php:
|
php:
|
||||||
- 7.1
|
- 7.1
|
||||||
|
- 7.2
|
||||||
|
|
||||||
before_install:
|
before_install:
|
||||||
- nvm install 8
|
- nvm install 8
|
||||||
|
36
README.md
36
README.md
@ -208,6 +208,42 @@ 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.
|
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
|
||||||
|
|
||||||
|
### Local php cli installed
|
||||||
|
|
||||||
|
1. Clone the repo and install packages.
|
||||||
|
```
|
||||||
|
git clone https://github.com/sc0Vu/web3.php.git && cd web3.php && composer install
|
||||||
|
```
|
||||||
|
|
||||||
|
2. Run test script.
|
||||||
|
```
|
||||||
|
vendor/bin/phpunit
|
||||||
|
```
|
||||||
|
|
||||||
|
### Docker container
|
||||||
|
|
||||||
|
1. Clone the repo and run docker container.
|
||||||
|
```
|
||||||
|
git clone https://github.com/sc0Vu/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
|
||||||
|
```
|
||||||
|
|
||||||
|
3. Enter php container and install packages.
|
||||||
|
```
|
||||||
|
docker-compose exec php ash
|
||||||
|
```
|
||||||
|
|
||||||
|
4. Run test script
|
||||||
|
```
|
||||||
|
vendor/bin/phpunit
|
||||||
|
```
|
||||||
|
|
||||||
# API
|
# API
|
||||||
|
|
||||||
Todo.
|
Todo.
|
||||||
|
11
docker/docker-compose.yml
Normal file
11
docker/docker-compose.yml
Normal file
@ -0,0 +1,11 @@
|
|||||||
|
version: '2'
|
||||||
|
|
||||||
|
services:
|
||||||
|
|
||||||
|
php:
|
||||||
|
build:
|
||||||
|
context: ./php
|
||||||
|
dockerfile: Dockerfile-72
|
||||||
|
volumes:
|
||||||
|
- ./app:/app
|
||||||
|
tty: true
|
17
docker/php/Dockerfile-71
Normal file
17
docker/php/Dockerfile-71
Normal file
@ -0,0 +1,17 @@
|
|||||||
|
FROM php:7.1.14-alpine
|
||||||
|
|
||||||
|
MAINTAINER Peter Lai <alk03073135@gmail.com>
|
||||||
|
|
||||||
|
ADD composer-setup.php composer-setup.php
|
||||||
|
|
||||||
|
RUN apk update && \
|
||||||
|
apk add git
|
||||||
|
|
||||||
|
# Install nodejs
|
||||||
|
# Run apk add --update nodejs nodejs-npm
|
||||||
|
|
||||||
|
# Install composer
|
||||||
|
RUN php composer-setup.php && \
|
||||||
|
php composer-setup.php --install-dir=/usr/bin --filename=composer
|
||||||
|
|
||||||
|
WORKDIR /app
|
17
docker/php/Dockerfile-72
Normal file
17
docker/php/Dockerfile-72
Normal file
@ -0,0 +1,17 @@
|
|||||||
|
FROM php:7.2.2-alpine
|
||||||
|
|
||||||
|
MAINTAINER Peter Lai <alk03073135@gmail.com>
|
||||||
|
|
||||||
|
ADD composer-setup.php composer-setup.php
|
||||||
|
|
||||||
|
RUN apk update && \
|
||||||
|
apk add git
|
||||||
|
|
||||||
|
# Install nodejs
|
||||||
|
# Run apk add --update nodejs nodejs-npm
|
||||||
|
|
||||||
|
# Install composer
|
||||||
|
RUN php composer-setup.php && \
|
||||||
|
php composer-setup.php --install-dir=/usr/bin --filename=composer
|
||||||
|
|
||||||
|
WORKDIR /app
|
5
docker/php/composer-setup.php
Normal file
5
docker/php/composer-setup.php
Normal file
@ -0,0 +1,5 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
copy('https://getcomposer.org/installer', 'composer-setup.php');
|
||||||
|
|
||||||
|
if (hash_file('SHA384', 'composer-setup.php') === '544e09ee996cdf60ece3804abc52599c22b1f40f4323403c44d44fdfdd586475ca9813a858088ffbc1f233e9b180f061') { echo 'Installer verified'; } else { echo 'Installer corrupt'; unlink('composer-setup.php'); } echo PHP_EOL;
|
Loading…
Reference in New Issue
Block a user