简体   繁体   English

如何在PHP文件/脚本中使用Node.js代码

[英]How to use node.js code inside php file/script

I am very new in node.js , I am creating a bitcoin application in php and I need to use Bitgo API for creating wallet address and bitcoin transfer. 我是node.js新手,正在用php创建一个比特币应用程序,我需要使用Bitgo API创建钱包地址和比特币转账。

Bitgo have there API in node.js only. Bitgo仅在node.js中具有API。 Please help me to call node.js API inside my php code. 请帮助我在我的PHP代码中调用node.js API。

Here is the API listed. 这是列出的API。

https://www.bitgo.com/api/?javascript#create-address https://www.bitgo.com/api/?javascript#create-address

On user signup I need to execute the Bitgo API for creating addresses inside wallet. 在用户注册时,我需要执行Bitgo API以在钱包内创建地址。 Bitgo returns the wallet address in response and I have to store in my database. Bitgo作为响应返回钱包地址,我必须将其存储在数据库中。

Thanks in advance! 提前致谢!

The BitGo Express REST API is a lightweight service for developers that want to take advantage of BitGo but are developing in a language without a native BitGo SDK. BitGo Express REST API是一种轻量级服务,适用于希望利用BitG​​o但使用没有本机BitGo SDK的语言进行开发的开发人员。

BitGo Express runs as a service in your own datacenter, and handles the client-side operations involving your own keys, such as partially signing transactions before submitting them to BitGo. BitGo Express在您自己的数据中心中作为服务运行,并处理涉及您自己的密钥的客户端操作,例如在将交易提交给BitGo之前对交易进行部分签名。 This ensures your keys never leave your network, and are never seen by BitGo. 这样可以确保您的密钥永远不会离开您的网络,并且不会被BitGo看到。 BitGo Express can also proxy the standard BitGo REST APIs, providing a unified interface to BitGo through a single REST API. BitGo Express还可以代理标准BitGo REST API,通过单个REST API为BitGo提供统一的接口。

To use BitGo Express: 要使用BitG​​o Express:

Install BitGoJS Run the following command in the bin directory: ./bitgo-express --debug --port 3080 --env test --bind localhost 安装BitGoJS在bin目录中运行以下命令:./bitgo-express --debug --port 3080 --env test --bind localhost

Make all BitGo REST API calls to the machine on which bitgo-express is running. 对运行bitgo-express的计算机进行所有BitGo REST API调用。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM