1 系统要求

  • 必须是linux系统
  • 必须有公网ip
  • 建议使用ubuntu 14.04 64位
  • 建议内存1G以上
  • 建议带宽2Mb以上

2 安装

2.1 下载

  1. wget https://www.asch.so/downloads/asch-linux-0.9.5-testnet.tar.gz
  2. tar zxvf asch-linux-0.9.5-testnet.tar.gz

2.2 初始化

这一步会自动帮您做以下几件事情

  1. 安装sqlite3等依赖软件
  2. 安装和配置ntp服务,保证您的时间与其他节点同步

这一步只需要运行一次即可

  1. cd asch-linux-0.9.5-testnet
  2. ./aschd configure

3 运行

  1. cd asch-linux-0.9.5-testnet
  2.  
  3. # 启动
  4. ./aschd start
  5.  
  6. # 停止
  7. ./aschd stop
  8.  
  9. # 查看运行状态
  10. ./aschd status
  11.  
  12. # 重启
  13. ./aschd restart
  14.  
  15. # 升级
  16. ./aschd upgrade
  17.  
  18. # 重新同步区块
  19. ./aschd rebuild
  20.  
  21. # 重建索引
  22. ./aschd reindex
  23.  
  24. # 查看版本
  25. ./aschd version
  26.  
  27. # 查看log
  28. tail -f logs/debug.log

4 受托人配置

4.1 受托人密码

使用文本编辑工具打开config.json, 找到secret字段,将你的受托人密钥填进去即可,该字段为json字符串数组,一台机器可以配置多个,但不能重复

注意 不管是一台机器还是多台机器,不要配置重复的受托人密钥

4.2 公网IP

默认情况下,系统会自动检测公网ip,但在某些云主机中,公网ip无法检测到,这时需要手动在config.json修改或添加如下字段

  1. "publicIp": "此处填写你的公网ip",

配置完之后需要重启程序

  1. ./aschd restart

5 升级

  1. ./aschd upgrade

6 命令行工具

命令行工具可以完成所有钱包的功能,包括账户登录及查询、区块链和交易查询、受托人查询,还可以创建、签署并广播任意的交易数据

6.1 安装方法

  1. npm install -g asch-cli

6.2 使用示例

随机生成新账户

  1. asch-cli crypto -g

使用公钥登录账户

  1. asch-cli openaccountbypublickey 8a601534d1638884e523bc0f4fc29eaa4c0f7d2fdc8ca3a9b03d3fa8e4abd04c

使用密码登录账户

  1. asch-cli openaccount "your secret"

转账

  1. asch-cli sendmoney -e "your secret" -t 9519461517002147305 -a 38.38

有二级密码后的转账

  1. asch-cli sendmoney -e "your secret" -s "your second secret" -t 9519461517002147305 -a 38.38

查看某个区块信息

  1. asch-cli getblockbyid 16006382490436415348
  2. asch-cli getblockbyheight 1

批量查询区块

  1. asch-cli getblocks --offset 10 --limit 3 --sort height:asc

批量查询交易

  1. asch-cli gettransactions --type 2 --limit 2

投票

  1. asch-cli upvote --secret "your secret" --publicKeys 45cbab2f997766925398e1b6eb7784a0bd3fbeff9bdda74d8da9bc645f974a5e,2cd541cf50a4a8641b9e6e2613aeeaa1614dc43f6756829fb45c990e5b6ff873
  2.  
  3. # 一次投多个,公钥列表用逗号分隔

更多命令行功能请使用help选项查看

  1. asch-cli --help
  2.  
  3. Usage: asch-cli [options] [command]
  4.  
  5. Commands:
  6.  
  7. getheight get block height
  8. getblockstatus get block status
  9. openaccount [secret] open your account and get the infomation by secret
  10. openaccountbypublickey [publickey] open your account and get the infomation by publickey
  11. getbalance [address] get balance by address
  12. getaccount [address] get account by address
  13. getvoteddelegates [options] [address] get delegates voted by address
  14. getdelegatescount get delegates count
  15. getdelegates [options] get delegates
  16. getvoters [publicKey] get voters of a delegate by public key
  17. getdelegatebypublickey [publicKey] get delegate by public key
  18. getdelegatebyusername [username] get delegate by username
  19. getblocks [options] get blocks
  20. getblockbyid [id] get block by id
  21. getblockbyheight [height] get block by height
  22. getpeers [options] get peers
  23. getunconfirmedtransactions [options] get unconfirmed transactions
  24. gettransactions [options] get transactions
  25. gettransaction [id] get transactions
  26. sendmoney [options] send money to some address
  27. registerdelegate [options] register delegate
  28. upvote [options] vote for delegates
  29. downvote [options] cancel vote for delegates
  30. setsecondsecret [options] set second secret
  31. contract [options] contract operations
  32. crypto [options] crypto operations
  33. dapps [options] manage your dapps
  34. creategenesis create genesis block
  35.  
  36. Options:
  37.  
  38. -h, --help output usage information
  39. -V, --version output the version number
  40. -H, --host <host> Specify the hostname or ip of the node, default: 127.0.0.1
  41. -p, --port <port> Specify the port of the node, default: 4096

子命令帮助查询

  1. asch-cli <sub-command> -h

区块链侧链应用开发平台Asch节点安装及区块生产教程的更多相关文章

  1. [区块链\理解BTCD源码]GO语言实现一个区块链原型

    摘要 本文构建了一个使用工作量证明机制(POW)的类BTC的区块链.将区块链持久化到一个Bolt数据库中,然后会提供一个简单的命令行接口,用来完成一些与区块链的交互操作.这篇文章目的是希望帮助大家理解 ...

  2. 在区块链侧链上进行Dapp技术开发

    我在白皮书里提到过,asch使用的是不同于以太坊和比特币的侧链架构,dapp是运行在侧链上的,每套侧链对应一个dapp. 侧链的独立性 侧链架构的好处是代码和数据独立,不增加主链的负担,避免数据过度膨 ...

  3. BlockChain:Py实现区块链简单场景应用:程序猿记录在区块里的收入记录图——Jason niu

    # -*- coding: utf-8 -*- ''' Created on 2018年3月11日 @author: Jason niu ''' import hashlib #该模块实现了诸多安全哈 ...

  4. 区块链从零开始做开发(0):hyperledger Fabric2.3安装

    一.前言 各位看官好,这是本人第一篇技术博客. 写博客的契机是因为原来配的环境在虚拟机扩容后莫名奇妙崩了(具体情况我以后会写),为了以后的自己特此从头开始记录.以前都是作为一个读者,这次终于有机会能够 ...

  5. go-admin在线开发平台学习-1[安装、配置、启动]

    项目介绍 go-admin 是一个中后台管理系统,基于(gin, gorm, Casbin, Vue, Element UI)实现.主要目的是为了让开发者更专注业务,减少重复代码的编写,节省时间,提升 ...

  6. HyperLedger Fabric 1.4 区块链开发平台(4.1)

    目前区块链开发平台分“公有链平台”和“联盟链系统”两类,“公有链平台”主要以以太坊为主的平台,可以在该类平台上进行代币的发行和根据各种模块搭建应用:“联盟链系统”主要以超级账本为主的开源系统,该类开源 ...

  7. 以太坊开发DApp入门教程——区块链投票系统(一)

    概述 对初学者,首先要了解以太坊开发相关的基本概念.   学习以太坊开发的一般前序知识要求,最好对以下技术已经有一些基本了解: 一种面向对象的开发语言,例如:Python,Ruby,Java... 前 ...

  8. 智能合约开发solidity编程语言开发一个以太坊应用区块链投票实例

    智能合约开发用solidity编程语言部署在以太坊这个区块链平台,本文提供一个官方实战示例快速入门,用例子深入浅出智能合约开发,体会以太坊构建去中心化可信交易技术魅力.智能合约其实是"执行合 ...

  9. Go语言开发区块链只需180行代码

    区块链开发用什么语言?通过本文你将使用Go语言开发自己的区块链(或者说用go语言搭建区块链).理解哈希函数是如何保持区块链的完整性.掌握如何用Go语言编程创造并添加新的块.实现多个节点通过竞争生成块. ...

随机推荐

  1. python3 asyncio-协程模块测试代码

    import time import asyncio #统计运行时间的装饰器 def run_time(func): def wrapperfunc(*argv, **kwargv): now = l ...

  2. TCP/IP教程

    一.TCP/IP 简介 TCP/IP 是用于因特网的通信协议. 通信协议是对计算机必须遵守的规则的描述,只有遵守这些规则,计算机之间才能进行通信. 什么是 TCP/IP? TCP/IP 是供已连接因特 ...

  3. OGG微服务架构入门

    数据复制任务路线图 设置数据复制必须执行许多任务. 下表列出了构建分发路径的阶段. Task Description 运行Oracle GoldenGate Configuration Assista ...

  4. Python3.6及以上pip安装pymssql错误的解决办法[Windows&Linux freetds安装]

    只有由于Python3.6装不上 pymssql,所以一直用Python3.5的版本. 报错界面 现在有了新的解决方法: 原帖如下: https://docs.microsoft.com/en-us/ ...

  5. 网络流24题——试题库问题 luogu 2763

    题目描述看:这里 这是我们遇到的第一个要求输出方案的问题 考虑建图然后用最大流思想: 首先由源点向每一道试题连边,容量为1 然后由每一种试题类型向汇点连边,容量为需求量 最后由每一道试题向可能属于的试 ...

  6. 使用Selenium+ChromeDriver登录微博并且获取cookie

    using OpenQA.Selenium;using OpenQA.Selenium.Chrome; public class GetSinaCookie { private static stri ...

  7. vue在jsx中使用for循环

    return <div domPropsInnerHTML="titles" style={{ color: 'red', fontSize: '14px' }}> { ...

  8. C++运算符重载——输入/输出运算符

    为了与IO标准库一致,重载输入输出运算符函数的第一个行参应该是流的引用,第二个行参是对象的引用. 如果重载为类的成员函数,第一个行参应该是对象的引用,第二个行参是流的引用. 使用方式是 ClassOb ...

  9. Codeforces 1109D Sasha and Interesting Fact from Graph Theory (看题解) 组合数学

    Sasha and Interesting Fact from Graph Theory n 个 点形成 m 个有标号森林的方案数为 F(n, m) = m * n ^ {n - 1 - m} 然后就 ...

  10. manjaro安装及设置

    因我的笔记本(联想的拯救者)昨晚打开后什么都还没做就被更新系统“抢走”了画面导致按什么都不管用 所以就想起能不能不用win系统,都知道linux比win稳定,so....就找到了manjaro.以下是 ...