Jump to content
Ryan

Documentation and Tutorials Now Available

Recommended Posts

1315385724_XAYAdocumentationandtutorialswiki.thumb.png.99c57c939cca946d6d0eb4de3971c187.pngNew documentation and tutorials are available in our XAYA tutorial wiki.

The new material covers many different facets of the XAYA platform.

Developers who are new to blockchain technology can get up to speed quickly with a short primer. 

Developers who are already familiar with blockchain technology can get up to speed on XAYA quickly with several short primers on various topics.

Full source code tutorials are also available, including a Hello World example app and a Unity version of the Mover game included with libxayagame.

You can find it all here:

https://github.com/xaya/xaya_tutorials/wiki/

WHY XAYA?

Simply put, XAYA massively empowers your game; it doesn't limit it. Even more, XAYA expands what is possible. Fully decentralised games don't need servers. That alone makes XAYA an incredible platform. 

But there's soooo much more goodness. Find out about some more benefits in our Medium blog here.

Then get started creating your own games!

 

  • Like 3

Share this post


Link to post
Share on other sites

Should these log files be left in the zip? See HelloXaya/bin/XayaStateProcessor/glogs

Also, I think at least the HelloXaya tutorial should have a Linux version. Any bounty for this if I can get it working?

  • Thanks 1

Share this post


Link to post
Share on other sites
44 minutes ago, DarkClaw said:

Should these log files be left in the zip? See HelloXaya/bin/XayaStateProcessor/glogs

Also, I think at least the HelloXaya tutorial should have a Linux version. Any bounty for this if I can get it working?

If you can sure. I think we could do 10k.

Share this post


Link to post
Share on other sites
51 minutes ago, DarkClaw said:

Should these log files be left in the zip? See HelloXaya/bin/XayaStateProcessor/glogs

Also, I think at least the HelloXaya tutorial should have a Linux version. Any bounty for this if I can get it working?

Thanks for the heads up. I missed the logs when I was cleaning up the ZIP. 

All fixed now. 

Share this post


Link to post
Share on other sites
33 minutes ago, snailbrain said:

If you can sure. I think we could do 10k.

I'll give it a go.

 

25 minutes ago, Ryan said:

Thanks for the heads up. I missed the logs when I was cleaning up the ZIP. 

All fixed now. 

No problem.

Share this post


Link to post
Share on other sites

Link here is dead: https://github.com/xaya/libxayagame/blob/master/mover/README

Also, this may be beyond me.

Using MonoDevelop, I got to the point of starting the xayaService, but It hangs on "Launch and Connect to XAYAwrapper". It hangs here in HelloXaya.cs (wrapper is always null):

// The wrapper must be connected before we can continue.
do
{
    Thread.Sleep(10);
} while (wrapper == null || !wrapper.IsConnected);

 It looks like because it can't find SetDLLDirectory in XAYAWrapper.cs which is some windows specific method:

static class NativeMethods
{
    [DllImport("kernel32.dll")]
    public static extern IntPtr LoadLibrary(string dllToLoad);

    [DllImport("kernel32.dll")]
    public static extern IntPtr GetProcAddress(IntPtr hModule, string procedureName);

    [DllImport("kernel32.dll")]
    public static extern bool FreeLibrary(IntPtr hModule);

    [DllImport("kernel32.dll")]
    public static extern bool SetDllDirectory(string pathName);

    [DllImport("kernel32.dll")]
    public static extern UInt32 WaitForSingleObject(IntPtr hHandle, UInt32 dwMilliseconds);
}

[...]

// if(!NativeMethods.SetDllDirectory(dataPath + "\\..\\XayaStateProcessor\\"))
if(!NativeMethods.SetDllDirectory(dataPath + "/../XayaStateProcessor/"))
{
    result = "Could not set dll directory";
    return;
}

Basically there is way more going on here than I expected for "hello world", I thought I would just have to change a few paths and have maybe one or two workarounds. I think I could probably figure out something like described here for this specific problem, but there are a crapload of dlls I am seeing in HelloXaya/bin/XayaStateProcessor. Also, this is possibly a dumb question, but where is the source for eg, libxayawrap.dll?

While this is probably a much better skeleton for an eventual xaya game, I feel like there could be a very simple CLI "Hello World" that only puts some info on the blockchain and reads back all the stuff people have put on there for that "g/" namespace (or however it works).

 

Edited by DarkClaw

Share this post


Link to post
Share on other sites
6 minutes ago, DarkClaw said:

Thanks got that fixed.

7 minutes ago, DarkClaw said:

Also, this may be beyond me.

Using MonoDevelop, I got to the point of starting the xayaService, but It hangs on "Launch and Connect to XAYAwrapper". It hangs here in HelloXaya.cs (wrapper is always null):


// The wrapper must be connected before we can continue.
do
{
    Thread.Sleep(10);
} while (wrapper == null || !wrapper.IsConnected);

 It looks like because it can't find SetDLLDirectory in XAYAWrapper.cs which is some windows specific method:


static class NativeMethods
{
    [DllImport("kernel32.dll")]
    public static extern IntPtr LoadLibrary(string dllToLoad);

    [DllImport("kernel32.dll")]
    public static extern IntPtr GetProcAddress(IntPtr hModule, string procedureName);

    [DllImport("kernel32.dll")]
    public static extern bool FreeLibrary(IntPtr hModule);

    [DllImport("kernel32.dll")]
    public static extern bool SetDllDirectory(string pathName);

    [DllImport("kernel32.dll")]
    public static extern UInt32 WaitForSingleObject(IntPtr hHandle, UInt32 dwMilliseconds);
}

[...]

// if(!NativeMethods.SetDllDirectory(dataPath + "\\..\\XayaStateProcessor\\"))
if(!NativeMethods.SetDllDirectory(dataPath + "/../XayaStateProcessor/"))
{
    result = "Could not set dll directory";
    return;
}

Basically there is way more going on here than I expected for "hello world", I thought I would just have to change a few paths and have maybe one or two workarounds. I think I could probably figure out something like described here for this specific problem, but there are a crapload of dlls I am seeing in HelloXaya/bin/XayaStateProcessor. Also, this is possibly a dumb question, but where is the source for eg, libxayawrap.dll?

While this is probably a much better skeleton for an eventual xaya game, I feel like there could be a very simple CLI "Hello World" that only puts some info on the blockchain and reads back all the stuff people have put on there for that "g/" namespace (or however it works).

Yes. I've not gotten to doing a Linux version yet. There are a lot of moving parts there and it takes time. It's on my TODO list. (Along with many other things.) 

libxayawrap.dll source is compiled from libxayagame is in the libxayagame repository. It needs to be compiled for Linux. The XayaStateProcessor folder is all the DLLs precompiled for Windows. The actual libxayagame DLL is named "libxayawrap.dll" in there. libxayagame currently has no precompiled binaries for Linux. 

Regarding the XAYAWrapper.cs file, yes - that is all native Windows calls for kernel32.dll. It won't work in Linux. None of the NativeMethods will work as they're all Windows platform calls. 

Quote

While this is probably a much better skeleton for an eventual xaya game, I feel like there could be a very simple CLI "Hello World" that only puts some info on the blockchain and reads back all the stuff people have put on there for that "g/" namespace (or however it works).

We have a Mover tutorial that is a console application, but it doesn't accept input. What you can learn there is limited. The XAYA Unity Mover tutorial allows input, but it's C# and Unity, so again, not Linux. 

At the moment I've been focusing on C# tutorials. C++ ones will come later. 

To make sure that I've answered you:

Quote

where is the source for eg, libxayawrap.dll?

There are 2 sources. The first is libxayagame and the second is the Windows wrapper here. The first is the actual C++ code and the second is a wrapper for Windows. The wrapper for Windows is still a C++ static library so it needs another wrapper for .NET, which is the XAYAWrapper library. 

That may be a bit confusing, so here's a basic diagram:

libxayagame (in C++) >> libxayagame_wrapper (a C++ statically linked library for Windows) >> XAYAWrapper (a C# wrapper for libxayagame_wrapper)

I hope that makes sense for you. 

The issue is about platforms. The libxayagame can be used on any platform. However, the other 2 libraries are for C++ on Windows and then C# on Windows.

Hello World currently requires additional work to get it working on Linux. 

I hope that helps. If you have additional questions, one of us can answer I'm sure. 

 

 

 

 

Share this post


Link to post
Share on other sites

Thanks. All makes sense except I don't see why a "Hello World" is so complex:

14 minutes ago, Ryan said:
Quote

While this is probably a much better skeleton for an eventual xaya game, I feel like there could be a very simple CLI "Hello World" that only puts some info on the blockchain and reads back all the stuff people have put on there for that "g/" namespace (or however it works).

We have a Mover tutorial that is a console application, but it doesn't accept input. What you can learn there is limited. The XAYA Unity Mover tutorial allows input, but it's C# and Unity, so again, not Linux. 

Basically, from a "Hello World" I just want to learn how game information is written, stored, and accessed using the blockchain without a bunch of other stuff going on. If that is possible to make (I guess I don't know), I think it will be helpful for people who come across this tech.

Edited by DarkClaw
  • Like 1

Share this post


Link to post
Share on other sites
2 hours ago, DarkClaw said:

While this is probably a much better skeleton for an eventual xaya game, I feel like there could be a very simple CLI "Hello World" that only puts some info on the blockchain and reads back all the stuff people have put on there for that "g/" namespace (or however it works).

If you want just the backend directly in C++, so no Unity/frontend/C#, then you can actually just look at the Mover code itself in the libxayagame repository.  It is not as simple as a game could possibly be, but I think it should be fairly easy to use as a template and for reading some code.

Share this post


Link to post
Share on other sites
10 hours ago, DarkClaw said:

Thanks. All makes sense except I don't see why a "Hello World" is so complex:

Basically, from a "Hello World" I just want to learn how game information is written, stored, and accessed using the blockchain without a bunch of other stuff going on. If that is possible to make (I guess I don't know), I think it will be helpful for people who come across this tech.

any feedback is great. If you want to do a guide we can put on there then lets do it - can give you some coins for it from the bounty pot

Share this post


Link to post
Share on other sites
12 hours ago, DarkClaw said:

Thanks. All makes sense except I don't see why a "Hello World" is so complex:

The Hello World tutorial aims to show:

  1. how to wire up an app or game, (video here)
  2. send a move,  (video here)
  3. get the game state (video here)
  4. update the UI (video here)

It's not focused on any of the actual game logic, because there really isn't any game logic in Hello World. 

Wiring up libxayagame requires at least 2 threads.

  1. Construct and connect to libxayagame
  2. Receive a game state to update the main UI front end

There's no way around that, so that adds in complexity.

The Hello World example doesn't use a third thread to update the UI, but ideally UI updates should be done in 1 or more threads. That would be done in the "UpdateHelloChat" method. 

Then there are the 3 callbacks to implement. See below.

12 hours ago, DarkClaw said:

Basically, from a "Hello World" I just want to learn how game information is written, stored, and accessed using the blockchain without a bunch of other stuff going on. If that is possible to make (I guess I don't know), I think it will be helpful for people who come across this tech.

Writing is just a simple RPC call, i.e. a name_update. It's pretty trivial. If you know the move, it's 1 line of code. This is the Hello World tutorial about that.

Storing game data is mainly done in 2 ways.

  1. Creating a new game state from moves in the last mined block
  2. Creating undo data to rewind 1 block

Once that data is created, it's returned inside the forward callback and effectively stored by libxayagame as it will pass back that data in both the forward and backward callbacks. Data can also be stored using SQLite or lmdb. Tutorials on those will be coming later. 

Accessing data is done through 1 of the threads mentioned above when wiring up libxayagame. The "Listening for New GameStates" part in the Hello World tutorial addresses that. 

For the "game logic", that's done in the forward and backward callbacks. We'll have tutorials for that coming along. For the moment, you may wish to check out forwardCallbackResult and Processing Moves. That will be improved, but it helps to understand processing moves forward. In particular, see here for an abstraction. That is in the context of the Mover sample game. 

 

From my guess, you're looking for tutorials on implementing that core game logic. Am I on target there?

Share this post


Link to post
Share on other sites
Quote

From my guess, you're looking for tutorials on implementing that core game logic. Am I on target there?

All this stuff is good, but for an initial foray into this it would be helpful to have a few dozen lines at most that shows how to pass game-like data to and from the blockchain.

Those examples you go over are all parts of a much larger project, which is fine, but not ideal as a "Hello World".  The current  project is 70 MB, this is too much for a "Hello World" because it is too easy to get side tracked like I did into stuff like learning about loading DLLs or whatever.

I am not saying these tutorials are bad or unhelpful in any way, but they are a step higher in complexity than I am looking for at this point. It is just that a really, really short and simple functional piece of code (puts "game info" on the blockchain, reads current gamestate from blockchain) with minimal dependencies would be helpful when introducing people to xaya.

 

11 hours ago, domob said:

If you want just the backend directly in C++, so no Unity/frontend/C#, then you can actually just look at the Mover code itself in the libxayagame repository.  It is not as simple as a game could possibly be, but I think it should be fairly easy to use as a template and for reading some code.

I saw there was also a tutorial for this but didn't get to it yet. It looks helpful too but still more complex than a hello world needs to be. Maybe I am just expecting the impossible here though and it isn't possible to extract a basic functionality from the rest.

Edited by DarkClaw

Share this post


Link to post
Share on other sites
14 minutes ago, DarkClaw said:

All this stuff is good, but for an initial foray into this it would be helpful to have a few dozen lines at most that shows how to pass game-like data to and from the blockchain.

Sending a move to the blockchain is trivial. It takes 4 lines of code total. From the HelloWorld example, these are the lines:

using BitcoinLib.Responses;
BitcoinLib.Services.Coins.XAYA.IXAYAService xayaService;
xayaService = new BitcoinLib.Services.Coins.XAYA.XAYAService("http://localhost:8396/wallet/game.dat",
	Properties.Settings.Default.Username,
	Properties.Settings.Default.Password,
	"",
	10);
xayaService.NameUpdate(this.cbxNames.GetItemText(this.cbxNames.SelectedItem), hello, new object());

However, GETTING game states requires much more effort. There's just no way around it. It requires wiring up libxayagame in a thread and getting the data in another listener thread. Threading takes much more code. Also, libxayagame's Connect method is a blocking operation, so if we have an example without threads, then you can never send or receive a move because the main thread is blocked. 

This tutorial here is extremely minimalistic and ONLY goes over the absolute minimum needed to wire up libxayagame. It requires knowledge of threading and the callbacks. However, implementing the callbacks is non-trivial and there's no way to do it in just a few lines of code. They're where the core game logic resides. 

28 minutes ago, DarkClaw said:

Those examples you go over are all parts of a much larger project, which is fine, but not ideal as a "Hello World".  The current  project is 70 MB, this is too much for a "Hello World" because it is too easy to get side tracked like I did into stuff like learning about loading DLLs or whatever.

There are a fair number of requirements, so the project size is fairly large, but the only important file for it is "HelloXaya.cs". Without those other things though, the program wouldn't compile or run.  

It's a good point about getting side tracked. I've added a note there. Hopefully it will keep people focused on the important parts. 

45 minutes ago, DarkClaw said:

I saw there was also a tutorial for this but didn't get to it yet. It looks helpful too but still more complex than a hello world needs to be. Maybe I am just expecting the impossible here though and it isn't possible to extract a basic functionality from the rest.

I've abstracted out basic wiring up, which gives the functionality, in "How to Wire Up libxayagame in C#". But, it's not something that you can compile and run like HelloXaya. All the parts are required to have something that you can compile and run. 

The documentation is still a work in progress though. And it certainly helps to get feedback like yours. I'll make sure to include it in forthcoming documentation. 

 

Share this post


Link to post
Share on other sites
Quote

However, GETTING game states requires much more effort. There's just no way around it. It requires wiring up libxayagame in a thread and getting the data in another listener thread.

Couldn't there be a way to do this using queries rather than "listening"? I.e, it would be used like an RPC request: "getgamestate(User, Pass, xayadPort, "g/HelloXaya") -> return some JSON". I don't mean that would work for an actual game, just for a "Hello World".

 

17 hours ago, Ryan said:

Sending a move to the blockchain is trivial. It takes 4 lines of code total. From the HelloWorld example, these are the lines:


using BitcoinLib.Responses;
BitcoinLib.Services.Coins.XAYA.IXAYAService xayaService;
xayaService = new BitcoinLib.Services.Coins.XAYA.XAYAService("http://localhost:8396/wallet/game.dat",
	Properties.Settings.Default.Username,
	Properties.Settings.Default.Password,
	"",
	10);
xayaService.NameUpdate(this.cbxNames.GetItemText(this.cbxNames.SelectedItem), hello, new object());

Well you also need CoinParameters.cs, Xayaservice.cs, etc. Both those files contain more code than is needed. Eg, for a hello world I'd expect you can at least delete:

// Copyright (c) 2014 - 2016 George Kimionis
// See the accompanying file LICENSE for the Software License Aggrement

using BitcoinLib.CoinParameters.XAYA;

namespace BitcoinLib.Services.Coins.XAYA
{
    public class XAYAService : CoinService, IXAYAService
    {
/*        public XAYAService(bool useTestnet = false) : base(useTestnet)
        {
        }

        public XAYAService(string daemonUrl, string rpcUsername, string rpcPassword, string walletPassword)
            : base(daemonUrl, rpcUsername, rpcPassword, walletPassword)
        {
        }
*/

        public XAYAService(string daemonUrl, string rpcUsername, string rpcPassword, string walletPassword, short rpcRequestTimeoutInSeconds)
            : base(daemonUrl, rpcUsername, rpcPassword, walletPassword, rpcRequestTimeoutInSeconds)
        {
        }

        public XAYAConstants.Constants Constants => XAYAConstants.Constants.Instance;
    }
}

And all the other coins (eg litecoin) can be removed from CoinParameters.cs. That is what I mean, all the error checking and multiple use-cases do not need to be there for a "hello world". It should be as minimal as possible.
 

BaseUnitName = "Chitoshi";

Nice.

Share this post


Link to post
Share on other sites

Chitoshi isn't official :D we could ask in General what people think it should be or if Chitoshi is ok - could do a poll..

@DarkClaw

Maybe we could do a hello World which is not related to libxayagame at all and we just do simple RPC to xayad.

  1. name_register p/john - (create a unique name on the blockchain that no one can ever take from you)
  2. name_update p/join {"message":"Hello World!"}
  3. name_show p/john

This should probably be simple and it will get new users accustomed into the RPC stuff first.

what do you thinik?

That would sort of be the first step to communicating to XAYAd

then they can go into the deeper stuff later (or build stuff how they want).

Share this post


Link to post
Share on other sites

If libxayagame is just a wrapper to RPC calls then that would work. This isn't really for users though, but potential game devs.

29 minutes ago, snailbrain said:

name_show p/john

Does this show the gamestate or just for that player?

 

Share this post


Link to post
Share on other sites
2 hours ago, DarkClaw said:

Couldn't there be a way to do this using queries rather than "listening"? I.e, it would be used like an RPC request: "getgamestate(User, Pass, xayadPort, "g/HelloXaya") -> return some JSON". I don't mean that would work for an actual game, just for a "Hello World".

In fact, that is actually the default mode for libxayagame.  You don't need any threading for it at all - if you use it in the simplest way, it basically gives you an RPC server that maintains and provides the game state.

All that threading stuff is only needed if you want to run that in addition to your frontend in the same binary (so that you can run the RPC server on one thread and query it from another).

Share this post


Link to post
Share on other sites
3 hours ago, DarkClaw said:

If libxayagame is just a wrapper to RPC calls then that would work. This isn't really for users though, but potential game devs.

Does this show the gamestate or just for that player?

 

Hi. You might need to check the relationships in the docs. 

Basically there are 3 parts to games on xaya.

Xayad (your wallet pretty much and allows rpcs for creating names and updating their values).

Game state processor (GSP) - This is libxayagame combined with your game logic. This gets all the name updates for specified games (libxayagame) and calculates the state of the game (with your gamelogic) and stores it however you want (sqlite for example). It also looks after reorgs (rollback the state) and catches up if out of sync.

Front end - This gets the state of the game every block from the GSP or requests for data from the gsp on demand. It also connects to xayad to do all the writing (nameupdates and some other rpcs like to check what names are held by you).

The GSP can run standalone with just xayad on some vps and provide gamestate for mobile devices or for live maps or whatever.

 

My example above would not touch libxayagame/gsp and would just be for simple rpc and the front end part. There is No game states involved... But maybe that would be the simplest way to start.

Name_show just shows the current value of the name so in the hello world example it would just show hello world.

After this the dev could go onto mover. The way the GSP works is it reads all nameupdates for every block and computes the state of the game based on the values of the names every block.

Share this post


Link to post
Share on other sites
13 hours ago, DarkClaw said:

If libxayagame is just a wrapper to RPC calls then that would work. This isn't really for users though, but potential game devs.

Absolutely. There's no reason for any regular user to ever even look at libxayagame. It's a development tool. 

 

13 hours ago, DarkClaw said:

Does this show the gamestate or just for that player?  

For other people, that's about this:

name_show p/john

No. It doesn't show a game state. It shows the data associated with the name, or the last name_update. At the moment, that's this for "p/John" (note the case difference). 

{
  "name": "p/John",
  "name_encoding": "utf8",
  "value": "{\"p/John\":\"\"}",
  "value_encoding": "ascii",
  "txid": "dce27bde307784aea84d1bb1e21e0e958f6af525e85f2a367233c30dd2ae7641",
  "vout": 1,
  "address": "CTpzhXe4gEN1cP28g2cvujFR9xyh1YwWK1",
  "height": 7212,
  "ismine": false
}

You can check for more information about name_show here:

https://github.com/xaya/xaya_tutorials/wiki/XAYA-RPC-Methods#name_show

 

 

Share this post


Link to post
Share on other sites
On 2/15/2019 at 12:33 PM, snailbrain said:

Game state processor (GSP) - This is libxayagame combined with your game logic. This gets all the name updates for specified games (libxayagame) and calculates the state of the game (with your gamelogic) 

Yes, I think it would be helpful to have an example of this using a just a few lines. So there is a function in the libxaya game that just returns all transactions that include, eg a "g/HelloXaya" update? Then however these select tx are processed depends on the individual game?

 

On 2/15/2019 at 9:06 PM, Ryan said:

It shows the data associated with the name, or the last name_update. At the moment, that's this for "p/John" (note the case difference). 


{
  "name": "p/John",
  "name_encoding": "utf8",
  "value": "{\"p/John\":\"\"}",
  "value_encoding": "ascii",
  "txid": "dce27bde307784aea84d1bb1e21e0e958f6af525e85f2a367233c30dd2ae7641",
  "vout": 1,
  "address": "CTpzhXe4gEN1cP28g2cvujFR9xyh1YwWK1",
  "height": 7212,
  "ismine": false
}

You can check for more information about name_show here:

I don't see any game info here though. For the hello world we want an example where there is info for a "game" included.

Share this post


Link to post
Share on other sites
57 minutes ago, DarkClaw said:

Yes, I think it would be helpful to have an example of this using a just a few lines. So there is a function in the libxaya game that just returns all transactions that include, eg a "g/HelloXaya" update? Then however these select tx are processed depends on the individual game?

 

I don't see any game info here though. For the hello world we want an example where there is info for a "game" included.

We've just added this page for an easier intro - it's probably too easy for you.. but have a check.

(note that this is a basic diagram of how games on xaya are setup.) Should be in the Overview section.

xaya-3-main-parts.png.16076a65e1b7f88fc94991bf77b7c59a.png


The XAYA Daemon. 
We are working on the libxayagame (and the GSP) part this week to make that as simplified way as possible.

https://github.com/xaya/xaya_tutorials/wiki/First-steps

Let us know if this is a good intro.

Share this post


Link to post
Share on other sites
Quote

xaya-cli -rpcuser=user -rpcpassword=password name_update "p/<my name>" "{\"g\":{\"helloworld\":{\"m\":\"Hello everybody!\"}}}"

Congratulations! You just made a move in the "Hello World!" game! In a later tutorial you'll be able to see your move along with everyone else's moves and we'll explain the JSON object that is required for values on the chain.

https://github.com/xaya/xaya_tutorials/wiki/First-steps

Yes, exactly. Now my (possibly wrong) understanding is that the next step is we find everything related to "g\helloworld" in the xaya chain? Everything after that is game specific and has nothing to do with the blockchain?

Share this post


Link to post
Share on other sites
On 2/17/2019 at 11:52 PM, DarkClaw said:

https://github.com/xaya/xaya_tutorials/wiki/First-steps

Yes, exactly. Now my (possibly wrong) understanding is that the next step is we find everything related to "g\helloworld" in the xaya chain? Everything after that is game specific and has nothing to do with the blockchain?

yes pretty much.

We've just made another example which is libxayagame with hello world - simplest form. Currently being wrriten up.

 

Share this post


Link to post
Share on other sites
9 hours ago, snailbrain said:

yes pretty much.

We've just made another example which is libxayagame with hello world - simplest form. Currently being wrriten up.
 

 

From my current understanding, I don't see what is stopping someone from spamming a game with invalid moves (besides tx fees). Everyone from there on out then needs to check all the spam messages every time they want to know the gamestate (or use some blacklist maintained outside the blockchain).

Is that the case, or is there some method that prevents invalid "moves" from being associated with a game?

Share this post


Link to post
Share on other sites
4 hours ago, DarkClaw said:

 

From my current understanding, I don't see what is stopping someone from spamming a game with invalid moves (besides tx fees). Everyone from there on out then needs to check all the spam messages every time they want to know the gamestate (or use some blacklist maintained outside the blockchain).

Is that the case, or is there some method that prevents invalid "moves" from being associated with a game?

Not sure what you mean entirely.

Each gsp will process the game moves only for that particular game. If the moves are invalid then the gsp will ignore them. It will need to check if they are valid.

If they are not they will have paid a tx fee anyway. That is what stops spam in blockchain and incentivises miners to put your tx in a block.

Each name can only make 1tx per block also (maybe every 2 or 3 in practice).

If it caused a problem with a game in that someone create thousands of names and did an invalid move every few blocks to put more load on a gsp at the cost of wasting chi txs + cost of the names + cost of a character in a game and maybe action costs in a game (Like ours).... you could also have a game rule that says if a name has more than 10 invalid txs in a day then ignore his moves for 5 days..

 

  • Thanks 1

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×

Important Information

Your use of this site is governed by our Terms of Use and Privacy Policy. We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.