Getting Started

Hello, World!

TinyChain has one of the simplest imaginable "Hello, World!" programs— just open this link in your browser: http://demo.tinychain.net/state/scalar/value/string?key="Hello, World!"
Some things to notice: TinyChain has four types of Op: GET, PUT, POST, and DELETE. These correspond to HTTP methods . Every TinyChain Op is accessible over HTTP using the corresponding request method.
TinyChain supports object-oriented programming (OOP), including class inheritance. You can see the superclasses of a TinyChain String in its classpath: /state/scalar/string. So, String is a subclass of Value, which is a subclass of Scalar, which is a subclass of State, which is the parent of every TinyChain class. Any TinyChain Value can be constructed using by GETting its class.

Run a TinyChain host

The TinyChain host at demo.tinychain.net is provided for convenience, but it may be slow due to the volume of requests it receives, and it may not always have the latest updates and bugfixes. For the best experience, you should run your own host. This is easy to do with Docker:
1
# the "docker build" command will output an image ID like "c0c251e99ef1"
2
docker build https://github.com/haydnv/tinychain.git
3
4
# paste the image ID into this command
5
docker run -it -p 8702:8702/tcp IMAGE_ID ./tinychain --address=0.0.0.0
6
Copied!
Check that it's working by running your own "Hello, World!" program: http://127.0.0.1:8702/state/scalar/value/string?key="Hello, World!"