Diferencias

Muestra las diferencias entre dos versiones de la página.

Enlace a la vista de comparación

Ambos lados, revisión anterior Revisión previa
Próxima revisión
Revisión previa
api [2018/11/14 23:47]
Pablo Blanco Editado: Sincronización
api [2019/07/31 20:44] (actual)
YerkoBits sección "pruebas"
Línea 1: Línea 1:
-**Running Bytecoin Services** 
  
-----+Ejemplo: Una configuración correcta para la pool Prosus, sería... 
 +  ./prosus-daemon --rpc-bind-port=16181 --rpc-bind-ip 0.0.0.0
  
 +  ./prosus-wallet --daemon-port 16181 --rpc-bind-port 16191 --wallet-file pool --password xxxxxxxx
 +  
 +En el ejemplo, la wallet se comunica con el daemon mediante el puerto 16181. El daemon se comunica con otros daemon (otras casas) de forma libre (bind 0-0-0-0). La pool mina y envía pagos usando la wallet mediante el puerto 16191
  
-**Bytecoin Developers Team edited this page on 11 Apr · 4 revisions**+Usando el archivo prosus-daemon junto con el prosus-wallet tienes un set de instrucciones JSON-RPC mucho más amplio que usando el archivo prosus-pay (que fue diseñado para experimentar botones de pago solamente)
  
----- +Como ejemplo aparte, los parámetros para iniciar el prosus-daemon para levantar un block-explorer, son... 
- +  ./prosus-daemon --restricted-rpc --enable-cors=--enable-blockchain-indexes --rpc-bind-ip=0.0.0.0 --rpc-bind-port=16181
-**Design notes**+
  
 ---- ----
 +**Pruebas**
  
 +Puedes probar si funciona el JSON-RPC de **Prosus.Money**, usando tu navegador...
 +    http://localhost:16181/getinfo
  
-Bytecoin is split into two separate services bytecoind and walletdThis is a direct consequence of the anonymity concept Bytecoin is built upon.+... o la consola (comando curl). 
 +    curl -s -u user:pass -X POST http://127.0.0.1:16181/json_rpc -H 'Content-Type: application/json-rpc' -d '{"jsonrpc": "2.0","id": "0","method": "getblockcount","params": {}}'
  
-bytecoind service is responsible for P2P connections and consensus, it can assemble transactions into blocks, check transactions validity, synchronize and grow blockchain, but it cannot look inside transactions to see transfers between addresses, because this requires access to user secrets (wallet) to do so. +Si quieres conectar un servidor remoto de Prosus.Money... 
- +    ./prosus-wallet --daemon-host pool.prosus.money --daemon-port 16181
-Here comes walletd that is designed to work with user wallet being run with wallet file as a mandatory argumentAfter getting chain of blocks from bytecoind, walletd sifts through all transactions with wallet keys to see transfers from and to addresses stored in that wallet file+
- +
-Though this separation is perfect, the most common case is running bytecoind and walletd on the same computer at the same timeThat's why walletd has a local copy of bytecoind built-in. If you run walletd without ''--bytecoind-remote-address=<ip:port>'' parameter, it will run in-process bytecoind while walletd itself is runningIf you run walletd with ''--bytecoind-remote-address=<ip:port>'', it will try to connect to external bytecoind running at the given remote address. +
- +
-You cannot have several bytecoinds running on the same machine, because bytecoind requires exclusive access to blockchain database stored in Bytecoin data folder. (kind-of exception is running one for mainnet and one for testnet, this works because there is separate Bytecoin data folder for testnet) +
- +
-In the meantime, you can have as many walletds running as you need, but the same wallet file (actually, wallet file with the same view key) cannot be open by more than one walletd. This is because walletd requires exclusive access to wallet cache database with a name derived from wallet file view key, stored in Bytecoin data folder. +
- +
-**Security notice**: If you operate large sums of money, you should always run bytecoind in separate process, so that potential attacks exploiting security vulnerabilities in p2p network code will not get access to address space where wallet keys are stored. +
- +
-**Note about secrets on command line**: walletd requires wallet password and HTTP basic authentication parameters to be used by JSON API. It expects them from the standard input (typed by user after launching), because secrets on a command line are security risk. So, if you wish to run walletd from script without user interaction, you should run it like this: +
- +
-**On Linux and Mac OSX** +
- +
-''$ echo -e "<wallet_password>\n<http_user>:<http_password>" | ./walletd <other parameters>'' +
- +
-**On Windows** +
- +
-''C:\> (echo <wallet_password> & echo <http_user>:<http_password>) | ./walletd <other parameters>'' +
- +
-**On Windows, if wallet password is empty, we need special syntax to echo empty line** +
- +
-''C:\> (echo( & echo <http_user>:<http_password>) | ./walletd <other parameters>'' +
- +
-**Handy examples**+
  
 ---- ----
  
-**Running a single walletd with built-in bytecoind and default parameters**: 
- 
-''$ ./walletd --wallet-file=<file>'' 
-Running a single walletd with external bytecoind on the same machine (in beta you can only use 127.0.0.1 instead of localhost): 
- 
-''$ ./bytecoind 
-$ ./walletd --wallet-file=<file> --bytecoind-remote-address=127.0.0.1:8081'' 
-Running a single walletd with external bytecoind on a different machine (if not using https, you can only use IP-address): 
- 
-''$ ./bytecoind 
-$ ./walletd --wallet-file=<file> --bytecoind-remote-address=137.28.14.69:8081'' 
-Running two walletds with external bytecoind on the same machine: 
- 
-''$ ./bytecoind 
-$ ./walletd --wallet-file=<file1> --bytecoind-remote-address=127.0.0.1:8081 
-$ ./walletd --wallet-file=<file2> --walletd-bind-address=127.0.0.1:8071 --bytecoind-remote-address=127.0.0.1:8081'' 
- 
-We had to specify different bind port for accessing second walletd, because port ''8070'' is already used by first walletd. 
- 
-We can check them both in GUI wallet, selecting "Connect to remote walletd" command in Wallet menu, and typing ''127.0.0.1:8070'' or ''127.0.0.1:8071'' to connect to each of running walletds. 
- 
-**Running walletd with external bytecoind on a remote server via https (when using https, you can only use full DNS name)**: 
- 
-''$./walletd --wallet-file=<file> --bytecoind-remote-address=https://node123.amazon.com:8091'' 
- 
-On your server, you should run bytecoind normally with Nginx HTTPS proxy (or amazon load balancer) configured with valid certificate (''https://letsencrypt.org'' is a popular option), listening on port ''8091'' and redirecting requests to bytecoind that listens on port ''8081''.