A place to understand ...how to connect, transact, and build with this language | framework | protocol.
Here you'll find the links to the github repo for polkadot
and acala
javascript libraries.
Our aim, is to connect to a Acala node using and RPC provider. We will build a set of simple Node applications. Hopefully this will become clear(er) as we continue on this pathway. Acala has built a library for us to easily interface, build, and connect.
We will need Node.js
and based on your OS, install the appropriate distribution.
node -v
v14.16.1
Create a project folder, change directory, and initialise as such:
mkdir acala
cd acala
npm init -y
Upon completion of the above commands you'll find a package.json
with the following entries:
{
"name": "acala",
"version": "1.0.0",
"description": "",
"main": "index.js",
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1"
},
"keywords": [],
"author": "",
"license": "ISC"
}
Install packages dotenv, axios, polkadot, acala
npm install --save dotenv axios @polkadot/api @acala-network/api@beta
Upon completion of the above commands you'll find a package.json
with the following entries:
{
"name": "acala",
"version": "1.0.0",
"description": "",
"main": "index.js",
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1"
},
"keywords": [],
"author": "",
"license": "ISC",
"dependencies": {
"@acala-network/api": "^0.7.4-6",
"@polkadot/api": "^4.9.2",
"axios": "^0.21.1",
"dotenv": "^9.0.2"
}
}