首页 > 其他分享 >fisco:

fisco:

时间:2023-04-28 16:55:28浏览次数:35  
标签:Return fisco deploy py ---------------------------------------------------------

第四步. 启动FISCO BCOS链
启动所有节点

bash nodes/127.0.0.1/start_all.sh

2.启动控制台

bash start.sh

一键部署

部署并启动所有服务 python3 deploy.py installAll
停止一键部署的所有服务 python3 deploy.py stopAll
启动一键部署的所有服务 python3 deploy.py startAll

各子服务启停

启动FISCO-BCOS节点: python3 deploy.py startNode
停止FISCO-BCOS节点: python3 deploy.py stopNode
启动WeBASE-Web: python3 deploy.py startWeb
停止WeBASE-Web: python3 deploy.py stopWeb
启动WeBASE-Node-Manager: python3 deploy.py startManager
停止WeBASE-Node-Manager: python3 deploy.py stopManager
启动WeBASE-Sign: python3 deploy.py startSign
停止WeBASE-Sign: python3 deploy.py stopSign
启动WeBASE-Front: python3 deploy.py startFront
停止WeBASE-Front: python3 deploy.py stopFront

可视化部署

部署并启动可视化部署的所有服务 python3 deploy.py installWeBASE
停止可视化部署的所有服务 python3 deploy.py stopWeBASE
启动可视化部署的所有服务 python3 deploy.py startWeBASE`

//部署合约 [group:1]> deploy KVTableTest //交易的hash值 transaction hash: 0xc18aeffad8e1b45a7cb944c49f733f45c540f1d20e4f9bdc4cf2a02db52649d2 //合约地址 contract address: 0x291ba326c748afe29d8c08f9e66632ba9a56b860 //合约账号 currentAccount: 0xca05676dc4a4502c7d04fd4d4c65507aab19e0c0

点击查看代码
//helloWorld.sol
pragma solidity>=0.4.24 <0.6.11;

contract HelloWorld {
    string name;

    constructor() public {
        name = "Hello, World!";
    }
//获取/设置合约变量name
    function get() public view returns (string memory) {
        return name;
    }

    function set(string memory n) public {
        name = n;
    }
}
点击查看代码
//调用合约
# 查看当前块高
[group:1]> getBlockNumber
1

# 调用get接口获取name变量 此处的合约地址是deploy指令返回的地址
[group:1]> call HelloWorld 0xb3c223fc0bf6646959f254ac4e4a7e355b50a344 get
---------------------------------------------------------------------------------------------
Return code: 0
description: transaction executed successfully
Return message: Success
---------------------------------------------------------------------------------------------
Return values:
[
    "Hello,World!"
]
---------------------------------------------------------------------------------------------

# 查看当前块高,块高不变,因为get接口不更改账本状态
[group:1]> getBlockNumber
1

# 调用set设置name
[group:1]> call HelloWorld 0xb3c223fc0bf6646959f254ac4e4a7e355b50a344 set "Hello, FISCO BCOS"
transaction hash: 0x7e742c44091e0d6e4e1df666d957d123116622ab90b718699ce50f54ed791f6e
---------------------------------------------------------------------------------------------
transaction status: 0x0
description: transaction executed successfully
---------------------------------------------------------------------------------------------
Output
Receipt message: Success
Return message: Success
---------------------------------------------------------------------------------------------
Event logs
Event: {}

# 再次查看当前块高,块高增加表示已出块,账本状态已更改
[group:1]> getBlockNumber
2

# 调用get接口获取name变量,检查设置是否生效
[group:1]> call HelloWorld 0xb3c223fc0bf6646959f254ac4e4a7e355b50a344 get
---------------------------------------------------------------------------------------------
Return code: 0
description: transaction executed successfully
Return message: Success
---------------------------------------------------------------------------------------------
Return values:
[
    "Hello,FISCO BCOS"
]
---------------------------------------------------------------------------------------------

# 退出控制台
[group:1]> quit


点击查看代码
[group:1]> call HelloWorld 0x244b605a4a50d6b9f6f6096c2be3b1dffa49133e get
---------------------------------------------------------------------------------------------
Return code: 0
description: transaction executed successfully
Return message: Success
---------------------------------------------------------------------------------------------
Return value size:1
Return types: (STRING)
Return values:(Hello, World!)
---------------------------------------------------------------------------------------------


点击查看代码
[group:1]> call HelloWorld 0x244b605a4a50d6b9f6f6096c2be3b1dffa49133e set "Hello, FISCO BCOS"
transaction hash: 0x936444676705cd2bc8cf642d1e316e855b3e4258591e5d17adc4023b7568d869
---------------------------------------------------------------------------------------------
transaction status: 0x0
description: transaction executed successfully
---------------------------------------------------------------------------------------------
Transaction inputs:
Input value size:1
Input types: (STRING)
Input values:(Hello, FISCO BCOS)
---------------------------------------------------------------------------------------------
Receipt message: Success
Return message: Success
Return values:[]
---------------------------------------------------------------------------------------------
Event logs
Event: {}

[group:1]> 

标签:Return,fisco,deploy,py,---------------------------------------------------------
From: https://www.cnblogs.com/yimumengke/p/17347426.html

相关文章

  • FISCO BCOS区块链搭建说明(第一篇)
    说明:此文章针对的是Ubuntu版本的,若要其他版本可以参考官网FISCOBCOS官网链接:​​FISCOBCOS​​第一步:安装依赖这是ubuntu依赖sudoaptinstall-yopensslcurl第二步:创建......
  • 解决ubuntu出现的std::exception::what: bind: Address already in use问题 (FISCO BC
    1、首先问题是这样的 Exceedwaitingtime.Pleasetryagaintostartnode2 Exceedwaitingtime.Pleasetryagaintostartnode3[2022-11-0701:37:47]Initiali......
  • 搭建Air版本FISCO BCOS联盟链(v3.x)
    以下安装均是在Ubuntu下面进行1、安装ubuntu依赖sudoaptinstall-ycurlopensslwget2、创建操作目录,下载安装脚本cd~&&mkdir-pfisco&&cdfiscocurl-#LOhttps:......
  • FISCO BCOS v3.x 多群组区块链Pro版本搭建说明(ubuntu)
    1、在root权限下进行创建目录    mkdirfiscoMax2、安装依赖sudoapt-getupdate sudoapt-getinstall-ycurldocker.iodocker-composepython3wget 3、下载pro......
  • 【转】FISCO BCOS 中的交易
    交易——区块链系统的核心,负责记录区块链上发生的一切。区块链引入智能合约后,交易便超脱『价值转移』的原始定义,其更加精准的定义应该是区块链中一次事务的数字记录。无论......
  • 【转】FISCO BCOS中交易池及其优化策略
    FISCOBCOS区块链系统中,交易上链之前,均存储在交易池中。交易池是区块链小能手,一方面担任质检员的职务,将所有非法交易拒之门外;一方面担任供应商的职责,向共识模块输送合法交......
  • fisco和fabric权限管理的区别
    fisco和fabric权限管理的区别​​一、FISCOBCOS权限管理​​​​引言​​​​如何使用角色权限?​​​​总结​​​​二、Fabric权限管理​​​​三、二者比较​​​​参......
  • FISCO BCOS 与 Fabric 之较
    起“底”联盟链:FISCOBCOS与Fabric之较​​一、理念:设计背景与发展路径的区别​​​​二、应用:带给开发者不同的设计思路​​​​三、跨链:关于通道和多链的比较​​​​......
  • Docker安装FISCO BCOS区块链平台
    2.0版本提供docker镜像,支持容器化部署,省去了很多编译安装过程遇到的各种问题。FISCOBCOS官方镜像docker地址:https://hub.docker.com/r/fiscoorg/fiscobcos/builds  我......
  • FISCO 区块链浏览器
    环境Ubuntu18.04参考文章区块链浏览器区块链浏览器将区块链中的数据可视化,并进行实时展示环境环境版本JavaOracleJDK8至14MySQLMySQL-5.6及以上......