rainit2006 / Block-Chain

0 stars 0 forks source link

以太坊 and Smart contract #2

Open rainit2006 opened 6 years ago

rainit2006 commented 6 years ago

https://zhuanlan.zhihu.com/p/34683424

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,值得学习,当然,以太坊官方经常转换方向,以后换别的也没准

rainit2006 commented 6 years ago

https://ethereum.org/en/developers/docs/intro-to-ethereum/ http://truffleframework.com/tutorials/ethereum-overview

What is Ethereum?

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"。

Ethereum networks

MainNet,Local test networks,Public test networks

Distributed applications (dapps):

Applications using smart contracts for their processing are called "distributed applications", or "dapps".

Smart contract

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

  1. Parties agree to terms and conditions

  2. The smart contract is created

  3. 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.

  4. 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.

  5. 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.

  6. The contract result is recorded to the blockchain

TYPES OF TRANSACTIONS

On Ethereum there are a few different types of transactions:

video about EVM

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)

rainit2006 commented 6 years ago

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.

rainit2006 commented 6 years ago

问题总结:

rainit2006 commented 1 month ago

How do smartcontracts self execute?

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!

Smart Contracts - How is the agreement guaranteed to be upheld?

https://www.reddit.com/r/ethereum/comments/kxvmch/smart_contracts_how_is_the_agreement_guaranteed/

How Chainlink Automation Enhances Smart Contract Applications

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.