Getting Started with Kadena
Welcome to the world of Kadena, a powerful blockchain platform that combines scalability with simplicity. In this guide, we'll walk you through the essential steps to kickstart your journey with Kadena. Whether you're a seasoned blockchain developer or a newcomer to the space, you'll find the process intuitive and efficient.
Start fat-container kadena/devnet
-
Create docker volume
docker volume create kadena_devnet
docker volume create kadena_devnet
-
start kadena-devnet fat-container
docker run -it -p 8080:8080 -v kadena_devnet:/data --name devnet kadena/devnet
docker run -it -p 8080:8080 -v kadena_devnet:/data --name devnet kadena/devnet
Monitor the blockchain
In the fat-container we expose an explorer that connects to the devnet
Here you can see the blocks that are mined, and the transactions that are executed
In Kadena a block is mined every 30 seconds. However, to optimize development workflow, the devnet mines a block in 5 seconds.
Install Chainweaver
- Download and install Chainweaver: https://github.com/kadena-io/chainweaver/releases
- Launch Chainweaver and create your mnemonic key
Add devnet to Chainweaver
- Click "Settings" tab in the bottom left
- Select "Network"
- Fill in the network name: "Devnet"
- Open the network you created "> Devnet"
- Add a node: "127.0.0.1:8080", the red dot on the right, should become green now.
Create keys to sign transactions
- Go to "Keys" on the left and click "+ Generate" on the top-right. This is your first key-pair.
- To show the balance of this account, click "Add k: Account".
- Go back to the "Accounts" tab on the left. Notice that the "Balance (KDA)" says "Does not exist".
In Kadena, keys and accounts do not represent the same thing. An account needs to be created before it can be used.
Fund your account
Note: we use NodeJS (personal recommendation to install with
n
) and runnpm install
in the root of this project
Before we can create an account, you need to have KDA to pay for the gas-fees (transaction fee).
We can gain KDA by funding it from a pre-installed "devnet" account called "sender00".
In this process, we’ll submit a transaction that creates an account based on the
"keys" and "predicate" that you supply. The combination of keys
+ predicate
makes a keyset
, which is used to guard
your account.
- Send money from "sender00" to your account. Copy your account name from the "Accounts" tab and fill it in the command
npm run start -- fund --keys "<your-key>" --predicate "keys-all"
npm run start -- fund --keys "<your-key>" --predicate "keys-all"
- Open the Block Explorer http://localhost:8080/explorer/ to monitor the transaction
- In Chainweaver, click "Refresh" to update the account balances
Deploy a contract
TBD