litecoin 500 internal server error

_ Here's how it works: Anybody can ask a question Anybody can answer The best answers are voted up and rise to the top up vote 1 down vote favorite I'm getting an error 500 from my web server when I try to send a raw transaction through the RPC API.PHP message: PHP Warning: fopen(://...@IP:8332/): failed to open stream: HTTP request failed!HTTP/1.1 500 Internal Server Error in /usr/share/nginx/html/common/jsonRPCClient.php on line 132 PHP message: PHP Fatal error: Uncaught exception 'Exception' with message 'Unable to connect to://bitcoinrpc:PASSWORD@IP:8332/' in /usr/share/nginx/html/common/jsonRPCClient.php:140 Stack trace: #0 /usr/share/nginx/html/tools/do_sendBTC.php(131): jsonRPCClient->__call('sendrawtransact...',Array) #1 /usr/share/nginx/html/tools/do_sendBTC.php(131): jsonRPCClient->sendrawtransaction('010000000115d34...')#2 {main} This is the line that crashes: $result = $bitcoin->sendrawtransaction($tx_data); Every other API call works, for example validateaddress.
Any idea why this fails?The same raw transaction works if sent through the bitcoind command line.Thanks bitcoind api up vote 1 down vote You cannot send one transaction twice.If you have already sent it from bitcoin commandline, then it will fail with -22(cli) or 500(http) error.500 means incorrect data: insufficient funds, bad syntax, bad type, impossible command... Try to cast to string: $bitcoin -> sendrawtransaction((string)$tx_data), and do var_dump($tx_data) to find the type.If it doesn't help, send this POST request from cURL, as in tutorial: https://en.bitcoin.it/wiki/API_reference_(JSON-RPC)#Command_line_.28cURL.29 Your Answer Sign up or log in Sign up using Google Sign up using Email and Password Post as a guest Name Email discard By posting your answer, you agree to the privacy policy and terms of service.Browse other questions tagged bitcoind api or ask your own question.Coinbase provides a simple and powerful REST API to integrate bitcoin, litecoin and ethereum payments into your business or application.
This API reference provides information on available endpoints and how to interact with it.To read more about the API, visit our API documentation.Note: If you’re still using legacy Coinbase API (v1), you should access relevant API reference, Wallet API and Merchant API documentation.cheap diy bitcoin minerThis API supports two modes of authentication: OAuth2 is recommended when you’re creating an application for others on top of Coinbase platform.coin slot bitcoinThis authentication provides a secure and easy to use authentication flow for users.litecoin gpuOAuth2 requests must be authenticated with a valid access token passed as bearer token.bitcoin exchange uae
To use the bearer token, construct a normal HTTPS request and include an Authorization header with the value of Bearer.Signing is not required.Read more about OAuth2 authentication.API key is recommend if you only need to access your own account.All API key requests must be signed and contain the following headers: All request bodies should have content type application/json and be valid JSON.dogecoin blockchainThe CB-ACCESS-SIGN header is generated by creating a sha256 HMAC using the secret key on the prehash string timestamp + method + requestPath + body (where + represents string concatenation).bitcoin atm norwayThe timestamp value is the same as the CB-ACCESS-TIMESTAMP header.comprar bitcoin barcelonaThe body is the request body string or omitted if there is no request body (typically for GET requests).bitcoin hard drive thrown away
The method should be UPPER CASE.The CB-ACCESS-TIMESTAMP header MUST be number of seconds since Unix Epoch.Your timestamp must be within 30 seconds of the api service time or your request will be considered expired and rejected.We recommend using the time endpoint to query for the API server time if you believe there many be time skew between your server and the API servers.bitcoin akzeptiertRead more about API keys.Note: You should never request API keys or secrets from other Coinbase users.As per RESTful design patterns, Coinbase API implements following HTTP verbs: When making requests, arguments can be passed as params, form data or JSON with correct Content-Type header.Most resources are bound to a specific account belonging to the authenticated user.As the user can control which accounts are accessible accounts for both API keys and OAuth applications (coming soon), you should make sure you have the access to right account with GET /v2/accounts/ endpoint.
Otherwise a 404 will be returned.Coinbase API v2 supports cross-origin HTTP requests which is commonly referred as CORS.This means that you can call API resources using Javascript from any browser.While this allows many interesting use cases, it’s important to remember that you should never expose private API keys to 3rd parties.CORS is mainly useful with unauthenticated endpoints (e.g.Bitcoin price information) and OAuth2 client side applications.Coinbase API supports localization for error messages and other strings.Localization is defined in each request with Accept-Language header.Accepted values are currently: Numbers, currency and datetime don’t rely on localization so they will always be returned in standard format.All resource IDs are represented in UUID format.These values can be useful when building wrappers around the API or when linking to other resources.Money values are represented by a hash object which contains amount and currency fields.Amount is always returned as a string which you should be careful when parsing to have correct decimal precision.
Bitcoin, litecoin and ethereum values will have 8 decimal points and fiat currencies will have two.All timestamp are returned in ISO8601 format in UTC with fields ending in postfix _at.Example: "created_at": "2015-07-01T00:55:47Z" Some fields like type usually have a constant set of values.As Coinbase is actively growing and adding features, new values can be added or removed over time and you should take this into account when designing implementation.A good example is the Transaction resource which has multiple type values and new ones are added as new features are added to Coinbase.Similar to enumerable values, list values can be added or removed over time.Instead of hardcoding for specific values, your implementation should be flexible enough to take these requirements into account.Both API key and OAuth2 authentication require that you obtain correct permissions (scopes) to access different API endpoints.All authenticated endpoints, except GET /user, require a specific scope to access them.
Some endpoints might also have additional scopes for additional information or access.In general, permissions follow the service-name:resource:action pattern, where the service is wallet for the main Coinbase API.With OAuth2, scopes should be considered as grants: Users can select which scopes they grant access to for the application.The application might need to request new scopes over the lifecycle of the authorization.To see which permissions the user has granted, you can use GET /user/auth endpoint.As a general rule, you should only ask for scopes which your application needs and avoid asking for access to unnessary ones.Users more readily grant access to limited, clearly described scopes.All GET endpoints which return an object list support cursor based pagination with pagination information inside a pagination object.This means that to get all objects, you need to paginate through the results by always using the id of the last resource in the list as a starting_after parameter for the next call.
To make it easier, the API will contruct the next call into next_uri together with all the currently used pagination parameters.You know that you have paginated all the results when the response’s next_uri is empty.While using cursor based pagination might seem weird compared to many APIs it protects from the situation when the resulting object list changes during pagination (new resource gets added or removed).Default limit is set to 25 but values up to 100 are permitted.Due to permissions and access level control, the response list might in some cases return less objects than specified by the limit parameter.This is normal behaviour and should be expected.The result list is in descending order by default (newest item first) but it can be reversed by supplying order=asc instead.Generic error response (4xx, 5xx) All error messages will return both machine (id) and human readable (message) error message.All errors, except validation_error, return only one error.Some errors will also have an optional link to the documentation (url).
validation_error with status code 400 is returned when the validation of the resource fails on POST or PUT requests.Response contains errors field with a list of errors.Important: Different error types (id) can be added and removed over time so you should make sure your application accepts new ones as well.When authenticating or refreshing access tokens, OAuth2, will follow different error format.Responses can include a warnings parameter to notify the developer of best practices, implementation suggestions or deprecation warnings.While you don’t need show warnings to the user, they are usually something you need to act on so it’s recommended that you add them to admin email alerts.All API calls should be made with a CB-VERSION header which guarantees that your call is using the correct API version.Version is passed in as a date (UTC) of the implementation in YYYY-MM-DD format.If no version is passed, the version from user’s API settings will be used and a warning will be shown.Under no circumstance should you always pass in the current date, as that will return the current version which might break your implementation.
For information about notification versioning, refer to notification documentation.The Coinbase API is rate limited to prevent abuse that would degrade our ability to maintain consistent API performance for all users.By default, each API key or app is rate limited at 10,000 requests per hour.If your requests are being rate limited, HTTP response code 429 will be returned with an rate_limit_exceeded error.Recent changes and additions to Coinbase API v2.Changes marked with [Versioned] include a versioned change and are only available for applications that specify that version or later.Other changes are available for all versions.Initial release of Coinbase API v2.Client libraries can help you integrate with our API more quickly.Note that if you are using OAuth2 authentication, often times a standard OAuth2 client library in your language of choice or popular 3rd party authentication framework the easiest integration method.Some libraries rely on older Wallet API v1 and will be updated in the near future.
See API v1 documentation for details.Note that these have not been security tested by Coinbase.We plan on adding more client libraries in the future.If you develop a client library that you’d like to open source and add to this page, please send us a note.We’ll be happy to give you attribution.To speed up development most web frameworks have popular authentication libraries.They can be used to integrate with Coinbase’s OAuth.Same call with expanded resource Many resources, like transactions, have other resources linked to them.By default only the resource type (resource), id (id) and path (resource_path) are exposed which can be used to fetch the resource separately.In some cases it’s useful to expand the resource in the response body.While this might increase the request time and payload, it’s still faster than fetching several resources separately.Resources are expanded by passing an array of fields to expand with expand parameter (e.g.This can be done both when fetching existing or creating new resources.
If you want to expand all available resources, you can pass expand=all.This is useful with large and complex resources like transactions but it makes queries slower and increases the request payload size.Merchant resources, orders and checkouts, support metadata field.It allows the API developer to store custom information related to orders.This information can be for example: Metadata field supports key-value pairs with the following limitations: Example notification for new payment to a bitcoin address (wallet:addresses:new-payment) Example notification for paid order (wallet:orders:paid) Example notification for completed buy (wallet:buys:completed) Notifications allow you to subscribe to updates regarding your OAuth application or API key.Notifications are sent as HTTP POST requests (webhooks) to a notification endpoint, which the developer can set for their OAuth application or API key settings.Each notification contains the following information: If notification delivery fails, it will be re-tried hourly up to three days.
If you ever need to access notifications afterwards, you can query them using notification API endpoints.Content of the notification will not change even if the referenced resource changes over time.To secure your notifications, you should obfuscate your notification URL and verify the origin of the callback by validating it against the Coinbase callback IP addresses and signature (CB-SIGNATURE header).Read more about merchant notifications Outbound notifications (webhooks) are versioned using API version defined in user’s API settings.Listed below are notification types that are currently supported.Each type is named with service:resource:action.For example, confirming a buy on the Wallet API is wallet:buys:completed.To protect sensitive information, read permission for the resource is required to receive notifications for the resource type.For example, an API key needs to have wallet:buys:read permission to receive a notification for wallet:buys:completed.There are some exceptions to this rule, but each supported notification type is listed below with its corresponding required permissions.
Only notifications listed below are currently supported.We’ll add more notifications over time.If your application would benefit from a specific notification, please let us know by emailing us or posting in Coinbase Community.Lists notifications where the current user was the subscriber (owner of the API key or OAuth application).Show a notification for which the current user was a subsciber.Detailed information of the authenticated user (wallet:user:read permission) Authenticated user with their email (wallet:user:email permission) Generic user information.By default, only public information is shared without any scopes.More detailed information or email can be requested with additional scopes.Get any user’s public information with their ID.Get current user’s public information.To get user’s email or private information, use permissions wallet:user:email and wallet:user:read.If current request has a wallet:transactions:send scope, then the response will contain a boolean sends_disabled field that indicates if the user’s send functionality has been disabled.
Get current user’s authorization information including granted scopes and send limits when using OAuth2 authentication.Modify current user and their preferences.Account resource represents all of a user’s accounts, including bitcoin, litecoin and ethereum wallets, fiat currency accounts, and vaults.This is represented in the type field.It’s important to note that new types can be added over time so you want to make sure this won’t break your implementation.User can only have one primary account and it’s type can only be wallet.Lists current user’s accounts to which the authentication method has access to.Show current user’s account.To access the primary account for a given currency, a currency string (BTC or ETH) can be used instead of the account id in the URL.Creates a new account for user.To create a multisig account, visit Multisig documentation.Promote an account as primary account.In order to remove an account it can’t be: Address resource represents a bitcoin, litecoin or ethereum address for an account.
Account can have unlimited amount of addresses and they should be used only once.If you want to get notified when an address receives a new transactions, you can set up a API notification.Lists addresses for an account.Important: Addresses should be considered one time use only.Please visit POST /accounts/:id/addresses/ for instructions on how to create new addresses.Show an individual address for an account.A regular bitcoin, litecoin or ethereum address can be used in place of address_id but the address has to be associated to the correct account.List transactions that have been sent to a specific address.Creates a new address for an account.As all the arguments are optinal, it’s possible just to do a empty POST which will create a new address.This is handy if you need to create new receive addresses for an account on-demand.Addresses can be created for all account types.With fiat accounts, funds will be received with Instant Exchange.Transaction resource represents an event on the account.
It can be either negative or positive on amount depending if it credited or debited funds on the account.If there’s another party, the transaction will have either to or from field.For certain types of transactions, also linked resources with type value as field will be included in the payload (example buy and sell).All these fields are expandable.Important: As transactions represent multiple objects, resources with new type values can and will be added over time.Also new status values might be added.See more about enumerable values.Transactions statuses vary based on the type of the transaction.As both types and statuses can change over time, we recommend that you use details field for constructing human readable descriptions of transactions.Currently available statuses are: Lists account’s transactions.See transaction resource for more information.Show an individual transaction for an account.Send funds to a bitcoin address, litecoin address, ethereum address, or email address.
No transaction fees are required for off blockchain bitcoin transactions.It’s recommended to always supply a unique idem field for each transaction.This prevents you from sending the same transaction twice if there has been an unexpected network outage or other issue.When used with OAuth2 authentication, this endpoint requires two factor authentication unless used with wallet:transactions:send:bypass-2fa scope.If the user is able to buy bitcoin, they can send funds from their fiat account using instant exchange feature.Buy fees will be included in the created transaction and the recipient will receive the user defined amount.To create a multisig transaction, visit Multisig documentation.Transfer bitcoin, litecoin or ethereum between two of a user’s accounts.Following transfers are allowed: Requests money from an email address.Lets the recipient of a money request complete the request by sending money to the user who requested the money.This can only be completed by the user to whom the request was made, not the user who sent the request.
Lets the user resend a money request.This will notify recipient with a new email.Lets a user cancel a money request.Money requests can be canceled by the sender or the recipient.Buy resource represents a purchase of bitcoin, litecoin or ethereum using a payment method (either a bank or a fiat account).Each committed buy also has an associated transaction.Buys can be started with commit: false which is useful when displaying the confirmation for a buy.These buys will never complete and receive an associated transaction unless they are committed separately.When using this endpoint, it is possible that our system will not be able to process the buy as normal.If this is the case, our system will return a 400 error with an id of unknown_error.Lists buys for an account.Buys a user-defined amount of bitcoin, litecoin or ethereum.There are two ways to define buy amounts–you can use either the amount or the total parameter: When supplying amount, you’ll get the amount of bitcoin, litecoin or ethereum defined.
With amount it’s recommended to use BTC or ETH as the currency value, but you can always specify a fiat currency and and the amount will be converted to BTC or ETH respectively.When supplying total, your payment method will be debited the total amount and you’ll get the amount in BTC or ETH after fees have been reduced from the total.With total it’s recommended to use the currency of the payment method as the currency parameter, but you can always specify a different currency and it will be converted.Given the price of digital currency depends on the time of the call and on the amount of purchase, it’s recommended to use the commit: false parameter to create an uncommitted buy to show the confirmation for the user or get the final quote, and commit that with a separate request.If you need to query the buy price without locking in the buy, you can use quote: true option.This returns an unsaved buy and unlike commit: false, this buy can’t be completed.This option is useful when you need to show the detailed buy price quote for the user when they are filling a form or similar situation.
Completes a buy that is created in commit: false state.If the exchange rate has changed since the buy was created, this call will fail with the error “The exchange rate updated while you were waiting.The new total is shown below”.The buy’s total will also be updated.You can repeat the /commit call to accept the new values and start the buy at the new rates.Sell resource represents a sell of bitcoin, litecoin or ethereum using a payment method (either a bank or a fiat account).Each committed sell also has an associated transaction.Sells can be started with commit: false which is useful when displaying the confirmation for a sell.These sells will never complete and receive an associated transaction unless they are committed separately.Lists sells for an account.Sells a user-defined amount of bitcoin, litecoin or ethereum.There are two ways to define sell amounts–you can use either the amount or the total parameter: When supplying amount, you’ll get the amount of bitcoin, litecoin or ethereum defined.
With amount it’s recommended to use BTC or ETH as the currency value, but you can always specify a fiat currency and the amount will be converted to BTC or ETH respectively.When supplying total, your payment method will be credited the total amount and you’ll get the amount in BTC or ETH after fees have been reduced from the subtotal.Given the price of digital currency depends on the time of the call and amount of the sell, it’s recommended to use the commit: false parameter to create an uncommitted sell to get a quote and then to commit that with a separate request.If you need to query the sell price without locking in the sell, you can use quote: true option.This returns an unsaved sell and unlike commit: false, this sell can’t be completed.This option is useful when you need to show the detailed sell price quote for the user when they are filling a form or similar situation.Completes a sell that is created in commit: false state.If the exchange rate has changed since the sell was created, this call will fail with the error “The exchange rate updated while you were waiting.
The sell’s total will also be updated.You can repeat the /commit call to accept the new values and commit the sell at the new rates.Deposit resource represents a deposit of funds using a payment method (e.g.Each committed deposit also has an associated transaction.Deposits can be started with commit: false which is useful when displaying the confirmation for a deposit.These deposits will never complete and receive an associated transaction unless they are committed separately.Lists deposits for an account.Deposits user-defined amount of funds to a fiat account.Completes a deposit that is created in commit: false state.Withdrawal resource represents a withdrawal of funds using a payment method (e.g.Each committed withdrawal also has a associated transaction.Withdrawal can be started with commit: false which is useful when displaying the confirmation for a withdrawal.These withdrawals will never complete and receive an associated transaction unless they are committed separately.Lists withdrawals for an account.
Withdraws user-defined amount of funds from a fiat account.Completes a withdrawal that is created in commit: false state.Additional payment method limit information (wallet:payment-methods:limits permission) Payment method resource represents the different kinds of payment methods that can be used when buying and selling bitcoin, litecoin or ethereum.As fiat accounts can be used for buying and selling, they have an associated payment method.This type of a payment method will also have a fiat_account reference to the actual account.If the user has obtained optional wallet:payment-methods:limits permission, an additional field, limits, will be embedded into payment method data.It will contain information about buy, instant buy, sell and deposit limits (there’s no limits for withdrawals at this time).As each one of these can have several limits you should always look for the lowest remaining value when performing the relevant action.Lists current user’s payment methods.Show current user’s payment method.
Get any merchant’s information with their ID.Example of a merchant’s order resource Example of a public order resource The Order resource is used when merchants receive bitcoin payments for orders in bitcoin.There are two representations of an order: Orders are always created for the merchant’s primary account.Lists the current user’s (merchant) orders.Show current user’s merchant order.This endpoint can also be used to view the order’s public information by the order recipient.Creates a new merchant order.When a new order is created its amount is converted to bitcoin and the order is given a unique bitcoin address.Each order is valid for 15 minutes, during which a customer can pay for it.If the customer pays for an amount that doesn’t equal to bitcoin_amount, or pays after the order has been expired, the payment is counted as a mispayment.All orders created using this endpoint are created for the merchant’s primary account.Using this endpoint to create orders is useful when you want to build a merchant checkout experience without Coinbase’s merchant tools.
If you’re looking into creating new checkout products, see checkouts.Each merchant order has a lifespan of 15 minutes, during which the payment can be made to the bitcoin address attached to the order.If a payment is made for an amount that is less than the order’s BTC amount, or is paid after the order expires, it is counted as a mispayment.Mispayments and refunds are included in the merchant’s private order resource and the order will have a status of mispaid.If a payment is made for an amount that is more than the orders’s BTC amount, it completes the order and counts the overpayment.In this case, the order has a status of paid and the overpaid amount will be available through the merchant’s private order resource.If a mispayment is made on an order, all subsequent payments to that order will be added to the array of mispayments.In other words, if payment 1 is less than the order’s BTC amount and payment 2 is more than the order’s BTC amount, they are both considered mispayments and the order maintains its mispaid status.
The merchant’s private order resource will contain an array of mispayments which will have each mispaid amount.If an order is paid (received the correct payment on the first payment) all subsequent payments to that order will be counted as mispayments.However, the order will remain it’s status as paid and the subsequent payments will be visible in the mispayments array.In order words, if payment 1 completes the order and then the order receives payment 2 for any arbitrary amount, only payment 2 will be in the mispayments array, and the order will keep its status as paid If an order expires and no payment is made then the order status is expired.If an order expires and a payment is made afterwards, the order status remains expired and the payment gets counted as a mispayment.Refunds an order or a mispayment to an order.Returns a snapshot of the order data, updated with refund transaction details.There are three ways to refund an order: By default, refunds will be issued to the refund_address that is set on the order or the mispayment.
This field is automatically present when the original incoming transaction was from a Coinbase user, or via the payment protocol.In these cases, we are able to provide a refund address automatically.If the refund address is not present, you can specify an address to send the refund to with the refund_address POST parameter.Example of a merchant’s checkout resource The Checkout resource is used with Coinbase’s merchant tools (payment pages, iframes etc).It’s highly linked to the order resource in the following ways: Checkouts are useful if you’re integrating Coinbase’s merchant tools as a payment option for your service.If you’re looking to collect bitcoin payments without Coinbase’s UI, you can do it directly with orders.Creates a new merchant order checkout product.All checkouts and subsequent orders created using this endpoint are created for merchant’s primary account.Using this endpoint to create checkouts and orders is useful when you want to build a merchant checkout experience with Coinbase’s merchant tools.
If you’re looking into building your own checkout flow, see POST /api/v2/orders.Creates a new order for a checkout.This will create a new receiving bitcoin address and converts the original order amount to bitcoin.Currency codes will conform to the ISO 4217 standard where possible.Currencies which have or had no representation in ISO 4217 may use a custom code (e.g.This endpoint doesn’t require authentication.Get current exchange rates.Default base currency is USD but it can be defined as any supported currency.Returned rates will define the exchange rate for one unit of the base currency.Get the total price to buy one bitcoin or ether.Note that exchange rates fluctuates so the price is only correct for seconds at the time.This buy price includes standard Coinbase fee (1%) but excludes any other fees including bank fees.If you need more accurate price estimate for a specific payment method or amount, see buy bitcoin endpoint and quote: true option.Get the total price to sell one bitcoin or ether.