Open rainit2006 opened 6 years ago
https://ethereum.org/en/developers/docs/intro-to-ethereum/ http://truffleframework.com/tutorials/ethereum-overview
Ethereum is a blockchain that allows you to run programs in its trusted environment. Ethereum has a virtual machine, called the Ethereum Virtual Machine (EVM). The EVM allows code to be verified and executed on the blockchain, providing guarantees it will be run the same way on everyone's machine. This code is contained in "smart contracts"。
MainNet,Local test networks,Public test networks
Applications using smart contracts for their processing are called "distributed applications", or "dapps".
A smart contract is code that lives on the Ethereum blockchain and runs exactly as programmed. Once smart contracts are deployed on the network you can't change them. A smart contract is code that runs on the EVM. Smart contracts can accept and store ether, data, or a combination of both.
Steps to make a smart contract
Parties agree to terms and conditions
The smart contract is created
The smart contract is deployed Once the securely designed smart contract is ready, the next step is to deploy it to a blockchain. The smart contract is broadcast to the blockchain just like any other crypto transaction, with the code of the smart contract included in the transaction’s data field. The smart contract is live on the blockchain once the transaction is confirmed, and it cannot be revoked or changed.
Triggering conditions are met A smart contract works by monitoring the blockchain or other credible information source for certain conditions or triggers. These triggers can include almost anything that can be verified digitally—a date reached, a payment completed, a monthly bill received, or any other verifiable event. Trigger conditions may also be met when one or more parties to the contract perform a specific action.
The smart contract is executed When the trigger conditions are satisfied, the smart contract executes. A smart contract that executes automatically may perform one or several actions, such as transferring funds to a seller or registering a buyer’s ownership of an asset.
The contract result is recorded to the blockchain
On Ethereum there are a few different types of transactions:
https://www.youtube.com/watch?v=sTOcqS4msoU&t=2s EVM, A program (smart contract) written with Solidity --> compile to bytecode --> Read by EVM OpCode (https://www.evm.codes/) -> language shows operational code, not instruction. Smart contracts can be broken down into a list of operations. EVM processes transactions sequentially one by one. Each transaction changes the data (the status of blockchains)
Truffle Tutotial: pet shop http://truffleframework.com/tutorials/pet-shop
Truffle https://github.com/ConsenSys/truffle/releases/tag/v2.0.0
ganache http://truffleframework.com/ganache/ a personal blockchain for Ethereum development you can use to deploy contracts, develop applications, and run tests. Note: If you are developing in an environment without a graphical interface, you can also use Truffle Develop, Truffle's built-in personal blockchain, instead of Ganache.
问题总结:
Truffle: command not found
安装完成后在终端输入truffle,发现找不到命令,原因是truffle被安装到了/usr/local/bin/bin中,而不是系统目录(/usr/local/bin)。试着输入命令: “/usr/local//bin/bin/truffle”会显示出truffle命令帮助信息。 为了让终端能识别truffle命令,需要创建一个软链接: $ sudo ln -s /usr/local/bin/bin/truffle /usr/local/bin/truffle
或者将usr/local/bin/bin加入到PATH环境变量中,在~/.bashrc文件最后加入一行: export PATH=$PATH:/usr/local/bin/bin 之后再输入truffle,就会显示truffle版本和用法。
在ubuntu下安装Ganache 下载Ganache后右键选择permission,将其设定为可运行程序,然后双击启动即可.
https://www.reddit.com/r/ethereum/comments/r4f6l8/how_do_smartcontracts_self_execute/ --> Smart contracts are PASSIVE. Somebody (or something, even another contract) must send a transaction of 0 ether to the smart contract which activates one of its function (in your case, the function which checks whether some conditions are met and sends the ethers around). Moreover, it is THIS transaction which pays all the fees that the smart contract has to pay. Otherwise the sc developer has to write a very complex code taking into account possible high fees, perhaps larger than the contract's balance!
https://www.reddit.com/r/ethereum/comments/kxvmch/smart_contracts_how_is_the_agreement_guaranteed/
https://blog.chain.link/chainlink-automation-open-beta-is-live/ smart contracts have two fundamental limitations: 1) they are disconnected from external resources, limiting their ability to use real-world data or leverage off-chain computations as a means of augmenting on-chain functions, and 2) they are asleep by default, requiring some external entity to wake them up when it’s time to perform on-chain functions and change contract state.
https://zhuanlan.zhihu.com/p/34683424
以太坊各个客户端项目说明 (一)go-ethereum项目 (二)webthree-umbrella项目 (三)Mist项目 。。。
以太坊常用网址(含智能合约) 1、以太坊官方网站:https://ethereum.org/ 该网站为以太坊的官方网站,有详细的以太坊介绍和各种连接地址,推荐详细看一看
2、以太坊所有源码地址(官方):https://github.com/ethereum/ 该github为以太坊所有项目的源码地址,以及更新和发布。
3、以太坊Homestead文档地址(官方):http://www.ethdocs.org/en/latest/index.html 该网站为以太坊的详细介绍文档,基本包括了以太坊的方方面面,如果有什么不清楚的原理和应用,基本都可以在这里找到答案和线索。
4、以太坊网络状态地址(官方):https://ethstats.net/ 该网站能全面的显示网络状态,包括节点、难度、算力等等,非常直观
5、以太坊资源网站(官方):http://ether.fund/ 该网站提供了以太坊很多应用资源,比如市场情况、合约辅助工具、已发布的智能合约、以太坊网络、DAAP等,方便开发和发布。
6、Solidity编程文档(官方):http://solidity.readthedocs.io/en/latest/ 该网站提供了以太坊Solidity语言的全面参考手册,学习Solidity语言必备。
7、以太坊网络扫描(官方):http://etherscan.io/ 该网站提供了以太坊网络的各种状态,比如帐号的详情、TOKEN详情,难度详情、区块详情,非常方便和直观。
8、以太坊官方博客:https://blog.ethereum.org/
9、以太坊wiki百科地址:https://github.com/ethereum/wiki/wiki 在这里有白皮书、黄皮书以及开发指南,比较全面。
10、以太坊中文爱好者网站:http://www.aibbt.com/a/ethereum/ 该网站为国内以太坊爱好者自发建立的网站,内容比较全,信息更新很快。
11、以太坊的gitter的实时交流网站:https://gitter.im/orgs/ethereum/rooms 该网站是以太坊的gitter chart的网站,根据项目分了很多房间,只要你提问题,大部分有人回答,很不错,不过只能英语交流。
12、以太坊的官方论坛:https://forum.ethereum.org/ 官方论坛,没什么好说的,我遇到的几个问题,都是在这里找到的答案
13、以太坊第三方强大的IDE:https://live.ether.camp/ 这个是第三方发布的Solidity IDE,我看了一下,很强大,强大到还不太会用,他的目标是企业级IDE,老外用的较多。
14、以太坊开发框架Truffle说明书:http://truffle.readthedocs.io/en/latest/ 以太坊目前很流行的开发框架Truffle的说明书,这个框架比较流行。
15、以太坊开发框架dapple说明书:http://dapple.readthedocs.io/en/master/ 这个开发框架是在gitter chart上看到的,感觉用的人不多,先观察
16、以太坊官方推荐开发框架Meteor说明书:https://github.com/ethereum/wiki/wiki/Dapp-using-Meteor 这个开发框架是以太坊官方推荐的,写进了以太坊的官方wiki,值得学习,当然,以太坊官方经常转换方向,以后换别的也没准