智能合约(Smart Contract),是一段部署在区块链上的代码,一旦某个事件触发合约中的条款,代码就会自动执行。用人话来讲就是:智能合约是一份基于密码学这种高科技上面的数字化合同,与传统的纸质合同的差异就是:自动售货机相当于智能合约,售货员相当于纸质合同。
def install
#ENV.deparallelize#if your formula fails when building in parallel
#Remove unrecognized options if warned by configure
system"./configure","--disable-debug",
"--disable-dependency-tracking",
"--disable-silent-rules",
"--prefix=#{prefix}"
#system"cmake",".",*std_cmake_args
system"make","install"#if this fails,try separate make/make install steps
end
system后面是需要执行的安装命令,这个根据实际软件编译过程进行修改。
因为bytom是已经编译好的二进制软件包,所以实际的文件进行修改如下:
class Bytom<Formula
desc"Official Go implementation of the Bytom protocol"
homepage"https://bytom.io/"
url"https://github.com/Bytom/bytom/releases/download/v1.0.7/bytom-1.0.7-darwin_amd64.tgz"
version"1.0.7"
sha256"25dd62343157fe6eb7a983edb1455f457cfca07552f02e1f9142227bd961a4a5"
def install
system'mv bytomd-darwin_amd64 bytomd'
system'mv bytomcli-darwin_amd64 bytomcli'
bin.install"bytomd"
bin.install"bytomcli"
end
test do
#test do
will create,run in and delete a temporary directory.
#
#This test will fail and we won't accept that!For Homebrew/homebrew-core
#this will need to be a test that verifies the functionality of the
#software.Run the test withbrew test bytom
.Options passed
#tobrew install
such as--HEAD
also need to be provided tobrew test
.
#
#The installed folder is not in the path,so use the entire path to any
#executables being tested:system"#{bin}/program","do","something"
.
system"false"
end
end