FISCO BCOS environment construction

TAX BCOS

FISCO BCOS environment construction

System Environment
Ubuntu 16.04+

Installation depends on openssl, curl

** ubuntu**

sudo apt install -y openssl curl

Execute the download script in the fisco-bcos operation directory

curl -#LO https://github.com/FISCO-BCOS/FISCO-BCOS/releases/download/v2.7.1/build_chain.sh

Set permissions for downloaded scripts

chmod u+x build_chain.sh

Execute the script to generate a 4-node fisco chain, and finally output All completed, indicating that the node generation is successful

bash build_chain.sh -l 127.0.0.1:4 30300,20200,8545

start all nodes

bash nodes/127.0.0.1/start_all.sh

Configure and use the console

  • Install the Java environment

  • Get the console download script and execute the download console
    curl -LO https://github.com/FISCO-BCOS/console/releases/download/v2.7.1/download_console.sh && bash download_console.sh

  • Copy the console configuration file
    cp -n console/conf/config-example.toml console/conf/config.toml

  • Configure console certificate
    cp -r nodes/127.0.0.1/sdk/* console/conf/

  • Go to the console directory to start and use the console
    bash start.sh

  • After entering the console

     获取客户端版本`getNodeVersion`
     获取节点信息`getPeers`
    

Deploy smart contracts and call

Deploy smart contracts

deploy 合约名

The example contract is in console/contracts/solidity

Deploy the HeeloWorld.sol contract
deploy HelloWorld

call contract

  • View current block height getBlockNumber

  • Call the get interface to get the address of the name variable. The contract address here is the address returned by the deploy command. call HelloWorld 0xf192536949b27bf4c78e051ba1244deac2814f4a get

  • Call the set interface to change the name call HelloWorld 0xf192536949b27bf4c78e051ba1244deac2814f4a set "Hello,FISCO BCOS"

  • Call the get interface again to check whether it takes effect call HelloWorld 0xf192536949b27bf4c78e051ba1244deac2814f4a get

  • View changes in BlockNumber getBlockNumber

  • exit console quit

Guess you like

Origin blog.csdn.net/qq_52696089/article/details/125778909