Create Transaction doesnt work
Closed this issue · 1 comments
Describe the bug
Other than the documentation PHP CRYPTO there is nothing really showing how this works. The JS has a bit more info but documentation is really poor.
I want to create transaction so i do this
To Reproduce
$transaction = ArkEcosystem\Crypto\Builder\Transfer::new()
->recipient('TARGET_ADDRESS')
->amount($amt * 10 ** 8)
->vendorField('This is a transaction from PHP')
->sign('MY_PASSWORD');
if ($transaction->verify()) {
$connection = new ArkEcosystem\Client\Connection([
'host' => 'http://127.0.0.1:4100/peer', // now its PEER instead of API
'version' => 2
]);
}
return $connection->transactions()->create([$transaction]);
Expected behavior
Creates new transaction on the blockchain.
Server (please complete the following information):
- OS: Ubuntu
- Version 16.04
Additional context
- Is this SDK going to be updated?
- Is proper documentation going to be added?
This creates chaos because of the 1000 different plugins used and definitely doesn't create transaction. From JS GIT i see it needs more headers, ok not a problem. But it also needs body json of transactions array which with the current structure seems difficult complicated.
Doesn't have anything to do with bad documentation, this client just is for the public API, not the P2P API. If you want to work with the P2P API just send a post request with the required headers using Guzzle or whatever http client you prefer.
If you would check the code you would see that there is no mention anywhere of the P2P API and it will not be supported as we are moving forward as Core 2.0 will have a public API endpoint to post transactions.