Skip to content

Latest commit

 

History

History
167 lines (114 loc) · 4.88 KB

en.md

File metadata and controls

167 lines (114 loc) · 4.88 KB

ASCH is a blockchain application development platform based on multi-chain architecture. Follow the steps to develop DApps on the ASCH Platform:


logo



What is ASCH?

1.ASCH White Paper

2.ASCH official website

3.ASCH blockchain explorer

4.ASCH source code repository

5.ASCH related documentation


Get started with Sidechain development (tutorial)

  1. Install local ASCH blockchain node
  2. Create new DApp
  3. Register your DApp on your local ASCH blockchain
  4. Start developing the business logic

All steps are described in detail in the following tutorials:

Part 1

sidechain1

Part 2

sidechain2

Hello World (tutorial)

  1. Build ASCH Hello World DApp

  2. Build ASCH Mini DAO DApp

ASCH Sample DApps

Documentation

Tools



Create an Account

ASCH provides a series of development tools for the blockchain application development, including SDK, a command-line tool as well as a series of REST API interfaces. Developers can choose the right development tools according to their preferences and environment.

The following are ways to use different tools to create an account, for example:

1. Call API

Request:
curl -k -X GET 'https://wallet.asch.io/api/accounts/new'

# return value  
Response JSON:
{    
	success: true,
	secret: "during crush zoo wealth horror left night upset spike iron divert lawn", 
	publicKey: "261fa56f389c324fddbe8777dbc0ef3341ee7b75d1ffdc82192265633b90d503",  
	privateKey: "67c9523b7622704c4bcfe960cb32d7fa04d3eb94e30e7964d3c6a24a3647a0a3261fa56f389c324fddbe8777dbc0ef3341ee7b75d1ffdc82192265633b90d503", 
	address: "ANfXDQUZroMnrQ6vRGR7UXXtbPn3fhEVRJ" 
}

2. Use npm asch-js package

Create new file account.js:

touch account.js

Create a package.json file with the following command:

npm init --yes

Install all needed dependencies:

npm install --save asch-js bitcore-mnemonic

Paste the following code into the account.js file:

const AschJS = require('asch-js')
const Mnemonic = require('bitcore-mnemonic')

module.exports = {
  createNewAccount: function () {
    let secret = new Mnemonic(Mnemonic.Words.ENGLISH).toString()
    let keypair = AschJS.crypto.getKeys(secret)
    let address = AschJS.crypto.getAddress(keypair.publicKey)
    return {
      address: address,
      secret: secret
    }
  }
}

Then execute the new code:

node -p 'require("./account").createNewAccount()'

# return value:  
{
  address: 'AMD4DNn5fKsnETVUJxBB3RB8nWNxC7goDf',
  secret: 'lecture shed style cake dentist print cool noble cloud safe ozone estate'
}

3. Use npm asch-cli package

./asch-cli crypto --generate
# ? Enter number of accounts to generate // 1

# return value  
[
  { 
    address: 'AP4CiQ7pFaazNfkv8JSqHmM1UmZ4kiqkvY',
    secret: 'glance stand fix dumb lottery exist filter peace donate shed intact cannon',
    publicKey: 'cd3559626060bd232444c3deb2b4a7a3807e7b8cf5a0558a7a0cb0a98a9ea3da'
  }
]