web3p/web3.php

Create Wallet

robinkbr opened this issue · 2 comments

Do you know how to make a wallet in php?

`protected $web3;

public function __construct()
{
    //与合约交互需要设置超时
    $this->web3 = new Web3(new HttpProvider(new HttpRequestManager('http://127.0.0.1:8545', 30)));
}

public function createAccount()
{
$this->web3->personal->newAccount('your_password', function ($err, $account) {
if ($err !== null) {
// do something
return;
}
echo $account;
});
}
`

`protected $web3;

public function __construct()
{
    //与合约交互需要设置超时
    $this->web3 = new Web3(new HttpProvider(new HttpRequestManager('http://127.0.0.1:8545', 30)));
}

public function createAccount() { $this->web3->personal->newAccount('your_password', function ($err, $account) { if ($err !== null) { // do something return; } echo $account; }); } `

Whats is HttpRequestManager?