This first guide will walk you through a step-by-step installation of the required tools to start developing applications on Symbol.
We will be using the test network, which uses the same technology and features of the future main public network. The testnet allows developers to experiment with the offered Symbol’s transaction set in a live network without the loss of valuable assets.
Note
Not a developer? Download our client to manage XYM and issue transactions.
An account is a deposit box where you can hold mosaics (tokens) and interact with them by announcing transactions.
We are creating a new account with the Symbol CLI, a command-line tool designed to architect solutions and interact with Symbol networks in an efficient manner.
node --version
If you get an error or the version returned does not match v12.X, visit nodejs.org to install the requirement.
npm install --global symbol-cli@0.20.2
symbol-cli account generate
Enter network type (MIJIN_TEST, MIJIN, MAIN_NET, TEST_NET): TEST_NET
Do you want to save the account? [y/n]: y
Select an import type: » PrivateKey
Enter Symbol Node URL. (Example: http://localhost:3000): http://api-01.us-east-1.096x.symboldev.network:3000/
Insert the profile name: testnet
Do you want to set the account as the default profile? [y/n]: y
Profile stored correctly
┌─────────────┬──────────────────────────────────────────────────────────────────┐
│ Property │ Value │
├─────────────┼──────────────────────────────────────────────────────────────────┤
│ Address │ TCWYXK-VYBMO4-NBCUF3-AXKJMX-CGVSYQ-OS7ZG2-TLI │
├─────────────┼──────────────────────────────────────────────────────────────────┤
│ Public Key │ 203...C0A │
├─────────────┼──────────────────────────────────────────────────────────────────┤
│ Private Key │ AAA...AAA │
└─────────────┴──────────────────────────────────────────────────────────────────┘
Note
Make sure to keep the private key secret and backed up safely somewhere offline.
If you get the error The CLI cannot reach the node
, the most common causes are:
--network
, --generation-hash
, --namespace-id
, and divisibility
. Type symbol-cli account generate --help
to know more about each parameter.To announce a transaction, the sender should pay a fee to provide an incentive to those who validate and secure the network and run the infrastructure.
This cost is paid in symbol.xym
mosaics, the default network currency of the public network.
Now that you have created your first account, let’s request symbol.xym
units from the testnet faucet.
Navigate here, indicate the amount of symbol.xym
you want to receive and the address, and click “CLAIM!”.
Note
If the default faucet is empty, try this other alternative faucet.
After the transaction gets confirmed, check if your account has received symbol.xym
using the command-line tool.
symbol-cli account info --profile testnet
Balance Information
┌──────────────────┬─────────────────┬─────────────────┬───────────────────┐
│ Mosaic Id │ Relative Amount │ Absolute Amount │ Expiration Height │
├──────────────────┼─────────────────┼─────────────────┼───────────────────┤
│ 5E62990DCAC5BE8A │ 750.0 │ 750000000 | Never │
└──────────────────┴─────────────────┴─────────────────┴───────────────────┘
Note
The faucet has a limited amount of symbol.xym
and must be replenished before it dries. If you don’t need your test symbol.xym
units anymore, please send them back to the account TA6W43-2Q3NHN-Q5HQSK-Q52XL7-MFJZQI-TJRYBI-LQGG
.
Now that you have your account filled with symbol.xym
units, it is the time to choose a programming language.
Pick the one you feel most comfortable with, or follow your project requirements.
Then, create a folder for your new project and run the instructions for the selected language. If none of the languages fits your project, you can always query the blockchain directly using the REST gateway.
Note
Symbol SDK require Node.js 12 LTS to execute.
package.json
file.npm init
npm install symbol-sdk@0.20.6 rxjs
npm install --global typescript
typescript --version
sudo npm install --global ts-node
Note
Symbol SDK requires Node.js 12 LTS to execute.
package.json
file.npm init
npm install symbol-sdk@0.20.6 rxjs
Note
Symbol SDK requires JDK 8 to execute.
gradle init --type java-application
build.gradle
to use Maven central repository.repositories {
mavenCentral()
}
symbol-sdk
as a dependency.dependencies {
compile "io.nem:symbol-sdk-vertx-client:0.20.2"
}
gradle build
and gradle run
to run your program.Continue: Writing your first application.
Did you find what you were looking for? Give us your feedback.