Git Product home page Git Product logo

xdag-python-example's Introduction

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.

xdag-python-example's People

Contributors

xrdavies avatar

Stargazers

 avatar  avatar  avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.