Orbit is a GraphQL server wrapper around @ton-community/sandbox
, designed to provide a mini TON Blockchain Server. Its purpose is to offer an easily launchable Blockchain environment (similar to testnet
) for seamless and thorough project testing before deploying to mainnet
. The Rift framework will leverage Orbit to provide a multi-contract testing framework for TON development.
While Sandbox itself is a valuable tool, it lacks direct persistence of Blockchain state and transactions, and is primarily tailored for node.js
environments. Orbit serves as a complementary tool, addressing these limitations by providing enhanced functionalities. As a local server, it ensures privacy and offers maximum flexibility before the project's initial launch on testnet
or mainnet
.
Currently, Orbit provides a GraphQL server for making calls. We have plans to support ton-api-v4
, which will minimize code changes required during integration.
To get started with Orbit, follow these steps:
-
Ensure you have a node environment set up.
-
Install Orbit globally by running the following command:
npm install -g @sky-ring/orbit
-
Open up a terminal and type:
orbit
If everything is okay, you will see a successful launch message.
- You can now send GraphQL queries to
localhost:29194
or navigate to the GraphiQL page atlocalhost:29194/graphql
.
Here are the GraphQL definitions for Query
and Mutation
along with brief descriptions:
type Mutation {
spawn(id: String!): Boolean # Launches a blockchain instance with the specified ID
sendBoc(id: String!, boc64: String!): [Tx] # Sends a BOC message to the specified network
bringDown(params: BringDownInput!): Boolean # Shuts down a blockchain instance with removal capability
createWallet(id: String!, walletId: String!, balance: String!): String # Creates a wallet with the specified name on the network with the given balance
charge(id: String!, address: String!, value: String!): Boolean # Tops up the balance for the specified account on the network
}
type Query {
version: Version # Retrieves the version of Orbit
snapshots: [String] # Retrieves the list of stored snapshots of blockchains
account(id: String!, address: String!): AccountInfo # Retrieves account information for the specified ID and address
}
Feel free to explore and utilize these GraphQL endpoints to interact with the Orbit server.