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

Replaced mdanter/ecc package with paragonie/ecc, and got rid of secp256k1-php extension #29

Open
wants to merge 4 commits 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
21 changes: 1 addition & 20 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,25 +19,6 @@ jobs:
uses: shivammathur/setup-php@v2
with:
php-version: '7.4'
ini-values: extension=secp256k1.so

- name: Clone libsecp256k1 repository
uses: GuillaumeFalourd/clone-github-repo-action@v2
with:
owner: 'bitcoin-core'
repository: 'secp256k1'

- name: Configure secp256k1
run: cd secp256k1 && ./autogen.sh && ./configure --enable-experimental --enable-module-{ecdh,recovery} && make && sudo make install && cd ..

- name: Clone secp256k1-php repository
uses: GuillaumeFalourd/clone-github-repo-action@v2
with:
owner: 'Bit-Wasp'
repository: 'secp256k1-php'

- name: Install secp256k1-php
run: cd secp256k1-php/secp256k1 && phpize && ./configure --with-secp256k1 && make && sudo make install && cd ..

- uses: actions/checkout@v3

Expand All @@ -47,4 +28,4 @@ jobs:
- name: Run test suite
run: composer run-script test
env:
CASPER_PHP_SDK_TEST_NODE_URL: "88.99.100.42:7777"
CASPER_PHP_SDK_TEST_NODE_URL: "95.216.240.135:7777"
23 changes: 0 additions & 23 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,29 +6,6 @@ The PHP SDK allows developers to interact with the Casper Network using PHP. Thi
composer require make-software/casper-php-sdk
```

### IMPORTANT
For using `Secp256K1` keys you need to install and enable [secp256k1-php](https://github.com/Bit-Wasp/secp256k1-php) extension:
```bash
git clone git@github.com:bitcoin-core/secp256k1 && \
cd secp256k1 && \
./autogen.sh && \
./configure --enable-experimental --enable-module-{ecdh,recovery} && \
make && sudo make install && \
cd ../
```
```bash
git clone git@github.com:Bit-Wasp/secp256k1-php && \
cd secp256k1-php/secp256k1 && \
phpize && \
./configure --with-secp256k1 && \
make && sudo make install && \
cd ../../
```
Enable extension by adding the following line to your `php.ini` file
```
extension=secp256k1.so
```

## Usage
### Creating RpcClient
Create `RpcClient` by passing node url and headers (optional) to constructor
Expand Down
4 changes: 2 additions & 2 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@
"ext-sodium": "*",
"ext-gmp": "*",
"ext-mbstring": "*",
"mdanter/ecc": "^1.0",
"ionux/phactor": "1.0.8"
"ionux/phactor": "1.0.8",
"paragonie/ecc": "^2.3"
},
"autoload": {
"psr-4": {
Expand Down
210 changes: 179 additions & 31 deletions composer.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion src/Util/Crypto/AsymmetricKey.php
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ abstract public function exportPublicKeyInPem(): string;
abstract public function exportPrivateKeyInPem(): string;

/**
* Sign the message and retrun hex-encoded signature
* Sign the message and return hex-encoded signature
*
* @param string $message
* @return string
Expand Down
Loading
Loading