XDagger / xdag-python-example

XDAG Python Example

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

XDAG Python Example

Currently there are three ways to integrate XDAG wallet.

  1. Use exchange wallet address and user's wallet address as combination to distingush different users.
  2. Maintain multi wallets by yourself program.
  3. Use decimal numbers to distingush different users.

This example just demonstrates the first way.

The main repo for XDAG: https://github.com/xdagger/xdag
API Doc: https://explorer.xdag.io/api-docs
Explorer: https://explorer.xdag.io
Getting Started: https://github.com/XDagger/xdag/wiki/Getting-started

How to setup testnet:

  1. Build your binary version following https://github.com/XDagger/xdag/wiki/Getting-started
  2. If you run nodes on the same machine, just copy those files to different folders.
  3. Currently, to run a testnet just need two nodes.
  4. Modify the netdb-white-testnet.txt and netdb-testnet.txt according to your configuration.
  5. The launch command is ./xdag -t -z RAM -v 7 -p 127.0.0.1:<port for node> -P 127.0.0.1:<port for miners>:64:64:64:1:5:5:0.5 -rpc-enable -disable-refresh

For example:

If wanna launch two nodes.

  1. Copy those files to two folders, let's assume folder xdag1 and xdag2.
  2. Modify the netdb-white-testnet.txt and netdb-testnet.txt in both folders.

127.0.0.1:3366
127.0.0.1:3367

  1. In the folder for the first node run this command ./xdag -t -z RAM -v 7 -p 127.0.0.1:3366 -P 127.0.0.1:8888:64:64:64:1:5:5:0.5 -disable-refresh to launch one node.
  2. In the folder for the second node run this command ./xdag -t -z RAM -v 7 -p 127.0.0.1:3367 -P 127.0.0.1:8889:64:64:64:1:5:5:0.5 -disable-refresh to launch another node.
  3. Make a new folder for wallet, and copy those files to the new folder.
  4. Launch your wallet by command ./xdag -t 127.0.0.1:8888 to connect to node xdag1.
  5. For sure you can make many wallets as you want by make different folders and connect to xdag1 node by using 127.0.0.1:8888 or xdag2 node by using 127.0.0.1:8889.

Hint:

  1. Currently https://explorer.xdag.io is only for main net. For your local testnet, you have to check the instructions about how to setup explorer in repo https://github.com/XDagger/explorer.
  2. If have any problem, please join XDAG Community discord channel https://discord.gg/YxXUVQJ. Or contact me through XDAG Developers Chinese QQ Group 676955224.
  3. This example is for Python3.

About

XDAG Python Example

License:MIT License


Languages

Language:Python 100.0%