rootsoft / algorand-php Goto Github PK
View Code? Open in Web Editor NEWUnofficial community SDK to interact with the Algorand network, in PHP & Laravel
License: MIT License
Unofficial community SDK to interact with the Algorand network, in PHP & Laravel
License: MIT License
Looks like use ManagesNodesV2;
is missing in class AssetManager ?
Hi!
I run IPFS Desktop and status - connected to IPFS.
I have some work addresses:
GATEWAY: http://127.0.0.1:8080
API: /ip4/127.0.0.1/tcp/5001
ADDRESSES:
/ip4/127.0.0.1/tcp/4001/p2p/12D3KooWQLpF7fRu8VcsNpxRoHoEwcxXriSpBdopW6BVKPZqQLi1
/ip4/127.0.0.1/udp/4001/quic/p2p/12D3KooWQLpF7fRu8VcsNpxRoHoEwcxXriSpBdopW6BVKPZqQLi1
/ip4/188.164.164.240/tcp/4001/p2p/12D3KooWQLpF7fRu8VcsNpxRoHoEwcxXriSpBdopW6BVKPZqQLi1
/ip4/188.164.164.240/udp/4001/quic/p2p/12D3KooWQLpF7fRu8VcsNpxRoHoEwcxXriSpBdopW6BVKPZqQLi1
/ip4/192.168.1.30/tcp/4001/p2p/12D3KooWQLpF7fRu8VcsNpxRoHoEwcxXriSpBdopW6BVKPZqQLi1
/ip4/192.168.1.30/udp/4001/quic/p2p/12D3KooWQLpF7fRu8VcsNpxRoHoEwcxXriSpBdopW6BVKPZqQLi1
/ip6/::1/tcp/4001/p2p/12D3KooWQLpF7fRu8VcsNpxRoHoEwcxXriSpBdopW6BVKPZqQLi1
/ip6/::1/udp/4001/quic/p2p/12D3KooWQLpF7fRu8VcsNpxRoHoEwcxXriSpBdopW6BVKPZqQLi1
But in Chrome Console a completely different address (status code 500) when i try to create an item:
POST http://192.168.1.190:81/asa/transaction/fields 500 (Internal Server Error)
{message: "cURL error 6: Could not resolve host: host.docker.…/host.docker.internal:5001/api/v0/add?only-hash=1", exception: "Rootsoft\\IPFS\\Exceptions\\IPFSException", file: "/var/www/html/vendor/rootsoft/laravel-ipfs/src/Traits/MakesHttpRequests.php", line: 93, trace: Array(50)}
How should I change the address "host.docker.internal"? I tried to change to 127.0.0.1, but I get 500.
I realize this is not the best way to use Issues, but I can't find any other way to get into contact with anybody and as an Algorand community-member who is a PHP/Laravel developer looking to find a good way to create an Algorand based web-app this is incredible. If you enable funding through github I will definitely contribute on a recurring basis. I also am very open to contributing to the code someday, but as of now I'm very inexperienced with blockchain development.
Apologies if the issue is a nuisance, feel free to close it. If you'd like to reach out to me my email is public on my profile.
Thanks!
$kmdClient = new KmdClient('127.0.0.1', 'YOUR-API-KEY');
$algorand = new Algorand($algodClient, $indexerClient, $kdmClient);
Please change the spell of $kdmClient to $kmdClient in second line (the third paramter).
vendor\rootsoft\algorand-php\src\Models\Transactions\Types\AssetConfigTransaction.php
!
"message": "MessagePack\Type\Bin::__construct(): Argument #1 ($data) must be of type string, null given, called in /var/www/html/vendor/rootsoft/algorand-php/src/Models/Transactions/Types/AssetConfigTransaction.php on line 136",
Halite version 5 was released today, which contains a few security improvements and may be worth the effort to upgrade to v5.
https://github.com/paragonie/halite/releases/tag/v5.0.0
(You're receiving this issue because Packagist says you depend on Halite.)
When configuring Algorand.php with PureStake credentials for Mainnet the transactions are still done in TestNet.
When trying to hardcode the credentials in the rest of the package code, the actions on the Algorand network throw a 'Forbidden' error.
Did I miss any settings?
the destroy() method of the AssetConfigTransactionBuilder class returns an instance of the AssetConfigTransaction class, when it should return its context, so that the transaction proceeds to the rate calculation step through the build() method.
made a client like:
$algodClient = new AlgodClient(PureStake::TESTNET_ALGOD_API_URL, 'my-api-key');
$indexerClient = new IndexerClient(PureStake::TESTNET_INDEXER_API_URL, ''my-api-key');
$kmdClient = new KmdClient('127.0.0.1', ''my-api-key');
$algorand = new Algorand($algodClient, $indexerClient, $kmdClient);
making http request:
$transaction = TransactionBuilder::payment()
->sender($account->getAddress())
->note('test')
->amount(1000000) // 1 Algo
->receiver(Address::fromPublicKey("some-address"))
->useSuggestedParams($algorand)
->suggestedFeePerByte(10)
->build();
error was occurred at line ->useSuggestedParams($algorand)
the error:
Fatal error: Uncaught Rootsoft\Algorand\Exceptions\ApiKeyException: {"message":"Forbidden"} in /Users/h1-226/code/phpz/vendor/rootsoft/algorand-php/src/Traits/MakesHttpRequests.php:125
Stack trace:
#0 /Users/h1-226/code/phpz/vendor/rootsoft/algorand-php/src/Traits/MakesHttpRequests.php(106): Rootsoft\Algorand\Algorand->handleRequestError(Object(GuzzleHttp\Psr7\Response))
#1 /Users/h1-226/code/phpz/vendor/rootsoft/algorand-php/src/Traits/MakesHttpRequests.php(27): Rootsoft\Algorand\Algorand->request(Object(Rootsoft\Algorand\Clients\AlgodClient), 'GET', 'v2/transactions...', Array)
#2 /Users/h1-226/code/phpz/vendor/rootsoft/algorand-php/src/Services/ManagesTransactionParamsV2.php(19): Rootsoft\Algorand\Algorand->get(Object(Rootsoft\Algorand\Clients\AlgodClient), '/v2/transaction...')
#3 /Users/h1-226/code/phpz/vendor/rootsoft/algorand-php/src/Models/Transactions/Builders/RawTransactionBuilder.php(361): Rootsoft\Algorand\Algorand->getSuggestedTransactionParams()
#4 /Users/h1-226/code/phpz/index.php(61): Rootsoft\Algorand\Models\Transactions\Builders\RawTransactionBuilder->useSuggestedParams(Object(Rootsoft\Algorand\Algorand))
#5 {main} thrown in /Users/h1-226/code/phpz/vendor/rootsoft/algorand-php/src/Traits/MakesHttpRequests.php on line 125
tested out my api key in https://developer.purestake.io/apis, everything was working fine over there.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.