简体   繁体   English

以太坊和坚固性之间有什么关系?

[英]What is the relationship between ethereum and solidity?

I am new to the blockchain. 我是区块链新手。 As I study solidity language, I can not figure out how it makes a blockchain in the end. 当我学习固态语言时,我无法弄清楚它最终如何构成区块链。 I can map a contract to a class; 我可以将合同映射到一个班级。 but is it that every instance is a chain or what? 但是每个实例都是一个链条还是什么?

The relationship between Solidity and Ethereum is something like the relationship between Objective-C and iPhones. Solidity与以太坊之间的关系类似于Objective-C与iPhone之间的关系。 The former is a programming language used to write code that runs on the latter. 前者是用于编写在后者上运行的代码的编程语言。

The actual implementation of the blockchain (the data structure, consensus protocols, etc.) is implemented in other languages (Go in the case of geth, Rust in the case of Parity). 区块链的实际实现(数据结构,共识协议等)以其他语言实现(在geth中为Go,在奇偶校验中为Rust)。

As I study solidity language, I can not figure out how it makes a blockchain in the end 当我学习固态语言时,我无法弄清楚它最终如何构成区块链

The Solidity programming language serves the sole purpose of allowing for the development of smart contracts on an Ethereum-based blockchain network. Solidity编程语言的唯一目的是允许在基于以太坊的区块链网络上开发智能合约 These smart contracts are simply the logic (code) that is triggered by internal or external actors (respectively users or other code) within the blockchain network and interpreted and executed by the Ethereum Virtual Machine (EVM) . 这些智能合约只是由区块链网络内部或外部参与者(分别为用户或其他代码)触发并由以太坊虚拟机(EVM)解释和执行的逻辑(代码

Solidity is not used to create the Ethereum blockchain network. 实体不用于创建以太坊区块链网络。 The blockchain network must already be in existence for the smart contract logic to be deployed to the network. 为了将智能合约逻辑部署到网络,区块链网络必须已经存在。 An Ethereum blockchain network can be created by any of the multiple Ethereum clients due to the unambiguous nature of the Ethereum protocols. 由于以太坊协议的明确性,可以由多个以太坊客户端中的任何一个创建以太坊区块链网络。

I can map a contract to a class; 我可以将合同映射到一个班级。 but is it that every instance is a chain or what? 但是每个实例都是一个链条还是什么?

Mappings in Solidity are a basic key/value data structure akin to a hash map. Solidity中的映射是类似于哈希映射的基本键/值数据结构。 You can map keys of data type X to a value of data type Y. There is no explicit relation between Solidity mappings and the blockchain network itself. 您可以将数据类型X的键映射到数据类型Y的值。Solidity映射与区块链网络本身之间没有明确的关系。

Whenever a smart contract function is called, a transaction is subsequently created on the blockchain network that is representative of the executed function as well as the caller of that function. 每当一个聪明的合同函数被调用时,一个事务随后的blockchain网络,它代表执行的功能,以及该函数的调用者上创建。 This transaction is persisted on the blockchain and serves as immutable proof that an action has taken place. 该交易将保留在区块链上,并作为已采取行动的不可变证明。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM