Create Wallet
robinkbr opened this issue · 2 comments
robinkbr commented
Do you know how to make a wallet in php?
Aangelojo commented
`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;
});
}
`
victorratts13 commented
`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
?